APMSensorsComponentSummary.qml 3.21 KB
Newer Older
1 2 3
import QtQuick                  2.5
import QtQuick.Controls         1.2
import QtQuick.Controls.Styles  1.2
Don Gagne's avatar
Don Gagne committed
4

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

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

Don Gagne's avatar
Don Gagne committed
15
FactPanel {
16 17 18
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
Don Gagne's avatar
Don Gagne committed
19 20

    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
21
    APMSensorsComponentController { id: controller; factPanel: panel }
Don Gagne's avatar
Don Gagne committed
22

Don Gagne's avatar
Don Gagne committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    property Fact compass1IdFact:   controller.getParameterFact(-1, "COMPASS_DEV_ID")
    property Fact compass2IdFact:   controller.getParameterFact(-1, "COMPASS_DEV_ID2")
    property Fact compass3IdFact:   controller.getParameterFact(-1, "COMPASS_DEV_ID3")

    property Fact compass1OfsXFact: controller.getParameterFact(-1, "COMPASS_OFS_X")
    property Fact compass1OfsYFact: controller.getParameterFact(-1, "COMPASS_OFS_Y")
    property Fact compass1OfsZFact: controller.getParameterFact(-1, "COMPASS_OFS_Z")
    property Fact compass2OfsXFact: controller.getParameterFact(-1, "COMPASS_OFS2_X")
    property Fact compass2OfsYFact: controller.getParameterFact(-1, "COMPASS_OFS2_Y")
    property Fact compass2OfsZFact: controller.getParameterFact(-1, "COMPASS_OFS2_Z")
    property Fact compass3OfsXFact: controller.getParameterFact(-1, "COMPASS_OFS3_X")
    property Fact compass3OfsYFact: controller.getParameterFact(-1, "COMPASS_OFS3_Y")
    property Fact compass3OfsZFact: controller.getParameterFact(-1, "COMPASS_OFS3_Z")

    property bool compass1Available: compass1IdFact.value !== 0
    property bool compass2Available: compass2IdFact.value !== 0
    property bool compass3Available: compass3IdFact.value !== 0

    property bool compass1Calibrated: compass1Available ? compass1OfsXFact.value != 0.0  && compass1OfsYFact.value != 0.0  &&compass1OfsZFact.value != 0.0 : false
    property bool compass2Calibrated: compass2Available ? compass2OfsXFact.value != 0.0  && compass2OfsYFact.value != 0.0  &&compass2OfsZFact.value != 0.0 : false
    property bool compass3Calibrated: compass3Available ? compass3OfsXFact.value != 0.0  && compass3OfsYFact.value != 0.0  &&compass3OfsZFact.value != 0.0 : false

45
    property bool compassCalNeeded: controller.compassSetupNeeded
Don Gagne's avatar
Don Gagne committed
46

47 48
    Column {
        anchors.fill:       parent
Don Gagne's avatar
Don Gagne committed
49

50
        VehicleSummaryRow {
51
            labelText: qsTr("Compass 1:")
Don Gagne's avatar
Don Gagne committed
52
            visible:    compass1Available
53
            valueText:  compass1Calibrated ? qsTr("Ready") : qsTr("Setup required")
Don Gagne's avatar
Don Gagne committed
54 55 56
        }

        VehicleSummaryRow {
57
            labelText: qsTr("Compass 2:")
Don Gagne's avatar
Don Gagne committed
58
            visible:    compass2Available
59
            valueText:  compass2Calibrated ? qsTr("Ready") : qsTr("Setup required")
Don Gagne's avatar
Don Gagne committed
60 61 62
        }

        VehicleSummaryRow {
63
            labelText: qsTr("Compass 3:")
Don Gagne's avatar
Don Gagne committed
64
            visible:    compass3Available
65
            valueText:  compass3Calibrated ? qsTr("Ready") : qsTr("Setup required")
66
        }
Don Gagne's avatar
Don Gagne committed
67

68
        VehicleSummaryRow {
69 70
            labelText: qsTr("Accelerometer:")
            valueText: controller.accelSetupNeeded ? qsTr("Setup required") : qsTr("Ready")
71
        }
Don Gagne's avatar
Don Gagne committed
72 73
    }
}