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
80ce7ae0
Commit
80ce7ae0
authored
Aug 13, 2019
by
Stefan Dunca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom-example: Add GPS info to the Vehicle Indicator
parent
f6e72014
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
105 additions
and
54 deletions
+105
-54
CustomFlyView.qml
custom-example/res/CustomFlyView.qml
+105
-54
No files found.
custom-example/res/CustomFlyView.qml
View file @
80ce7ae0
...
...
@@ -266,68 +266,59 @@ Item {
rowSpacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
columns
:
7
anchors.centerIn
:
parent
//-- Chronometer
QGC
ColoredImage
{
//-- Latitude
QGC
Label
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/chronometer.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
text
:
"
lat:
"
}
QGCLabel
{
text
:
{
if
(
activeVehicle
)
return
secondsToHHMMSS
(
activeVehicle
.
getFact
(
"
flightTime
"
).
value
)
return
"
00:00:00
"
}
id
:
firstLabel
text
:
activeVehicle
?
activeVehicle
.
gps
.
lat
.
value
.
toFixed
(
activeVehicle
.
gps
.
lat
.
decimalPlaces
)
:
"
-
"
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
Text
.
AlignLef
t
}
//--
Ground Speed
QGC
ColoredImage
{
//--
Longitude
QGC
Label
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/horizontal_speed.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
text
:
"
lon:
"
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
g
roundSpeed
.
value
.
toFixed
(
1
)
+
'
'
+
activeVehicle
.
groundSpeed
.
units
:
"
0.0
"
text
:
activeVehicle
?
activeVehicle
.
g
ps
.
lon
.
value
.
toFixed
(
activeVehicle
.
gps
.
lon
.
decimalPlaces
)
:
"
-
"
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
firstLabel
.
horizontalAlignmen
t
}
//--
Vertical Speed
QGC
ColoredImage
{
//--
HDOP
QGC
Label
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/vertical_speed.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
text
:
"
HDOP:
"
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
climbRate
.
value
.
toFixed
(
1
)
+
'
'
+
activeVehicle
.
climbRate
.
units
:
"
0.0
"
text
:
activeVehicle
?
activeVehicle
.
gps
.
hdop
.
value
.
toFixed
(
activeVehicle
.
gps
.
hdop
.
decimalPlaces
)
:
"
-
"
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
firstLabel
.
horizontalAlignmen
t
}
//-- Compass
Item
{
Layout.rowSpan
:
2
Layout.rowSpan
:
3
Layout.minimumWidth
:
mainIsMap
?
parent
.
height
*
1.25
:
0
Layout.fillHeight
:
true
Layout.fillWidth
:
true
...
...
@@ -395,6 +386,66 @@ Item {
}
}
//-- Second Row
//-- Chronometer
QGCColoredImage
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/chronometer.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
}
QGCLabel
{
text
:
{
if
(
activeVehicle
)
return
secondsToHHMMSS
(
activeVehicle
.
getFact
(
"
flightTime
"
).
value
)
return
"
00:00:00
"
}
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
firstLabel
.
horizontalAlignment
}
//-- Ground Speed
QGCColoredImage
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/horizontal_speed.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
groundSpeed
.
value
.
toFixed
(
1
)
+
'
'
+
activeVehicle
.
groundSpeed
.
units
:
"
0.0
"
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
firstLabel
.
horizontalAlignment
}
//-- Vertical Speed
QGCColoredImage
{
height
:
_indicatorsHeight
width
:
height
source
:
"
/custom/img/vertical_speed.svg
"
fillMode
:
Image
.
PreserveAspectFit
sourceSize.height
:
height
Layout.alignment
:
Qt
.
AlignVCenter
|
Qt
.
AlignHCenter
color
:
qgcPal
.
text
}
QGCLabel
{
text
:
activeVehicle
?
activeVehicle
.
climbRate
.
value
.
toFixed
(
1
)
+
'
'
+
activeVehicle
.
climbRate
.
units
:
"
0.0
"
color
:
_indicatorsColor
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
firstLabel
.
horizontalAlignment
}
//-- Third Row
//-- Odometer
QGCColoredImage
{
height
:
_indicatorsHeight
...
...
@@ -412,7 +463,7 @@ Item {
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
firstLabel
.
horizontalAlignmen
t
}
//-- Altitude
QGCColoredImage
{
...
...
@@ -431,7 +482,7 @@ Item {
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
firstLabel
.
horizontalAlignmen
t
}
//-- Distance
QGCColoredImage
{
...
...
@@ -450,7 +501,7 @@ Item {
font.pointSize
:
ScreenTools
.
smallFontPointSize
Layout.fillWidth
:
true
Layout.minimumWidth
:
indicatorValueWidth
horizontalAlignment
:
Text
.
AlignRigh
t
horizontalAlignment
:
firstLabel
.
horizontalAlignmen
t
}
}
MouseArea
{
...
...
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