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
b5aefa7c
Commit
b5aefa7c
authored
Jul 15, 2019
by
Pierre TILAK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HOME and COG indicator inside Compass
parent
b2c8d991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
8 deletions
+45
-8
QGCCompassWidget.qml
src/FlightMap/Widgets/QGCCompassWidget.qml
+45
-8
No files found.
src/FlightMap/Widgets/QGCCompassWidget.qml
View file @
b5aefa7c
...
...
@@ -30,13 +30,16 @@ Item {
property
real
size
:
_defaultSize
property
var
vehicle
:
null
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
10
)
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
property
int
_fontSize
:
ScreenTools
.
defaultFontPointSize
*
_sizeRatio
property
real
_heading
:
vehicle
?
vehicle
.
heading
.
rawValue
:
0
property
real
_defaultSize
:
ScreenTools
.
defaultFontPixelHeight
*
(
10
)
property
real
_sizeRatio
:
ScreenTools
.
isTinyScreen
?
(
size
/
_defaultSize
)
*
0.5
:
size
/
_defaultSize
property
int
_fontSize
:
ScreenTools
.
defaultFontPointSize
*
_sizeRatio
property
real
_heading
:
vehicle
?
vehicle
.
heading
.
rawValue
:
0
property
real
_headingToHome
:
vehicle
?
vehicle
.
headingToHome
.
rawValue
:
0
property
real
_courseOverGround
:
activeVehicle
?
activeVehicle
.
gps
.
courseOverGround
.
rawValue
:
0
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
Rectangle
{
id
:
borderRect
anchors.fill
:
parent
...
...
@@ -59,10 +62,20 @@ Item {
sourceSize.width
:
width
fillMode
:
Image
.
PreserveAspectFit
anchors.centerIn
:
parent
transform
:
Rotation
{
origin.x
:
pointer
.
width
/
2
origin.y
:
pointer
.
height
/
2
angle
:
_heading
}
Image
{
id
:
homePointer
width
:
size
*
0.1
source
:
"
/qmlimages/Home.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.centerIn
:
parent
sourceSize.width
:
width
transform
:
Translate
{
x
:
size
/
2.3
*
Math
.
sin
((
-
_heading
+
_headingToHome
)
*
(
3.14
/
180
))
y
:
-
size
/
2.3
*
Math
.
cos
((
-
_heading
+
_headingToHome
)
*
(
3.14
/
180
))
}
}
...
...
@@ -74,6 +87,30 @@ Item {
anchors.fill
:
parent
sourceSize.height
:
parent
.
height
color
:
qgcPal
.
text
transform
:
Rotation
{
origin.x
:
compassDial
.
width
/
2
origin.y
:
compassDial
.
height
/
2
angle
:
-
_heading
}
}
Image
{
function
f
(){
console
.
log
(
_heading
-
_courseOverGround
)
}
property
double
test
:
f
()
id
:
cOGPointer
source
:
"
/qmlimages/attitudePointer.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
anchors.fill
:
parent
sourceSize.height
:
parent
.
height
transform
:
Rotation
{
origin.x
:
cOGPointer
.
width
/
2
origin.y
:
cOGPointer
.
height
/
2
angle
:
_courseOverGround
-
_heading
}
}
Rectangle
{
...
...
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