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