5import QGroundControl.Controls
6import QGroundControl.FactControls
11 property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
13 property bool gpsFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.gcsPositionUsable : false
14 property bool basicIDFlag: _activeVehicle && _activeVehicle.remoteIDManager ? !_activeVehicle.remoteIDManager.vehicleReportsBasicIDMissing : false
15 property bool armFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.armStatusGoodToArm : false
16 property bool commsFlag: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.ridDeviceCommsGood : false
17 property bool emergencyDeclared: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.emergencyDeclared : false
18 property bool operatorIDFlag: QGroundControl.settingsManager.remoteIDSettings.operatorIDValidForRegion
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 bool isEURegion: regionFact.rawValue == RemoteIDIndicatorPage.EU
297 property bool isFAARegion: regionFact.rawValue == RemoteIDIndicatorPage.FAA
298 property real textFieldWidth: ScreenTools.defaultFontPixelWidth * 24
299 property real textLabelWidth: ScreenTools.defaultFontPixelWidth * 30
302 spacing: ScreenTools.defaultFontPixelHeight / 2
303 Layout.alignment: Qt.AlignTop
306 SettingsGroupLayout {
307 visible: armStatusLabel.labelText !== ""
310 label: qsTr("Arm Status Error")
311 labelText: remoteIDManager.armStatusError
312 Layout.fillWidth: true
316 SettingsGroupLayout {
317 heading: qsTr("Self ID")
318 Layout.fillWidth: true
321 Layout.fillWidth: true
322 spacing: ScreenTools.defaultFontPixelHeight / 2
326 text: qsTr("Broadcast")
328 visible: _fact.userVisible
329 Layout.fillWidth: true
331 property Fact _fact: remoteIDSettings.sendSelfID
335 text: qsTr("If an emergency is declared, Emergency Text will be broadcast even if Broadcast setting is not enabled.")
336 font.pointSize: ScreenTools.smallFontPointSize
337 wrapMode: Text.WordWrap
338 Layout.preferredWidth: sendSelfIDSlider.width
339 visible: !sendSelfIDSlider._fact.rawValue
343 LabelledFactComboBox {
345 label: qsTr("Broadcast Message")
348 visible: _fact.userVisible
349 enabled: sendSelfIDSlider._fact.rawValue
350 Layout.fillWidth: true
352 property Fact _fact: remoteIDSettings.selfIDType
355 LabelledFactTextField {
356 label: _fact.shortDescription
358 visible: _fact.userVisible
359 enabled: sendSelfIDSlider._fact.rawValue
360 textField.maximumLength: 23
361 Layout.fillWidth: true
362 textFieldPreferredWidth: textFieldWidth
364 property Fact _fact: remoteIDSettings.selfIDFree
367 LabelledFactTextField {
368 label: _fact.shortDescription
370 visible: _fact.userVisible
371 enabled: sendSelfIDSlider._fact.rawValue
372 textField.maximumLength: 23
373 Layout.fillWidth: true
374 textFieldPreferredWidth: textFieldWidth
376 property Fact _fact: remoteIDSettings.selfIDExtended
379 LabelledFactTextField {
380 label: _fact.shortDescription
382 visible: _fact.userVisible
383 textField.maximumLength: 23
384 Layout.fillWidth: true
385 textFieldPreferredWidth: textFieldWidth
387 property Fact _fact: remoteIDSettings.selfIDEmergency
391 SettingsGroupLayout {
392 Layout.fillWidth: true
393 visible: QGroundControl.corePlugin.showAdvancedUI
396 Layout.fillWidth: true
398 QGCLabel { Layout.fillWidth: true; text: qsTr("Remote ID") }
400 text: qsTr("Configure")