FlightModesComponentSummary.qml 1.55 KB
Newer Older
1 2 3
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
4

5
import QGroundControl.FactSystem 1.0
6
import QGroundControl.Controls 1.0
7 8 9 10 11

Column {
    anchors.fill: parent
    anchors.margins: 8

12 13 14 15 16 17 18 19 20 21 22 23 24
    Component {
        id: component

        Row {
            width: parent.width

            QGCLabel { id: label; text: labelText }
            QGCLabel {
                property Fact fact: Fact { name: factName }
                horizontalAlignment: Text.AlignRight
                width: parent.width - label.contentWidth
                text: fact.value == 0 ? zeroText : fact.value
            }
25 26 27
        }
    }

28 29 30 31
    Loader {
        property string labelText: "Mode switch:"
        property string zeroText: "Setup required"
        property string factName: "RC_MAP_MODE_SW"
32
        width: parent.width
33
        sourceComponent: component
34 35
    }

36 37 38 39
    Loader {
        property string labelText: "Position Ctl switch:"
        property string zeroText: "Disabled"
        property string factName: "RC_MAP_POSCTL_SW"
40
        width: parent.width
41
        sourceComponent: component
42 43
    }

44 45 46 47
    Loader {
        property string labelText: "Position Ctl switch:"
        property string zeroText: "Disabled"
        property string factName: "RC_MAP_LOITER_SW"
48
        width: parent.width
49 50
        sourceComponent: component
    }
51

52 53 54 55 56 57
    Loader {
        property string labelText: "Return switch:"
        property string zeroText: "Disabled"
        property string factName: "RC_MAP_RETURN_SW"
        width: parent.width
        sourceComponent: component
58 59
    }
}