5import QGroundControl.Controls
6import QGroundControl.FactControls
8// This indicator page is used both when showing RTK status only with no vehicle connect and when showing GPS/RTK status with a vehicle connected
13 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
14 property string na: qsTr("N/A", "No data to display")
15 property string valueNA: qsTr("–.––", "No data to display")
16 property var rtkSettings: QGroundControl.settingsManager.rtkSettings
17 property var useFixedPosition: rtkSettings.useFixedBasePosition.rawValue
18 property var manufacturer: rtkSettings.baseReceiverManufacturers.rawValue
20 readonly property var _trimble: 0b0001
21 readonly property var _septentrio: 0b0010
22 readonly property var _femtomes: 0b0100
23 readonly property var _ublox: 0b1000
24 readonly property var _all: 0b1111
25 property var settingsDisplayId: _all
27 function updateSettingsDisplayId() {
28 switch(manufacturer) {
30 settingsDisplayId = _trimble | _septentrio | _femtomes | _ublox
33 settingsDisplayId = _trimble
36 settingsDisplayId = _septentrio
39 settingsDisplayId = _femtomes
42 settingsDisplayId = _ublox
45 settingsDisplayId = _all
49 onManufacturerChanged: {
50 updateSettingsDisplayId()
53 Component.onCompleted: {
54 updateSettingsDisplayId()
57 function errorText() {
58 if (!_activeVehicle) {
59 return qsTr("Disconnected");
62 switch (_activeVehicle.gps.systemErrors.value) {
64 return qsTr("Incoming correction");
66 return qsTr("Configuration");
68 return qsTr("Software");
70 return qsTr("Antenna");
72 return qsTr("Event congestion");
74 return qsTr("CPU overload");
76 return qsTr("Output congestion");
78 return qsTr("Multiple errors");
82 contentComponent: Component {
84 spacing: ScreenTools.defaultFontPixelHeight / 2
87 heading: qsTr("Vehicle GPS Status")
88 visible: activeVehicle
91 label: qsTr("Satellites")
92 labelText: activeVehicle ? activeVehicle.gps.count.valueString : na
96 label: qsTr("GPS Lock")
97 labelText: activeVehicle ? activeVehicle.gps.lock.enumStringValue : na
102 labelText: activeVehicle ? activeVehicle.gps.hdop.valueString : valueNA
107 labelText: activeVehicle ? activeVehicle.gps.vdop.valueString : valueNA
111 label: qsTr("Course Over Ground")
112 labelText: activeVehicle ? activeVehicle.gps.courseOverGround.valueString : valueNA
116 label: qsTr("GPS Error")
117 labelText: errorText()
118 visible: activeVehicle && activeVehicle.gps.systemErrors.value > 0
122 SettingsGroupLayout {
123 heading: qsTr("RTK GPS Status")
124 visible: QGroundControl.gpsRtk.connected.value
127 text: (QGroundControl.gpsRtk.active.value) ? qsTr("Survey-in Active") : qsTr("RTK Streaming")
131 label: qsTr("Satellites")
132 labelText: QGroundControl.gpsRtk.numSatellites.value
136 label: qsTr("Duration")
137 labelText: QGroundControl.gpsRtk.currentDuration.value + ' s'
141 label: QGroundControl.gpsRtk.valid.value ? qsTr("Accuracy") : qsTr("Current Accuracy")
142 labelText: QGroundControl.gpsRtk.currentAccuracy.valueString + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString
143 visible: QGroundControl.gpsRtk.currentAccuracy.value > 0
149 expandedComponent: Component {
150 SettingsGroupLayout {
151 heading: qsTr("RTK GPS Settings")
153 property real sliderWidth: ScreenTools.defaultFontPixelWidth * 40
156 Layout.fillWidth: true
157 text: qsTr("AutoConnect")
158 fact: QGroundControl.settingsManager.autoConnectSettings.autoConnectRTKGPS
159 visible: fact.visible
166 text: qsTr("Settings displayed")
169 Layout.fillWidth: true
170 fact: QGroundControl.settingsManager.rtkSettings.baseReceiverManufacturers
171 visible: QGroundControl.settingsManager.rtkSettings.baseReceiverManufacturers.visible
177 text: qsTr("Survey-In")
178 checked: useFixedPosition == BaseModeDefinition.BaseSurveyIn
179 onClicked: rtkSettings.useFixedBasePosition.rawValue = BaseModeDefinition.BaseSurveyIn
180 visible: settingsDisplayId & _all
184 text: qsTr("Specify position")
185 checked: useFixedPosition == BaseModeDefinition.BaseFixed
186 onClicked: rtkSettings.useFixedBasePosition.rawValue = BaseModeDefinition.BaseFixed
187 visible: settingsDisplayId & _all
192 Layout.fillWidth: true
193 Layout.preferredWidth: sliderWidth
194 label: qsTr("Accuracy")
195 fact: QGroundControl.settingsManager.rtkSettings.surveyInAccuracyLimit
196 majorTickStepSize: 0.1
198 useFixedPosition == BaseModeDefinition.BaseSurveyIn
199 && rtkSettings.surveyInAccuracyLimit.visible
200 && (settingsDisplayId & _ublox)
205 Layout.fillWidth: true
206 Layout.preferredWidth: sliderWidth
207 label: qsTr("Min Duration")
208 fact: rtkSettings.surveyInMinObservationDuration
209 majorTickStepSize: 10
211 useFixedPosition == BaseModeDefinition.BaseSurveyIn
212 && rtkSettings.surveyInMinObservationDuration.visible
213 && (settingsDisplayId & (_ublox | _femtomes | _trimble))
217 LabelledFactTextField {
218 label: rtkSettings.fixedBasePositionLatitude.shortDescription
219 fact: rtkSettings.fixedBasePositionLatitude
221 useFixedPosition == BaseModeDefinition.BaseFixed
222 && (settingsDisplayId & _all)
226 LabelledFactTextField {
227 label: rtkSettings.fixedBasePositionLongitude.shortDescription
228 fact: rtkSettings.fixedBasePositionLongitude
230 useFixedPosition == BaseModeDefinition.BaseFixed
231 && (settingsDisplayId & _all)
235 LabelledFactTextField {
236 label: rtkSettings.fixedBasePositionAltitude.shortDescription
237 fact: rtkSettings.fixedBasePositionAltitude
239 useFixedPosition == BaseModeDefinition.BaseFixed
240 && (settingsDisplayId & _all)
244 LabelledFactTextField {
245 label: rtkSettings.fixedBasePositionAccuracy.shortDescription
246 fact: rtkSettings.fixedBasePositionAccuracy
248 useFixedPosition == BaseModeDefinition.BaseFixed
249 && (settingsDisplayId & _ublox)
254 label: qsTr("Current Base Position")
255 buttonText: enabled ? qsTr("Save") : qsTr("Not Yet Valid")
256 visible: useFixedPosition == BaseModeDefinition.BaseFixed
257 enabled: QGroundControl.gpsRtk.valid.value
260 rtkSettings.fixedBasePositionLatitude.rawValue = QGroundControl.gpsRtk.currentLatitude.rawValue
261 rtkSettings.fixedBasePositionLongitude.rawValue = QGroundControl.gpsRtk.currentLongitude.rawValue
262 rtkSettings.fixedBasePositionAltitude.rawValue = QGroundControl.gpsRtk.currentAltitude.rawValue
263 rtkSettings.fixedBasePositionAccuracy.rawValue = QGroundControl.gpsRtk.currentAccuracy.rawValue