APMSafetyComponentSummaryCopter.qml 4.02 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
Don Gagne's avatar
Don Gagne committed
3

4 5 6 7
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
Don Gagne's avatar
Don Gagne committed
8

9
Item {
10 11
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
Don Gagne's avatar
Don Gagne committed
12

13
    FactPanelController { id: controller; }
Don Gagne's avatar
Don Gagne committed
14

15
    property Fact _failsafeThrEnable:       controller.getParameterFact(-1, "FS_THR_ENABLE")
Don Gagne's avatar
Don Gagne committed
16

17 18 19
    property Fact _fenceAction:             controller.getParameterFact(-1, "FENCE_ACTION")
    property Fact _fenceEnable:             controller.getParameterFact(-1, "FENCE_ENABLE")
    property Fact _fenceType:               controller.getParameterFact(-1, "FENCE_TYPE")
20

21
    property Fact _rtlAltFact:              controller.getParameterFact(-1, "RTL_ALT")
Don Gagne's avatar
Don Gagne committed
22

23
    property Fact _armingCheck:             controller.getParameterFact(-1, "ARMING_CHECK")
Don Gagne's avatar
Don Gagne committed
24

25 26 27 28 29
    property Fact _batt1Monitor:            controller.getParameterFact(-1, "BATT_MONITOR")
    property Fact _batt2Monitor:            controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
    property bool _batt2MonitorAvailable:   controller.parameterExists(-1, "BATT2_MONITOR")
    property bool _batt1MonitorEnabled:     _batt1Monitor.rawValue !== 0
    property bool _batt2MonitorEnabled:     _batt2MonitorAvailable && _batt2Monitor.rawValue !== 0
30

31 32 33 34 35
    property Fact _batt1FSLowAct:           controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT", false /* reportMissing */)
    property Fact _batt1FSCritAct:          controller.getParameterFact(-1, "BATT_FS_CRT_ACT", false /* reportMissing */)
    property Fact _batt2FSLowAct:           controller.getParameterFact(-1, "BATT2_FS_LOW_ACT", false /* reportMissing */)
    property Fact _batt2FSCritAct:          controller.getParameterFact(-1, "BATT2_FS_CRT_ACT", false /* reportMissing */)
    property bool _batt1FSCritActAvailable: controller.parameterExists(-1, "BATT_FS_CRT_ACT")
Don Gagne's avatar
Don Gagne committed
36

37 38 39
    Column {
        anchors.fill:       parent

Don Gagne's avatar
Don Gagne committed
40
        VehicleSummaryRow {
41
            labelText: qsTr("Arming Checks:")
42
            valueText: _armingCheck.value & 1 ? qsTr("Enabled") : qsTr("Some disabled")
Don Gagne's avatar
Don Gagne committed
43 44
        }

45
        VehicleSummaryRow {
46
            labelText: qsTr("Throttle failsafe:")
47
            valueText: _failsafeThrEnable.enumStringValue
48 49 50
        }

        VehicleSummaryRow {
51 52 53
            labelText:  qsTr("Batt1 low failsafe:")
            valueText:  _batt1MonitorEnabled ? _batt1FSLowAct.enumStringValue : ""
            visible:    _batt1MonitorEnabled
54 55 56
        }

        VehicleSummaryRow {
57 58 59
            labelText:  qsTr("Batt1 critical failsafe:")
            valueText:  _batt1FSCritActAvailable ? _batt1FSCritAct.enumStringValue : ""
            visible:    _batt1FSCritActAvailable
60 61 62
        }

        VehicleSummaryRow {
63 64 65
            labelText:  qsTr("Batt2 low failsafe:")
            valueText:  _batt2MonitorEnabled ? _batt2FSLowAct.enumStringValue : ""
            visible:    _batt2MonitorEnabled
66 67 68
        }

        VehicleSummaryRow {
69 70 71
            labelText:  qsTr("Batt2 critical failsafe:")
            valueText:  _batt2MonitorEnabled ? _batt2FSCritAct.enumStringValue : ""
            visible:    _batt2MonitorEnabled
Don Gagne's avatar
Don Gagne committed
72 73
        }

74
        VehicleSummaryRow {
75
            labelText: qsTr("GeoFence:")
76
            valueText: _fenceEnable.value == 0 || _fenceType == 0 ?
77
                           qsTr("Disabled") :
78
                           (_fenceType.value == 1 ?
79 80
                                qsTr("Altitude") :
                                (_fenceType.value == 2 ? qsTr("Circle") : qsTr("Altitude,Circle")))
81
        }
82

83
        VehicleSummaryRow {
84
            labelText: qsTr("GeoFence:")
85
            valueText: _fenceAction.value == 0 ?
86 87
                           qsTr("Report only") :
                           (_fenceAction.value == 1 ? qsTr("RTL or Land") : qsTr("Unknown"))
88 89
            visible:    _fenceEnable.value != 0
        }
90

91
        VehicleSummaryRow {
92
            labelText: qsTr("RTL min alt:")
Don Gagne's avatar
Don Gagne committed
93
            valueText: _rtlAltFact.value == 0 ? qsTr("current") : _rtlAltFact.valueString + " " + _rtlAltFact.units
94
        }
Don Gagne's avatar
Don Gagne committed
95 96
    }
}