Commit 8a973ac5 authored by Valentin Platzgummer's avatar Valentin Platzgummer

wima settings and reverse (wima menu) added

parent f0f3912e
...@@ -432,7 +432,8 @@ HEADERS += \ ...@@ -432,7 +432,8 @@ HEADERS += \
src/Wima/OptimisationTools.h \ src/Wima/OptimisationTools.h \
src/Wima/GeoUtilities.h \ src/Wima/GeoUtilities.h \
src/Wima/TestPolygonCalculus.h \ src/Wima/TestPolygonCalculus.h \
src/Wima/testplanimetrycalculus.h src/Wima/testplanimetrycalculus.h \
src/Settings/WimaSettings.h
SOURCES += \ SOURCES += \
src/api/QGCCorePlugin.cc \ src/api/QGCCorePlugin.cc \
src/api/QGCOptions.cc \ src/api/QGCOptions.cc \
...@@ -463,7 +464,8 @@ SOURCES += \ ...@@ -463,7 +464,8 @@ SOURCES += \
src/Wima/GeoUtilities.cc \ src/Wima/GeoUtilities.cc \
src/Wima/PolygonCalculus.cc \ src/Wima/PolygonCalculus.cc \
src/Wima/TestPolygonCalculus.cpp \ src/Wima/TestPolygonCalculus.cpp \
src/Wima/testplanimetrycalculus.cpp src/Wima/testplanimetrycalculus.cpp \
src/Settings/WimaSettings.cc
# #
# Unit Test specific configuration goes here (requires full debug build with all plugins) # Unit Test specific configuration goes here (requires full debug build with all plugins)
...@@ -1346,3 +1348,4 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) { ...@@ -1346,3 +1348,4 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) {
DISTFILES += \ DISTFILES += \
src/WimaView/WimaMeasurementAreaEditor.qml \ src/WimaView/WimaMeasurementAreaEditor.qml \
src/Settings/Wima.SettingsGroup.json
...@@ -278,6 +278,7 @@ ...@@ -278,6 +278,7 @@
<file alias="CircularSurvey.SettingsGroup.json">src/Wima/CircularSurvey.SettingsGroup.json</file> <file alias="CircularSurvey.SettingsGroup.json">src/Wima/CircularSurvey.SettingsGroup.json</file>
<file alias="WimaArea.SettingsGroup.json">src/Wima/WimaArea.SettingsGroup.json</file> <file alias="WimaArea.SettingsGroup.json">src/Wima/WimaArea.SettingsGroup.json</file>
<file alias="WimaController.SettingsGroup.json">src/Wima/WimaController.SettingsGroup.json</file> <file alias="WimaController.SettingsGroup.json">src/Wima/WimaController.SettingsGroup.json</file>
<file alias="Wima.SettingsGroup.json">src/Settings/Wima.SettingsGroup.json</file>
</qresource> </qresource>
<qresource prefix="/MockLink"> <qresource prefix="/MockLink">
<file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file> <file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file>
......
...@@ -107,7 +107,7 @@ Item { ...@@ -107,7 +107,7 @@ Item {
Column { Column {
id: mainColumn id: mainColumn
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: 4 spacing: ScreenTools.defaultFontPixelHeight * 0.3
SectionHeader{ SectionHeader{
id: settingsHeader id: settingsHeader
...@@ -145,6 +145,12 @@ Item { ...@@ -145,6 +145,12 @@ Item {
fact: wimaController.overlapWaypoints fact: wimaController.overlapWaypoints
Layout.fillWidth: true Layout.fillWidth: true
} }
}
GridLayout {
columns: 2
rowSpacing: ScreenTools.defaultFontPixelHeight * 0.5
columnSpacing: ScreenTools.defaultFontPixelHeight * 0.5
visible: settingsHeader.checked
FactCheckBox { FactCheckBox {
text: qsTr("Show All") text: qsTr("Show All")
...@@ -157,6 +163,12 @@ Item { ...@@ -157,6 +163,12 @@ Item {
fact: wimaController.showCurrentMissionItems fact: wimaController.showCurrentMissionItems
Layout.fillWidth: true Layout.fillWidth: true
} }
FactCheckBox {
text: qsTr("Reverse")
fact: wimaController.reverse
Layout.fillWidth: true
}
} // Grid } // Grid
SectionHeader{ SectionHeader{
......
...@@ -12,6 +12,7 @@ add_library(Settings ...@@ -12,6 +12,7 @@ add_library(Settings
SettingsManager.cc SettingsManager.cc
UnitsSettings.cc UnitsSettings.cc
VideoSettings.cc VideoSettings.cc
WimaSettings.cc
) )
target_link_libraries(Settings target_link_libraries(Settings
......
...@@ -20,3 +20,4 @@ DECLARE_SETTINGGROUP(FlyView, "FlyView") ...@@ -20,3 +20,4 @@ DECLARE_SETTINGGROUP(FlyView, "FlyView")
DECLARE_SETTINGSFACT(FlyViewSettings, guidedMinimumAltitude) DECLARE_SETTINGSFACT(FlyViewSettings, guidedMinimumAltitude)
DECLARE_SETTINGSFACT(FlyViewSettings, guidedMaximumAltitude) DECLARE_SETTINGSFACT(FlyViewSettings, guidedMaximumAltitude)
...@@ -26,6 +26,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox) ...@@ -26,6 +26,7 @@ SettingsManager::SettingsManager(QGCApplication* app, QGCToolbox* toolbox)
, _flyViewSettings (nullptr) , _flyViewSettings (nullptr)
, _planViewSettings (nullptr) , _planViewSettings (nullptr)
, _brandImageSettings (nullptr) , _brandImageSettings (nullptr)
, _wimaSettings (nullptr)
#if !defined(NO_ARDUPILOT_DIALECT) #if !defined(NO_ARDUPILOT_DIALECT)
, _apmMavlinkStreamRateSettings (nullptr) , _apmMavlinkStreamRateSettings (nullptr)
#endif #endif
...@@ -48,6 +49,7 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox) ...@@ -48,6 +49,7 @@ void SettingsManager::setToolbox(QGCToolbox *toolbox)
_flyViewSettings = new FlyViewSettings (this); _flyViewSettings = new FlyViewSettings (this);
_planViewSettings = new PlanViewSettings (this); _planViewSettings = new PlanViewSettings (this);
_brandImageSettings = new BrandImageSettings (this); _brandImageSettings = new BrandImageSettings (this);
_wimaSettings = new WimaSettings (this);
#if !defined(NO_ARDUPILOT_DIALECT) #if !defined(NO_ARDUPILOT_DIALECT)
_apmMavlinkStreamRateSettings = new APMMavlinkStreamRateSettings (this); _apmMavlinkStreamRateSettings = new APMMavlinkStreamRateSettings (this);
#endif #endif
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "PlanViewSettings.h" #include "PlanViewSettings.h"
#include "BrandImageSettings.h" #include "BrandImageSettings.h"
#include "APMMavlinkStreamRateSettings.h" #include "APMMavlinkStreamRateSettings.h"
#include "WimaSettings.h"
#if defined(QGC_AIRMAP_ENABLED) #if defined(QGC_AIRMAP_ENABLED)
#include "AirMapSettings.h" #include "AirMapSettings.h"
#endif #endif
...@@ -49,6 +50,7 @@ public: ...@@ -49,6 +50,7 @@ public:
Q_PROPERTY(QObject* flyViewSettings READ flyViewSettings CONSTANT) Q_PROPERTY(QObject* flyViewSettings READ flyViewSettings CONSTANT)
Q_PROPERTY(QObject* planViewSettings READ planViewSettings CONSTANT) Q_PROPERTY(QObject* planViewSettings READ planViewSettings CONSTANT)
Q_PROPERTY(QObject* brandImageSettings READ brandImageSettings CONSTANT) Q_PROPERTY(QObject* brandImageSettings READ brandImageSettings CONSTANT)
Q_PROPERTY(QObject* wimaSettings READ wimaSettings CONSTANT)
#if !defined(NO_ARDUPILOT_DIALECT) #if !defined(NO_ARDUPILOT_DIALECT)
Q_PROPERTY(QObject* apmMavlinkStreamRateSettings READ apmMavlinkStreamRateSettings CONSTANT) Q_PROPERTY(QObject* apmMavlinkStreamRateSettings READ apmMavlinkStreamRateSettings CONSTANT)
#endif #endif
...@@ -67,6 +69,7 @@ public: ...@@ -67,6 +69,7 @@ public:
FlyViewSettings* flyViewSettings (void) { return _flyViewSettings; } FlyViewSettings* flyViewSettings (void) { return _flyViewSettings; }
PlanViewSettings* planViewSettings (void) { return _planViewSettings; } PlanViewSettings* planViewSettings (void) { return _planViewSettings; }
BrandImageSettings* brandImageSettings (void) { return _brandImageSettings; } BrandImageSettings* brandImageSettings (void) { return _brandImageSettings; }
WimaSettings* wimaSettings (void) { return _wimaSettings; }
#if !defined(NO_ARDUPILOT_DIALECT) #if !defined(NO_ARDUPILOT_DIALECT)
APMMavlinkStreamRateSettings* apmMavlinkStreamRateSettings(void) { return _apmMavlinkStreamRateSettings; } APMMavlinkStreamRateSettings* apmMavlinkStreamRateSettings(void) { return _apmMavlinkStreamRateSettings; }
#endif #endif
...@@ -83,6 +86,7 @@ private: ...@@ -83,6 +86,7 @@ private:
FlyViewSettings* _flyViewSettings; FlyViewSettings* _flyViewSettings;
PlanViewSettings* _planViewSettings; PlanViewSettings* _planViewSettings;
BrandImageSettings* _brandImageSettings; BrandImageSettings* _brandImageSettings;
WimaSettings* _wimaSettings;
#if !defined(NO_ARDUPILOT_DIALECT) #if !defined(NO_ARDUPILOT_DIALECT)
APMMavlinkStreamRateSettings* _apmMavlinkStreamRateSettings; APMMavlinkStreamRateSettings* _apmMavlinkStreamRateSettings;
#endif #endif
......
[
{
"name": "lowBatteryThreshold",
"shortDescription": "The battery threshold in percents, for which low battery handling measures get triggered.",
"type": "double",
"units": "%",
"defaultValue": 40
},
{
"name": "enableLowBatteryHandling",
"shortDescription": "Enables or disables low battery handling measures.",
"type": "bool",
"defaultValue": true
}
]
#include "WimaSettings.h"
#include <QQmlEngine>
#include <QtQml>
DECLARE_SETTINGGROUP(Wima, "Wima")
{
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); \
qmlRegisterUncreatableType<WimaSettings>("QGroundControl.SettingsManager", 1, 0, "WimaSettings", "Reference only"); \
}
DECLARE_SETTINGSFACT(WimaSettings, lowBatteryThreshold)
DECLARE_SETTINGSFACT(WimaSettings, enableLowBatteryHandling)
#pragma once
#include "SettingsGroup.h"
class WimaSettings : public SettingsGroup
{
Q_OBJECT
public:
WimaSettings(QObject* parent = nullptr);
DEFINE_SETTING_NAME_GROUP()
DEFINE_SETTINGFACT(lowBatteryThreshold)
DEFINE_SETTINGFACT(enableLowBatteryHandling)
};
...@@ -51,5 +51,11 @@ ...@@ -51,5 +51,11 @@
"type": "double", "type": "double",
"min" : 1, "min" : 1,
"defaultValue": 5 "defaultValue": 5
},
{
"name": "Reverse",
"shortDescription": "Reverses the phase direction. Phases go from high to low waypoint numbers, if checked.",
"type": "bool",
"defaultValue": false
} }
] ]
...@@ -12,6 +12,7 @@ const char* WimaController::showAllMissionItemsName = "ShowAllMissionItems"; ...@@ -12,6 +12,7 @@ const char* WimaController::showAllMissionItemsName = "ShowAllMissionItems";
const char* WimaController::showCurrentMissionItemsName = "ShowCurrentMissionItems"; const char* WimaController::showCurrentMissionItemsName = "ShowCurrentMissionItems";
const char* WimaController::flightSpeedName = "FlightSpeed"; const char* WimaController::flightSpeedName = "FlightSpeed";
const char* WimaController::altitudeName = "Altitude"; const char* WimaController::altitudeName = "Altitude";
const char* WimaController::reverseName = "Reverse";
WimaController::WimaController(QObject *parent) WimaController::WimaController(QObject *parent)
: QObject (parent) : QObject (parent)
...@@ -30,29 +31,32 @@ WimaController::WimaController(QObject *parent) ...@@ -30,29 +31,32 @@ WimaController::WimaController(QObject *parent)
, _showCurrentMissionItems (settingsGroup, _metaDataMap[showCurrentMissionItemsName]) , _showCurrentMissionItems (settingsGroup, _metaDataMap[showCurrentMissionItemsName])
, _flightSpeed (settingsGroup, _metaDataMap[flightSpeedName]) , _flightSpeed (settingsGroup, _metaDataMap[flightSpeedName])
, _altitude (settingsGroup, _metaDataMap[altitudeName]) , _altitude (settingsGroup, _metaDataMap[altitudeName])
, _reverse (settingsGroup, _metaDataMap[reverseName])
, _startWaypointIndex (0) , _startWaypointIndex (0)
, _lastMissionPhaseReached (false) , _lastMissionPhaseReached (false)
, _uploadOverrideRequired (false) , _uploadOverrideRequired (false)
, _phaseDistance(-1) , _phaseDistance (-1)
, _phaseDuration(-1) , _phaseDuration (-1)
, _vehicleHasLowBattery(false) , _vehicleHasLowBattery (false)
, _lowBatteryHandlingTriggered(false) , _lowBatteryHandlingTriggered(false)
, _executingSmartRTL(false) , _executingSmartRTL (false)
{ {
_nextPhaseStartWaypointIndex.setRawValue(int(1)); _nextPhaseStartWaypointIndex.setRawValue(int(1));
_showAllMissionItems.setRawValue(true); _showAllMissionItems.setRawValue(true);
_showCurrentMissionItems.setRawValue(true); _showCurrentMissionItems.setRawValue(true);
connect(&_overlapWaypoints, &Fact::rawValueChanged, this, &WimaController::updateNextWaypoint); connect(&_overlapWaypoints, &Fact::rawValueChanged, this, &WimaController::updateNextWaypoint);
connect(&_maxWaypointsPerPhase, &Fact::rawValueChanged, this, &WimaController::recalcCurrentPhase); connect(&_maxWaypointsPerPhase, &Fact::rawValueChanged, this, &WimaController::recalcCurrentPhase);
connect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase); connect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase);
connect(&_flightSpeed, &Fact::rawValueChanged, this, &WimaController::updateSpeed); connect(&_flightSpeed, &Fact::rawValueChanged, this, &WimaController::updateSpeed);
connect(&_altitude, &Fact::rawValueChanged, this, &WimaController::updateAltitude); connect(&_altitude, &Fact::rawValueChanged, this, &WimaController::updateAltitude);
// battery timer // setup low battery handling
connect(&_checkBatteryTimer, &QTimer::timeout, this, &WimaController::checkBatteryLevel); connect(&_checkBatteryTimer, &QTimer::timeout, this, &WimaController::checkBatteryLevel);
_checkBatteryTimer.setInterval(500); _checkBatteryTimer.setInterval(500);
_checkBatteryTimer.start(); Fact *enableLowBatteryHandling = qgcApp()->toolbox()->settingsManager()->wimaSettings()->enableLowBatteryHandling();
connect(enableLowBatteryHandling, &Fact::rawValueChanged, this, &WimaController::enableDisableLowBatteryHandling);
enableDisableLowBatteryHandling(enableLowBatteryHandling->rawValue());
} }
QmlObjectListModel* WimaController::visualItems() QmlObjectListModel* WimaController::visualItems()
...@@ -137,6 +141,11 @@ Fact *WimaController::altitude() ...@@ -137,6 +141,11 @@ Fact *WimaController::altitude()
return &_altitude; return &_altitude;
} }
Fact *WimaController::reverse()
{
return &_reverse;
}
bool WimaController::uploadOverrideRequired() const bool WimaController::uploadOverrideRequired() const
{ {
return _uploadOverrideRequired; return _uploadOverrideRequired;
...@@ -553,31 +562,70 @@ bool WimaController::calcNextPhase() ...@@ -553,31 +562,70 @@ bool WimaController::calcNextPhase()
emit currentMissionItemsChanged(); emit currentMissionItemsChanged();
emit currentWaypointPathChanged(); emit currentWaypointPathChanged();
bool reverseBool = _reverse.rawValue().toBool(); // Reverses the phase direction. Phases go from high to low waypoint numbers, if true.
_startWaypointIndex = _nextPhaseStartWaypointIndex.rawValue().toInt()-1; _startWaypointIndex = _nextPhaseStartWaypointIndex.rawValue().toInt()-1;
if (_startWaypointIndex > _missionItems.count()-1) if (!reverseBool) {
return false; if (_startWaypointIndex > _missionItems.count()-1)
return false;
}
else {
if (_startWaypointIndex < 0)
return false;
}
int maxWaypointsPerPhaseInt = _maxWaypointsPerPhase.rawValue().toInt(); int maxWaypointsPerPhaseInt = _maxWaypointsPerPhase.rawValue().toInt();
// determine end waypoint index // determine end waypoint index
_endWaypointIndex = std::min(_startWaypointIndex + maxWaypointsPerPhaseInt - 1, _missionItems.count()-1); if (!reverseBool) {
if (_endWaypointIndex == _missionItems.count() - 1) _endWaypointIndex = std::min(_startWaypointIndex + maxWaypointsPerPhaseInt - 1, _missionItems.count()-1);
_lastMissionPhaseReached = true; if (_endWaypointIndex == _missionItems.count() - 1)
_lastMissionPhaseReached = true;
}
else {
_endWaypointIndex = std::max(_startWaypointIndex - maxWaypointsPerPhaseInt + 1, 0);
if (_endWaypointIndex == 0)
_lastMissionPhaseReached = true;
}
// extract waypoints // extract waypoints
QList<QGeoCoordinate> geoCoordinateList; // list with potential waypoints (from _missionItems), for _currentMissionItems QList<QGeoCoordinate> geoCoordinateList; // list with potential waypoints (from _missionItems), for _currentMissionItems
if (!extractCoordinateList(_missionItems, geoCoordinateList, _startWaypointIndex, _endWaypointIndex)) {
qWarning("WimaController::calcNextPhase(): error on waypoint extraction."); if (!reverseBool) {
return false; if (!extractCoordinateList(_missionItems, geoCoordinateList, _startWaypointIndex, _endWaypointIndex)) {
qWarning("WimaController::calcNextPhase(): error on waypoint extraction.");
return false;
}
} else {
if (!extractCoordinateList(_missionItems, geoCoordinateList, _endWaypointIndex, _startWaypointIndex)) {
qWarning("WimaController::calcNextPhase(): error on waypoint extraction.");
return false;
}
// reverse path
QList<QGeoCoordinate> reversePath;
for (QGeoCoordinate c : geoCoordinateList)
reversePath.prepend(c);
geoCoordinateList.clear();
geoCoordinateList.append(reversePath);
} }
// set start waypoint index for next phase // set start waypoint index for next phase
if (!_lastMissionPhaseReached) { if (!_lastMissionPhaseReached) {
disconnect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase); disconnect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase);
int untruncated = std::max(_endWaypointIndex + 1 - _overlapWaypoints.rawValue().toInt(), 0); if (!reverseBool) {
int truncated = std::min(untruncated , _missionItems.count()-1); int untruncated = std::max(_endWaypointIndex + 1 - _overlapWaypoints.rawValue().toInt(), 0);
_nextPhaseStartWaypointIndex.setRawValue(truncated + 1); int truncated = std::min(untruncated , _missionItems.count()-1);
_nextPhaseStartWaypointIndex.setRawValue(truncated + 1);
}
else {
int untruncated = std::min(_endWaypointIndex - 1 + _overlapWaypoints.rawValue().toInt(), _missionItems.count()-1);
int truncated = std::max(untruncated , 0);
_nextPhaseStartWaypointIndex.setRawValue(truncated + 1);
}
connect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase); connect(&_nextPhaseStartWaypointIndex, &Fact::rawValueChanged, this, &WimaController::calcNextPhase);
} }
...@@ -742,7 +790,9 @@ void WimaController::updateAltitude() ...@@ -742,7 +790,9 @@ void WimaController::updateAltitude()
void WimaController::checkBatteryLevel() void WimaController::checkBatteryLevel()
{ {
Vehicle *managerVehicle = masterController()->managerVehicle(); Vehicle *managerVehicle = masterController()->managerVehicle();
int batteryThreshold = 94; // percent WimaSettings* wimaSettings = qgcApp()->toolbox()->settingsManager()->wimaSettings();
int batteryThreshold = wimaSettings->lowBatteryThreshold()->rawValue().toInt();
if (managerVehicle != nullptr) { if (managerVehicle != nullptr) {
Fact *battery1percentRemaining = managerVehicle->battery1FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName); Fact *battery1percentRemaining = managerVehicle->battery1FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName);
Fact *battery2percentRemaining = managerVehicle->battery2FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName); Fact *battery2percentRemaining = managerVehicle->battery2FactGroup()->getFact(VehicleBatteryFactGroup::_percentRemainingFactName);
...@@ -786,6 +836,15 @@ void WimaController::smartRTLCleanUp(bool flying) ...@@ -786,6 +836,15 @@ void WimaController::smartRTLCleanUp(bool flying)
} }
} }
void WimaController::enableDisableLowBatteryHandling(QVariant enable)
{
if (enable.toBool()) {
_checkBatteryTimer.start();
} else {
_checkBatteryTimer.stop();
}
}
void WimaController::_setPhaseDistance(double distance) void WimaController::_setPhaseDistance(double distance)
{ {
if (!qFuzzyCompare(distance, _phaseDistance)) { if (!qFuzzyCompare(distance, _phaseDistance)) {
...@@ -952,6 +1011,8 @@ void WimaController::_loadCurrentMissionItemsFromBuffer() ...@@ -952,6 +1011,8 @@ void WimaController::_loadCurrentMissionItemsFromBuffer()
int numItems = _missionItemsBuffer.count(); int numItems = _missionItemsBuffer.count();
for (int i = 0; i < numItems; i++) for (int i = 0; i < numItems; i++)
_currentMissionItems.append(_missionItemsBuffer.removeAt(0)); _currentMissionItems.append(_missionItemsBuffer.removeAt(0));
updateCurrentPath();
} }
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#include "JsonHelper.h" #include "JsonHelper.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "SettingsFact.h" #include "SettingsFact.h"
#include "WimaSettings.h"
#include "SettingsManager.h"
class WimaController : public QObject class WimaController : public QObject
...@@ -53,6 +55,7 @@ public: ...@@ -53,6 +55,7 @@ public:
Q_PROPERTY(Fact* showCurrentMissionItems READ showCurrentMissionItems CONSTANT) Q_PROPERTY(Fact* showCurrentMissionItems READ showCurrentMissionItems CONSTANT)
Q_PROPERTY(Fact* flightSpeed READ flightSpeed CONSTANT) Q_PROPERTY(Fact* flightSpeed READ flightSpeed CONSTANT)
Q_PROPERTY(Fact* altitude READ altitude CONSTANT) Q_PROPERTY(Fact* altitude READ altitude CONSTANT)
Q_PROPERTY(Fact* reverse READ reverse CONSTANT)
Q_PROPERTY(bool uploadOverrideRequired READ uploadOverrideRequired WRITE setUploadOverrideRequired NOTIFY uploadOverrideRequiredChanged) Q_PROPERTY(bool uploadOverrideRequired READ uploadOverrideRequired WRITE setUploadOverrideRequired NOTIFY uploadOverrideRequiredChanged)
Q_PROPERTY(double phaseDistance READ phaseDistance NOTIFY phaseDistanceChanged) Q_PROPERTY(double phaseDistance READ phaseDistance NOTIFY phaseDistanceChanged)
Q_PROPERTY(double phaseDuration READ phaseDuration NOTIFY phaseDurationChanged) Q_PROPERTY(double phaseDuration READ phaseDuration NOTIFY phaseDurationChanged)
...@@ -81,7 +84,8 @@ public: ...@@ -81,7 +84,8 @@ public:
Fact* showAllMissionItems (void); Fact* showAllMissionItems (void);
Fact* showCurrentMissionItems(void); Fact* showCurrentMissionItems(void);
Fact* flightSpeed (void); Fact* flightSpeed (void);
Fact* altitude (void); Fact* altitude (void);
Fact* reverse (void);
bool uploadOverrideRequired (void) const; bool uploadOverrideRequired (void) const;
double phaseDistance (void) const; double phaseDistance (void) const;
double phaseDuration (void) const; double phaseDuration (void) const;
...@@ -126,7 +130,8 @@ public: ...@@ -126,7 +130,8 @@ public:
static const char* showAllMissionItemsName; static const char* showAllMissionItemsName;
static const char* showCurrentMissionItemsName; static const char* showCurrentMissionItemsName;
static const char* flightSpeedName; static const char* flightSpeedName;
static const char* altitudeName; static const char* altitudeName;
static const char* reverseName;
// Member Methodes // Member Methodes
QJsonDocument saveToJson(FileType fileType); QJsonDocument saveToJson(FileType fileType);
...@@ -171,6 +176,7 @@ private slots: ...@@ -171,6 +176,7 @@ private slots:
void updateAltitude (void); void updateAltitude (void);
void checkBatteryLevel (void); void checkBatteryLevel (void);
void smartRTLCleanUp (bool flying); // cleans up after successfull smart RTL void smartRTLCleanUp (bool flying); // cleans up after successfull smart RTL
void enableDisableLowBatteryHandling (QVariant enable);
private: private:
void _setPhaseDistance(double distance); void _setPhaseDistance(double distance);
...@@ -212,6 +218,7 @@ private: ...@@ -212,6 +218,7 @@ private:
SettingsFact _showCurrentMissionItems; // bool value, Determines whether the mission items of the current mission phase are displayed or not. SettingsFact _showCurrentMissionItems; // bool value, Determines whether the mission items of the current mission phase are displayed or not.
SettingsFact _flightSpeed; // mission flight speed SettingsFact _flightSpeed; // mission flight speed
SettingsFact _altitude; // mission altitude SettingsFact _altitude; // mission altitude
SettingsFact _reverse; // Reverses the phase direction. Phases go from high to low waypoint numbers, if true.
int _endWaypointIndex; // indes of the mission item stored in _missionItems defining the last element int _endWaypointIndex; // indes of the mission item stored in _missionItems defining the last element
// (which is not part of the return path) of _currentMissionItem // (which is not part of the return path) of _currentMissionItem
......
...@@ -929,6 +929,43 @@ QGCView { ...@@ -929,6 +929,43 @@ QGCView {
} }
} }
QGCLabel {
id: wimaSectionLabel
text: qsTr("WiMA")
visible: QGroundControl.settingsManager.wimaSettings.visible
}
Rectangle {
Layout.preferredWidth: wimaGrid.width + (_margins * 2)
Layout.preferredHeight: wimaGrid.height + (_margins * 2)
Layout.fillWidth: true
color: qgcPal.windowShade
visible: wimaSectionLabel.visible
GridLayout {
id: wimaGrid
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
columns: 4
QGCLabel {
text: qsTr("Low Battery Threshold")
visible: _userBrandImageIndoor.visible
}
FactTextField {
Layout.preferredWidth: _valueFieldWidth
fact: QGroundControl.settingsManager.wimaSettings.lowBatteryThreshold
}
FactCheckBox {
text: "Enable low battery handling"
fact: QGroundControl.settingsManager.wimaSettings.enableLowBatteryHandling
Layout.columnSpan: 2
}
}
}
Item { width: 1; height: _margins } Item { width: 1; height: _margins }
QGCLabel { QGCLabel {
......
Markdown is supported
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