diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/main.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/main.o index a1d6e7e88c75acd4b65490479420902600b840cb..f6245f55df830cfc8f19e059b8a6f0272bbcefff 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/main.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/main.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp index 790dff2c1f08c108206161a1542ab972345c8038..9a25aeb1edd455ef3afda5be056c5beb02d81a30 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.cpp @@ -56,17 +56,21 @@ void MainGUIWindow::_init() { scene = new myGraphicsScene(ui->frame_drawing); - //scene->setSceneRect(QRectF(QPointF(-100, 100), QSizeF(200, 200))); + scene->setSceneRect(QRectF(QPointF(-1400, 1400), QSizeF(1400, 1400))); ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); ui->graphicsView->setScene(scene); + // ui->radioButton_crazyfly_zones_mode->setCheckable(false); + // ui->radioButton_crazyfly_zones_mode->setEnabled(false); + QObject::connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), scene, SLOT(removeCrazyFlyZone(int))); QObject::connect(scene, SIGNAL(numCrazyFlyZonesChanged(int)), this, SLOT(set_tabs(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))); + QObject::connect(scene, SIGNAL(numTablePiecesChanged(int)), this, SLOT(handleTablePiecesNumChanged(int))); } #ifndef DEBUG_GUI @@ -945,46 +949,80 @@ void CSetpointQueue::print() #endif // DEBUG_GUI -void MainGUIWindow::on_drawingModeButton_clicked() + +void MainGUIWindow::on_removeTable_clicked() { - switch(scene->getMode()) + if(scene->getMode() == myGraphicsScene::mode_table) + { + scene->removeTable(); + } +} + +void MainGUIWindow::transitionToMode(int mode) +{ + switch(mode) { case myGraphicsScene::mode_table: { - scene->setMode(myGraphicsScene::mode_crazyfly_zones); - ui->drawingModeButton->setText("CreateCFZonesMode"); + ui->removeTable->setDisabled(false); break; } case myGraphicsScene::mode_crazyfly_zones: { - scene->setMode(myGraphicsScene::mode_table); - ui->drawingModeButton->setText("CreateTableMode"); + ui->removeTable->setDisabled(true); break; } } } -void MainGUIWindow::on_removeTable_clicked() +void MainGUIWindow::on_radioButton_table_mode_toggled(bool checked) { - if(scene->getMode() == myGraphicsScene::mode_table) + switch(scene->getMode()) { - scene->removeTable(); + case myGraphicsScene::mode_table: + { + // already in the mode we want, do nothing + break; + } + case myGraphicsScene::mode_crazyfly_zones: + { + scene->setMode(myGraphicsScene::mode_table); + ui->radioButton_crazyfly_zones_mode->setChecked(false); + break; + } } + } -void MainGUIWindow::transitionToMode(int mode) + +void MainGUIWindow::on_radioButton_crazyfly_zones_mode_toggled(bool checked) { - switch(mode) + switch(scene->getMode()) { case myGraphicsScene::mode_table: { - ui->removeTable->setDisabled(false); + scene->setMode(myGraphicsScene::mode_crazyfly_zones); + ui->radioButton_table_mode->setChecked(false); break; } case myGraphicsScene::mode_crazyfly_zones: { - ui->removeTable->setDisabled(true); + // already in the mode we want, do nothing break; } } } + +void MainGUIWindow::handleTablePiecesNumChanged(int newNum) +{ + // if(newNum == 0) + // { + // ui->radioButton_crazyfly_zones_mode->setCheckable(false); + // ui->radioButton_crazyfly_zones_mode->setEnabled(false); + // } + // else + // { + // ui->radioButton_crazyfly_zones_mode->setCheckable(true); + // ui->radioButton_crazyfly_zones_mode->setEnabled(true); + // } +} diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.h index 23f1e280e4a3e03c80a6b4964fa86e8fa0cd7fd5..3fa7f5575dd7a684112ccc125b53a2176e4186e8 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.h +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.h @@ -131,9 +131,13 @@ private slots: void set_tabs(int n); void transitionToMode(int mode); - void on_drawingModeButton_clicked(); void on_removeTable_clicked(); + void on_radioButton_table_mode_toggled(bool checked); + + void on_radioButton_crazyfly_zones_mode_toggled(bool checked); + void handleTablePiecesNumChanged(int newNum); + private: Ui::MainGUIWindow *ui; diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o index b699f66db3d8023774841aa0cd471f09f1edde67..be5beb40bdc049b74e5e5fa4fd066768c76da088 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.ui b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.ui index 5176a6d3037d26750c7c3914fe7a6db5c63a6f54..341a24cdc4e3b36dae14e7846a1a1e7745a5871c 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.ui +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/mainguiwindow.ui @@ -19,7 +19,7 @@ <rect> <x>40</x> <y>510</y> - <width>1171</width> + <width>1431</width> <height>451</height> </rect> </property> @@ -34,7 +34,7 @@ <rect> <x>20</x> <y>19</y> - <width>1131</width> + <width>1391</width> <height>401</height> </rect> </property> @@ -53,9 +53,9 @@ <property name="geometry"> <rect> <x>20</x> - <y>20</y> - <width>641</width> - <height>469</height> + <y>18</y> + <width>951</width> + <height>471</height> </rect> </property> <property name="frameShape"> @@ -69,7 +69,7 @@ <rect> <x>10</x> <y>9</y> - <width>571</width> + <width>741</width> <height>401</height> </rect> </property> @@ -77,39 +77,130 @@ <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="drawingModeButton"> + <widget class="QPushButton" name="removeTable"> <property name="geometry"> <rect> - <x>20</x> + <x>340</x> <y>430</y> - <width>141</width> + <width>91</width> <height>21</height> </rect> </property> <property name="text"> - <string>CreateTableMode</string> + <string>Remove Table</string> </property> </widget> - <widget class="QPushButton" name="removeTable"> + <widget class="QGroupBox" name="groupBox"> <property name="geometry"> <rect> - <x>200</x> - <y>430</y> - <width>91</width> - <height>21</height> + <x>790</x> + <y>30</y> + <width>121</width> + <height>80</height> </rect> </property> - <property name="text"> - <string>Remove Table</string> + <property name="title"> + <string>Creation Modes</string> </property> + <widget class="QRadioButton" name="radioButton_table_mode"> + <property name="geometry"> + <rect> + <x>10</x> + <y>20</y> + <width>61</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string>Tables</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QRadioButton" name="radioButton_crazyfly_zones_mode"> + <property name="geometry"> + <rect> + <x>10</x> + <y>50</y> + <width>91</width> + <height>16</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string>CrazyFly Zones</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + </widget> + </widget> + <widget class="QGroupBox" name="groupBox_2"> + <property name="geometry"> + <rect> + <x>790</x> + <y>130</y> + <width>120</width> + <height>241</height> + </rect> + </property> + <property name="title"> + <string>What to show</string> + </property> + <widget class="QCheckBox" name="checkBox_crazyfly_zones"> + <property name="geometry"> + <rect> + <x>10</x> + <y>20</y> + <width>101</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string>Show CF Zones</string> + </property> + </widget> + <widget class="QCheckBox" name="checkBox_vicon_markers"> + <property name="geometry"> + <rect> + <x>10</x> + <y>40</y> + <width>101</width> + <height>20</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>7</pointsize> + </font> + </property> + <property name="text"> + <string>Show Markers</string> + </property> + </widget> </widget> </widget> <widget class="QFrame" name="frame_3"> <property name="geometry"> <rect> - <x>669</x> - <y>21</y> - <width>541</width> + <x>990</x> + <y>20</y> + <width>481</width> <height>469</height> </rect> </property> diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.cpp index 2f9be88fd728670da0084ddd9864415882add08b..9de91594c2908bcd3b525b20f4eae02e02958e6d 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.cpp @@ -19,8 +19,8 @@ QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_MainGUIWindow_t { - QByteArrayData data[8]; - char stringdata0[100]; + QByteArrayData data[12]; + char stringdata0[191]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -35,13 +35,19 @@ QT_MOC_LITERAL(2, 23, 0), // "" QT_MOC_LITERAL(3, 24, 1), // "n" QT_MOC_LITERAL(4, 26, 16), // "transitionToMode" QT_MOC_LITERAL(5, 43, 4), // "mode" -QT_MOC_LITERAL(6, 48, 28), // "on_drawingModeButton_clicked" -QT_MOC_LITERAL(7, 77, 22) // "on_removeTable_clicked" +QT_MOC_LITERAL(6, 48, 22), // "on_removeTable_clicked" +QT_MOC_LITERAL(7, 71, 33), // "on_radioButton_table_mode_tog..." +QT_MOC_LITERAL(8, 105, 7), // "checked" +QT_MOC_LITERAL(9, 113, 42), // "on_radioButton_crazyfly_zones..." +QT_MOC_LITERAL(10, 156, 27), // "handleTablePiecesNumChanged" +QT_MOC_LITERAL(11, 184, 6) // "newNum" }, "MainGUIWindow\0set_tabs\0\0n\0transitionToMode\0" - "mode\0on_drawingModeButton_clicked\0" - "on_removeTable_clicked" + "mode\0on_removeTable_clicked\0" + "on_radioButton_table_mode_toggled\0" + "checked\0on_radioButton_crazyfly_zones_mode_toggled\0" + "handleTablePiecesNumChanged\0newNum" }; #undef QT_MOC_LITERAL @@ -51,7 +57,7 @@ static const uint qt_meta_data_MainGUIWindow[] = { 7, // revision 0, // classname 0, 0, // classinfo - 4, 14, // methods + 6, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -59,16 +65,20 @@ static const uint qt_meta_data_MainGUIWindow[] = { 0, // signalCount // slots: name, argc, parameters, tag, flags - 1, 1, 34, 2, 0x08 /* Private */, - 4, 1, 37, 2, 0x08 /* Private */, - 6, 0, 40, 2, 0x08 /* Private */, - 7, 0, 41, 2, 0x08 /* Private */, + 1, 1, 44, 2, 0x08 /* Private */, + 4, 1, 47, 2, 0x08 /* Private */, + 6, 0, 50, 2, 0x08 /* Private */, + 7, 1, 51, 2, 0x08 /* Private */, + 9, 1, 54, 2, 0x08 /* Private */, + 10, 1, 57, 2, 0x08 /* Private */, // slots: parameters QMetaType::Void, QMetaType::Int, 3, QMetaType::Void, QMetaType::Int, 5, QMetaType::Void, - QMetaType::Void, + QMetaType::Void, QMetaType::Bool, 8, + QMetaType::Void, QMetaType::Bool, 8, + QMetaType::Void, QMetaType::Int, 11, 0 // eod }; @@ -81,8 +91,10 @@ void MainGUIWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i switch (_id) { case 0: _t->set_tabs((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: _t->transitionToMode((*reinterpret_cast< int(*)>(_a[1]))); break; - case 2: _t->on_drawingModeButton_clicked(); break; - case 3: _t->on_removeTable_clicked(); break; + case 2: _t->on_removeTable_clicked(); break; + case 3: _t->on_radioButton_table_mode_toggled((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 4: _t->on_radioButton_crazyfly_zones_mode_toggled((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 5: _t->handleTablePiecesNumChanged((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } } @@ -113,13 +125,13 @@ int MainGUIWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 4) + if (_id < 6) qt_static_metacall(this, _c, _id, _a); - _id -= 4; + _id -= 6; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 4) + if (_id < 6) *reinterpret_cast<int*>(_a[0]) = -1; - _id -= 4; + _id -= 6; } return _id; } diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o index a137561ede2dc57f4decbafeceb0e654e1e6f4f5..ae71da32e3561a43d1b6b9fd1e8cc20215bdfe77 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_mainguiwindow.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.cpp index facb70ccf8347e7b6c4f84f721a957e86257890e..ee4b64fdf9b23e7a8a4949fd43ae46be97481252 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.cpp @@ -19,8 +19,8 @@ QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_myGraphicsScene_t { - QByteArrayData data[12]; - char stringdata0[158]; + QByteArrayData data[13]; + char stringdata0[180]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -37,17 +37,18 @@ QT_MOC_LITERAL(4, 48, 20), // "crazyFlyZoneSelected" QT_MOC_LITERAL(5, 69, 5), // "index" QT_MOC_LITERAL(6, 75, 11), // "modeChanged" QT_MOC_LITERAL(7, 87, 4), // "mode" -QT_MOC_LITERAL(8, 92, 18), // "removeCrazyFlyZone" -QT_MOC_LITERAL(9, 111, 23), // "setSelectedCrazyFlyZone" -QT_MOC_LITERAL(10, 135, 12), // "changeModeTo" -QT_MOC_LITERAL(11, 148, 9) // "next_mode" +QT_MOC_LITERAL(8, 92, 21), // "numTablePiecesChanged" +QT_MOC_LITERAL(9, 114, 18), // "removeCrazyFlyZone" +QT_MOC_LITERAL(10, 133, 23), // "setSelectedCrazyFlyZone" +QT_MOC_LITERAL(11, 157, 12), // "changeModeTo" +QT_MOC_LITERAL(12, 170, 9) // "next_mode" }, "myGraphicsScene\0numCrazyFlyZonesChanged\0" "\0newNum\0crazyFlyZoneSelected\0index\0" - "modeChanged\0mode\0removeCrazyFlyZone\0" - "setSelectedCrazyFlyZone\0changeModeTo\0" - "next_mode" + "modeChanged\0mode\0numTablePiecesChanged\0" + "removeCrazyFlyZone\0setSelectedCrazyFlyZone\0" + "changeModeTo\0next_mode" }; #undef QT_MOC_LITERAL @@ -57,32 +58,34 @@ static const uint qt_meta_data_myGraphicsScene[] = { 7, // revision 0, // classname 0, 0, // classinfo - 6, 14, // methods + 7, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 3, // signalCount + 4, // signalCount // signals: name, argc, parameters, tag, flags - 1, 1, 44, 2, 0x06 /* Public */, - 4, 1, 47, 2, 0x06 /* Public */, - 6, 1, 50, 2, 0x06 /* Public */, + 1, 1, 49, 2, 0x06 /* Public */, + 4, 1, 52, 2, 0x06 /* Public */, + 6, 1, 55, 2, 0x06 /* Public */, + 8, 1, 58, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags - 8, 1, 53, 2, 0x0a /* Public */, - 9, 1, 56, 2, 0x0a /* Public */, - 10, 1, 59, 2, 0x0a /* Public */, + 9, 1, 61, 2, 0x0a /* Public */, + 10, 1, 64, 2, 0x0a /* Public */, + 11, 1, 67, 2, 0x0a /* Public */, // signals: parameters QMetaType::Void, QMetaType::Int, 3, QMetaType::Void, QMetaType::Int, 5, QMetaType::Void, QMetaType::Int, 7, + QMetaType::Void, QMetaType::Int, 3, // slots: parameters QMetaType::Void, QMetaType::Int, 5, QMetaType::Void, QMetaType::Int, 5, - QMetaType::Void, QMetaType::Int, 11, + QMetaType::Void, QMetaType::Int, 12, 0 // eod }; @@ -96,9 +99,10 @@ void myGraphicsScene::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int case 0: _t->numCrazyFlyZonesChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: _t->crazyFlyZoneSelected((*reinterpret_cast< int(*)>(_a[1]))); break; case 2: _t->modeChanged((*reinterpret_cast< int(*)>(_a[1]))); break; - case 3: _t->removeCrazyFlyZone((*reinterpret_cast< int(*)>(_a[1]))); break; - case 4: _t->setSelectedCrazyFlyZone((*reinterpret_cast< int(*)>(_a[1]))); break; - case 5: _t->changeModeTo((*reinterpret_cast< int(*)>(_a[1]))); break; + case 3: _t->numTablePiecesChanged((*reinterpret_cast< int(*)>(_a[1]))); break; + case 4: _t->removeCrazyFlyZone((*reinterpret_cast< int(*)>(_a[1]))); break; + case 5: _t->setSelectedCrazyFlyZone((*reinterpret_cast< int(*)>(_a[1]))); break; + case 6: _t->changeModeTo((*reinterpret_cast< int(*)>(_a[1]))); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { @@ -125,6 +129,13 @@ void myGraphicsScene::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int return; } } + { + typedef void (myGraphicsScene::*_t)(int ); + if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&myGraphicsScene::numTablePiecesChanged)) { + *result = 3; + return; + } + } } } @@ -153,13 +164,13 @@ int myGraphicsScene::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 6) + if (_id < 7) qt_static_metacall(this, _c, _id, _a); - _id -= 6; + _id -= 7; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 6) + if (_id < 7) *reinterpret_cast<int*>(_a[0]) = -1; - _id -= 6; + _id -= 7; } return _id; } @@ -184,4 +195,11 @@ void myGraphicsScene::modeChanged(int _t1) void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 2, _a); } + +// SIGNAL 3 +void myGraphicsScene::numTablePiecesChanged(int _t1) +{ + void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 3, _a); +} QT_END_MOC_NAMESPACE diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o index c1f4c0f7b3bab6aafbba6a4aac982839faa3ab32..4e284587e9e1c9259227f345a1b6c0fc89feef83 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/moc_myGraphicsScene.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp index 03be79c75dcb9e4982afeff16c23448b059b3723..73c715cce3f5398d3796d19b1fb5d7423c1bd496 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.cpp @@ -152,6 +152,7 @@ void myGraphicsScene::addCrazyFlyZoneToVector(crazyFlyZone* rect) void myGraphicsScene::addTablePieceToVector(tablePiece* rect) { table_pieces.push_back(rect); + emit numTablePiecesChanged(table_pieces.size()); } void myGraphicsScene::updateIndexesAndLabelsCrazyFlyZones() @@ -247,6 +248,7 @@ void myGraphicsScene::removeTable() this->removeItem(table_pieces[i]); } table_pieces.clear(); + emit numTablePiecesChanged(table_pieces.size()); } void myGraphicsScene::removeTablePiece(int index) @@ -254,6 +256,7 @@ void myGraphicsScene::removeTablePiece(int index) this->removeItem(table_pieces[index]); table_pieces.erase(table_pieces.begin() + index); qDebug("removed TabledPiece %d", index); + emit numTablePiecesChanged(table_pieces.size()); } void myGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h index 3558f01e89781c7ef6bcb2a289bc8974332edaa8..50043b8696193b3d7b0f50fbc082a62e78373cac 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.h @@ -38,6 +38,7 @@ signals: void numCrazyFlyZonesChanged(int newNum); void crazyFlyZoneSelected(int index); void modeChanged(int mode); + void numTablePiecesChanged(int newNum); protected: void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) override; diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o index bcb5bf746bcbdda3e2cb18eb5d5306d2ff5433fb..cf364f826bdd89e71ea5502bf317962a1dfed12e 100644 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/myGraphicsScene.o differ diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/ui_mainguiwindow.h b/crazyflie_ws/sandbox/crazypkg/gui/untitled/ui_mainguiwindow.h index 3ff850827693f2cfae6ce52a2bdb336321aafb5b..2075b906943dddded80e25fcdf36d03686947b67 100644 --- a/crazyflie_ws/sandbox/crazypkg/gui/untitled/ui_mainguiwindow.h +++ b/crazyflie_ws/sandbox/crazypkg/gui/untitled/ui_mainguiwindow.h @@ -13,11 +13,14 @@ #include <QtWidgets/QAction> #include <QtWidgets/QApplication> #include <QtWidgets/QButtonGroup> +#include <QtWidgets/QCheckBox> #include <QtWidgets/QFrame> +#include <QtWidgets/QGroupBox> #include <QtWidgets/QHeaderView> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMenuBar> #include <QtWidgets/QPushButton> +#include <QtWidgets/QRadioButton> #include <QtWidgets/QStatusBar> #include <QtWidgets/QTabWidget> #include <QtWidgets/QToolBar> @@ -34,8 +37,13 @@ public: QTabWidget *tabWidget; QFrame *frame_drawing; myGraphicsView *graphicsView; - QPushButton *drawingModeButton; QPushButton *removeTable; + QGroupBox *groupBox; + QRadioButton *radioButton_table_mode; + QRadioButton *radioButton_crazyfly_zones_mode; + QGroupBox *groupBox_2; + QCheckBox *checkBox_crazyfly_zones; + QCheckBox *checkBox_vicon_markers; QFrame *frame_3; QMenuBar *menuBar; QToolBar *mainToolBar; @@ -50,32 +58,55 @@ public: centralWidget->setObjectName(QStringLiteral("centralWidget")); frame = new QFrame(centralWidget); frame->setObjectName(QStringLiteral("frame")); - frame->setGeometry(QRect(40, 510, 1171, 451)); + frame->setGeometry(QRect(40, 510, 1431, 451)); frame->setFrameShape(QFrame::StyledPanel); frame->setFrameShadow(QFrame::Raised); tabWidget = new QTabWidget(frame); tabWidget->setObjectName(QStringLiteral("tabWidget")); - tabWidget->setGeometry(QRect(20, 19, 1131, 401)); + tabWidget->setGeometry(QRect(20, 19, 1391, 401)); tabWidget->setLayoutDirection(Qt::LeftToRight); tabWidget->setTabsClosable(true); frame_drawing = new QFrame(centralWidget); frame_drawing->setObjectName(QStringLiteral("frame_drawing")); - frame_drawing->setGeometry(QRect(20, 20, 641, 469)); + frame_drawing->setGeometry(QRect(20, 18, 951, 471)); frame_drawing->setFrameShape(QFrame::StyledPanel); frame_drawing->setFrameShadow(QFrame::Raised); graphicsView = new myGraphicsView(frame_drawing); graphicsView->setObjectName(QStringLiteral("graphicsView")); - graphicsView->setGeometry(QRect(10, 9, 571, 401)); + graphicsView->setGeometry(QRect(10, 9, 741, 401)); graphicsView->setMouseTracking(true); - drawingModeButton = new QPushButton(frame_drawing); - drawingModeButton->setObjectName(QStringLiteral("drawingModeButton")); - drawingModeButton->setGeometry(QRect(20, 430, 141, 21)); removeTable = new QPushButton(frame_drawing); removeTable->setObjectName(QStringLiteral("removeTable")); - removeTable->setGeometry(QRect(200, 430, 91, 21)); + removeTable->setGeometry(QRect(340, 430, 91, 21)); + groupBox = new QGroupBox(frame_drawing); + groupBox->setObjectName(QStringLiteral("groupBox")); + groupBox->setGeometry(QRect(790, 30, 121, 80)); + radioButton_table_mode = new QRadioButton(groupBox); + radioButton_table_mode->setObjectName(QStringLiteral("radioButton_table_mode")); + radioButton_table_mode->setGeometry(QRect(10, 20, 61, 20)); + QFont font; + font.setPointSize(7); + radioButton_table_mode->setFont(font); + radioButton_table_mode->setChecked(true); + radioButton_crazyfly_zones_mode = new QRadioButton(groupBox); + radioButton_crazyfly_zones_mode->setObjectName(QStringLiteral("radioButton_crazyfly_zones_mode")); + radioButton_crazyfly_zones_mode->setGeometry(QRect(10, 50, 91, 16)); + radioButton_crazyfly_zones_mode->setFont(font); + radioButton_crazyfly_zones_mode->setCheckable(true); + groupBox_2 = new QGroupBox(frame_drawing); + groupBox_2->setObjectName(QStringLiteral("groupBox_2")); + groupBox_2->setGeometry(QRect(790, 130, 120, 241)); + checkBox_crazyfly_zones = new QCheckBox(groupBox_2); + checkBox_crazyfly_zones->setObjectName(QStringLiteral("checkBox_crazyfly_zones")); + checkBox_crazyfly_zones->setGeometry(QRect(10, 20, 101, 20)); + checkBox_crazyfly_zones->setFont(font); + checkBox_vicon_markers = new QCheckBox(groupBox_2); + checkBox_vicon_markers->setObjectName(QStringLiteral("checkBox_vicon_markers")); + checkBox_vicon_markers->setGeometry(QRect(10, 40, 101, 20)); + checkBox_vicon_markers->setFont(font); frame_3 = new QFrame(centralWidget); frame_3->setObjectName(QStringLiteral("frame_3")); - frame_3->setGeometry(QRect(669, 21, 541, 469)); + frame_3->setGeometry(QRect(990, 20, 481, 469)); frame_3->setFrameShape(QFrame::StyledPanel); frame_3->setFrameShadow(QFrame::Raised); MainGUIWindow->setCentralWidget(centralWidget); @@ -101,8 +132,13 @@ public: void retranslateUi(QMainWindow *MainGUIWindow) { MainGUIWindow->setWindowTitle(QApplication::translate("MainGUIWindow", "MainGUIWindow", 0)); - drawingModeButton->setText(QApplication::translate("MainGUIWindow", "CreateTableMode", 0)); removeTable->setText(QApplication::translate("MainGUIWindow", "Remove Table", 0)); + groupBox->setTitle(QApplication::translate("MainGUIWindow", "Creation Modes", 0)); + radioButton_table_mode->setText(QApplication::translate("MainGUIWindow", "Tables", 0)); + radioButton_crazyfly_zones_mode->setText(QApplication::translate("MainGUIWindow", "CrazyFly Zones", 0)); + groupBox_2->setTitle(QApplication::translate("MainGUIWindow", "What to show", 0)); + checkBox_crazyfly_zones->setText(QApplication::translate("MainGUIWindow", "Show CF Zones", 0)); + checkBox_vicon_markers->setText(QApplication::translate("MainGUIWindow", "Show Markers", 0)); } // retranslateUi }; diff --git a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled index 490fb173f046308f90293d5d4f698b8c0c9d2d05..ec9ce1041ab65ebf50692b1cb7e3dbb001cadcab 100755 Binary files a/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled and b/crazyflie_ws/sandbox/crazypkg/gui/untitled/untitled differ