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
2cf4fb88
Commit
2cf4fb88
authored
May 15, 2017
by
Don Gagne
Committed by
GitHub
May 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5153 from DonLakeFlyer/AltSliderUnits
Altitude Slider: Respect app units
parents
c7a9943c
f41429ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
GuidedAltitudeSlider.qml
src/FlightDisplay/GuidedAltitudeSlider.qml
+10
-9
No files found.
src/FlightDisplay/GuidedAltitudeSlider.qml
View file @
2cf4fb88
...
@@ -25,15 +25,15 @@ Rectangle {
...
@@ -25,15 +25,15 @@ Rectangle {
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
var
_activeVehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
property
real
_vehicleAltitude
:
_activeVehicle
?
_activeVehicle
.
altitudeRelative
.
rawValue
:
0
property
real
_vehicleAltitude
:
_activeVehicle
?
_activeVehicle
.
altitudeRelative
.
rawValue
:
0
property
bool
_fixedWing
:
_activeVehicle
?
_activeVehicle
.
fixedWing
:
false
property
bool
_fixedWing
:
_activeVehicle
?
_activeVehicle
.
fixedWing
:
false
property
real
_sliderMaxAlt
:
_fixedWing
?
_guidedSettings
.
fixedWingMaximumAltitude
.
value
:
_guidedSettings
.
vehicleMaximumAltitude
.
v
alue
property
real
_sliderMaxAlt
:
_fixedWing
?
_guidedSettings
.
fixedWingMaximumAltitude
.
rawValue
:
_guidedSettings
.
vehicleMaximumAltitude
.
rawV
alue
property
real
_sliderMinAlt
:
_fixedWing
?
_guidedSettings
.
fixedWingMinimumAltitude
.
value
:
_guidedSettings
.
vehicleMinimumAltitude
.
v
alue
property
real
_sliderMinAlt
:
_fixedWing
?
_guidedSettings
.
fixedWingMinimumAltitude
.
rawValue
:
_guidedSettings
.
vehicleMinimumAltitude
.
rawV
alue
function
reset
()
{
function
reset
()
{
altSlider
.
value
=
0
altSlider
.
value
=
0
}
}
function
getValue
()
{
function
getValue
()
{
return
altField
.
newAltitude
-
_vehicleAltitude
return
altField
.
newAltitude
Meters
-
_vehicleAltitude
}
}
function
log10
(
value
)
{
function
log10
(
value
)
{
...
@@ -62,13 +62,14 @@ Rectangle {
...
@@ -62,13 +62,14 @@ Rectangle {
QGCLabel
{
QGCLabel
{
id
:
altField
id
:
altField
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
text
:
Math
.
abs
(
newAltitude
.
toFixed
(
1
))
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
text
:
newAltitudeAppUnits
+
"
"
+
QGroundControl
.
appSettingsDistanceUnitsString
property
real
altGainRange
:
Math
.
max
(
_sliderMaxAlt
-
_vehicleAltitude
,
0
)
property
real
altGainRange
:
Math
.
max
(
_sliderMaxAlt
-
_vehicleAltitude
,
0
)
property
real
altLossRange
:
Math
.
max
(
_vehicleAltitude
-
_sliderMinAlt
,
0
)
property
real
altLossRange
:
Math
.
max
(
_vehicleAltitude
-
_sliderMinAlt
,
0
)
property
real
altExp
:
Math
.
pow
(
altSlider
.
value
,
3
)
property
real
altExp
:
Math
.
pow
(
altSlider
.
value
,
3
)
property
real
altLossGain
:
altExp
*
(
altSlider
.
value
>
0
?
altGainRange
:
altLossRange
)
property
real
altLossGain
:
altExp
*
(
altSlider
.
value
>
0
?
altGainRange
:
altLossRange
)
property
real
newAltitude
:
_vehicleAltitude
+
altLossGain
// QGroundControl.metersToAppSettingsDistanceUnits(_root._vehicleAltitude + altSlider.value).toFixed(1)
property
real
newAltitudeMeters
:
_vehicleAltitude
+
altLossGain
property
string
newAltitudeAppUnits
:
QGroundControl
.
metersToAppSettingsDistanceUnits
(
newAltitudeMeters
).
toFixed
(
1
)
}
}
}
}
...
...
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