APMAirframeComponentSummary.qml 1.45 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

FactPanel {
11 12 13
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
14 15

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
16 17 18 19
    APMAirframeComponentController {
        id:         controller
        factPanel:  panel
    }
20

21
    property Fact _frameClass:          controller.getParameterFact(-1, "FRAME_CLASS")
22
    property Fact _frameType:           controller.getParameterFact(-1, "FRAME_TYPE", false)
23
    property bool _frameTypeAvailable:  controller.parameterExists(-1, "FRAME_TYPE")
24

25
    Column {
26
        anchors.fill:       parent
27 28

        VehicleSummaryRow {
29
            labelText:  qsTr("Frame Class")
30
            valueText:  _frameClass.enumStringValue
31 32 33

        }

34
        VehicleSummaryRow {
35
            labelText:  qsTr("Frame Type")
36
            valueText:  visible ? _frameType.enumStringValue : ""
37
            visible:    _frameTypeAvailable
38
        }
39 40

        VehicleSummaryRow {
41
            labelText: qsTr("Firmware Version")
42 43
            valueText: activeVehicle.firmwareMajorVersion == -1 ? qsTr("Unknown") : activeVehicle.firmwareMajorVersion + "." + activeVehicle.firmwareMinorVersion + "." + activeVehicle.firmwarePatchVersion + activeVehicle.firmwareVersionTypeString
        }
44 45
    }
}