QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMSensorsComponentSummary.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.FactControls
7import QGroundControl.Controls
8
9/*
10 IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml
11*/
12
13Item {
14 anchors.fill: parent
15
16 APMSensorsComponentController { id: controller; }
17
18 APMSensorParams {
19 id: sensorParams
20 factPanelController: controller
21 }
22
23 Column {
24 anchors.fill: parent
25
26 VehicleSummaryRow {
27 labelText: qsTr("Compasses:")
28 valueText: ""
29 }
30
31 Repeater {
32 model: sensorParams.rgCompassAvailable.length
33 RowLayout {
34 Layout.fillWidth: true
35 width: parent.width
36
37 QGCLabel {
38
39 text: sensorParams.rgCompassAvailable[index] ?
40 (sensorParams.rgCompassCalibrated[index] ?
41 getPriority(index) +
42 (sensorParams.rgCompassExternalParamAvailable[index] ?
43 (sensorParams.rgCompassExternal[index] ? ", External" : ", Internal" ) :
44 "") :
45 qsTr("Setup required")) :
46 qsTr("Not installed")
47
48 function getPriority (index) {
49 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[0].value) {
50 return "Primary"
51 }
52 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[1].value) {
53 return "Secondary"
54 }
55 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[2].value) {
56 return "Tertiary"
57 }
58 return "Unused"
59 }
60 }
61
62 APMSensorIdDecoder {
63 horizontalAlignment: Text.AlignRight
64 Layout.alignment: Qt.AlignRight
65
66 fact: sensorParams.rgCompassPrio[index]
67 }
68 }
69 }
70
71 VehicleSummaryRow {
72 labelText: qsTr("Accelerometer(s):")
73 valueText: controller.accelSetupNeeded ? qsTr("Setup required") : qsTr("Ready")
74 }
75
76 Repeater {
77 model: sensorParams.rgInsId.length
78 APMSensorIdDecoder {
79 fact: sensorParams.rgInsId[index]
80 anchors.right: parent.right
81 }
82 }
83
84 VehicleSummaryRow {
85 labelText: qsTr("Barometer(s):")
86 valueText: sensorParams.baroIdAvailable ? "" : qsTr("Not Supported(Over APM 4.1)")
87 }
88
89 Repeater {
90 model: sensorParams.rgBaroId.length
91 APMSensorIdDecoder {
92 fact: sensorParams.rgBaroId[index]
93 anchors.right: parent.right
94 }
95 }
96 }
97}