diff --git a/deploy/QGroundControl.AppImage b/deploy/QGroundControl.AppImage new file mode 100755 index 0000000000000000000000000000000000000000..c841f9730473d586da211149df65ed8019aaf710 Binary files /dev/null and b/deploy/QGroundControl.AppImage differ diff --git a/src/Wima/WimaController.cc b/src/Wima/WimaController.cc index a9e363d67d27acac03a3c90e402783944a6883a3..c609b56fcb75ffc1d72b74cacefbe543fc71afb1 100644 --- a/src/Wima/WimaController.cc +++ b/src/Wima/WimaController.cc @@ -94,6 +94,21 @@ void WimaController::addVehicleCorridor() emit visualItemsChanged(); } +void WimaController::removeAllAreas() +{ + bool changesApplied = false; + while (_visualItems->count() > 0) { + _visualItems->removeAt(0); + changesApplied = true; + } + + _currentFile = ""; + + emit currentFileChanged(); + if ( changesApplied ) + emit visualItemsChanged(); +} + void WimaController::startMission() { @@ -233,7 +248,7 @@ bool WimaController::updateMission() void WimaController::saveToCurrent() { - + saveToFile(_currentFile); } void WimaController::saveToFile(const QString& filename) diff --git a/src/Wima/WimaController.h b/src/Wima/WimaController.h index 587cc38ce4c89ea846fb258e58e6b06a20b4376b..66ea17661f298b90069a5f99bf13772871a0fe57 100644 --- a/src/Wima/WimaController.h +++ b/src/Wima/WimaController.h @@ -59,6 +59,7 @@ public: Q_INVOKABLE void addServiceArea(); /// @return true if a vehicle corridor was added sucessfully and false otherwise. Q_INVOKABLE void addVehicleCorridor(); + Q_INVOKABLE void removeAllAreas(); Q_INVOKABLE void startMission(); Q_INVOKABLE void abortMission(); diff --git a/src/WimaView/WimaView.qml b/src/WimaView/WimaView.qml index 4e1b646f61d6c9f478db2f2164831d36c2d27fd5..232b96e353a0866b6edcba6a139a1c15d986b18a 100644 --- a/src/WimaView/WimaView.qml +++ b/src/WimaView/WimaView.qml @@ -1006,6 +1006,17 @@ QGCView { } } + Component { + id: wimaRemoveAllPromptDialog + QGCViewMessage { + message: qsTr("Are you sure you want to remove all items and create a Wima mission? ") + function accept() { + wimaController.removeAllAreas(); + hideDialog() + } + } + } + Component { id: clearVehicleMissionDialog QGCViewMessage { @@ -1058,12 +1069,12 @@ QGCView { columnSpacing: ScreenTools.defaultFontPixelWidth QGCButton { - text: qsTr("New...ToDo") + text: qsTr("New...Testing") Layout.fillWidth: true enabled: _wimaVisualItems.count > 1 onClicked: { dropPanel.hide() - _qgcView.showDialog(removeAllPromptDialog, qsTr("New Plan"), _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) + _qgcView.showDialog(wimaRemoveAllPromptDialog, qsTr("New Plan"), _qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) } } @@ -1084,6 +1095,7 @@ QGCView { onClicked: { dropPanel.hide() wimaController.saveToCurrent() + console.log("saveing to: ", wimaController.currentFile) } } @@ -1093,7 +1105,7 @@ QGCView { enabled: _wimaVisualItems.count > 1 onClicked: { dropPanel.hide() - masterController.saveToSelectedFile() + wimaController.saveToSelectedFile() } }