APMAirframeComponentSummary.qml 1.79 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 22 23 24
    property bool _useOldFrameParam:    controller.parameterExists(-1, "FRAME")
    property Fact _oldFrameParam:       controller.getParameterFact(-1, "FRAME", false)
    property Fact _newFrameParam:       controller.getParameterFact(-1, "FRAME_CLASS", false)
    property Fact _frameTypeParam:      controller.getParameterFact(-1, "FRAME_TYPE", false)
25

26
    Column {
27
        anchors.fill:       parent
28 29

        VehicleSummaryRow {
30
            labelText:  qsTr("Frame Type")
31 32 33 34 35
            valueText:  controller.currentAirframeTypeName() + " " + _oldFrameParam.enumStringValue
            visible:    _useOldFrameParam
        }

        VehicleSummaryRow {
36
            labelText:  qsTr("Frame Class")
37 38 39 40 41
            valueText:  _newFrameParam.enumStringValue
            visible:    !_useOldFrameParam

        }

42
        VehicleSummaryRow {
43
            labelText:  qsTr("Frame Type")
44 45
            valueText:  _frameTypeParam.enumStringValue
            visible:    !_useOldFrameParam
46 47

        }
48 49

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