QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMFlightSafetyComponentSummary.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.FactControls
7import QGroundControl.Controls
8
9Item {
10 implicitWidth: mainLayout.implicitWidth
11 implicitHeight: mainLayout.implicitHeight
12 width: parent.width // grows when Loader is wider than implicitWidth
13
14 FactPanelController { id: controller; }
15
16 property Fact _copterFenceAction: controller.getParameterFact(-1, "FENCE_ACTION", false /* reportMissing */)
17 property Fact _copterFenceEnable: controller.getParameterFact(-1, "FENCE_ENABLE", false /* reportMissing */)
18 property Fact _copterFenceType: controller.getParameterFact(-1, "FENCE_TYPE", false /* reportMissing */)
19
20 ColumnLayout {
21 id: mainLayout
22 spacing: 0
23
24 VehicleSummaryRow {
25 labelText: qsTr("Arming Checks:")
26 valueText: {
27 if (_armingCheckFact) {
28 return _armingCheckFact.value & 1 ? qsTr("Enabled") : qsTr("Some disabled")
29 } else if (_armingSkipCheckFact) {
30 return _armingSkipCheckFact.value === 0 ? qsTr("Enabled") : qsTr("Some disabled")
31 }
32 return ""
33 }
34
35 // Older firmwares use ARMING_CHECK. Newer firmwares use ARMING_SKIPCHK.
36 property Fact _armingCheckFact: controller.getParameterFact(-1, "ARMING_CHECK", false /* reportMissing */)
37 property Fact _armingSkipCheckFact: controller.getParameterFact(-1, "ARMING_SKIPCHK", false /* reportMissing */)
38 }
39
40 VehicleSummaryRow {
41 labelText: qsTr("GeoFence:")
42 valueText: {
43 if(_copterFenceEnable && _copterFenceType) {
44 if(_copterFenceEnable.value == 0 || _copterFenceType.value == 0) {
45 return qsTr("Disabled")
46 } else {
47 if(_copterFenceType.value == 1) {
48 return qsTr("Altitude")
49 }
50 if(_copterFenceType.value == 2) {
51 return qsTr("Circle")
52 }
53 return qsTr("Altitude,Circle")
54 }
55 }
56 return ""
57 }
58 visible: controller.vehicle.multiRotor
59 }
60
61 VehicleSummaryRow {
62 labelText: qsTr("GeoFence:")
63 valueText: _copterFenceAction ? (_copterFenceAction.value == 0 ?
64 qsTr("Report only") :
65 (_copterFenceAction.value == 1 ? qsTr("RTL or Land") : qsTr("Unknown"))) : ""
66 visible: controller.vehicle.multiRotor && _copterFenceEnable && _copterFenceEnable.value !== 0
67 }
68
69 VehicleSummaryRow {
70 labelText: qsTr("RTL min alt:")
71 valueText: fact ? (fact.value == 0 ? qsTr("current") : fact.valueString + " " + fact.units) : ""
72 visible: controller.vehicle.multiRotor
73
74 property Fact fact: controller.getParameterFact(-1, "RTL_ALT_M", false /* reportMissing */)
75 }
76
77 VehicleSummaryRow {
78 labelText: qsTr("RTL min alt:")
79 valueText: fact ? (fact.value < 0 ? qsTr("current") : fact.valueString + " " + fact.units) : ""
80 visible: controller.vehicle.fixedWing
81
82 property Fact fact: controller.getParameterFact(-1, "RTL_ALTITUDE", false /* reportMissing */)
83 }
84 }
85}