Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote id fronted: hide all indicators if RID comms is not healthy: #10704

Merged
merged 1 commit into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ui/preferences/RemoteIDSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Rectangle {
// Flag to get active vehicle and active RID
property var _activeRID: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager : null

// Healthy connection with RID device
property bool commsGood: _activeVehicle && _activeVehicle.remoteIDManager ? _activeVehicle.remoteIDManager.commsGood : false

// General properties
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property int _regionOperation: QGroundControl.settingsManager.remoteIDSettings.region.value
Expand Down Expand Up @@ -151,6 +154,7 @@ Rectangle {
Layout.preferredWidth: flagsWidth
color: _activeRID ? (_activeVehicle.remoteIDManager.armStatusGood ? qgcPal.colorGreen : qgcPal.colorRed) : qgcPal.colorGrey
radius: radiusFlags
visible: commsGood

QGCLabel {
anchors.fill: parent
Expand Down Expand Up @@ -178,7 +182,7 @@ Rectangle {

QGCLabel {
anchors.fill: parent
text: qsTr("RID COMMS")
text: _activeRID && _activeVehicle.remoteIDManager.commsGood ? qsTr("RID COMMS") : qsTr("NOT CONNECTED")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Expand All @@ -192,6 +196,7 @@ Rectangle {
Layout.preferredWidth: flagsWidth
color: _activeRID ? (_activeVehicle.remoteIDManager.gcsGPSGood ? qgcPal.colorGreen : qgcPal.colorRed) : qgcPal.colorGrey
radius: radiusFlags
visible: commsGood

QGCLabel {
anchors.fill: parent
Expand All @@ -215,6 +220,7 @@ Rectangle {
Layout.preferredWidth: flagsWidth
color: _activeRID ? (_activeVehicle.remoteIDManager.basicIDGood ? qgcPal.colorGreen : qgcPal.colorRed) : qgcPal.colorGrey
radius: radiusFlags
visible: commsGood

QGCLabel {
anchors.fill: parent
Expand All @@ -238,7 +244,7 @@ Rectangle {
Layout.preferredWidth: flagsWidth
color: _activeRID ? (_activeVehicle.remoteIDManager.operatorIDGood ? qgcPal.colorGreen : qgcPal.colorRed) : qgcPal.colorGrey
radius: radiusFlags
visible: _activeRID ? (QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value || _regionOperation == RemoteIDSettings.RegionOperation.EU) : false
visible: commsGood && _activeRID ? (QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value || _regionOperation == RemoteIDSettings.RegionOperation.EU) : false

QGCLabel {
anchors.fill: parent
Expand Down
7 changes: 5 additions & 2 deletions src/ui/toolbar/RemoteIDIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Item {
source: armFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
visible: commsFlag

QGCLabel {
anchors.fill: parent
Expand Down Expand Up @@ -169,7 +170,7 @@ Item {

QGCLabel {
anchors.fill: parent
text: qsTr("RID COMMS")
text: commsFlag ? qsTr("RID COMMS") : qsTr("NOT CONNECTED")
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Expand All @@ -190,6 +191,7 @@ Item {
source: gpsFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
visible: commsFlag

QGCLabel {
anchors.fill: parent
Expand All @@ -214,6 +216,7 @@ Item {
source: basicIDFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
visible: commsFlag

QGCLabel {
anchors.fill: parent
Expand All @@ -238,7 +241,7 @@ Item {
source: operatorIDFlag ? "/qmlimages/RidFlagBackgroundGreen.svg" : "/qmlimages/RidFlagBackgroundRed.svg"
fillMode: Image.PreserveAspectFit
sourceSize.height: height
visible: _activeVehicle ? (QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value || _regionOperation == RemoteIDIndicator.RegionOperation.EU) : false
visible: commsFlag && _activeVehicle ? (QGroundControl.settingsManager.remoteIDSettings.sendOperatorID.value || _regionOperation == RemoteIDIndicator.RegionOperation.EU) : false

QGCLabel {
anchors.fill: parent
Expand Down