APMSafetyComponentSummaryPlane.qml 1.8 KB
Newer Older
1
import QtQuick 2.2
Don Gagne's avatar
Don Gagne committed
2
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 17 18 19 20 21 22 23 24

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

    property Fact _failsafeBattMah:     controller.getParameterFact(-1, "FS_BATT_MAH")
    property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE")
    property Fact _failsafeThrEnable:   controller.getParameterFact(-1, "THR_FAILSAFE")
    property Fact _failsafeThrValue:    controller.getParameterFact(-1, "THR_FS_VALUE")
    property Fact _failsafeGCSEnable:   controller.getParameterFact(-1, "FS_GCS_ENABL")

    property Fact _rtlAltFact: controller.getParameterFact(-1, "ALT_HOLD_RTL")

25 26 27 28
    Column {
        anchors.fill:       parent

        VehicleSummaryRow {
29 30
            labelText: qsTr("Throttle failsafe:")
            valueText:  _failsafeThrEnable.value != 0 ? _failsafeThrValue.valueString : qsTr("Disabled")
31 32 33
        }

        VehicleSummaryRow {
34
            labelText: qsTr("Voltage failsafe:")
Don Gagne's avatar
Don Gagne committed
35
            valueText:  _failsafeBattVoltage.value == 0 ? qsTr("Disabled") : _failsafeBattVoltage.valueString + " " + _failsafeBattVoltage.units
36 37 38
        }

        VehicleSummaryRow {
39
            labelText: qsTr("mAh failsafe:")
Don Gagne's avatar
Don Gagne committed
40
            valueText:  _failsafeBattMah.value == 0 ? qsTr("Disabled") : _failsafeBattMah.valueString + " " + _failsafeBattMah.units
41 42 43
        }

        VehicleSummaryRow {
44
            labelText: qsTr("RTL min alt:")
Don Gagne's avatar
Don Gagne committed
45
            valueText: _rtlAltFact.value < 0 ? qsTr("current") : _rtlAltFact.valueString + " " + _rtlAltFact.units
46
        }
Don Gagne's avatar
Don Gagne committed
47
    }
Don Gagne's avatar
Don Gagne committed
48
}