Browse Source

Merge pull request #6364 from philipoe/checklist_draft

Automated preflight checklists
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
d283233330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      qgcresources.qrc
  2. 2
      qgroundcontrol.qrc
  3. 80
      resources/check.svg
  4. 206
      src/FlightDisplay/CheckList.qml
  5. 75
      src/FlightDisplay/FlightDisplayView.qml
  6. 1
      src/FlightDisplay/qmldir
  7. 74
      src/QmlControls/QGCCheckListItem.qml
  8. 1
      src/QmlControls/QGroundControl.Controls.qmldir
  9. 7
      src/Settings/App.SettingsGroup.json
  10. 11
      src/Settings/AppSettings.cc
  11. 4
      src/Settings/AppSettings.h
  12. 2
      src/Vehicle/Vehicle.h
  13. 10
      src/ui/preferences/GeneralSettings.qml

1
qgcresources.qrc

@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
<file alias="APM/BrandImageSub">src/FirmwarePlugin/APM/APMBrandImageSub.png</file>
<file alias="PX4/BrandImage">src/FirmwarePlugin/PX4/PX4BrandImage.png</file>
<file alias="subVehicleArrowOpaque.png">src/FlightMap/Images/sub.png</file>
<file alias="check.svg">resources/check.svg</file>
</qresource>
<qresource prefix="/res">
<file alias="action.svg">resources/action.svg</file>

2
qgroundcontrol.qrc

@ -87,6 +87,7 @@ @@ -87,6 +87,7 @@
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckListItem.qml">src/QmlControls/QGCCheckListItem.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
<file alias="QGroundControl/Controls/QGCComboBox.qml">src/QmlControls/QGCComboBox.qml</file>
@ -192,6 +193,7 @@ @@ -192,6 +193,7 @@
<file alias="VibrationPageWidget.qml">src/FlightMap/Widgets/VibrationPageWidget.qml</file>
<file alias="VideoPageWidget.qml">src/FlightMap/Widgets/VideoPageWidget.qml</file>
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="QGroundControl/FlightDisplay/CheckList.qml">src/FlightDisplay/CheckList.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="CameraCalc.FactMetaData.json">src/MissionManager/CameraCalc.FactMetaData.json</file>

80
resources/check.svg

@ -0,0 +1,80 @@ @@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 72 72"
style="enable-background:new 0 0 72 72;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="check.svg"><metadata
id="metadata3416"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs3414"><linearGradient
id="linearGradient4141"
osb:paint="solid"><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop4143" /></linearGradient><linearGradient
inkscape:collect="always"
xlink:href="#linearGradient4141"
id="linearGradient4145"
x1="48.508473"
y1="58.423729"
x2="79.322032"
y2="58.423729"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.8414091,0,0,2.2407508,-82.18242,-94.289127)" /></defs><sodipodi:namedview
pagecolor="#000000"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1855"
inkscape:window-height="1056"
id="namedview3412"
showgrid="false"
inkscape:zoom="3.2777778"
inkscape:cx="-54.305085"
inkscape:cy="36"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><style
type="text/css"
id="style3406">
.st0{fill:#66BD59;stroke:#FFFFFF;stroke-width:5;stroke-miterlimit:10;}
.st1{fill:none;stroke:#FFFFFF;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style><polyline
class="st1"
points="55.1,19.8 30.2,52.2 16.9,36.5 "
id="polyline3410"
transform="matrix(0.85559226,0,0,0.85559226,5.1269823,8.2041673)"
style="fill:none;stroke:#ffffff;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10" /><style
id="style3419"
type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:3;stroke-miterlimit:10;}
.st1{fill:none;stroke:#FFFFFF;stroke-width:8;stroke-miterlimit:10;}
.st2{fill:#FFFFFF;}
</style><circle
style="fill:none;stroke:url(#linearGradient4145);stroke-width:3.25963402;stroke-miterlimit:4;stroke-dasharray:none"
id="path3339"
cx="35.5117"
cy="36.62389"
r="28.370182" /></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

206
src/FlightDisplay/CheckList.qml

@ -0,0 +1,206 @@ @@ -0,0 +1,206 @@
import QtQuick 2.3
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Vehicle 1.0
// This class stores the data and functions of the check list but NOT the GUI (which is handled somewhere else).
Item {
// Properties
property int unhealthySensors: _activeVehicle ? _activeVehicle.sensorsUnhealthyBits : 0
property bool gpsLock: _activeVehicle ? _activeVehicle.gps.lock.rawValue>=3 : 0
property var batPercentRemaining: _activeVehicle ? _activeVehicle.battery.percentRemaining.value : 0
property bool audioMuted: QGroundControl.settingsManager.appSettings.audioMuted.rawValue
property ObjectModel checkListItems: _checkListItems
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _checkState: _activeVehicle ? (_activeVehicle.armed ? 1 + (buttonActuators._state + buttonMotors._state + buttonMission._state + buttonSoundOutput._state) / 4 / 4 : 0) : 0 ; // Shows progress of checks inside the checklist - unlocks next check steps in groups
// Connections
onBatPercentRemainingChanged: buttonBattery.updateItem();
onGpsLockChanged: buttonSensors.updateItem();
onAudioMutedChanged: buttonSoundOutput.updateItem();
onUnhealthySensorsChanged: updateVehicleDependentItems();
Connections {
target: QGroundControl.multiVehicleManager
onActiveVehicleChanged: onActiveVehicleChanged();
}
Component.onCompleted: {
if(QGroundControl.multiVehicleManager.vehicles.count > 0) {
onActiveVehicleChanged();
}
}
// Functions
function updateVehicleDependentItems() {
buttonSensors.updateItem();
buttonBattery.updateItem();
buttonRC.updateItem();
buttonEstimator.updateItem();
}
function onActiveVehicleChanged() {
buttonSoundOutput.updateItem(); // Just updated here for initialization once we connect to a vehicle
updateVehicleDependentItems();
}
function resetNrClicks() {
buttonHardware.resetNrClicks();
buttonBattery.resetNrClicks();
buttonRC.resetNrClicks();
buttonActuators.resetNrClicks();
buttonMotors.resetNrClicks();
buttonMission.resetNrClicks();
buttonSoundOutput.resetNrClicks();
buttonPayload.resetNrClicks();
buttonWeather.resetNrClicks();
buttonFlightAreaFree.resetNrClicks();
}
// Check list item data
ObjectModel {
id: _checkListItems
// Standard check list items (group 0) - Available from the start
QGCCheckListItem {
id: buttonHardware
name: "Hardware"
defaulttext: "Props mounted? Wings secured? Tail secured?"
}
QGCCheckListItem {
id: buttonBattery
name: "Battery"
pendingtext: "Healthy & charged > 40%. Battery connector firmly plugged?"
function updateItem() {
if (!_activeVehicle) {
_state = 0;
} else {
if (!(unhealthySensors & Vehicle.SysStatusSensorBattery) && batPercentRemaining>=40.0) _state = 1+3*(_nrClicked>0);
else {
if(unhealthySensors & Vehicle.SysStatusSensorBattery) failuretext="Not healthy. Check console.";
else if(batPercentRemaining<40.0) failuretext="Low (below 40%). Please recharge.";
_state = 3;
}
}
}
}
QGCCheckListItem {
id: buttonSensors
name: "Sensors"
function updateItem() {
if (!_activeVehicle) {
_state = 0;
} else {
if(!(unhealthySensors & Vehicle.SysStatusSensor3dMag) &&
!(unhealthySensors & Vehicle.SysStatusSensor3dAccel) &&
!(unhealthySensors & Vehicle.SysStatusSensor3dGyro) &&
!(unhealthySensors & Vehicle.SysStatusSensorAbsolutePressure) &&
!(unhealthySensors & Vehicle.SysStatusSensorDifferentialPressure) &&
!(unhealthySensors & Vehicle.SysStatusSensorGPS)) {
if(!gpsLock) {
pendingtext="Pending. Waiting for GPS lock.";
_state=1;
} else {
_state = 4; // All OK
}
} else {
if(unhealthySensors & Vehicle.SysStatusSensor3dMag) failuretext="Failure. Magnetometer issues. Check console.";
else if(unhealthySensors & Vehicle.SysStatusSensor3dAccel) failuretext="Failure. Accelerometer issues. Check console.";
else if(unhealthySensors & Vehicle.SysStatusSensor3dGyro) failuretext="Failure. Gyroscope issues. Check console.";
else if(unhealthySensors & Vehicle.SysStatusSensorAbsolutePressure) failuretext="Failure. Barometer issues. Check console.";
else if(unhealthySensors & Vehicle.SysStatusSensorDifferentialPressure) failuretext="Failure. Airspeed sensor issues. Check console.";
else if(unhealthySensors & Vehicle.SysStatusSensorGPS) failuretext="Failure. No valid or low quality GPS signal. Check console.";
_state = 3;
}
}
}
}
QGCCheckListItem {
id: buttonRC
name: "Radio Control"
pendingtext: "Receiving signal. Perform range test & confirm."
failuretext: "No signal or invalid autopilot-RC config. Check RC and console."
function updateItem() {
if (!_activeVehicle) {
_state = 0;
} else {
if (unhealthySensors & Vehicle.SysStatusSensorRCReceiver) {_state = 3}
else {_state = 1+3*(_nrClicked>0);}
}
}
}
QGCCheckListItem {
id: buttonEstimator
name: "Global position estimate"
function updateItem() {
if (!_activeVehicle) {
_state = 0;
} else {
if (unhealthySensors & Vehicle.SysStatusSensorAHRS) {_state = 3;}
else {_state = 4;}
}
}
}
// Check list item group 1 - Require arming
QGCLabel {text:qsTr("<i>Please arm the vehicle here.</i>") ; opacity: 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0) ; anchors.horizontalCenter:buttonHardware.horizontalCenter ; anchors.topMargin:40 ; anchors.bottomMargin:40;}
QGCCheckListItem {
id: buttonActuators
name: "Actuators"
group: 1
defaulttext: "Move all control surfaces. Did they work properly?"
}
QGCCheckListItem {
id: buttonMotors
name: "Motors"
group: 1
defaulttext: "Propellers free? Then throttle up gently. Working properly?"
}
QGCCheckListItem {
id: buttonMission
name: "Mission"
group: 1
defaulttext: "Please confirm mission is valid (waypoints valid, no terrain collision)."
}
QGCCheckListItem {
id: buttonSoundOutput
name: "Sound output"
group: 1
pendingtext: "QGC audio output enabled. System audio output enabled, too?"
failuretext: "Failure, QGC audio output is disabled. Please enable it under application settings->general to hear audio warnings!"
function updateItem() {
if (!_activeVehicle) {
_state = 0;
} else {
if (audioMuted) {_state = 3 ; _nrClicked=0;}
else {_state = 1+3*(_nrClicked>0);}
}
}
}
// Check list item group 2 - Final checks before launch
QGCLabel {text:qsTr("<i>Last preparations before launch</i>") ; opacity : 0.2+0.8*(_checkState >= 2); anchors.horizontalCenter:buttonHardware.horizontalCenter}
QGCCheckListItem {
id: buttonPayload
name: "Payload"
group: 2
defaulttext: "Configured and started?"
pendingtext: "Payload lid closed?"
}
QGCCheckListItem {
id: buttonWeather
name: "Wind & weather"
group: 2
defaulttext: "OK for your platform?"
pendingtext: "Launching into the wind?"
}
QGCCheckListItem {
id: buttonFlightAreaFree
name: "Flight area"
group: 2
defaulttext: "Launch area and path free of obstacles/people?"
}
} // Object Model
}

75
src/FlightDisplay/FlightDisplayView.qml

@ -17,6 +17,7 @@ import QtPositioning 5.3 @@ -17,6 +17,7 @@ import QtPositioning 5.3
import QtMultimedia 5.5
import QtQuick.Layouts 1.2
import QtQuick.Window 2.2
import QtQml.Models 2.1
import QGroundControl 1.0
import QGroundControl.FlightDisplay 1.0
@ -46,13 +47,13 @@ QGCView { @@ -46,13 +47,13 @@ QGCView {
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property bool _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist.rawValue
property real _savedZoomLevel: 0
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _pipSize: flightView.width * 0.2
property alias _guidedController: guidedActionsController
property alias _altitudeSlider: altitudeSlider
readonly property var _dynamicCameras: _activeVehicle ? _activeVehicle.dynamicCameras : null
readonly property bool _isCamera: _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
readonly property bool isBackgroundDark: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
@ -112,6 +113,10 @@ QGCView { @@ -112,6 +113,10 @@ QGCView {
Component.onCompleted: start(true /* flyView */)
}
CheckList {
id: checklist
}
Connections {
target: _missionController
onResumeMissionReady: guidedActionsController.confirmAction(guidedActionsController.actionResumeMissionReady)
@ -504,8 +509,8 @@ QGCView { @@ -504,8 +509,8 @@ QGCView {
z: _panel.z + 4
title: qsTr("Fly")
maxHeight: (_flightVideo.visible ? _flightVideo.y : parent.height) - toolStrip.y
buttonVisible: [ _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true, _guidedController.smartShotsAvailable ]
buttonEnabled: [ _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable, _anySmartShotAvailable ]
buttonVisible: [ _useChecklist, _guidedController.showTakeoff || !_guidedController.showLand, _guidedController.showLand && !_guidedController.showTakeoff, true, true, true, _guidedController.smartShotsAvailable ]
buttonEnabled: [ _useChecklist, _guidedController.showTakeoff, _guidedController.showLand, _guidedController.showRTL, _guidedController.showPause, _anyActionAvailable, _anySmartShotAvailable ]
property bool _anyActionAvailable: _guidedController.showStartMission || _guidedController.showResumeMission || _guidedController.showChangeAlt || _guidedController.showLandAbort
property bool _anySmartShotAvailable: _guidedController.showOrbit
@ -552,6 +557,11 @@ QGCView { @@ -552,6 +557,11 @@ QGCView {
model: [
{
name: "Checklist",
iconSource: "/qmlimages/check.svg",
dropPanelComponent: checklistDropPanel
},
{
name: _guidedController.takeoffTitle,
iconSource: "/res/takeoff.svg",
action: _guidedController.actionTakeoff
@ -677,4 +687,61 @@ QGCView { @@ -677,4 +687,61 @@ QGCView {
visible: false
}
}
}
//-- Checklist GUI
Component {
id: checklistDropPanel
Rectangle {
id: checklistRect
visible: true
width: mainColumn.width + 3*ScreenTools.defaultFontPixelWidth
height: mainColumn.height + ScreenTools.defaultFontPixelHeight
color: qgcPal.windowShade
radius: 3
enabled: QGroundControl.multiVehicleManager.vehicles.count > 0;
Column {
id: mainColumn
width: 40*ScreenTools.defaultFontPixelWidth
spacing: 0.8*ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: 0.6*ScreenTools.defaultFontPixelWidth
anchors.leftMargin: 1.5*ScreenTools.defaultFontPixelWidth
// Header/title of checklist
Item {
width: parent.width
height: 1.75*ScreenTools.defaultFontPixelHeight
QGCLabel {
text: _activeVehicle ? qsTr("Pre-flight checklist")+" (MAV ID:"+_activeVehicle.id+")" : qsTr("Pre-flight checklist (no vehicle)")
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
font.pointSize: ScreenTools.mediumFontPointSize
}
QGCButton {
width: 1.2*ScreenTools.defaultFontPixelHeight
height: 1.2*ScreenTools.defaultFontPixelHeight
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
opacity : 0.2+0.8*(QGroundControl.multiVehicleManager.vehicles.count > 0)
tooltip: "Reset the checklist (e.g. after a vehicle reboot)"
onClicked: checklist.resetNrClicks()
Image { source:"/qmlimages/MapSyncBlack.svg" ; anchors.fill: parent }
}
}
Rectangle {width:parent.width ; height:1 ; color:qgcPal.text}
// All check list items
Repeater {
model: checklist.checkListItems
}
} // Column
} //Rectangle
} //Component
} //QGC View

1
src/FlightDisplay/qmldir

@ -9,4 +9,5 @@ GuidedActionsController 1.0 GuidedActionsController.qml @@ -9,4 +9,5 @@ GuidedActionsController 1.0 GuidedActionsController.qml
GuidedActionList 1.0 GuidedActionList.qml
GuidedAltitudeSlider 1.0 GuidedAltitudeSlider.qml
MultiVehicleList 1.0 MultiVehicleList.qml
CheckList 1.0 CheckList.qml

74
src/QmlControls/QGCCheckListItem.qml

@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.4
import QGroundControl 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
QGCButton {
property string name: ""
property int group: 0
property string defaulttext: "Not checked yet"
property string pendingtext: ""
property string failuretext: "Failure. Check console."
property int _state: 0
property var _color: qgcPal.button
property int _nrClicked: 0
property string _text: qsTr(name)+ ": " + qsTr(defaulttext)
enabled : (_activeVehicle==null || _activeVehicle.connectionLost) ? false : checklist._checkState>=group
opacity : (_activeVehicle==null || _activeVehicle.connectionLost) ? 0.4 : 0.2+0.8*(checklist._checkState >= group);
width: 40*ScreenTools.defaultFontPixelWidth
style: ButtonStyle {
background: Rectangle {color:_color; border.color: qgcPal.button; radius:3}
label: Label {
text: _text
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
color: _state>0 ? qgcPal.mapWidgetBorderLight : qgcPal.buttonText
}
}
// Connections
onPendingtextChanged: { if(_state==1) {getTextFromState(); getColorFromState();} }
onFailuretextChanged: { if(_state==3) {getTextFromState(); getColorFromState();} }
on_StateChanged: { getTextFromState(); getColorFromState(); }
onClicked: {
if(_state<2) _nrClicked=_nrClicked+1; //Only allow click-counter to increase when not failed yet
updateItem();
}
//Functions
function updateItem() {
// This is the default updateFunction. It assumes the item is a MANUAL check list item, i.e. one that
// only requires user clicks (one click if pendingtext="", two clicks otherwise) for completion.
if(_nrClicked===0) _state = 0;
else if(_nrClicked===1) {
if(pendingtext.length === 0) _state = 4;
else _state = 1;
} else _state = 4;
getTextFromState();
getColorFromState();
}
function getTextFromState() {
if(_state === 0) {_text= qsTr(name) + ": " + qsTr(defaulttext)} // Not checked yet
else if(_state === 1) {_text= "<b>"+qsTr(name)+"</b>" +": " + qsTr(pendingtext)} // Pending
else if(_state === 2) {_text= "<b>"+qsTr(name)+"</b>" +": " + qsTr("Minor problem")} // Small problem or need further user action to resolve
else if(_state === 3) {_text= "<b>"+qsTr(name)+"</b>" +": " + qsTr(failuretext)} // Big problem
else {_text= "<b>"+qsTr(name)+"</b>" +": " + qsTr("OK")} // All OK
}
function getColorFromState() {
if(_state === 0) {_color=qgcPal.button} // Not checked yet
else if(_state === 1) {_color=Qt.rgba(0.9,0.47,0.2,1)} // Pending
else if(_state === 2) {_color=Qt.rgba(1.0,0.6,0.2,1)} // Small problem or need further user action to resolve
else if(_state === 3) {_color=Qt.rgba(0.92,0.22,0.22,1)} // Big problem
else {_color=Qt.rgba(0.27,0.67,0.42,1)} // All OK
}
function resetNrClicks() {
_nrClicked=0;
updateItem();
}
}

1
src/QmlControls/QGroundControl.Controls.qmldir

@ -34,6 +34,7 @@ ParameterEditor 1.0 ParameterEditor.qml @@ -34,6 +34,7 @@ ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PlanToolBar 1.0 PlanToolBar.qml
QGCButton 1.0 QGCButton.qml
QGCCheckListItem 1.0 QGCCheckListItem.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
QGCComboBox 1.0 QGCComboBox.qml

7
src/Settings/App.SettingsGroup.json

@ -118,6 +118,13 @@ @@ -118,6 +118,13 @@
"defaultValue": false
},
{
"name": "UseChecklist",
"shortDescription": "Use preflight checklist",
"longDescription": "If this option is enabled the preflight checklist will be used.",
"type": "bool",
"defaultValue": false
},
{
"name": "BaseDeviceFontPointSize",
"shortDescription": "Application font size",
"longDescription": "The point size for the default font used.",

11
src/Settings/AppSettings.cc

@ -33,6 +33,7 @@ const char* AppSettings::indoorPaletteName = "StyleIs @@ -33,6 +33,7 @@ const char* AppSettings::indoorPaletteName = "StyleIs
const char* AppSettings::showLargeCompassName = "ShowLargeCompass";
const char* AppSettings::savePathName = "SavePath";
const char* AppSettings::autoLoadMissionsName = "AutoLoadMissions";
const char* AppSettings::useChecklistName = "UseChecklist";
const char* AppSettings::mapboxTokenName = "MapboxToken";
const char* AppSettings::esriTokenName = "EsriToken";
const char* AppSettings::defaultFirmwareTypeName = "DefaultFirmwareType";
@ -75,6 +76,7 @@ AppSettings::AppSettings(QObject* parent) @@ -75,6 +76,7 @@ AppSettings::AppSettings(QObject* parent)
, _showLargeCompassFact (NULL)
, _savePathFact (NULL)
, _autoLoadMissionsFact (NULL)
, _useChecklistFact (NULL)
, _mapboxTokenFact (NULL)
, _esriTokenFact (NULL)
, _defaultFirmwareTypeFact (NULL)
@ -220,6 +222,15 @@ Fact* AppSettings::audioMuted(void) @@ -220,6 +222,15 @@ Fact* AppSettings::audioMuted(void)
return _audioMutedFact;
}
Fact* AppSettings::useChecklist(void)
{
if (!_useChecklistFact) {
_useChecklistFact = _createSettingsFact(useChecklistName);
}
return _useChecklistFact;
}
Fact* AppSettings::appFontPointSize(void)
{
if (!_appFontPointSizeFact) {

4
src/Settings/AppSettings.h

@ -37,6 +37,7 @@ public: @@ -37,6 +37,7 @@ public:
Q_PROPERTY(Fact* showLargeCompass READ showLargeCompass CONSTANT)
Q_PROPERTY(Fact* savePath READ savePath CONSTANT)
Q_PROPERTY(Fact* autoLoadMissions READ autoLoadMissions CONSTANT)
Q_PROPERTY(Fact* useChecklist READ useChecklist CONSTANT)
Q_PROPERTY(Fact* mapboxToken READ mapboxToken CONSTANT)
Q_PROPERTY(Fact* esriToken READ esriToken CONSTANT)
Q_PROPERTY(Fact* defaultFirmwareType READ defaultFirmwareType CONSTANT)
@ -75,6 +76,7 @@ public: @@ -75,6 +76,7 @@ public:
Fact* showLargeCompass (void);
Fact* savePath (void);
Fact* autoLoadMissions (void);
Fact* useChecklist (void);
Fact* mapboxToken (void);
Fact* esriToken (void);
Fact* defaultFirmwareType (void);
@ -110,6 +112,7 @@ public: @@ -110,6 +112,7 @@ public:
static const char* showLargeCompassName;
static const char* savePathName;
static const char* autoLoadMissionsName;
static const char* useChecklistName;
static const char* mapboxTokenName;
static const char* esriTokenName;
static const char* defaultFirmwareTypeName;
@ -160,6 +163,7 @@ private: @@ -160,6 +163,7 @@ private:
SettingsFact* _showLargeCompassFact;
SettingsFact* _savePathFact;
SettingsFact* _autoLoadMissionsFact;
SettingsFact* _useChecklistFact;
SettingsFact* _mapboxTokenFact;
SettingsFact* _esriTokenFact;
SettingsFact* _defaultFirmwareTypeFact;

2
src/Vehicle/Vehicle.h

@ -380,7 +380,7 @@ public: @@ -380,7 +380,7 @@ public:
SysStatusSensor3dGyro = MAV_SYS_STATUS_SENSOR_3D_GYRO,
SysStatusSensor3dAccel = MAV_SYS_STATUS_SENSOR_3D_ACCEL,
SysStatusSensor3dMag = MAV_SYS_STATUS_SENSOR_3D_MAG,
SysStatusSensorAsolutePressure = MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE,
SysStatusSensorAbsolutePressure = MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE,
SysStatusSensorDifferentialPressure = MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE,
SysStatusSensorGPS = MAV_SYS_STATUS_SENSOR_GPS,
SysStatusSensorOpticalFlow = MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW,

10
src/ui/preferences/GeneralSettings.qml

@ -411,6 +411,16 @@ QGCView { @@ -411,6 +411,16 @@ QGCView {
}
}
}
//-----------------------------------------------------------------
//-- Checklist Settings
FactCheckBox {
text: qsTr("Use preflight checklist")
fact: _useChecklist
visible: _useChecklist.visible
property Fact _useChecklist: QGroundControl.settingsManager.appSettings.useChecklist
}
}
}

Loading…
Cancel
Save