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
b9e81086
Unverified
Commit
b9e81086
authored
Jan 05, 2019
by
Don Gagne
Committed by
GitHub
Jan 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7127 from DonLakeFlyer/AltMode
Plan: Altitude modes rework
parents
b1c90168
5b2bae59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
50 deletions
+87
-50
SimpleItemEditor.qml
src/PlanView/SimpleItemEditor.qml
+87
-50
No files found.
src/PlanView/SimpleItemEditor.qml
View file @
b9e81086
...
...
@@ -18,23 +18,46 @@ Rectangle {
color
:
qgcPal
.
windowShadeDark
radius
:
_radius
property
bool
_specifiesAltitude
:
missionItem
.
specifiesAltitude
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
_supportsTerrainFrame
:
missionItem
readonly
property
int
_altModeRelative
:
0
readonly
property
int
_altModeAbsolute
:
1
readonly
property
int
_altModeAboveTerrain
:
2
readonly
property
int
_altModeTerrainFrame
:
3
ExclusiveGroup
{
id
:
altRadios
onCurrentChanged
:
{
altModeLabel
.
text
=
Qt
.
binding
(
function
()
{
return
current
.
helpText
})
missionItem
.
altitudeMode
=
current
.
altModeValue
property
bool
_specifiesAltitude
:
missionItem
.
specifiesAltitude
property
real
_margin
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
_supportsTerrainFrame
:
missionItem
property
string
_altModeRelativeHelpText
:
qsTr
(
"
Altitude relative to home altitude
"
)
property
string
_altModeAbsoluteHelpText
:
qsTr
(
"
Altitude above mean sea level
"
)
property
string
_altModeAboveTerrainHelpText
:
qsTr
(
"
Altitude above terrain
\n
Actual AMSL altitude: %1 %2
"
).
arg
(
missionItem
.
amslAltAboveTerrain
.
valueString
).
arg
(
missionItem
.
amslAltAboveTerrain
.
units
)
property
string
_altModeTerrainFrameHelpText
:
qsTr
(
"
Using terrain reference frame
"
)
function
updateAltitudeModeText
()
{
if
(
missionItem
.
altitudeMode
===
_altModeRelative
)
{
altModeLabel
.
text
=
qsTr
(
"
Altitude
"
)
altModeHelp
.
text
=
_altModeRelativeHelpText
}
else
if
(
missionItem
.
altitudeMode
===
_altModeAbsolute
)
{
altModeLabel
.
text
=
qsTr
(
"
Above Mean Sea Level
"
)
altModeHelp
.
text
=
_altModeAbsoluteHelpText
}
else
if
(
missionItem
.
altitudeMode
===
_altModeAboveTerrain
)
{
altModeLabel
.
text
=
qsTr
(
"
Above Terrain
"
)
altModeHelp
.
text
=
Qt
.
binding
(
function
()
{
return
_altModeAboveTerrainHelpText
})
}
else
if
(
missionItem
.
altitudeMode
===
_altModeTerrainFrame
)
{
altModeLabel
.
text
=
qsTr
(
"
Terrain Frame
"
)
altModeHelp
.
text
=
_altModeTerrainFrameHelpText
}
else
{
altModeLabel
.
text
=
qsTr
(
"
Internal Error
"
)
altModeHelp
.
text
=
""
}
}
Component.onCompleted
:
updateAltitudeModeText
()
Connections
{
target
:
missionItem
onAltitudeModeChanged
:
updateAltitudeModeText
()
}
Column
{
id
:
valuesColumn
anchors.margins
:
_margin
...
...
@@ -97,56 +120,70 @@ Rectangle {
anchors.right
:
parent
.
right
spacing
:
_margin
QGCLabel
{
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Altitude
"
)
}
RowLayout
{
QGCRadioButton
{
text
:
qsTr
(
"
Rel
"
)
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeRelative
readonly
property
string
helpText
:
qsTr
(
"
Relative to home altitude
"
)
}
QGCRadioButton
{
text
:
qsTr
(
"
AMSL
"
)
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeAbsolute
readonly
property
string
helpText
:
qsTr
(
"
Above Mean Sea Level
"
)
Item
{
width
:
altHamburger
.
x
+
altHamburger
.
width
height
:
altModeLabel
.
height
QGCLabel
{
id
:
altModeLabel
}
QGCColoredImage
{
id
:
altHamburger
anchors.leftMargin
:
ScreenTools
.
defaultFontPixelWidth
/
4
anchors.left
:
altModeLabel
.
right
anchors.top
:
altModeLabel
.
top
width
:
height
height
:
altModeLabel
.
height
sourceSize.height
:
height
source
:
"
qrc:/qmlimages/Hamburger.svg
"
color
:
qgcPal
.
text
}
QGCRadioButton
{
text
:
qsTr
(
"
AGL
"
)
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeAboveTerrain
property
string
helpText
:
qsTr
(
"
Calculated from terrain data
\n
AMSL Alt
"
)
+
missionItem
.
amslAltAboveTerrain
.
valueString
+
"
"
+
missionItem
.
amslAltAboveTerrain
.
units
QGCMouseArea
{
anchors.fill
:
parent
onClicked
:
altHamburgerMenu
.
popup
()
}
QGCRadioButton
{
text
:
qsTr
(
"
TerrF
"
)
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
visible
:
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeTerrainFrame
readonly
property
string
helpText
:
qsTr
(
"
Using terrain reference frame
"
)
Menu
{
id
:
altHamburgerMenu
MenuItem
{
text
:
qsTr
(
"
Altitude Relative To Home
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
_altModeRelative
onTriggered
:
missionItem
.
altitudeMode
=
_altModeRelative
}
MenuItem
{
text
:
qsTr
(
"
Altitude Above Mean Sea Level
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
_altModeAbsolute
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
onTriggered
:
missionItem
.
altitudeMode
=
_altModeAbsolute
}
MenuItem
{
text
:
qsTr
(
"
Altitude Above Terrain
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
_altModeAboveTerrain
onTriggered
:
missionItem
.
altitudeMode
=
_altModeAboveTerrain
}
MenuItem
{
text
:
qsTr
(
"
Terrain Frame
"
)
checkable
:
true
checked
:
missionItem
.
altitudeMode
===
_altModeTerrainFrame
visible
:
missionItem
.
altitudeMode
===
_altModeTerrainFrame
onTriggered
:
missionItem
.
altitudeMode
=
_altModeTerrainFrame
}
}
}
FactValueSlider
{
fact
:
missionItem
.
altitude
digitCount
:
3
incrementSlots
:
1
FactTextField
{
fact
:
missionItem
.
altitude
}
QGCLabel
{
id
:
altMode
Label
id
:
altMode
Help
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
...
...
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