FlightModesComponentSummary.qml 1.48 KB
Newer Older
1 2
import QtQuick 2.2
import QtQuick.Controls 1.2
3

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

9
FactPanel {
Don Gagne's avatar
Don Gagne committed
10 11 12
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
13

Don Gagne's avatar
Don Gagne committed
14 15 16 17 18 19 20
    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
    FactPanelController { id: controller; factPanel: panel }

    property Fact modeSwFact:   controller.getParameterFact(-1, "RC_MAP_MODE_SW")
    property Fact posCtlSwFact: controller.getParameterFact(-1, "RC_MAP_POSCTL_SW")
    property Fact loiterSwFact: controller.getParameterFact(-1, "RC_MAP_LOITER_SW")
    property Fact returnSwFact: controller.getParameterFact(-1, "RC_MAP_RETURN_SW")
21

22 23 24
    Column {
        anchors.fill:       parent
        anchors.margins:    8
25

26 27 28 29
        VehicleSummaryRow {
            labelText: "Mode switch:"
            valueText: modeSwFact.value == 0 ? "Setup required" : modeSwFact.valueString
        }
30

31 32 33 34 35 36 37 38 39
        VehicleSummaryRow {
            labelText: "Position Ctl switch:"
            valueText: posCtlSwFact.value == 0 ? "Disabled" : posCtlSwFact.valueString
        }

        VehicleSummaryRow {
            labelText: "Loiter switch:"
            valueText: loiterSwFact.value == 0 ? "Disabled" : loiterSwFact.valueString
        }
40

41 42 43 44
        VehicleSummaryRow {
            labelText: "Return switch:"
            valueText: returnSwFact.value == 0 ? "Disabled" : returnSwFact.valueString
        }
45 46
    }
}