APMSafetyComponentSummaryCopter.qml 4.7 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 _failsafeBattLowAct:  controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT")
Don Gagne's avatar
Don Gagne committed
18 19
    property Fact _failsafeThrEnable:   controller.getParameterFact(-1, "FS_THR_ENABLE")

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

Don Gagne's avatar
Don Gagne committed
24 25 26 27 28
    property Fact _rtlAltFact:      controller.getParameterFact(-1, "RTL_ALT")
    property Fact _rtlLoitTimeFact: controller.getParameterFact(-1, "RTL_LOIT_TIME")
    property Fact _rtlAltFinalFact: controller.getParameterFact(-1, "RTL_ALT_FINAL")
    property Fact _landSpeedFact:   controller.getParameterFact(-1, "LAND_SPEED")

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

31 32 33 34 35 36 37 38
    property bool _failsafeBattCritActAvailable:    controller.parameterExists(-1, "BATT_FS_CRT_ACT")
    property bool _failsafeBatt2LowActAvailable:    controller.parameterExists(-1, "BATT2_FS_LOW_ACT")
    property bool _failsafeBatt2CritActAvailable:   controller.parameterExists(-1, "BATT2_FS_CRT_ACT")

    property Fact _failsafeBattCritAct:             controller.getParameterFact(-1, "BATT_FS_CRT_ACT", false /* reportMissing */)
    property Fact _batt2Monitor:                    controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
    property Fact _failsafeBatt2LowAct:             controller.getParameterFact(-1, "BATT2_FS_LOW_ACT", false /* reportMissing */)
    property Fact _failsafeBatt2CritAct:            controller.getParameterFact(-1, "BATT2_FS_CRT_ACT", false /* reportMissing */)
Don Gagne's avatar
Don Gagne committed
39

40 41 42
    Column {
        anchors.fill:       parent

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

48
        VehicleSummaryRow {
49
            labelText: qsTr("Throttle failsafe:")
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
            valueText:  _failsafeBattLowAct.enumStringValue
        }

        VehicleSummaryRow {
            labelText: qsTr("Batt low failsafe:")
            valueText:  _failsafeBattLowAct.enumStringValue
        }

        VehicleSummaryRow {
            labelText:  qsTr("Batt critical failsafe:")
            valueText:  _failsafeBattCritActAvailable ? _failsafeBattCritAct.enumStringValue : ""
            visible:    _failsafeBattCritActAvailable
        }

        VehicleSummaryRow {
            labelText: qsTr("Batt2 low failsafe:")
            valueText:  _failsafeBatt2LowActAvailable ? _failsafeBatt2LowAct.enumStringValue : ""
            visible:    _failsafeBatt2LowActAvailable
68 69 70
        }

        VehicleSummaryRow {
71 72 73
            labelText: qsTr("Batt2 critical failsafe:")
            valueText:  _failsafeBatt2CritActAvailable ? _failsafeBatt2CritAct.enumStringValue : ""
            visible:    _failsafeBatt2CritActAvailable
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
        VehicleSummaryRow {
99
            labelText: qsTr("RTL loiter time:")
Don Gagne's avatar
Don Gagne committed
100
            valueText: _rtlLoitTimeFact.valueString + " " + _rtlLoitTimeFact.units
101 102 103
        }

        VehicleSummaryRow {
104
            labelText: qsTr("RTL final alt:")
Don Gagne's avatar
Don Gagne committed
105
            valueText: _rtlAltFinalFact.value == 0 ? qsTr("Land") : _rtlAltFinalFact.valueString + " " + _rtlAltFinalFact.units
106 107 108
        }

        VehicleSummaryRow {
109
            labelText: qsTr("Descent speed:")
Don Gagne's avatar
Don Gagne committed
110
            valueText: _landSpeedFact.valueString + " " + _landSpeedFact.units
111
        }
Don Gagne's avatar
Don Gagne committed
112 113
    }
}