SensorsComponentSummaryFixedWing.qml 1.89 KB
Newer Older
1 2
import QtQuick 2.3
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 10 11 12

/*
    IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml
*/

13
Item {
Don Gagne's avatar
Don Gagne committed
14
    anchors.fill:   parent
15

16
    FactPanelController { id: controller; }
Don Gagne's avatar
Don Gagne committed
17

Don Gagne's avatar
Don Gagne committed
18 19 20 21 22 23 24
    property Fact mag0IdFact:           controller.getParameterFact(-1, "CAL_MAG0_ID")
    property Fact gyro0IdFact:          controller.getParameterFact(-1, "CAL_GYRO0_ID")
    property Fact accel0IdFact:         controller.getParameterFact(-1, "CAL_ACC0_ID")
    property Fact dpressOffFact:        controller.getParameterFact(-1, "SENS_DPRES_OFF")
    property Fact airspeedDisabledFact: controller.getParameterFact(-1, "FW_ARSP_MODE")
    property Fact airspeedBreakerFact:  controller.getParameterFact(-1, "CBRK_AIRSPD_CHK")

25
    property bool _airspeedVisible:     airspeedDisabledFact.value == 0 && airspeedBreakerFact.value !== 162128
26
    property bool _airspeedCalRequired: _airspeedVisible && dpressOffFact.value === 0
27 28 29 30 31

    Column {
        anchors.fill:       parent

        VehicleSummaryRow {
32 33
            labelText: qsTr("Compass:")
            valueText: mag0IdFact ? (mag0IdFact.value  === 0 ? qsTr("Setup required") : qsTr("Ready")) : ""
34 35 36
        }

        VehicleSummaryRow {
37 38
            labelText: qsTr("Gyro:")
            valueText: gyro0IdFact ? (gyro0IdFact.value === 0 ? qsTr("Setup required") : qsTr("Ready")) : ""
39 40 41
        }

        VehicleSummaryRow {
42 43
            labelText: qsTr("Accelerometer:")
            valueText: accel0IdFact ? (accel0IdFact.value === 0 ? qsTr("Setup required") : qsTr("Ready")) : ""
44 45 46
        }

        VehicleSummaryRow {
Don Gagne's avatar
Don Gagne committed
47 48 49
            labelText:  qsTr("Airspeed:")
            visible:    _airspeedVisible
            valueText: _airspeedCalRequired ? qsTr("Setup required") : qsTr("Ready")
50
        }
51 52
    }
}