-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GNSS receiver resilience information
- Loading branch information
1 parent
0251034
commit f978894
Showing
17 changed files
with
460 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
import QtQuick | ||
import QtQuick.Layouts | ||
|
||
import QGroundControl | ||
import QGroundControl.Controls | ||
import QGroundControl.ScreenTools | ||
import QGroundControl.Palette | ||
|
||
//------------------------------------------------------------------------- | ||
//-- GPS Authentication Indicator | ||
Item { | ||
id: control | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
|
||
property bool showIndicator: _activeVehicle.gps.authenticationState.value > 0 | ||
|
||
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
|
||
function authenticationIconColor() { | ||
if (_activeVehicle.gps.authenticationState.value === 0) { | ||
return qgcPal.colorGrey | ||
} else if (_activeVehicle.gps.authenticationState.value === 1) { | ||
return qgcPal.colorYellow | ||
} else if (_activeVehicle.gps.authenticationState.value === 2) { | ||
return qgcPal.colorRed | ||
} else if (_activeVehicle.gps.authenticationState.value === 3) { | ||
return qgcPal.colorGreen | ||
} else if (_activeVehicle.gps.authenticationState.value === 4) { | ||
return qgcPal.colorGrey | ||
} | ||
} | ||
|
||
function getAuthenticationText(){ | ||
if (_activeVehicle.gps.authenticationState.value === 0) { | ||
return qsTr("Unkown") | ||
} else if (_activeVehicle.gps.authenticationState.value === 1) { | ||
return qsTr("Initializing...") | ||
} else if (_activeVehicle.gps.authenticationState.value === 2) { | ||
return qsTr("Failed") | ||
} else if (_activeVehicle.gps.authenticationState.value === 3) { | ||
return qsTr("OK") | ||
} else if (_activeVehicle.gps.authenticationState.value === 4) { | ||
return qsTr("Disabled") | ||
} | ||
return qsTr("n/a") | ||
} | ||
|
||
QGCColoredImage { | ||
id: gpsAuthenticationIcon | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
source: "/qmlimages/GpsAuthentication.svg" | ||
fillMode: Image.PreserveAspectFit | ||
sourceSize.height: height | ||
opacity: 1 | ||
color: authenticationIconColor() | ||
} | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: mainWindow.showIndicatorDrawer(authenticationContentComponent, control) | ||
} | ||
|
||
Component{ | ||
id: authenticationContentComponent | ||
|
||
ColumnLayout{ | ||
spacing: ScreenTools.defaultFontPixelHeight / 2 | ||
|
||
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
|
||
SettingsGroupLayout { | ||
heading: qsTr("GPS Authentication") | ||
contentSpacing: 0 | ||
showDividers: false | ||
|
||
LabelledLabel { | ||
label: qsTr("Status") | ||
labelText: getAuthenticationText() | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2024 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
import QtQuick | ||
import QtQuick.Layouts | ||
|
||
import QGroundControl | ||
import QGroundControl.Controls | ||
import QGroundControl.ScreenTools | ||
import QGroundControl.Palette | ||
|
||
//------------------------------------------------------------------------- | ||
//-- GPS Interference Indicator | ||
Item { | ||
id: control | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
|
||
property bool showIndicator: _activeVehicle.gps.spoofingState.value > 0 || _activeVehicle.gps.jammingState.value > 0 | ||
|
||
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
|
||
function interferenceIconColor() { | ||
if (_activeVehicle.gps.spoofingState.value === 1 && _activeVehicle.gps.jammingState.value === 1) { | ||
return qgcPal.colorWhite | ||
} else if ((_activeVehicle.gps.spoofingState.value === 2 && _activeVehicle.gps.jammingState.value<3) || (_activeVehicle.gps.jammingState.value === 2 && _activeVehicle.gps.spoofingState.value<3)) { | ||
return qgcPal.colorOrange | ||
} else if (_activeVehicle.gps.spoofingState.value === 3 || _activeVehicle.gps.jammingState.value === 3) { | ||
return qgcPal.colorRed | ||
} | ||
return qgcPal.colorGrey | ||
} | ||
|
||
function spoofingText() { | ||
if (_activeVehicle.gps.spoofingState.value === 1) { | ||
return qsTr("OK") | ||
} else if (_activeVehicle.gps.spoofingState.value === 2) { | ||
return qsTr("Mitigated") | ||
} else if (_activeVehicle.gps.spoofingState.value === 3) { | ||
return qsTr("Ongoing") | ||
} | ||
return qsTr("n/a") | ||
} | ||
function jammingText() { | ||
if (_activeVehicle.gps.jammingState.value === 1) { | ||
return qsTr("OK") | ||
} else if (_activeVehicle.gps.jammingState.value === 2) { | ||
return qsTr("Mitigated") | ||
} else if (_activeVehicle.gps.jammingState.value === 3) { | ||
return qsTr("Ongoing") | ||
} | ||
return qsTr("n/a") | ||
} | ||
|
||
function interferenceText() { | ||
if (_activeVehicle.gps.spoofingState.value === 1) { | ||
return qsTr("OK") | ||
} else if (_activeVehicle.gps.spoofingState.value === 2) { | ||
return qsTr("Mitigated") | ||
} else if (_activeVehicle.gps.spoofingState.value === 3) { | ||
return qsTr("Ongoing") | ||
} | ||
return Integer.class.isIntsance(_activeVehicle.gps.spoofingState.value) ? qsTr("N/A") : qsTr("n/a") | ||
} | ||
|
||
QGCColoredImage { | ||
id: gpsSpoofingIcon | ||
width: height | ||
anchors.top: parent.top | ||
anchors.bottom: parent.bottom | ||
source: "/qmlimages/GpsInterference.svg" | ||
fillMode: Image.PreserveAspectFit | ||
sourceSize.height: height | ||
opacity: 1 | ||
color: interferenceIconColor() | ||
} | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: mainWindow.showIndicatorDrawer(gpsSpoofingPopup, control) | ||
} | ||
|
||
Component { | ||
id: gpsSpoofingPopup | ||
|
||
ToolIndicatorPage { | ||
showExpand: expandedComponent ? true : false | ||
contentComponent: spoofingContentComponent | ||
} | ||
} | ||
|
||
Component{ | ||
id: spoofingContentComponent | ||
|
||
ColumnLayout{ | ||
spacing: ScreenTools.defaultFontPixelHeight / 2 | ||
|
||
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle | ||
|
||
SettingsGroupLayout { | ||
heading: qsTr("GPS Interference Status") | ||
showDividers: true | ||
|
||
LabelledLabel { | ||
label: qsTr("GPS Jamming") | ||
labelText: jammingText() | ||
} | ||
|
||
LabelledLabel { | ||
label: qsTr("GPS Spoofing") | ||
labelText: spoofingText() | ||
} | ||
} | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.