APMSafetyComponentSummaryPlane.qml 1.69 KB
Newer Older
Don Gagne's avatar
Don Gagne committed
1
import QtQuick          2.5
Don Gagne's avatar
Don Gagne committed
2
import QtQuick.Controls 1.2
Don Gagne's avatar
Don Gagne committed
3

Don Gagne's avatar
Don Gagne committed
4 5 6 7 8
import QGroundControl.FactSystem    1.0
import QGroundControl.FactControls  1.0
import QGroundControl.Controls      1.0
import QGroundControl.Palette       1.0
import QGroundControl.ScreenTools   1.0
Don Gagne's avatar
Don Gagne committed
9 10

FactPanel {
Don Gagne's avatar
Don Gagne committed
11 12 13 14
    id:     panel
    width:  grid.width
    height: grid.height
    color:  qgcPal.windowShade
Don Gagne's avatar
Don Gagne committed
15 16 17 18 19 20 21 22 23 24 25 26

    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")

Don Gagne's avatar
Don Gagne committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    Grid {
        id:         grid
        rows:       4
        columns:    2
        spacing:    ScreenTools.defaultFontPixelWidth / 2

        QGCLabel { text: "Throttle failsafe:" }
        QGCLabel { text: _failsafeThrEnable.value != 0 ? _failsafeThrValue.valueString : "Disabled" }

        QGCLabel { text: "Voltage failsafe:" }
        QGCLabel { text: _failsafeBattVoltage.value == 0 ? "Disabled" : _failsafeBattVoltage.valueString }

        QGCLabel { text: "mAh failsafe:" }
        QGCLabel { text: _failsafeBattMah.value == 0 ? "Disabled" : _failsafeBattMah.valueString }

        QGCLabel { text: "RTL min alt:" }
        QGCLabel { text: _rtlAltFact.value < 0 ? "current" : _rtlAltFact.valueString }
Don Gagne's avatar
Don Gagne committed
44
    }
Don Gagne's avatar
Don Gagne committed
45
}