5import QGroundControl.Controls
7//-------------------------------------------------------------------------
8//-- Remote ID Indicator
11 objectName: "toolbar_remoteIDIndicator"
12 width: remoteIDIcon.width * 1.1
13 anchors.top: parent.top
14 anchors.bottom: parent.bottom
16 property bool showIndicator: remoteIDManager.available
18 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
19 property var remoteIDManager: activeVehicle ? activeVehicle.remoteIDManager : null
21 property bool gpsFlag: activeVehicle && remoteIDManager ? remoteIDManager.gcsGPSGood : false
22 property bool basicIDFlag: activeVehicle && remoteIDManager ? remoteIDManager.basicIDGood : false
23 property bool armFlag: activeVehicle && remoteIDManager ? remoteIDManager.armStatusGood : false
24 property bool commsFlag: activeVehicle && remoteIDManager ? remoteIDManager.commsGood : false
25 property bool emergencyDeclared: activeVehicle && remoteIDManager ? remoteIDManager.emergencyDeclared : false
26 property bool operatorIDFlag: activeVehicle && remoteIDManager ? remoteIDManager.operatorIDGood : false
27 property int remoteIDState: getRemoteIDState()
29 property int regionOperation: QGroundControl.settingsManager.remoteIDSettings.region.value
38 enum RegionOperation {
43 function getRidColor() {
44 switch (remoteIDState) {
45 case RemoteIDIndicator.RIDState.HEALTHY:
46 return qgcPal.colorGreen
48 case RemoteIDIndicator.RIDState.WARNING:
49 return qgcPal.colorYellow
51 case RemoteIDIndicator.RIDState.ERROR:
52 return qgcPal.colorRed
54 case RemoteIDIndicator.RIDState.UNAVAILABLE:
55 return qgcPal.colorGrey
58 return qgcPal.colorGrey
62 function getRemoteIDState() {
64 return RemoteIDIndicator.RIDState.UNAVAILABLE
66 // We need to have comms and arm healthy to even be in any other state other than ERROR
67 if (!commsFlag || !armFlag || emergencyDeclared) {
68 return RemoteIDIndicator.RIDState.ERROR
70 if (!gpsFlag || !basicIDFlag) {
71 return RemoteIDIndicator.RIDState.WARNING
73 if (regionOperation == RemoteIDIndicator.RegionOperation.EU || QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value) {
74 if (!operatorIDFlag) {
75 return RemoteIDIndicator.RIDState.WARNING
78 return RemoteIDIndicator.RIDState.HEALTHY
81 function goToSettings() {
82 if (mainWindow.allowViewSwitch()) {
83 globals.commingFromRIDIndicator = true
84 mainWindow.showSettingsTool()
88 QGCPalette { id: qgcPal }
93 anchors.top: parent.top
94 anchors.bottom: parent.bottom
95 source: "/qmlimages/RidIconMan.svg"
97 fillMode: Image.PreserveAspectFit
98 sourceSize.height: height
103 sourceSize.height: height
104 source: "/qmlimages/RidIconText.svg"
105 fillMode: Image.PreserveAspectFit
112 onClicked: mainWindow.showIndicatorDrawer(indicatorPage, control)
118 RemoteIDIndicatorPage { }