5import QGroundControl.Controls
6import QGroundControl.FactControls
11 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
13 property bool gpsFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.gcsGPSGood : false
14 property bool basicIDFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.basicIDGood : false
15 property bool armFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.armStatusGood : false
16 property bool commsFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.commsGood : false
17 property bool emergencyDeclared: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.emergencyDeclared : false
18 property bool operatorIDFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.operatorIDGood : false
20 property int _regionOperation: QGroundControl.settingsManager.remoteIDSettings.region.value
22 // Flags visual properties
23 property real flagsWidth: ScreenTools.defaultFontPixelWidth * 10
24 property real flagsHeight: ScreenTools.defaultFontPixelWidth * 5
25 property int radiusFlags: 5
28 property real _margins: ScreenTools.defaultFontPixelWidth
30 enum RegionOperation {
41 enum ClassificationType {
46 function goToSettings() {
47 if (mainWindow.allowViewSwitch()) {
48 mainWindow.closeIndicatorDrawer()
49 globals.commingFromRIDIndicator = true
50 mainWindow.showSettingsTool()
54 contentComponent: Component {
56 width: remoteIDCol.width + ScreenTools.defaultFontPixelWidth * 3
57 height: remoteIDCol.height + ScreenTools.defaultFontPixelHeight * 2 + (emergencyButtonItem.visible ? emergencyButtonItem.height : 0)
58 radius: ScreenTools.defaultFontPixelHeight * 0.5
60 border.color: qgcPal.text
64 spacing: ScreenTools.defaultFontPixelHeight * 0.5
65 width: Math.max(remoteIDGrid.width, remoteIDLabel.width)
66 anchors.margins: ScreenTools.defaultFontPixelHeight
67 anchors.top: parent.top
68 anchors.horizontalCenter: parent.horizontalCenter
72 text: qsTr("RemoteID Status")
74 anchors.horizontalCenter: parent.horizontalCenter
79 anchors.margins: ScreenTools.defaultFontPixelHeight
80 columnSpacing: ScreenTools.defaultFontPixelWidth
81 anchors.horizontalCenter: parent.horizontalCenter
88 source: armFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
89 fillMode: Image.PreserveAspectFit
90 sourceSize.height: height
95 text: qsTr("ARM STATUS")
96 wrapMode: Text.WordWrap
97 horizontalAlignment: Text.AlignHCenter
98 verticalAlignment: Text.AlignVCenter
100 font.pointSize: ScreenTools.smallFontPointSize
105 onClicked: goToSettings()
113 source: commsFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
114 fillMode: Image.PreserveAspectFit
115 sourceSize.height: height
119 text: commsFlag ? qsTr("RID COMMS") : qsTr("NOT CONNECTED")
120 wrapMode: Text.WordWrap
121 horizontalAlignment: Text.AlignHCenter
122 verticalAlignment: Text.AlignVCenter
124 font.pointSize: ScreenTools.smallFontPointSize
129 onClicked: goToSettings()
137 source: gpsFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
138 fillMode: Image.PreserveAspectFit
139 sourceSize.height: height
144 text: qsTr("GCS GPS")
145 wrapMode: Text.WordWrap
146 horizontalAlignment: Text.AlignHCenter
147 verticalAlignment: Text.AlignVCenter
149 font.pointSize: ScreenTools.smallFontPointSize
154 onClicked: goToSettings()
162 source: basicIDFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
163 fillMode: Image.PreserveAspectFit
164 sourceSize.height: height
169 text: qsTr("BASIC ID")
170 wrapMode: Text.WordWrap
171 horizontalAlignment: Text.AlignHCenter
172 verticalAlignment: Text.AlignVCenter
174 font.pointSize: ScreenTools.smallFontPointSize
179 onClicked: goToSettings()
184 id: operatorIDFlagImage
187 source: operatorIDFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
188 fillMode: Image.PreserveAspectFit
189 sourceSize.height: height
190 visible: commsFlag && _activeVehicle ? (QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value || _regionOperation == RemoteIDIndicatorPage.EU) : false
194 text: qsTr("OPERATOR ID")
195 wrapMode: Text.WordWrap
196 horizontalAlignment: Text.AlignHCenter
197 verticalAlignment: Text.AlignVCenter
199 font.pointSize: ScreenTools.smallFontPointSize
204 onClicked: goToSettings()
211 id: emergencyButtonItem
212 anchors.top: remoteIDCol.bottom
213 anchors.left: parent.left
214 anchors.right: parent.right
215 height: emergencyDeclareLabel.height + emergencyButton.height + (_margins * 4)
219 id: emergencyDeclareLabel
220 text: emergencyDeclared ? qsTr("EMERGENCY HAS BEEN DECLARED, Press and Hold for 3 seconds to cancel") : qsTr("Press and Hold below button to declare emergency")
222 anchors.top: parent.top
223 anchors.left: parent.left
224 anchors.right: parent.right
225 anchors.margins: _margins
226 anchors.topMargin: _margins * 3
227 wrapMode: Text.WordWrap
228 horizontalAlignment: Text.AlignHCenter
234 width: flagsWidth * 2
235 height: flagsHeight * 1.5
236 source: "/qmlimages/RidEmergencyBackground.svg"
237 sourceSize.height: height
238 anchors.horizontalCenter: parent.horizontalCenter
239 anchors.top: emergencyDeclareLabel.bottom
240 anchors.margins: _margins
245 text: emergencyDeclared ? qsTr("Clear Emergency") : qsTr("EMERGENCY")
246 wrapMode: Text.WordWrap
247 horizontalAlignment: Text.AlignHCenter
248 verticalAlignment: Text.AlignVCenter
250 font.pointSize: ScreenTools.largeFontPointSize
254 id: emergencyButtonTimer
257 if (emergencyButton.source == "/qmlimages/RidEmergencyBackgroundHighlight.svg" ) {
258 emergencyButton.source = "/qmlimages/RidEmergencyBackground.svg"
260 emergencyButton.source = "/qmlimages/RidEmergencyBackgroundHighlight.svg"
268 onEntered: emergencyButton.source = "/qmlimages/RidEmergencyBackgroundHighlight.svg"
269 onExited: emergencyButton.source = "/qmlimages/RidEmergencyBackground.svg"
270 pressAndHoldInterval: emergencyDeclared ? 3000 : 800
272 if (emergencyButton.source == "/qmlimages/RidEmergencyBackgroundHighlight.svg" ) {
273 emergencyButton.source = "/qmlimages/RidEmergencyBackground.svg"
275 emergencyButton.source = "/qmlimages/RidEmergencyBackgroundHighlight.svg"
277 emergencyButtonTimer.restart()
278 if (_activeVehicle) {
279 _activeVehicle.remoteIDManager.setEmergency(!emergencyDeclared)
288 expandedComponent: Component {
290 spacing: ScreenTools.defaultFontPixelWidth
292 property var remoteIDSettings:QGroundControl.settingsManager.remoteIDSettings
293 property Fact regionFact: remoteIDSettings.region
294 property Fact sendOperatorIdFact: remoteIDSettings.sendOperatorID
295 property Fact locationTypeFact: remoteIDSettings.locationType
296 property Fact operatorIDFact: remoteIDSettings.operatorID
297 property bool isEURegion: regionFact.rawValue == RemoteIDIndicatorPage.EU
298 property bool isFAARegion: regionFact.rawValue == RemoteIDIndicatorPage.FAA
299 property real textFieldWidth: ScreenTools.defaultFontPixelWidth * 24
300 property real textLabelWidth: ScreenTools.defaultFontPixelWidth * 30
305 if (regionFact.rawValue === RemoteIDIndicatorPage.EU) {
306 sendOperatorIdFact.rawValue = true
308 if (regionFact.rawValue === RemoteIDIndicatorPage.FAA) {
309 locationTypeFact.value = RemoteIDIndicatorPage.LocationType.LIVE
315 spacing: ScreenTools.defaultFontPixelHeight / 2
316 Layout.alignment: Qt.AlignTop
319 SettingsGroupLayout {
320 visible: armStatusLabel.labelText !== ""
323 label: qsTr("Arm Status Error")
324 labelText: remoteIDManager.armStatusError
325 Layout.fillWidth: true
329 SettingsGroupLayout {
330 heading: qsTr("Self ID")
331 Layout.fillWidth: true
334 Layout.fillWidth: true
335 spacing: ScreenTools.defaultFontPixelHeight / 2
339 text: qsTr("Broadcast")
341 visible: _fact.visible
342 Layout.fillWidth: true
344 property Fact _fact: remoteIDSettings.sendSelfID
348 text: qsTr("If an emergency is declared, Emergency Text will be broadcast even if Broadcast setting is not enabled.")
349 font.pointSize: ScreenTools.smallFontPointSize
350 wrapMode: Text.WordWrap
351 Layout.preferredWidth: sendSelfIDSlider.width
352 visible: !sendSelfIDSlider._fact.rawValue
356 LabelledFactComboBox {
358 label: qsTr("Broadcast Message")
361 visible: _fact.visible
362 enabled: sendSelfIDSlider._fact.rawValue
363 Layout.fillWidth: true
365 property Fact _fact: remoteIDSettings.selfIDType
368 LabelledFactTextField {
369 label: _fact.shortDescription
371 visible: _fact.visible
372 enabled: sendSelfIDSlider._fact.rawValue
373 textField.maximumLength: 23
374 Layout.fillWidth: true
375 textFieldPreferredWidth: textFieldWidth
377 property Fact _fact: remoteIDSettings.selfIDFree
380 LabelledFactTextField {
381 label: _fact.shortDescription
383 visible: _fact.visible
384 enabled: sendSelfIDSlider._fact.rawValue
385 textField.maximumLength: 23
386 Layout.fillWidth: true
387 textFieldPreferredWidth: textFieldWidth
389 property Fact _fact: remoteIDSettings.selfIDExtended
392 LabelledFactTextField {
393 label: _fact.shortDescription
395 visible: _fact.visible
396 textField.maximumLength: 23
397 Layout.fillWidth: true
398 textFieldPreferredWidth: textFieldWidth
400 property Fact _fact: remoteIDSettings.selfIDEmergency
404 SettingsGroupLayout {
405 Layout.fillWidth: true
406 visible: QGroundControl.corePlugin.showAdvancedUI
409 Layout.fillWidth: true
411 QGCLabel { Layout.fillWidth: true; text: qsTr("Remote ID") }
413 text: qsTr("Configure")