Commit 61318759 authored by Gus Grubba's avatar Gus Grubba

Add option to enforce the use (and passing) the checklist before being allowed to arm.

parent 2894ffb6
......@@ -49,6 +49,8 @@ Item {
property var _rallyPointController: _planController.rallyPointController
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property bool _enforceChecklist: _useChecklist && QGroundControl.settingsManager.appSettings.enforceChecklist.rawValue
property bool _canArm: activeVehicle ? (_useChecklist ? (_enforceChecklist ? activeVehicle.checkListState === Vehicle.CheckListPassed : true) : true) : false
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _pipSize: mainWindow.width * 0.2
property alias _guidedController: guidedActionsController
......@@ -595,7 +597,7 @@ Item {
name: _guidedController.takeoffTitle,
iconSource: "/res/takeoff.svg",
buttonVisible: _guidedController.showTakeoff || !_guidedController.showLand,
buttonEnabled: _guidedController.showTakeoff,
buttonEnabled: _guidedController.showTakeoff && _canArm,
action: _guidedController.actionTakeoff
},
{
......@@ -623,7 +625,7 @@ Item {
name: qsTr("Action"),
iconSource: "/res/action.svg",
buttonVisible: !_guidedController.showPause,
buttonEnabled: _anyActionAvailable,
buttonEnabled: _anyActionAvailable && _canArm,
action: -1
}
]
......@@ -657,7 +659,7 @@ Item {
z: _flightVideoPipControl.z + 1
onShowStartMissionChanged: {
if (showStartMission) {
if (showStartMission && _canArm) {
confirmAction(actionStartMission)
}
}
......
......@@ -138,6 +138,13 @@
"type": "bool",
"defaultValue": false
},
{
"name": "enforceChecklist",
"shortDescription": "Preflight checklist must pass before arming",
"longDescription": "If this option is enabled the preflight checklist must pass before arming.",
"type": "bool",
"defaultValue": false
},
{
"name": "appFontPointSize",
"shortDescription": "Application font size",
......
......@@ -85,6 +85,7 @@ DECLARE_SETTINGSFACT(AppSettings, showLargeCompass)
DECLARE_SETTINGSFACT(AppSettings, savePath)
DECLARE_SETTINGSFACT(AppSettings, autoLoadMissions)
DECLARE_SETTINGSFACT(AppSettings, useChecklist)
DECLARE_SETTINGSFACT(AppSettings, enforceChecklist)
DECLARE_SETTINGSFACT(AppSettings, mapboxToken)
DECLARE_SETTINGSFACT(AppSettings, esriToken)
DECLARE_SETTINGSFACT(AppSettings, defaultFirmwareType)
......
......@@ -46,6 +46,7 @@ public:
DEFINE_SETTINGFACT(savePath)
DEFINE_SETTINGFACT(autoLoadMissions)
DEFINE_SETTINGFACT(useChecklist)
DEFINE_SETTINGFACT(enforceChecklist)
DEFINE_SETTINGFACT(mapboxToken)
DEFINE_SETTINGFACT(esriToken)
DEFINE_SETTINGFACT(defaultFirmwareType)
......
......@@ -475,13 +475,23 @@ Rectangle {
spacing: _margins
FactCheckBox {
text: qsTr("Use Preflight Checklist")
fact: _useChecklist
visible: _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
id: useCheckList
text: qsTr("Use Preflight Checklist")
fact: _useChecklist
visible: _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
}
FactCheckBox {
text: qsTr("Enforce Preflight Checklist")
fact: _enforceChecklist
enabled: QGroundControl.settingsManager.appSettings.useChecklist.value
visible: useCheckList.visible && _enforceChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
property Fact _enforceChecklist: QGroundControl.settingsManager.appSettings.enforceChecklist
}
FactCheckBox {
text: qsTr("Keep Map Centered On Vehicle")
fact: _keepMapCenteredOnVehicle
......
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