APMSafetyComponentSummarySub.qml 3.41 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
3

4 5
import QGroundControl              1.0
import QGroundControl.FactSystem   1.0
6
import QGroundControl.FactControls 1.0
7 8
import QGroundControl.Controls     1.0
import QGroundControl.Palette      1.0
9

10
Item {
11 12
    anchors.fill:   parent

13
    property bool   _firmware34: activeVehicle.versionCompare(3, 5, 0) < 0
14

15
    FactPanelController { id: controller; }
16

Jacob Walser's avatar
Jacob Walser committed
17
    // Enable/Action parameters
18
    property Fact _failsafeBatteryEnable:     controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT")
Jacob Walser's avatar
Jacob Walser committed
19 20 21
    property Fact _failsafeEKFEnable:         controller.getParameterFact(-1, "FS_EKF_ACTION")
    property Fact _failsafeGCSEnable:         controller.getParameterFact(-1, "FS_GCS_ENABLE")
    property Fact _failsafeLeakEnable:        controller.getParameterFact(-1, "FS_LEAK_ENABLE")
22
    property Fact _failsafePilotEnable:       _firmware34 ? null : controller.getParameterFact(-1, "FS_PILOT_INPUT")
Jacob Walser's avatar
Jacob Walser committed
23 24
    property Fact _failsafePressureEnable:    controller.getParameterFact(-1, "FS_PRESS_ENABLE")
    property Fact _failsafeTemperatureEnable: controller.getParameterFact(-1, "FS_TEMP_ENABLE")
25

Jacob Walser's avatar
Jacob Walser committed
26 27 28
    // Threshold parameters
    property Fact _failsafePressureThreshold:    controller.getParameterFact(-1, "FS_PRESS_MAX")
    property Fact _failsafeTemperatureThreshold: controller.getParameterFact(-1, "FS_TEMP_MAX")
29
    property Fact _failsafePilotTimeout:         _firmware34 ? null : controller.getParameterFact(-1, "FS_PILOT_TIMEOUT")
Jacob Walser's avatar
Jacob Walser committed
30 31 32
    property Fact _failsafeLeakPin:              controller.getParameterFact(-1, "LEAK1_PIN")
    property Fact _failsafeLeakLogic:            controller.getParameterFact(-1, "LEAK1_LOGIC")
    property Fact _failsafeEKFThreshold:         controller.getParameterFact(-1, "FS_EKF_THRESH")
33 34
    property Fact _failsafeBatteryVoltage:       controller.getParameterFact(-1, "r.BATT_LOW_VOLT")
    property Fact _failsafeBatteryCapacity:      controller.getParameterFact(-1, "r.BATT_LOW_MAH")
35 36 37 38 39 40 41 42 43 44 45

    property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")

    Column {
        anchors.fill:       parent

        VehicleSummaryRow {
            labelText: qsTr("Arming Checks:")
            valueText:  _armingCheck.value & 1 ? qsTr("Enabled") : qsTr("Some disabled")
        }
        VehicleSummaryRow {
46
            labelText: qsTr("GCS failsafe:")
47
            valueText: _failsafeGCSEnable.enumOrValueString
48 49
        }
        VehicleSummaryRow {
50
            labelText: qsTr("Leak failsafe:")
51
            valueText:  _failsafeLeakEnable.enumOrValueString
52 53
        }
        VehicleSummaryRow {
54
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
55
            labelText: qsTr("Battery failsafe:")
56
            valueText: _firmware34 ? "" : _failsafeBatteryEnable.enumOrValueString
57 58
        }
        VehicleSummaryRow {
59
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
60
            labelText: qsTr("EKF failsafe:")
61
            valueText: _firmware34 ? "" : _failsafeEKFEnable.enumOrValueString
Jacob Walser's avatar
Jacob Walser committed
62 63
        }
        VehicleSummaryRow {
64
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
65
            labelText: qsTr("Pilot Input failsafe:")
66
            valueText: _firmware34 ? "" : _failsafePilotEnable.enumOrValueString
Jacob Walser's avatar
Jacob Walser committed
67 68 69 70
        }
        VehicleSummaryRow {
            labelText: qsTr("Int. Temperature failsafe:")
            valueText:  _failsafeTemperatureEnable.enumOrValueString
71 72
        }
        VehicleSummaryRow {
Jacob Walser's avatar
Jacob Walser committed
73 74
            labelText: qsTr("Int. Pressure failsafe:")
            valueText:  _failsafePressureEnable.enumOrValueString
75 76 77
        }
    }
}