Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
7e7c6587
Unverified
Commit
7e7c6587
authored
Aug 16, 2020
by
Don Gagne
Committed by
GitHub
Aug 16, 2020
Browse files
Merge pull request #8994 from DonLakeFlyer/TerrainStatusUnitsConversion
Terrain Status: Convert to app units as needed
parents
36fd25ba
7b2020ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/PlanView/TerrainStatus.qml
View file @
7e7c6587
...
@@ -33,6 +33,7 @@ Rectangle {
...
@@ -33,6 +33,7 @@ Rectangle {
property
real
_minAMSLAltitude
:
isNaN
(
missionController
.
minAMSLAltitude
)
?
0
:
missionController
.
minAMSLAltitude
property
real
_minAMSLAltitude
:
isNaN
(
missionController
.
minAMSLAltitude
)
?
0
:
missionController
.
minAMSLAltitude
property
real
_maxAMSLAltitude
:
isNaN
(
missionController
.
maxAMSLAltitude
)
?
100
:
missionController
.
maxAMSLAltitude
property
real
_maxAMSLAltitude
:
isNaN
(
missionController
.
maxAMSLAltitude
)
?
100
:
missionController
.
maxAMSLAltitude
property
real
_missionDistance
:
isNaN
(
missionController
.
missionDistance
)
?
100
:
missionController
.
missionDistance
property
real
_missionDistance
:
isNaN
(
missionController
.
missionDistance
)
?
100
:
missionController
.
missionDistance
property
var
_unitsConversion
:
QGroundControl
.
unitsConversion
function
yPosFromAlt
(
alt
)
{
function
yPosFromAlt
(
alt
)
{
var
fullHeight
=
terrainProfileFlickable
.
height
var
fullHeight
=
terrainProfileFlickable
.
height
...
@@ -46,9 +47,7 @@ Rectangle {
...
@@ -46,9 +47,7 @@ Rectangle {
anchors.top
:
parent
.
bottom
anchors.top
:
parent
.
bottom
width
:
parent
.
height
width
:
parent
.
height
font.pointSize
:
ScreenTools
.
smallFontPointSize
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Height AMSL (%1)
"
).
arg
(
text
:
qsTr
(
"
Height AMSL (%1)
"
).
arg
(
_unitsConversion
.
appSettingsHorizontalDistanceUnitsString
)
QGroundControl
.
unitsConversion
.
appSettingsHorizontalDistanceUnitsString
)
horizontalAlignment
:
Text
.
AlignHCenter
horizontalAlignment
:
Text
.
AlignHCenter
rotation
:
-
90
rotation
:
-
90
transformOrigin
:
Item
.
TopLeft
transformOrigin
:
Item
.
TopLeft
...
@@ -82,7 +81,7 @@ Rectangle {
...
@@ -82,7 +81,7 @@ Rectangle {
ValueAxis
{
ValueAxis
{
id
:
axisX
id
:
axisX
min
:
0
min
:
0
max
:
missionController
.
missionDistance
max
:
_unitsConversion
.
metersToAppSettingsHorizontalDistanceUnits
(
missionController
.
missionDistance
)
lineVisible
:
true
lineVisible
:
true
labelsFont.family
:
"
Fixed
"
labelsFont.family
:
"
Fixed
"
labelsFont.pointSize
:
ScreenTools
.
smallFontPointSize
labelsFont.pointSize
:
ScreenTools
.
smallFontPointSize
...
@@ -93,8 +92,8 @@ Rectangle {
...
@@ -93,8 +92,8 @@ Rectangle {
ValueAxis
{
ValueAxis
{
id
:
axisY
id
:
axisY
min
:
_minAMSLAltitude
min
:
_unitsConversion
.
metersToAppSettingsVerticalDistanceUnits
(
_minAMSLAltitude
)
max
:
_maxAMSLAltitude
max
:
_unitsConversion
.
metersToAppSettingsVerticalDistanceUnits
(
_maxAMSLAltitude
)
lineVisible
:
true
lineVisible
:
true
labelsFont.family
:
"
Fixed
"
labelsFont.family
:
"
Fixed
"
labelsFont.pointSize
:
ScreenTools
.
smallFontPointSize
labelsFont.pointSize
:
ScreenTools
.
smallFontPointSize
...
@@ -109,8 +108,8 @@ Rectangle {
...
@@ -109,8 +108,8 @@ Rectangle {
axisY
:
axisY
axisY
:
axisY
visible
:
true
visible
:
true
XYPoint
{
x
:
0
;
y
:
_minAMSLAltitude
}
XYPoint
{
x
:
0
;
y
:
_unitsConversion
.
metersToAppSettingsVerticalDistanceUnits
(
_minAMSLAltitude
)
}
XYPoint
{
x
:
_missionDistance
;
y
:
_maxAMSLAltitude
}
XYPoint
{
x
:
_unitsConversion
.
metersToAppSettingsHorizontralDistanceUnits
(
_missionDistance
)
;
y
:
_unitsConversion
.
metersToAppSettingsVerticalDistanceUnits
(
_maxAMSLAltitude
)
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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