Commit 701f3da2 authored by Pierre TILAK's avatar Pierre TILAK

Compass Add setting to concatenate indicators

- Remove HomeHeading / COG / HeadingToNext
- Add setting AdditionalIndicatorsCompass that group the previous
  settings
parent d732579a
......@@ -41,7 +41,7 @@ Item {
property real _courseOverGround:activeVehicle ? activeVehicle.gps.courseOverGround.rawValue : 0
function isCOGAngleOK(){
if(_groundSpeed < 0.5 && _showCOGAngleCompass){
if(_groundSpeed < 0.5 && _showAdditionalIndicatorsCompass){
return false
}
else{
......@@ -49,21 +49,19 @@ Item {
}
}
function isHeadingAngleOK(){
return vehicle && _showHomeHeadingCompass && !isNaN(_headingToHome)
function isHeadingHomeOK(){
return vehicle && _showAdditionalIndicatorsCompass && !isNaN(_headingToHome)
}
function isHeadingToNextWPOK(){
return vehicle && _showHeadingToNextWP && !isNaN(_headingToNextWP)
return vehicle && _showAdditionalIndicatorsCompass && !isNaN(_headingToNextWP)
}
function isNorthUpLocked(){
return _lockNorthUpCompass
}
readonly property bool _showHomeHeadingCompass: QGroundControl.settingsManager.flyViewSettings.showHomeHeadingCompass.value
readonly property bool _showCOGAngleCompass: QGroundControl.settingsManager.flyViewSettings.showCOGAngleCompass.value
readonly property bool _showHeadingToNextWP: QGroundControl.settingsManager.flyViewSettings.showHeadingToNextWP.value
readonly property bool _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass.value
readonly property bool _lockNorthUpCompass: QGroundControl.settingsManager.flyViewSettings.lockNorthUpCompass.value
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
......@@ -132,12 +130,11 @@ Item {
Image {
id: homePointer
width: size * 0.1
source: isHeadingAngleOK() ? "/qmlimages/Home.svg" : ""
source: isHeadingHomeOK() ? "/qmlimages/Home.svg" : ""
mipmap: true
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
sourceSize.width: width
visible: _showHomeHeadingCompass
transform: Translate {
property double _angle: isNorthUpLocked()?-_heading+_headingToHome:_headingToHome
......
......@@ -26,20 +26,8 @@
"defaultValue": false
},
{
"name": "showHomeHeadingCompass",
"shortDescription": "Show/Hide Home heading on Compass",
"type": "bool",
"defaultValue": false
},
{
"name": "showCOGAngleCompass",
"shortDescription": "Show/Hide Course Over Ground angle on Compass",
"type": "bool",
"defaultValue": false
},
{
"name": "showHeadingToNextWP",
"shortDescription": "Show/Hide Heading to Next Waypoint on Compass",
"name": "showAdditionalIndicatorsCompass",
"shortDescription": "Show additional heading indicators on Compass",
"type": "bool",
"defaultValue": false
},
......
......@@ -21,7 +21,5 @@ DECLARE_SETTINGSFACT(FlyViewSettings, guidedMinimumAltitude)
DECLARE_SETTINGSFACT(FlyViewSettings, guidedMaximumAltitude)
DECLARE_SETTINGSFACT(FlyViewSettings, showLogReplayStatusBar)
DECLARE_SETTINGSFACT(FlyViewSettings, alternateInstrumentPanel)
DECLARE_SETTINGSFACT(FlyViewSettings, showHomeHeadingCompass)
DECLARE_SETTINGSFACT(FlyViewSettings, showCOGAngleCompass)
DECLARE_SETTINGSFACT(FlyViewSettings, showHeadingToNextWP)
DECLARE_SETTINGSFACT(FlyViewSettings, showAdditionalIndicatorsCompass)
DECLARE_SETTINGSFACT(FlyViewSettings, lockNorthUpCompass)
......@@ -23,8 +23,6 @@ public:
DEFINE_SETTINGFACT(guidedMaximumAltitude)
DEFINE_SETTINGFACT(showLogReplayStatusBar)
DEFINE_SETTINGFACT(alternateInstrumentPanel)
DEFINE_SETTINGFACT(showHomeHeadingCompass)
DEFINE_SETTINGFACT(showCOGAngleCompass)
DEFINE_SETTINGFACT(showHeadingToNextWP)
DEFINE_SETTINGFACT(showAdditionalIndicatorsCompass)
DEFINE_SETTINGFACT(lockNorthUpCompass)
};
......@@ -476,25 +476,11 @@ Rectangle {
property Fact _alternateInstrumentPanel: QGroundControl.settingsManager.flyViewSettings.alternateInstrumentPanel
}
FactCheckBox {
text: qsTr("Show/Hide Home heading on Compass")
visible: _showHomeHeadingCompass.visible
fact: _showHomeHeadingCompass
text: qsTr("Show additional heading indicators on Compass")
visible: _showAdditionalIndicatorsCompass.visible
fact: _showAdditionalIndicatorsCompass
property Fact _showHomeHeadingCompass: QGroundControl.settingsManager.flyViewSettings.showHomeHeadingCompass
}
FactCheckBox {
text: qsTr("Show/Hide Course Over Ground angle on Compass")
visible: _showCOGAngleCompass.visible
fact: _showCOGAngleCompass
property Fact _showCOGAngleCompass: QGroundControl.settingsManager.flyViewSettings.showCOGAngleCompass
}
FactCheckBox {
text: qsTr("Show/Hide Heading to Next Waypoint on Compass")
visible: _showHeadingToNextWP.visible
fact: _showHeadingToNextWP
property Fact _showHeadingToNextWP: QGroundControl.settingsManager.flyViewSettings.showHeadingToNextWP
property Fact _showAdditionalIndicatorsCompass: QGroundControl.settingsManager.flyViewSettings.showAdditionalIndicatorsCompass
}
FactCheckBox {
text: qsTr("Lock North up on Compass")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment