SafetyComponentSummary.qml 2.85 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
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
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 18 19 20 21 22 23 24 25
    property Fact   returnAltFact:      controller.getParameterFact(-1, "RTL_RETURN_ALT")
    property Fact   _descendAltFact:    controller.getParameterFact(-1, "RTL_DESCEND_ALT")
    property Fact   landDelayFact:      controller.getParameterFact(-1, "RTL_LAND_DELAY")
    property Fact   commRCLossFact:     controller.getParameterFact(-1, "COM_RC_LOSS_T")
    property Fact   lowBattAction:      controller.getParameterFact(-1, "COM_LOW_BAT_ACT")
    property Fact   rcLossAction:       controller.getParameterFact(-1, "NAV_RCL_ACT")
    property Fact   dataLossAction:     controller.getParameterFact(-1, "NAV_DLL_ACT")
    property Fact   _rtlLandDelayFact:  controller.getParameterFact(-1, "RTL_LAND_DELAY")
    property int    _rtlLandDelayValue: _rtlLandDelayFact.value
26

27 28 29 30
    Column {
        anchors.fill:       parent

        VehicleSummaryRow {
31 32
            labelText: qsTr("Low Battery Failsafe")
            valueText: lowBattAction ? lowBattAction.enumStringValue : ""
33 34 35
        }

        VehicleSummaryRow {
36 37
            labelText: qsTr("RC Loss Failsafe")
            valueText: rcLossAction ? rcLossAction.enumStringValue : ""
38 39 40
        }

        VehicleSummaryRow {
41
            labelText: qsTr("RC Loss Timeout")
Don Gagne's avatar
Don Gagne committed
42
            valueText: commRCLossFact ? commRCLossFact.valueString + " " + commRCLossFact.units : ""
43 44 45
        }

        VehicleSummaryRow {
46 47
            labelText: qsTr("Data Link Loss Failsafe")
            valueText: dataLossAction ? dataLossAction.enumStringValue : ""
48 49 50
        }

        VehicleSummaryRow {
51 52
            labelText: qsTr("RTL Climb To")
            valueText: returnAltFact ? returnAltFact.valueString + " " + returnAltFact.units : ""
53
        }
54 55

        VehicleSummaryRow {
56 57 58 59 60 61 62
            labelText: qsTr("RTL, Then")
            valueText: _rtlLandDelayValue === 0 ?
                           qsTr("Land immediately") :
                           (_rtlLandDelayValue < 0 ?
                                qsTr("Loiter and do not land") :
                                qsTr("Loiter and land after specified time"))

63 64
        }

65 66 67 68 69 70 71 72 73 74 75
        VehicleSummaryRow {
            labelText: qsTr("Loiter Alt")
            valueText: _descendAltFact.valueString + " " + _descendAltFact.units
            visible:    _rtlLandDelayValue !== 0
        }

        VehicleSummaryRow {
            labelText: qsTr("Land Delay")
            valueText: _rtlLandDelayValue + " " + _rtlLandDelayFact.units
            visible:    _rtlLandDelayValue > 0
        }
76 77
    }
}