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

starting the link process

parent 8cc10520
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!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> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
......
...@@ -70,7 +70,7 @@ private slots: ...@@ -70,7 +70,7 @@ private slots:
#ifdef CATKIN_MAKE #ifdef CATKIN_MAKE
#endif #endif
void set_tabs(int n); void doNumCrazyFlyZonesChanged(int n);
void transitionToMode(int mode); void transitionToMode(int mode);
void on_removeTable_clicked(); void on_removeTable_clicked();
......
...@@ -51,8 +51,9 @@ MainGUIWindow::~MainGUIWindow() ...@@ -51,8 +51,9 @@ MainGUIWindow::~MainGUIWindow()
delete ui; 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(); ui->tabWidget->clear();
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
...@@ -62,6 +63,26 @@ void MainGUIWindow::set_tabs(int n) ...@@ -62,6 +63,26 @@ void MainGUIWindow::set_tabs(int n)
ui->tabWidget->addTab(widget, qstr); ui->tabWidget->addTab(widget, qstr);
connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int))); 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() void MainGUIWindow::_init()
...@@ -85,7 +106,7 @@ void MainGUIWindow::_init() ...@@ -85,7 +106,7 @@ void MainGUIWindow::_init()
ui->graphicsView->setScene(scene); ui->graphicsView->setScene(scene);
QObject::connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), scene, SLOT(removeCrazyFlyZone(int))); 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(ui->tabWidget, SIGNAL(currentChanged(int)), scene, SLOT(setSelectedCrazyFlyZone(int)));
QObject::connect(scene, SIGNAL(crazyFlyZoneSelected(int)), ui->tabWidget, SLOT(setCurrentIndex(int))); QObject::connect(scene, SIGNAL(crazyFlyZoneSelected(int)), ui->tabWidget, SLOT(setCurrentIndex(int)));
QObject::connect(scene, SIGNAL(modeChanged(int)), this, SLOT(transitionToMode(int))); QObject::connect(scene, SIGNAL(modeChanged(int)), this, SLOT(transitionToMode(int)));
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1043</width> <width>866</width>
<height>658</height> <height>563</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
...@@ -98,19 +98,6 @@ ...@@ -98,19 +98,6 @@
</layout> </layout>
</widget> </widget>
</item> </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"> <item row="1" column="1">
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
...@@ -231,14 +218,25 @@ ...@@ -231,14 +218,25 @@
</layout> </layout>
</widget> </widget>
</item> </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> </layout>
<zorder>graphicsView</zorder> <zorder>graphicsView</zorder>
<zorder>removeTable</zorder> <zorder>removeTable</zorder>
<zorder>groupBox</zorder> <zorder>groupBox</zorder>
<zorder>groupBox_2</zorder> <zorder>groupBox_2</zorder>
<zorder>pushButton_fitAll</zorder> <zorder>pushButton_fitAll</zorder>
<zorder>frame_3</zorder>
<zorder>tabWidget</zorder>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
...@@ -255,6 +253,49 @@ ...@@ -255,6 +253,49 @@
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </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> </widget>
</item> </item>
<item row="1" column="0" colspan="2"> <item row="1" column="0" colspan="2">
...@@ -301,7 +342,7 @@ ...@@ -301,7 +342,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1043</width> <width>866</width>
<height>19</height> <height>19</height>
</rect> </rect>
</property> </property>
...@@ -311,7 +352,7 @@ ...@@ -311,7 +352,7 @@
<enum>TopToolBarArea</enum> <enum>TopToolBarArea</enum>
</attribute> </attribute>
<attribute name="toolBarBreak"> <attribute name="toolBarBreak">
<bool>true</bool> <bool>false</bool>
</attribute> </attribute>
</widget> </widget>
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
......
Supports Markdown
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