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 implicitWidth: mainLayout.implicitWidth
15 implicitHeight: mainLayout.implicitHeight
16 width: parent.width // grows when Loader is wider than implicitWidth
17
18 APMSensorsComponentController { id: controller; }
19
20 APMSensorParams {
21 id: sensorParams
22 factPanelController: controller
23 }
24
25 ColumnLayout {
26 id: mainLayout
27 width: parent.width
28 spacing: 0
29
30 VehicleSummaryRow {
31 labelText: qsTr("Compasses:")
32 valueText: ""
33 }
34
35 Repeater {
36 model: sensorParams.rgCompassAvailable.length
37 RowLayout {
38 Layout.fillWidth: true
39 width: parent.width
40
41 QGCLabel {
42
43 text: sensorParams.rgCompassAvailable[index] ?
44 (sensorParams.rgCompassCalibrated[index] ?
45 getPriority(index) +
46 (sensorParams.rgCompassExternalParamAvailable[index] ?
47 (sensorParams.rgCompassExternal[index] ? ", External" : ", Internal" ) :
48 "") :
49 qsTr("Setup required")) :
50 qsTr("Not installed")
51
52 function getPriority (index) {
53 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[0].value) {
54 return "Primary"
55 }
56 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[1].value) {
57 return "Secondary"
58 }
59 if (sensorParams.rgCompassId[index].value == sensorParams.rgCompassPrio[2].value) {
60 return "Tertiary"
61 }
62 return "Unused"
63 }
64 }
65
66 APMSensorIdDecoder {
67 horizontalAlignment: Text.AlignRight
68 Layout.alignment: Qt.AlignRight
69
70 fact: sensorParams.rgCompassPrio[index]
71 }
72 }
73 }
74
75 VehicleSummaryRow {
76 labelText: qsTr("Accelerometer(s):")
77 valueText: controller.accelSetupNeeded ? qsTr("Setup required") : qsTr("Ready")
78 }
79
80 Repeater {
81 model: sensorParams.rgInsId.length
82 APMSensorIdDecoder {
83 fact: sensorParams.rgInsId[index]
84 Layout.alignment: Qt.AlignRight
85 }
86 }
87
88 VehicleSummaryRow {
89 labelText: qsTr("Barometer(s):")
90 valueText: sensorParams.baroIdAvailable ? "" : qsTr("Not Supported(Over APM 4.1)")
91 }
92
93 Repeater {
94 model: sensorParams.rgBaroId.length
95 APMSensorIdDecoder {
96 fact: sensorParams.rgBaroId[index]
97 Layout.alignment: Qt.AlignRight
98 }
99 }
100 }
101}