Browse Source

CP - Add setting to toggle splitting concave polygon on/off

QGC4.4
Gus Grubba 7 years ago committed by Thomas Gubler
parent
commit
6f2a99531a
  1. 8
      src/PlanView/SurveyItemEditor.qml
  2. 7
      src/Settings/App.SettingsGroup.json
  3. 11
      src/Settings/AppSettings.cc
  4. 8
      src/Settings/AppSettings.h

8
src/PlanView/SurveyItemEditor.qml

@ -9,6 +9,7 @@ import QGroundControl 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0 import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.FlightMap 1.0 import QGroundControl.FlightMap 1.0
@ -120,6 +121,13 @@ Rectangle {
} }
FactCheckBox { FactCheckBox {
text: qsTr("Split concave polygons")
fact: _splitConcave
visible: _splitConcave.visible
property Fact _splitConcave: QGroundControl.settingsManager.appSettings.splitConcavePolygons
}
FactCheckBox {
text: qsTr("Hover and capture image") text: qsTr("Hover and capture image")
fact: missionItem.hoverAndCapture fact: missionItem.hoverAndCapture
visible: missionItem.hoverAndCaptureAllowed visible: missionItem.hoverAndCaptureAllowed

7
src/Settings/App.SettingsGroup.json

@ -199,5 +199,12 @@
"enumStrings": "Never,Always,When in Follow Me Flight Mode", "enumStrings": "Never,Always,When in Follow Me Flight Mode",
"enumValues": "0,1,2", "enumValues": "0,1,2",
"defaultValue": 0 "defaultValue": 0
},
{
"name": "SplitConcavePolygons",
"shortDescription": "Split mission concave polygons",
"longDescription": "Split mission concave polygons into separate regular, convex polygons",
"type": "bool",
"defaultValue": false
} }
] ]

11
src/Settings/AppSettings.cc

@ -41,6 +41,7 @@ const char* AppSettings::esriTokenName = "EsriTok
const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType"; const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType";
const char* AppSettings::gstDebugName = "GstreamerDebugLevel"; const char* AppSettings::gstDebugName = "GstreamerDebugLevel";
const char* AppSettings::followTargetName = "FollowTarget"; const char* AppSettings::followTargetName = "FollowTarget";
const char* AppSettings::splitConcavePolygonsName = "SplitConcavePolygons";
const char* AppSettings::parameterFileExtension = "params"; const char* AppSettings::parameterFileExtension = "params";
const char* AppSettings::planFileExtension = "plan"; const char* AppSettings::planFileExtension = "plan";
@ -84,6 +85,7 @@ AppSettings::AppSettings(QObject* parent)
, _defaultFirmwareTypeFact (NULL) , _defaultFirmwareTypeFact (NULL)
, _gstDebugFact (NULL) , _gstDebugFact (NULL)
, _followTargetFact (NULL) , _followTargetFact (NULL)
, _splitConcavePolygonsFact (NULL)
{ {
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<AppSettings>("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only"); qmlRegisterUncreatableType<AppSettings>("QGroundControl.SettingsManager", 1, 0, "AppSettings", "Reference only");
@ -428,3 +430,12 @@ Fact* AppSettings::followTarget(void)
return _followTargetFact; return _followTargetFact;
} }
Fact* AppSettings::splitConcavePolygons(void)
{
if (!_splitConcavePolygonsFact) {
_splitConcavePolygonsFact = _createSettingsFact(splitConcavePolygonsName);
}
return _splitConcavePolygonsFact;
}

8
src/Settings/AppSettings.h

@ -43,6 +43,7 @@ public:
Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT) Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT)
Q_PROPERTY(Fact* gstDebug READ gstDebug CONSTANT) Q_PROPERTY(Fact* gstDebug READ gstDebug CONSTANT)
Q_PROPERTY(Fact* followTarget READ followTarget CONSTANT) Q_PROPERTY(Fact* followTarget READ followTarget CONSTANT)
Q_PROPERTY(Fact* splitConcavePolygons READ splitConcavePolygons CONSTANT)
Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString missionSavePath READ missionSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString parameterSavePath READ parameterSavePath NOTIFY savePathsChanged)
@ -82,13 +83,14 @@ public:
Fact* defaultFirmwareType (void); Fact* defaultFirmwareType (void);
Fact* gstDebug (void); Fact* gstDebug (void);
Fact* followTarget (void); Fact* followTarget (void);
Fact* splitConcavePolygons (void);
QString missionSavePath (void); QString missionSavePath (void);
QString parameterSavePath (void); QString parameterSavePath (void);
QString telemetrySavePath (void); QString telemetrySavePath (void);
QString logSavePath (void); QString logSavePath (void);
QString videoSavePath (void); QString videoSavePath (void);
QString crashSavePath (void); QString crashSavePath (void);
static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType); static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType(MAV_AUTOPILOT firmwareType);
static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType); static MAV_TYPE offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleType);
@ -119,6 +121,7 @@ public:
static const char* defaultFirmwareTypeName; static const char* defaultFirmwareTypeName;
static const char* gstDebugName; static const char* gstDebugName;
static const char* followTargetName; static const char* followTargetName;
static const char* splitConcavePolygonsName;
// Application wide file extensions // Application wide file extensions
static const char* parameterFileExtension; static const char* parameterFileExtension;
@ -170,6 +173,7 @@ private:
SettingsFact* _defaultFirmwareTypeFact; SettingsFact* _defaultFirmwareTypeFact;
SettingsFact* _gstDebugFact; SettingsFact* _gstDebugFact;
SettingsFact* _followTargetFact; SettingsFact* _followTargetFact;
SettingsFact* _splitConcavePolygonsFact;
}; };
#endif #endif

Loading…
Cancel
Save