APMAirframeComponentSummary.qml 1.76 KB
Newer Older
1 2
import QtQuick 2.3
import QtQuick.Controls 1.2
3

4 5 6 7 8
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
9

10
Item {
11 12
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
13 14

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
15 16 17
    APMAirframeComponentController {
        id:         controller
    }
18

19 20 21 22
    property bool _frameAvailable:      controller.parameterExists(-1, "FRAME")
    property Fact _frame:               controller.getParameterFact(-1, "FRAME", false)
    property Fact _frameClass:          controller.getParameterFact(-1, "FRAME_CLASS", false)
    property Fact _frameType:           controller.getParameterFact(-1, "FRAME_TYPE", false)
23

24
    Column {
25
        anchors.fill:       parent
26 27

        VehicleSummaryRow {
28
            labelText:  qsTr("Frame Type")
29 30
            valueText:  visible ? controller.currentAirframeTypeName() + " " + _frame.enumStringValue : ""
            visible:    _frameAvailable
31 32 33
        }

        VehicleSummaryRow {
34
            labelText:  qsTr("Frame Class")
35 36
            valueText:  visible ? _frameClass.enumStringValue : ""
            visible:    !_frameAvailable
37 38 39

        }

40
        VehicleSummaryRow {
41
            labelText:  qsTr("Frame Type")
42 43
            valueText:  visible ? _frameType.enumStringValue : ""
            visible:    !_frameAvailable
44
        }
45 46

        VehicleSummaryRow {
47
            labelText: qsTr("Firmware Version")
48 49
            valueText: activeVehicle.firmwareMajorVersion == -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString
        }
50 51
    }
}