APMSafetyComponentSummaryCopter.qml 4.13 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

FactPanel {
10 11 12
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
Don Gagne's avatar
Don Gagne committed
13 14 15 16

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
    FactPanelController { id: controller; factPanel: panel }

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

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

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

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

27 28 29 30 31
    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
32

33 34 35 36 37
    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
38

39 40 41
    Column {
        anchors.fill:       parent

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

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

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

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

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

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

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

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

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