APMSensorsComponentSummary.qml 3.17 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 {
Don Gagne's avatar
Don Gagne committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
            labelText: "Compass 1:"
            visible:    compass1Available
            valueText:  compass1Calibrated ? "Ready" : "Setup required"
        }

        VehicleSummaryRow {
            labelText: "Compass 2:"
            visible:    compass2Available
            valueText:  compass2Calibrated ? "Ready" : "Setup required"
        }

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

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