APMSafetyComponentSummarySub.qml 3.67 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 11 12 13 14

FactPanel {
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark

15 16 17
    property var _activeVehicle:     QGroundControl.multiVehicleManager.activeVehicle
    property bool _firmware34: _activeVehicle.firmwareMajorVersion == 3 && _activeVehicle.firmwareMinorVersion == 4

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

Jacob Walser's avatar
Jacob Walser committed
21 22 23 24 25
    // Enable/Action parameters
    property Fact _failsafeBatteryEnable:     controller.getParameterFact(-1, "FS_BATT_ENABLE")
    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")
26
    property Fact _failsafePilotEnable:       _firmware34 ? null : controller.getParameterFact(-1, "FS_PILOT_INPUT")
Jacob Walser's avatar
Jacob Walser committed
27 28
    property Fact _failsafePressureEnable:    controller.getParameterFact(-1, "FS_PRESS_ENABLE")
    property Fact _failsafeTemperatureEnable: controller.getParameterFact(-1, "FS_TEMP_ENABLE")
29

Jacob Walser's avatar
Jacob Walser committed
30 31 32
    // Threshold parameters
    property Fact _failsafePressureThreshold:    controller.getParameterFact(-1, "FS_PRESS_MAX")
    property Fact _failsafeTemperatureThreshold: controller.getParameterFact(-1, "FS_TEMP_MAX")
33
    property Fact _failsafePilotTimeout:         _firmware34 ? null : controller.getParameterFact(-1, "FS_PILOT_TIMEOUT")
Jacob Walser's avatar
Jacob Walser committed
34 35 36 37 38
    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")
    property Fact _failsafeBatteryVoltage:       controller.getParameterFact(-1, "FS_BATT_VOLTAGE")
    property Fact _failsafeBatteryCapacity:      controller.getParameterFact(-1, "FS_BATT_MAH")
39 40 41 42 43 44 45 46 47 48 49

    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 {
50
            labelText: qsTr("GCS failsafe:")
51
            valueText: _failsafeGCSEnable.enumOrValueString
52 53
        }
        VehicleSummaryRow {
54
            labelText: qsTr("Leak failsafe:")
55
            valueText:  _failsafeLeakEnable.enumOrValueString
56 57
        }
        VehicleSummaryRow {
58
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
59
            labelText: qsTr("Battery failsafe:")
60
            valueText: _firmware34 ? "" : _failsafeBatteryEnable.enumOrValueString
61 62
        }
        VehicleSummaryRow {
63
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
64
            labelText: qsTr("EKF failsafe:")
65
            valueText: _firmware34 ? "" : _failsafeEKFEnable.enumOrValueString
Jacob Walser's avatar
Jacob Walser committed
66 67
        }
        VehicleSummaryRow {
68
            visible: !_firmware34
Jacob Walser's avatar
Jacob Walser committed
69
            labelText: qsTr("Pilot Input failsafe:")
70
            valueText: _firmware34 ? "" : _failsafePilotEnable.enumOrValueString
Jacob Walser's avatar
Jacob Walser committed
71 72 73 74
        }
        VehicleSummaryRow {
            labelText: qsTr("Int. Temperature failsafe:")
            valueText:  _failsafeTemperatureEnable.enumOrValueString
75 76
        }
        VehicleSummaryRow {
Jacob Walser's avatar
Jacob Walser committed
77 78
            labelText: qsTr("Int. Pressure failsafe:")
            valueText:  _failsafePressureEnable.enumOrValueString
79 80 81
        }
    }
}