QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
TelemetrySettings.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.FactControls
8import QGroundControl.Controls
9
10SettingsPage {
11 property var _settingsManager: QGroundControl.settingsManager
12 property var _mavlinkSettings: _settingsManager.mavlinkSettings
13 property var _appSettings: _settingsManager.appSettings
14 property bool _disableAllDataPersistence: _appSettings.disableAllPersistence.rawValue
15 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
16 property string _notConnectedStr: qsTr("Not Connected")
17 property bool _isAPM: _activeVehicle ? _activeVehicle.apmFirmware : true
18 property bool _showAPMStreamRates: QGroundControl.apmFirmwareSupported && _settingsManager.apmMavlinkStreamRateSettings.visible && _isAPM
19 property var _apmStartMavlinkStreams: _mavlinkSettings.apmStartMavlinkStreams
20
21 SettingsGroupLayout {
22 Layout.fillWidth: true
23 heading: qsTr("Ground Station")
24
25 LabelledFactTextField {
26 Layout.fillWidth: true
27 label: qsTr("MAVLink System ID")
28 fact: _mavlinkSettings.gcsMavlinkSystemID
29 }
30
31 FactCheckBoxSlider {
32 Layout.fillWidth: true
33 text: qsTr("Emit heartbeat")
34 fact: _mavlinkSettings.sendGCSHeartbeat
35 }
36 }
37
38 SettingsGroupLayout {
39 id: mavlink2SigningGroup
40 Layout.fillWidth: true
41 heading: qsTr("MAVLink 2 Signing")
42 headingDescription: qsTr("Signing keys should only be sent to the vehicle over secure links.")
43 visible: _mavlink2SigningKey.visible
44
45 property Fact _mavlink2SigningKey: _mavlinkSettings.mavlink2SigningKey
46
47 Connections {
48 target: mavlink2SigningGroup._mavlink2SigningKey
49 function onRawValueChanged(value) { sendToVehiclePrompt.visible = true }
50 }
51
52 RowLayout {
53 spacing: ScreenTools.defaultFontPixelWidth
54
55 LabelledFactTextField {
56 Layout.fillWidth: true
57 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 32
58 label: qsTr("Key")
59 fact: mavlink2SigningGroup._mavlink2SigningKey
60 }
61
62 QGCButton {
63 text: qsTr("Send to Vehicle")
64 enabled: _activeVehicle
65
66 onClicked: {
67 sendToVehiclePrompt.visible = false
68 _activeVehicle.sendSetupSigning()
69 }
70 }
71 }
72
73 QGCLabel {
74 id: sendToVehiclePrompt
75 Layout.fillWidth: true
76 text: qsTr("Signing key has changed. Don't forget to send to Vehicle(s) if needed.")
77 visible: false
78 }
79 }
80
81 SettingsGroupLayout {
82 Layout.fillWidth: true
83 heading: qsTr("MAVLink Forwarding")
84
85 FactCheckBoxSlider {
86 Layout.fillWidth: true
87 text: qsTr("Enable")
88 fact: _mavlinkSettings.forwardMavlink
89 visible: fact.visible
90 }
91
92 LabelledFactTextField {
93 Layout.fillWidth: true
94 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 20
95 label: qsTr("Host name")
96 fact: _mavlinkSettings.forwardMavlinkHostName
97 visible: fact.visible
98 enabled: _mavlinkSettings.forwardMavlink.rawValue
99 }
100 }
101
102 SettingsGroupLayout {
103 Layout.fillWidth: true
104 heading: qsTr("Logging")
105 visible: !_disableAllDataPersistence
106
107 FactCheckBoxSlider {
108 Layout.fillWidth: true
109 text: qsTr("Save log after each flight")
110 fact: _telemetrySave
111 visible: fact.visible
112 property Fact _telemetrySave: _mavlinkSettings.telemetrySave
113 }
114
115 FactCheckBoxSlider {
116 Layout.fillWidth: true
117 text: qsTr("Save logs even if vehicle was not armed")
118 fact: _telemetrySaveNotArmed
119 visible: fact.visible
120 enabled: _mavlinkSettings.telemetrySave.rawValue
121 property Fact _telemetrySaveNotArmed: _mavlinkSettings.telemetrySaveNotArmed
122 }
123
124 FactCheckBoxSlider {
125 Layout.fillWidth: true
126 text: qsTr("Save CSV log of telemetry data")
127 fact: _saveCsvTelemetry
128 visible: fact.visible
129 property Fact _saveCsvTelemetry: _mavlinkSettings.saveCsvTelemetry
130 }
131 }
132
133 SettingsGroupLayout {
134 Layout.fillWidth: true
135 heading: qsTr("Stream Rates (ArduPilot Only)")
136 visible: _showAPMStreamRates
137
138 QGCCheckBoxSlider {
139 id: controllerByVehicleCheckBox
140 Layout.fillWidth: true
141 text: qsTr("Controlled By vehicle")
142 checked: !_apmStartMavlinkStreams.rawValue
143 onClicked: _apmStartMavlinkStreams.rawValue = !checked
144 }
145
146 LabelledFactComboBox {
147 Layout.fillWidth: true
148 label: qsTr("Raw Sensors")
149 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateRawSensors
150 indexModel: false
151 enabled: !controllerByVehicleCheckBox.checked
152 }
153
154 LabelledFactComboBox {
155 Layout.fillWidth: true
156 label: qsTr("Extended Status")
157 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtendedStatus
158 indexModel: false
159 enabled: !controllerByVehicleCheckBox.checked
160 }
161
162 LabelledFactComboBox {
163 Layout.fillWidth: true
164 label: qsTr("RC Channels")
165 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateRCChannels
166 indexModel: false
167 enabled: !controllerByVehicleCheckBox.checked
168 }
169
170 LabelledFactComboBox {
171 Layout.fillWidth: true
172 label: qsTr("Position")
173 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRatePosition
174 indexModel: false
175 enabled: !controllerByVehicleCheckBox.checked
176 }
177
178 LabelledFactComboBox {
179 Layout.fillWidth: true
180 label: qsTr("Extra 1")
181 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra1
182 indexModel: false
183 enabled: !controllerByVehicleCheckBox.checked
184 }
185
186 LabelledFactComboBox {
187 Layout.fillWidth: true
188 label: qsTr("Extra 2")
189 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra2
190 indexModel: false
191 enabled: !controllerByVehicleCheckBox.checked
192 }
193
194 LabelledFactComboBox {
195 Layout.fillWidth: true
196 label: qsTr("Extra 3")
197 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra3
198 indexModel: false
199 enabled: !controllerByVehicleCheckBox.checked
200 }
201 }
202
203 SettingsGroupLayout {
204 Layout.fillWidth: true
205 heading: qsTr("Link Status (Current Vehicle))")
206
207 LabelledLabel {
208 Layout.fillWidth: true
209 label: qsTr("Total messages sent (computed)")
210 labelText: _activeVehicle ? _activeVehicle.mavlinkSentCount : _notConnectedStr
211 }
212
213 LabelledLabel {
214 Layout.fillWidth: true
215 label: qsTr("Total messages received")
216 labelText: _activeVehicle ? _activeVehicle.mavlinkReceivedCount : _notConnectedStr
217 }
218
219 LabelledLabel {
220 Layout.fillWidth: true
221 label: qsTr("Total message loss")
222 labelText: _activeVehicle ? _activeVehicle.mavlinkLossCount : _notConnectedStr
223 }
224
225 LabelledLabel {
226 Layout.fillWidth: true
227 label: qsTr("Loss rate:")
228 labelText: _activeVehicle ? _activeVehicle.mavlinkLossPercent.toFixed(0) + '%' : _notConnectedStr
229 }
230
231 LabelledLabel {
232 Layout.fillWidth: true
233 label: qsTr("Signing:")
234 labelText: _activeVehicle ? (_activeVehicle.mavlinkSigning ? "On" : "Off") : _notConnectedStr
235 }
236 }
237}