1pragma ComponentBehavior: Bound
7import QGroundControl.Controls
8import QGroundControl.FactControls
9import QGroundControl.GPS
11/// Live GNSS receiver status, shared by the GPS indicator and the receiver settings page.
15 property GPSReceiver receiver: QGroundControl.gpsManager.receiver
16 /// The receiver's status Facts.
17 property GPSReceiverFactGroup facts: root.receiver.facts
18 /// Keep the group visible without a receiver, showing disconnectedText.
19 property bool showWhenDisconnected: false
20 property string disconnectedText: qsTr("No GNSS receiver connected.")
22 readonly property bool _connected: root.facts.telemetryAvailable
23 readonly property gpsReceiverPresentation _presentation: root.receiver.activePresentation
24 readonly property bool _surveyConnected: root.receiver.activeBaseMode === BaseModeDefinition.BaseSurveyIn
25 // A finished survey is the moment to keep its position, so the next connection can start as a fixed base.
26 readonly property bool _surveyComplete: root._connected && root._surveyConnected && !root.facts.active.value
27 && root.facts.canSaveCurrentBasePosition
28 readonly property bool _surveySaved: root.facts.currentBasePositionSaved
30 heading: qsTr("GNSS Receiver Status")
31 visible: root._connected || root.receiver.hasReceiver || root.receiver.reconnecting || root.showWhenDisconnected
33 /// A status Fact, labelled with its description.
34 component FactRow: LabelledLabel {
35 required property Fact fact
36 label: fact.shortDescription
37 labelText: fact.enumOrValueString
40 /// A label and a value reported from outside, such as a long endpoint, which wraps instead of widening the panel.
41 component WrappingRow: RowLayout {
42 property alias label: rowLabel.text
43 property alias labelText: rowValue.text
45 spacing: ScreenTools.defaultFontPixelWidth * 2
47 QGCLabel { id: rowLabel }
50 horizontalAlignment: Text.AlignRight
51 wrapMode: Text.WrapAnywhere
56 objectName: "rtkReceiverStatus"
57 text: root.receiver.statusText || root.disconnectedText
61 objectName: "rtkDetectedReceiver"
62 visible: root.receiver.hasReceiver && root.receiver.detectedReceiver.length > 0
63 label: qsTr("Detected")
64 labelText: root.receiver.detectedReceiver
65 labelTextFormat: Text.PlainText
69 objectName: "rtkReceiverIdentity"
70 visible: root._connected && root.receiver.receiverIdentity.length > 0
71 label: qsTr("Receiver")
72 labelText: root.receiver.receiverIdentity
76 objectName: "rtkReceiverEndpoint"
77 visible: root.receiver.hasReceiver && root.receiver.activeEndpoint.length > 0
78 label: qsTr("Connection")
79 labelText: root.receiver.activeEndpoint
82 // Values the receiver does not report are not shown. Each row appears with its value, at the Facts' update rate.
84 objectName: "rtkFixType"
85 fact: root.facts.fixType
86 visible: root._connected && root.facts.fixType.value !== GPSFixQuality.Unknown
90 objectName: "rtkSatellitesInView"
91 fact: root.facts.numSatellites
92 visible: root._connected && root.facts.numSatellites.value >= 0
96 objectName: "rtkSatellitesUsed"
97 fact: root.facts.numSatellitesUsed
98 visible: root._connected && root.facts.numSatellitesUsed.value >= 0
102 objectName: "rtkJamming"
103 fact: root.facts.jammingState
104 visible: root._connected && root.facts.jammingState.rawValue > 0
108 objectName: "rtkSpoofing"
109 fact: root.facts.spoofingState
110 visible: root._connected && root.facts.spoofingState.rawValue > 0
114 objectName: "rtkAntenna"
115 fact: root.facts.antennaState
116 visible: root._connected && root.facts.antennaState.rawValue > 0
120 objectName: "rtkSurveyDuration"
121 label: root._presentation.acceptedObservationTime ? qsTr("Accepted observation time") : qsTr("Duration")
122 fact: root.facts.currentDuration
123 visible: root._connected && root._presentation.reportsSurveyDuration && root._surveyConnected
127 objectName: "rtkSurveyAccuracy"
128 label: root.facts.valid.value ? qsTr("Accuracy") : qsTr("Current Accuracy")
129 fact: root.facts.currentAccuracy
130 visible: root._connected && root._surveyConnected && root.facts.currentAccuracy.value > 0
134 objectName: "rtkSurveyCompletePrompt"
135 visible: root._surveyComplete
136 text: root._surveySaved
137 ? qsTr("Survey position saved. Select Fixed position to start from it next time.")
138 : qsTr("Survey complete. Save this position to start the base from it next time.")
142 objectName: "rtkSurveySaveButton"
143 Layout.fillWidth: true
144 Layout.minimumWidth: 0
146 visible: root._surveyComplete && !root._surveySaved
147 text: qsTr("Save Survey Position")
148 onClicked: QGroundControl.gpsManager.saveCurrentBasePosition()