From 7e00907d50a43141d3579d9523ad3950c2f833b7 Mon Sep 17 00:00:00 2001 From: Valentin Platzgummer Date: Thu, 12 Nov 2020 16:48:09 +0100 Subject: [PATCH] before moving wima view functionality to circular survey (and removing wima view) --- qgroundcontrol.pro | 1 + qgroundcontrol.qrc | 6 +++- resources/.directory | 2 +- src/MissionManager/MissionController.cc | 1 + src/Settings/Wima.SettingsGroup.json | 34 ++++++------------- src/Settings/WimaSettings.cc | 3 -- src/Settings/WimaSettings.h | 3 -- src/Wima/CircularSurvey.cc | 8 ++--- .../json/CircularGenerator.SettingsGroup.json | 5 +++ .../json/LinearGenerator.SettingsGroup.json | 5 +++ .../json/CircularSurvey.SettingsGroup.json | 5 +++ src/ui/preferences/GeneralSettings.qml | 30 +--------------- 12 files changed, 38 insertions(+), 65 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 694cd0a6d..d1164e064 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -417,6 +417,7 @@ INCLUDEPATH += \ src/QtLocationPlugin/QMLControl \ src/Settings \ src/Wima/Snake \ + src/Wima \ src/Terrain \ src/Vehicle \ src/Audio \ diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 4b9a55e31..0ffb5bccc 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -261,7 +261,7 @@ src/QmlControls/QmlTest.qml src/AutoPilotPlugins/Common/RadioComponent.qml src/ui/preferences/SerialSettings.qml - src/Wima/Snake/WimaAreaNoVisual.qml + src/Wima/Snake/WimaAreaNoVisual.qml src/WimaView/CircularGeneratorEditor.qml src/WimaView/CircularGeneratorMapVisual.qml src/WimaView/CircularSurveyItemEditor.qml @@ -360,6 +360,10 @@ src/Vehicle/WindFact.json src/Settings/Video.SettingsGroup.json src/MissionManager/VTOLLandingPattern.FactMetaData.json + src/Settings/Wima.SettingsGroup.json + src/Wima/json/CircularSurvey.SettingsGroup.json + src/Wima/Snake/json/LinearGenerator.SettingsGroup.json + src/Wima/Snake/json/CircularGenerator.SettingsGroup.json src/comm/APMArduSubMockLink.params diff --git a/resources/.directory b/resources/.directory index 4803c4f12..6d0af6479 100644 --- a/resources/.directory +++ b/resources/.directory @@ -1,4 +1,4 @@ [Dolphin] PreviewsShown=true -Timestamp=2020,2,21,14,47,12 +Timestamp=2020,11,12,9,46,48 Version=4 diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index 7af1586c6..9713e5475 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -2230,6 +2230,7 @@ QStringList MissionController::complexMissionItemNames(void) const complexItems.append(SurveyComplexItem::name); complexItems.append(CorridorScanComplexItem::name); + complexItems.append(CircularSurvey::name); if (_controllerVehicle->multiRotor() || _controllerVehicle->vtol()) { complexItems.append(StructureScanComplexItem::name); } diff --git a/src/Settings/Wima.SettingsGroup.json b/src/Settings/Wima.SettingsGroup.json index 661453d29..65af85601 100644 --- a/src/Settings/Wima.SettingsGroup.json +++ b/src/Settings/Wima.SettingsGroup.json @@ -1,28 +1,14 @@ -[ -{ - "name": "lowBatteryThreshold", - "shortDescription": "The battery threshold in percents, for which low battery handling measures get triggered.", - "type": "double", - "units": "%", - "defaultValue": 35 -}, -{ - "name": "enableLowBatteryHandling", - "shortDescription": "Enables or disables low battery handling measures.", - "type": "bool", - "defaultValue": true -}, { - "name": "minimalRemainingMissionTime", - "shortDescription": "If the remaining estimated mission time is lower than this value, low battery handling will not be triggered.", - "type": "uint64", - "units": "s", - "defaultValue": 15 -}, + "version": 1, + "fileType": "FactMetaData", + "QGC.MetaData.Facts": +[ { - "name": "rosbridgeConnectionString", - "shortDescription": "Ros Bridge Connection String (host:port).", - "type": "string", - "defaultValue": "localhost:9090" + "name": "rosbridgeConnectionString", + "shortDesc": "Connection String", + "longDesc": "Ros Bridge Connection String (e.g. host_ip:port).", + "type": "string", + "default": "localhost:9090" } ] +} diff --git a/src/Settings/WimaSettings.cc b/src/Settings/WimaSettings.cc index 46a04fc79..32c2a828b 100644 --- a/src/Settings/WimaSettings.cc +++ b/src/Settings/WimaSettings.cc @@ -8,7 +8,4 @@ DECLARE_SETTINGGROUP(Wima, "Wima") qmlRegisterUncreatableType("QGroundControl.SettingsManager", 1, 0, "WimaSettings", "Reference only"); \ } -DECLARE_SETTINGSFACT(WimaSettings, lowBatteryThreshold) -DECLARE_SETTINGSFACT(WimaSettings, enableLowBatteryHandling) -DECLARE_SETTINGSFACT(WimaSettings, minimalRemainingMissionTime) DECLARE_SETTINGSFACT(WimaSettings, rosbridgeConnectionString) diff --git a/src/Settings/WimaSettings.h b/src/Settings/WimaSettings.h index 30b747d67..6f8edbd28 100644 --- a/src/Settings/WimaSettings.h +++ b/src/Settings/WimaSettings.h @@ -10,8 +10,5 @@ public: DEFINE_SETTING_NAME_GROUP() - DEFINE_SETTINGFACT(lowBatteryThreshold) - DEFINE_SETTINGFACT(enableLowBatteryHandling) - DEFINE_SETTINGFACT(minimalRemainingMissionTime) DEFINE_SETTINGFACT(rosbridgeConnectionString) }; diff --git a/src/Wima/CircularSurvey.cc b/src/Wima/CircularSurvey.cc index e5cce2f36..163ec407d 100644 --- a/src/Wima/CircularSurvey.cc +++ b/src/Wima/CircularSurvey.cc @@ -68,7 +68,7 @@ CircularSurvey::CircularSurvey(PlanMasterController *masterController, CircularSurvey::~CircularSurvey() {} void CircularSurvey::reverse() { - this->_setState(STATE::REVERSE); + this->_setState(STATE::REVERT_PATH); this->_rebuildTransects(); } @@ -217,7 +217,7 @@ bool CircularSurvey::_calculating(CircularSurvey::STATE state) const { } void CircularSurvey::_changeVariant() { - this->_setState(STATE::VARIANT_CHANGE); + this->_setState(STATE::CHANGE_VARIANT); this->_rebuildTransects(); } @@ -479,12 +479,12 @@ void CircularSurvey::_rebuildTransectsPhase1(void) { qCDebug(CircularSurveyLog) << "rebuildTransectsPhase1: skipp."; this->_setState(STATE::IDLE); break; - case STATE::VARIANT_CHANGE: + case STATE::CHANGE_VARIANT: qCDebug(CircularSurveyLog) << "rebuildTransectsPhase1: variant change."; this->_changeVariantWorker(); this->_setState(STATE::IDLE); break; - case STATE::REVERSE: + case STATE::REVERT_PATH: qCDebug(CircularSurveyLog) << "rebuildTransectsPhase1: reverse."; this->_reverseWorker(); this->_setState(STATE::IDLE); diff --git a/src/Wima/Snake/json/CircularGenerator.SettingsGroup.json b/src/Wima/Snake/json/CircularGenerator.SettingsGroup.json index 001a3df5f..9c63ddb04 100644 --- a/src/Wima/Snake/json/CircularGenerator.SettingsGroup.json +++ b/src/Wima/Snake/json/CircularGenerator.SettingsGroup.json @@ -1,3 +1,7 @@ +{ + "version": 1, + "fileType": "FactMetaData", + "QGC.MetaData.Facts": [ { "name": "TransectDistance", @@ -28,3 +32,4 @@ "defaultValue": 5.0 } ] +} diff --git a/src/Wima/Snake/json/LinearGenerator.SettingsGroup.json b/src/Wima/Snake/json/LinearGenerator.SettingsGroup.json index cc3bc7130..a24f3e1ba 100644 --- a/src/Wima/Snake/json/LinearGenerator.SettingsGroup.json +++ b/src/Wima/Snake/json/LinearGenerator.SettingsGroup.json @@ -1,3 +1,7 @@ +{ + "version": 1, + "fileType": "FactMetaData", + "QGC.MetaData.Facts": [ { "name": "TransectDistance", @@ -28,3 +32,4 @@ "defaultValue": 5.0 } ] +} diff --git a/src/Wima/json/CircularSurvey.SettingsGroup.json b/src/Wima/json/CircularSurvey.SettingsGroup.json index 8f712af16..65e2cbbe4 100644 --- a/src/Wima/json/CircularSurvey.SettingsGroup.json +++ b/src/Wima/json/CircularSurvey.SettingsGroup.json @@ -1,3 +1,7 @@ +{ + "version": 1, + "fileType": "FactMetaData", + "QGC.MetaData.Facts": [ { "name": "TransectDistance", @@ -53,3 +57,4 @@ "defaultValue": 0 } ] +} diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 563a57d84..879d17f56 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -1095,6 +1095,7 @@ Rectangle { text: qsTr("WiMA") visible: QGroundControl.settingsManager.wimaSettings.visible } + Rectangle { Layout.preferredWidth: wimaGrid.width + (_margins * 2) Layout.preferredHeight: wimaGrid.height + (_margins * 2) @@ -1110,35 +1111,6 @@ Rectangle { anchors.right: parent.right columns: 4 - QGCLabel { - text: qsTr("Battery Threshold") - visible: _userBrandImageIndoor.visible - } - FactTextField { - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.wimaSettings.lowBatteryThreshold - Layout.columnSpan: 2 - } - - FactCheckBox { - text: "Enable Smart RTL" - fact: QGroundControl.settingsManager.wimaSettings.enableLowBatteryHandling - } - - QGCLabel { - text: qsTr("Minimal remaining Mission Time") - visible: _userBrandImageIndoor.visible - } - FactTextField { - Layout.preferredWidth: _valueFieldWidth - fact: QGroundControl.settingsManager.wimaSettings.minimalRemainingMissionTime - Layout.columnSpan: 2 - } - Item{ - // dummy - width: 1 - } - QGCLabel { text: qsTr("ROS Bridge Connection String") visible: _userBrandImageIndoor.visible -- 2.22.0