Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
719931c5
Commit
719931c5
authored
Jul 15, 2019
by
Pierre TILAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add setting to enable COG/HOME Compass
parent
b5aefa7c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
10 deletions
+50
-10
QGCCompassWidget.qml
src/FlightMap/Widgets/QGCCompassWidget.qml
+19
-10
FlyView.SettingsGroup.json
src/Settings/FlyView.SettingsGroup.json
+12
-0
FlyViewSettings.cc
src/Settings/FlyViewSettings.cc
+2
-0
FlyViewSettings.h
src/Settings/FlyViewSettings.h
+2
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+15
-0
No files found.
src/FlightMap/Widgets/QGCCompassWidget.qml
View file @
719931c5
...
...
@@ -17,10 +17,11 @@
import
QtQuick
2.3
import
QtGraphicalEffects
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Vehicle
1.0
import
QGroundControl
.
Palette
1.0
Item
{
id
:
root
...
...
@@ -37,6 +38,9 @@ Item {
property
real
_headingToHome
:
vehicle
?
vehicle
.
headingToHome
.
rawValue
:
0
property
real
_courseOverGround
:
activeVehicle
?
activeVehicle
.
gps
.
courseOverGround
.
rawValue
:
0
readonly
property
bool
_showHomeHeadingCompass
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showHomeHeadingCompass
.
value
readonly
property
bool
_showCOGAngleCompass
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showCOGAngleCompass
.
value
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
...
...
@@ -67,11 +71,12 @@ Item {
Image
{
id
:
homePointer
width
:
size
*
0.1
source
:
"
/qmlimages/Home.svg
"
source
:
_showHomeHeadingCompass
?
"
/qmlimages/Home.svg
"
:
"
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.centerIn
:
parent
sourceSize.width
:
width
visible
:
_showHomeHeadingCompass
transform
:
Translate
{
x
:
size
/
2.3
*
Math
.
sin
((
-
_heading
+
_headingToHome
)
*
(
3.14
/
180
))
...
...
@@ -95,17 +100,21 @@ Item {
}
Image
{
function
f
(){
console
.
log
(
_heading
-
_courseOverGround
)
}
property
double
test
:
f
()
id
:
cOGPointer
source
:
"
/qmlimages/attitudePointer.svg
"
source
:
_showCOGAngleCompass
?
"
/qmlimages/attitudePointer.svg
"
:
"
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
sourceSize.height
:
parent
.
height
onVisibleChanged
:
{
if
(
visible
)
console
.
log
(
"
is being displayed
"
)
else
console
.
log
(
"
is being hidden
"
)
}
transform
:
Rotation
{
origin.x
:
cOGPointer
.
width
/
2
origin.y
:
cOGPointer
.
height
/
2
...
...
src/Settings/FlyView.SettingsGroup.json
View file @
719931c5
...
...
@@ -24,5 +24,17 @@
"shortDescription"
:
"Use Vertical Instrument Panel instead of the default one"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"showHomeHeadingCompass"
,
"shortDescription"
:
"Show/Hide Home heading on the Compass"
,
"type"
:
"bool"
,
"defaultValue"
:
false
},
{
"name"
:
"showCOGAngleCompass"
,
"shortDescription"
:
"Show/Hide Course Over Ground angle on the Compass"
,
"type"
:
"bool"
,
"defaultValue"
:
false
}
]
src/Settings/FlyViewSettings.cc
View file @
719931c5
...
...
@@ -21,3 +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
)
src/Settings/FlyViewSettings.h
View file @
719931c5
...
...
@@ -23,4 +23,6 @@ public:
DEFINE_SETTINGFACT
(
guidedMaximumAltitude
)
DEFINE_SETTINGFACT
(
showLogReplayStatusBar
)
DEFINE_SETTINGFACT
(
alternateInstrumentPanel
)
DEFINE_SETTINGFACT
(
showHomeHeadingCompass
)
DEFINE_SETTINGFACT
(
showCOGAngleCompass
)
};
src/ui/preferences/GeneralSettings.qml
View file @
719931c5
...
...
@@ -475,6 +475,21 @@ Rectangle {
property
Fact
_alternateInstrumentPanel
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
alternateInstrumentPanel
}
FactCheckBox
{
text
:
qsTr
(
"
Show/Hide Home heading on the Compass
"
)
visible
:
_showHomeHeadingCompass
.
visible
fact
:
_showHomeHeadingCompass
property
Fact
_showHomeHeadingCompass
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showHomeHeadingCompass
}
FactCheckBox
{
text
:
qsTr
(
"
Show/Hide Course Over Ground angle on the Compass
"
)
visible
:
_showCOGAngleCompass
.
visible
fact
:
_showCOGAngleCompass
property
Fact
_showCOGAngleCompass
:
QGroundControl
.
settingsManager
.
flyViewSettings
.
showCOGAngleCompass
}
GridLayout
{
columns
:
2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment