7import QGroundControl.FactControls
8import QGroundControl.Controls
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
22 Layout.fillWidth: true
23 heading: qsTr("Ground Station")
25 LabelledFactTextField {
26 Layout.fillWidth: true
27 label: qsTr("MAVLink System ID")
28 fact: _mavlinkSettings.gcsMavlinkSystemID
32 Layout.fillWidth: true
33 text: qsTr("Emit heartbeat")
34 fact: _mavlinkSettings.sendGCSHeartbeat
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
45 property Fact _mavlink2SigningKey: _mavlinkSettings.mavlink2SigningKey
48 target: mavlink2SigningGroup._mavlink2SigningKey
49 function onRawValueChanged(value) { sendToVehiclePrompt.visible = true }
53 spacing: ScreenTools.defaultFontPixelWidth
55 LabelledFactTextField {
56 Layout.fillWidth: true
57 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 32
59 fact: mavlink2SigningGroup._mavlink2SigningKey
63 text: qsTr("Send to Vehicle")
64 enabled: _activeVehicle
67 sendToVehiclePrompt.visible = false
68 _activeVehicle.sendSetupSigning()
74 id: sendToVehiclePrompt
75 Layout.fillWidth: true
76 text: qsTr("Signing key has changed. Don't forget to send to Vehicle(s) if needed.")
82 Layout.fillWidth: true
83 heading: qsTr("MAVLink Forwarding")
86 Layout.fillWidth: true
88 fact: _mavlinkSettings.forwardMavlink
92 LabelledFactTextField {
93 Layout.fillWidth: true
94 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 20
95 label: qsTr("Host name")
96 fact: _mavlinkSettings.forwardMavlinkHostName
98 enabled: _mavlinkSettings.forwardMavlink.rawValue
102 SettingsGroupLayout {
103 Layout.fillWidth: true
104 heading: qsTr("Logging")
105 visible: !_disableAllDataPersistence
108 Layout.fillWidth: true
109 text: qsTr("Save log after each flight")
111 visible: fact.visible
112 property Fact _telemetrySave: _mavlinkSettings.telemetrySave
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
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
133 SettingsGroupLayout {
134 Layout.fillWidth: true
135 heading: qsTr("Stream Rates (ArduPilot Only)")
136 visible: _showAPMStreamRates
139 id: controllerByVehicleCheckBox
140 Layout.fillWidth: true
141 text: qsTr("Controlled By vehicle")
142 checked: !_apmStartMavlinkStreams.rawValue
143 onClicked: _apmStartMavlinkStreams.rawValue = !checked
146 LabelledFactComboBox {
147 Layout.fillWidth: true
148 label: qsTr("Raw Sensors")
149 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateRawSensors
151 enabled: !controllerByVehicleCheckBox.checked
154 LabelledFactComboBox {
155 Layout.fillWidth: true
156 label: qsTr("Extended Status")
157 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtendedStatus
159 enabled: !controllerByVehicleCheckBox.checked
162 LabelledFactComboBox {
163 Layout.fillWidth: true
164 label: qsTr("RC Channels")
165 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateRCChannels
167 enabled: !controllerByVehicleCheckBox.checked
170 LabelledFactComboBox {
171 Layout.fillWidth: true
172 label: qsTr("Position")
173 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRatePosition
175 enabled: !controllerByVehicleCheckBox.checked
178 LabelledFactComboBox {
179 Layout.fillWidth: true
180 label: qsTr("Extra 1")
181 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra1
183 enabled: !controllerByVehicleCheckBox.checked
186 LabelledFactComboBox {
187 Layout.fillWidth: true
188 label: qsTr("Extra 2")
189 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra2
191 enabled: !controllerByVehicleCheckBox.checked
194 LabelledFactComboBox {
195 Layout.fillWidth: true
196 label: qsTr("Extra 3")
197 fact: _settingsManager.apmMavlinkStreamRateSettings.streamRateExtra3
199 enabled: !controllerByVehicleCheckBox.checked
203 SettingsGroupLayout {
204 Layout.fillWidth: true
205 heading: qsTr("Link Status (Current Vehicle))")
208 Layout.fillWidth: true
209 label: qsTr("Total messages sent (computed)")
210 labelText: _activeVehicle ? _activeVehicle.mavlinkSentCount : _notConnectedStr
214 Layout.fillWidth: true
215 label: qsTr("Total messages received")
216 labelText: _activeVehicle ? _activeVehicle.mavlinkReceivedCount : _notConnectedStr
220 Layout.fillWidth: true
221 label: qsTr("Total message loss")
222 labelText: _activeVehicle ? _activeVehicle.mavlinkLossCount : _notConnectedStr
226 Layout.fillWidth: true
227 label: qsTr("Loss rate:")
228 labelText: _activeVehicle ? _activeVehicle.mavlinkLossPercent.toFixed(0) + '%' : _notConnectedStr
232 Layout.fillWidth: true
233 label: qsTr("Signing:")
234 labelText: _activeVehicle ? (_activeVehicle.mavlinkSigning ? "On" : "Off") : _notConnectedStr