APMSensorsComponentSummary.qml 3.24 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 49
    Column {
        anchors.fill:       parent
        anchors.margins:    8
Don Gagne's avatar
Don Gagne committed
50

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

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

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

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