Commit 83e4ba26 authored by roangel's avatar roangel
Browse files

starting the link process

parent 8cc10520
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.0.2, 2017-05-18T12:14:24. -->
<!-- Written by QtCreator 4.0.2, 2017-05-18T17:53:08. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
......
......@@ -70,7 +70,7 @@ private slots:
#ifdef CATKIN_MAKE
#endif
void set_tabs(int n);
void doNumCrazyFlyZonesChanged(int n);
void transitionToMode(int mode);
void on_removeTable_clicked();
......
......@@ -51,8 +51,9 @@ MainGUIWindow::~MainGUIWindow()
delete ui;
}
void MainGUIWindow::set_tabs(int n)
void MainGUIWindow::doNumCrazyFlyZonesChanged(int n)
{
// tabs number management, maybe do it in a different way so we dont have to remove and add everything?
ui->tabWidget->clear();
for (int i = 0; i < n; i++)
{
......@@ -62,6 +63,26 @@ void MainGUIWindow::set_tabs(int n)
ui->tabWidget->addTab(widget, qstr);
connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
}
// add options to QComboBox of CFZones
int current_count = ui->comboBoxCFZones->count();
if(n > current_count)
{
for(int i = current_count; i < n; i++)
{
QString qstr = "CrazyFlyZone ";
qstr.append(QString::number(i+1));
ui->comboBoxCFZones->addItem(qstr);
}
}
else if(n < current_count)
{
for(int i = current_count; i >= n; i--)
{
ui->comboBoxCFZones->removeItem(i);
}
}
}
void MainGUIWindow::_init()
......@@ -85,7 +106,7 @@ void MainGUIWindow::_init()
ui->graphicsView->setScene(scene);
QObject::connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), scene, SLOT(removeCrazyFlyZone(int)));
QObject::connect(scene, SIGNAL(numCrazyFlyZonesChanged(int)), this, SLOT(set_tabs(int)));
QObject::connect(scene, SIGNAL(numCrazyFlyZonesChanged(int)), this, SLOT(doNumCrazyFlyZonesChanged(int)));
QObject::connect(ui->tabWidget, SIGNAL(currentChanged(int)), scene, SLOT(setSelectedCrazyFlyZone(int)));
QObject::connect(scene, SIGNAL(crazyFlyZoneSelected(int)), ui->tabWidget, SLOT(setCurrentIndex(int)));
QObject::connect(scene, SIGNAL(modeChanged(int)), this, SLOT(transitionToMode(int)));
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1043</width>
<height>658</height>
<width>866</width>
<height>563</height>
</rect>
</property>
<property name="windowTitle">
......@@ -98,19 +98,6 @@
</layout>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="myGraphicsView" name="graphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
......@@ -231,14 +218,25 @@
</layout>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="myGraphicsView" name="graphicsView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<zorder>graphicsView</zorder>
<zorder>removeTable</zorder>
<zorder>groupBox</zorder>
<zorder>groupBox_2</zorder>
<zorder>pushButton_fitAll</zorder>
<zorder>frame_3</zorder>
<zorder>tabWidget</zorder>
</widget>
</item>
<item row="0" column="1">
......@@ -255,6 +253,49 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="tabWidget_2">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="links_tab">
<attribute name="title">
<string>Links</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="1">
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Link!</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxCFs"/>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxCFZones"/>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Choose CF to link:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Choose CF Zone to link:</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
......@@ -301,7 +342,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1043</width>
<width>866</width>
<height>19</height>
</rect>
</property>
......@@ -311,7 +352,7 @@
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>true</bool>
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment