5import QGroundControl.Controls
7//-------------------------------------------------------------------------
8//-- Remote ID Indicator
11 width: remoteIDIcon.width * 1.1
12 anchors.top: parent.top
13 anchors.bottom: parent.bottom
15 property bool showIndicator: remoteIDManager.available
17 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
18 property var remoteIDManager: activeVehicle ? activeVehicle.remoteIDManager : null
20 property bool gpsFlag: activeVehicle && remoteIDManager ? remoteIDManager.gcsGPSGood : false
21 property bool basicIDFlag: activeVehicle && remoteIDManager ? remoteIDManager.basicIDGood : false
22 property bool armFlag: activeVehicle && remoteIDManager ? remoteIDManager.armStatusGood : false
23 property bool commsFlag: activeVehicle && remoteIDManager ? remoteIDManager.commsGood : false
24 property bool emergencyDeclared: activeVehicle && remoteIDManager ? remoteIDManager.emergencyDeclared : false
25 property bool operatorIDFlag: activeVehicle && remoteIDManager ? remoteIDManager.operatorIDGood : false
26 property int remoteIDState: getRemoteIDState()
28 property int regionOperation: QGroundControl.settingsManager.remoteIDSettings.region.value
37 enum RegionOperation {
42 function getRidColor() {
43 switch (remoteIDState) {
44 case RemoteIDIndicator.RIDState.HEALTHY:
45 return qgcPal.colorGreen
47 case RemoteIDIndicator.RIDState.WARNING:
48 return qgcPal.colorYellow
50 case RemoteIDIndicator.RIDState.ERROR:
51 return qgcPal.colorRed
53 case RemoteIDIndicator.RIDState.UNAVAILABLE:
54 return qgcPal.colorGrey
57 return qgcPal.colorGrey
61 function getRemoteIDState() {
63 return RemoteIDIndicator.RIDState.UNAVAILABLE
65 // We need to have comms and arm healthy to even be in any other state other than ERROR
66 if (!commsFlag || !armFlag || emergencyDeclared) {
67 return RemoteIDIndicator.RIDState.ERROR
69 if (!gpsFlag || !basicIDFlag) {
70 return RemoteIDIndicator.RIDState.WARNING
72 if (regionOperation == RemoteIDIndicator.RegionOperation.EU || QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value) {
73 if (!operatorIDFlag) {
74 return RemoteIDIndicator.RIDState.WARNING
77 return RemoteIDIndicator.RIDState.HEALTHY
80 function goToSettings() {
81 if (mainWindow.allowViewSwitch()) {
82 globals.commingFromRIDIndicator = true
83 mainWindow.showSettingsTool()
87 QGCPalette { id: qgcPal }
92 anchors.top: parent.top
93 anchors.bottom: parent.bottom
94 source: "/qmlimages/RidIconMan.svg"
96 fillMode: Image.PreserveAspectFit
97 sourceSize.height: height
102 sourceSize.height: height
103 source: "/qmlimages/RidIconText.svg"
104 fillMode: Image.PreserveAspectFit
111 onClicked: mainWindow.showIndicatorDrawer(indicatorPage, control)
117 RemoteIDIndicatorPage { }