diff --git a/modules/catkin_ws/src/CMakeLists.txt b/modules/catkin_ws/src/CMakeLists.txt index 3421623bd042f7eb4d2675c8c9ca624feb01cd4f..581e61db89fce59006b1ceb2d208d9f3e5fbcb5e 120000 --- a/modules/catkin_ws/src/CMakeLists.txt +++ b/modules/catkin_ws/src/CMakeLists.txt @@ -1 +1 @@ -/opt/ros/lunar/share/catkin/cmake/toplevel.cmake \ No newline at end of file +/opt/ros/kinetic/share/catkin/cmake/toplevel.cmake \ No newline at end of file diff --git a/modules/catkin_ws/src/PCGui/PCGui/CommandGui.qml b/modules/catkin_ws/src/PCGui/PCGui/CommandGui.qml index 7173a386bfc302df4b326dc36565147bded861ce..9e63cc475d2e8cc7f0c324febdb4cb53e77d741a 100644 --- a/modules/catkin_ws/src/PCGui/PCGui/CommandGui.qml +++ b/modules/catkin_ws/src/PCGui/PCGui/CommandGui.qml @@ -40,23 +40,33 @@ ApplicationWindow { } // --- enablePlatoon --- - CheckBox { - id: enablePlatoonCheckbox - objectName: "enablePlatoonCheckbox" - text: "Platoon enabled" + Button { + id: enablePlatoonButton + objectName: "enablePlatoonButton" + text: "Enable Platoon" anchors.left: hostLabel.left anchors.top: hostLabel.bottom anchors.topMargin: 20 } + Button { + id: disablePlatoonButton + objectName: "disablePlatoonButton" + text: "Disable Platoon" + + anchors.left: enablePlatoonButton.right + anchors.leftMargin: 15 + anchors.verticalCenter: enablePlatoonButton.verticalCenter + } + // --- platoonSpeed --- Label { id: platoonSpeedLabel text: "Platoon Speed:" anchors.left: hostLabel.left - anchors.top: enablePlatoonCheckbox.bottom + anchors.top: enablePlatoonButton.bottom anchors.topMargin: 20 } diff --git a/modules/catkin_ws/src/PCGui/PCGui/include/CommandGui/SignalConsumer.h b/modules/catkin_ws/src/PCGui/PCGui/include/CommandGui/SignalConsumer.h index efefa1eae58cf7382b85ac700f0a9ca80db314c2..d75360e063012cb91c6cca765a601f874886230e 100644 --- a/modules/catkin_ws/src/PCGui/PCGui/include/CommandGui/SignalConsumer.h +++ b/modules/catkin_ws/src/PCGui/PCGui/include/CommandGui/SignalConsumer.h @@ -22,8 +22,11 @@ public: void setOnHostChanged(const Callback & callback) { onHostChanged = callback; } - void setOnEnablePlatoonChanged(const Callback & callback) - { onEnablePlatoonChanged = callback; } + void setOnEnablePlatoon(const Callback & callback) + { onEnablePlatoon = callback; } + + void setOnDisablePlatoon(const Callback & callback) + { onDisablePlatoon = callback; } void setOnPlatoonSpeedChanged(const Callback & callback) { onPlatoonSpeedChanged = callback; } @@ -39,8 +42,11 @@ public slots: void hostChanged() { onHostChanged(); }; - void enablePlatoonChanged() - { onEnablePlatoonChanged(); } + void enablePlatoon() + { onEnablePlatoon(); } + + void disablePlatoon() + { onDisablePlatoon(); } void platoonSpeedChanged() { onPlatoonSpeedChanged(); } @@ -54,7 +60,8 @@ public slots: private: Callback onHostChanged = [] {}; - Callback onEnablePlatoonChanged = [] {}; + Callback onEnablePlatoon = [] {}; + Callback onDisablePlatoon = [] {}; Callback onPlatoonSpeedChanged = [] {}; Callback onInnerPlatoonDistanceChanged = [] {}; Callback onSpeedChanged = [] {}; diff --git a/modules/catkin_ws/src/PCGui/PCGui/src/CommandGui/CommandGui.cpp b/modules/catkin_ws/src/PCGui/PCGui/src/CommandGui/CommandGui.cpp index 2f81c9cfeb72fa26969e887448ac01803769ab36..bd52892bb60364a764681effb4e63125d469a9a9 100644 --- a/modules/catkin_ws/src/PCGui/PCGui/src/CommandGui/CommandGui.cpp +++ b/modules/catkin_ws/src/PCGui/PCGui/src/CommandGui/CommandGui.cpp @@ -44,7 +44,8 @@ int main(int argc, char * argv[]) auto root = engine.rootObjects()[0]; auto hostTextField = root->findChild<QObject *>("hostTextField"); auto setHostButton = root->findChild<QObject *>("setHostButton"); - auto enablePlatoonCheckBox = root->findChild<QObject *>("enablePlatoonCheckbox"); + auto enablePlatoonButton = root->findChild<QObject *>("enablePlatoonButton"); + auto disablePlatoonButton = root->findChild<QObject *>("disablePlatoonButton"); auto platoonSpeedTextField = root->findChild<QObject *>("platoonSpeedTextField"); auto setPlatoonSpeedButton = root->findChild<QObject *>("setPlatoonSpeedButton"); auto innerPlatoonDistanceTextField = root->findChild<QObject *>("innerPlatoonDistanceTextField"); @@ -53,7 +54,8 @@ int main(int argc, char * argv[]) auto setSpeedButton = root->findChild<QObject *>("setSpeedButton"); QObject::connect(setHostButton, SIGNAL(clicked()), &consumer, SLOT(hostChanged())); - QObject::connect(enablePlatoonCheckBox, SIGNAL(clicked()), &consumer, SLOT(enablePlatoonChanged())); + QObject::connect(enablePlatoonButton, SIGNAL(clicked()), &consumer, SLOT(enablePlatoon())); + QObject::connect(disablePlatoonButton, SIGNAL(clicked()), &consumer, SLOT(disablePlatoon())); QObject::connect(setPlatoonSpeedButton, SIGNAL(clicked()), &consumer, SLOT(platoonSpeedChanged())); QObject::connect(setInnerPlatoonDistanceButton, SIGNAL(clicked()), &consumer, SLOT(innerPlatoonDistanceChanged())); QObject::connect(setSpeedButton, SIGNAL(clicked()), &consumer, SLOT(speedChanged())); @@ -65,11 +67,16 @@ int main(int argc, char * argv[]) commandSender.setHost(host); }); - consumer.setOnEnablePlatoonChanged( - [&commandSender, &enablePlatoonCheckBox] + consumer.setOnEnablePlatoon( + [&commandSender] { - auto checked = enablePlatoonCheckBox->property("checked").toBool(); - commandSender.enablePlatoon(checked); + commandSender.enablePlatoon(true); + }); + + consumer.setOnDisablePlatoon( + [&commandSender] + { + commandSender.enablePlatoon(false); }); consumer.setOnPlatoonSpeedChanged(