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
36186141
Unverified
Commit
36186141
authored
May 23, 2018
by
Don Gagne
Committed by
GitHub
May 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6494 from DonLakeFlyer/AltModeHelp
Better help for alt mode
parents
117e3dde
5c93e8d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+3
-0
SimpleItemEditor.qml
src/PlanView/SimpleItemEditor.qml
+20
-21
No files found.
src/MissionManager/SimpleMissionItem.cc
View file @
36186141
...
@@ -706,13 +706,16 @@ void SimpleMissionItem::_terrainAltChanged(void)
...
@@ -706,13 +706,16 @@ void SimpleMissionItem::_terrainAltChanged(void)
}
}
if
(
qIsNaN
(
terrainAltitude
()))
{
if
(
qIsNaN
(
terrainAltitude
()))
{
qDebug
()
<<
"1"
;
// Set NaNs to signal we are waiting on terrain data
// Set NaNs to signal we are waiting on terrain data
_missionItem
.
_param7Fact
.
setRawValue
(
qQNaN
());
_missionItem
.
_param7Fact
.
setRawValue
(
qQNaN
());
_amslAltAboveTerrainFact
.
setRawValue
(
qQNaN
());
_amslAltAboveTerrainFact
.
setRawValue
(
qQNaN
());
}
else
{
}
else
{
double
newAboveTerrain
=
terrainAltitude
()
+
_altitudeFact
.
rawValue
().
toDouble
();
double
newAboveTerrain
=
terrainAltitude
()
+
_altitudeFact
.
rawValue
().
toDouble
();
double
oldAboveTerrain
=
_amslAltAboveTerrainFact
.
rawValue
().
toDouble
();
double
oldAboveTerrain
=
_amslAltAboveTerrainFact
.
rawValue
().
toDouble
();
qDebug
()
<<
"2"
<<
newAboveTerrain
<<
oldAboveTerrain
;
if
(
qIsNaN
(
oldAboveTerrain
)
||
!
qFuzzyCompare
(
newAboveTerrain
,
oldAboveTerrain
))
{
if
(
qIsNaN
(
oldAboveTerrain
)
||
!
qFuzzyCompare
(
newAboveTerrain
,
oldAboveTerrain
))
{
qDebug
()
<<
"3"
;
_missionItem
.
_param7Fact
.
setRawValue
(
newAboveTerrain
);
_missionItem
.
_param7Fact
.
setRawValue
(
newAboveTerrain
);
_amslAltAboveTerrainFact
.
setRawValue
(
newAboveTerrain
);
_amslAltAboveTerrainFact
.
setRawValue
(
newAboveTerrain
);
}
}
...
...
src/PlanView/SimpleItemEditor.qml
View file @
36186141
...
@@ -29,7 +29,10 @@ Rectangle {
...
@@ -29,7 +29,10 @@ Rectangle {
ExclusiveGroup
{
ExclusiveGroup
{
id
:
altRadios
id
:
altRadios
onCurrentChanged
:
missionItem
.
altitudeMode
=
current
.
altModeValue
onCurrentChanged
:
{
altModeLabel
.
text
=
Qt
.
binding
(
function
()
{
return
current
.
helpText
})
missionItem
.
altitudeMode
=
current
.
altModeValue
}
}
}
Column
{
Column
{
...
@@ -104,29 +107,36 @@ Rectangle {
...
@@ -104,29 +107,36 @@ Rectangle {
text
:
qsTr
(
"
Rel
"
)
text
:
qsTr
(
"
Rel
"
)
exclusiveGroup
:
altRadios
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
checked
:
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeRelative
readonly
property
int
altModeValue
:
_altModeRelative
readonly
property
string
helpText
:
qsTr
(
"
Relative to home altitude
"
)
}
}
QGCRadioButton
{
QGCRadioButton
{
text
:
qsTr
(
"
Abs
"
)
text
:
qsTr
(
"
Abs
"
)
exclusiveGroup
:
altRadios
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
checked
:
missionItem
.
altitudeMode
===
altModeValue
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
missionItem
.
altitudeMode
===
altModeValue
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeAbsolute
readonly
property
int
altModeValue
:
_altModeAbsolute
readonly
property
string
helpText
:
qsTr
(
"
Absolute WGS84
"
)
}
}
QGCRadioButton
{
QGCRadioButton
{
text
:
qsTr
(
"
AGL
"
)
text
:
qsTr
(
"
AGL
"
)
exclusiveGroup
:
altRadios
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
checked
:
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeAboveTerrain
readonly
property
int
altModeValue
:
_altModeAboveTerrain
property
string
helpText
:
qsTr
(
"
Calculated from terrain data
\n
Abs Alt
"
)
+
missionItem
.
amslAltAboveTerrain
.
valueString
+
"
"
+
missionItem
.
amslAltAboveTerrain
.
units
}
}
QGCRadioButton
{
QGCRadioButton
{
text
:
qsTr
(
"
TerrF
"
)
text
:
qsTr
(
"
TerrF
"
)
exclusiveGroup
:
altRadios
exclusiveGroup
:
altRadios
checked
:
missionItem
.
altitudeMode
===
altModeValue
checked
:
missionItem
.
altitudeMode
===
altModeValue
visible
:
missionItem
.
supportsTerrainFrame
||
missionItem
.
altitudeMode
===
altModeValue
visible
:
missionItem
.
supportsTerrainFrame
||
missionItem
.
altitudeMode
===
altModeValue
readonly
property
int
altModeValue
:
_altModeTerrainFrame
}
readonly
property
int
altModeValue
:
_altModeTerrainFrame
readonly
property
string
helpText
:
qsTr
(
"
Using terrain reference frame
"
)
}
}
}
FactValueSlider
{
FactValueSlider
{
...
@@ -135,23 +145,12 @@ Rectangle {
...
@@ -135,23 +145,12 @@ Rectangle {
incrementSlots
:
1
incrementSlots
:
1
}
}
RowLayout
{
spacing
:
_margin
visible
:
missionItem
.
altitudeMode
===
_altModeAboveTerrain
QGCLabel
{
text
:
qsTr
(
"
Calculated Abs Alt
"
)
font.pointSize
:
ScreenTools
.
smallFontPointSize
}
QGCLabel
{
text
:
missionItem
.
amslAltAboveTerrain
.
valueString
+
"
"
+
missionItem
.
amslAltAboveTerrain
.
units
}
}
QGCLabel
{
QGCLabel
{
text
:
qsTr
(
"
Using terrain reference frame
"
)
id
:
altModeLabel
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
font.pointSize
:
ScreenTools
.
smallFontPointSize
visible
:
missionItem
.
altitudeMode
===
_altModeTerrainFrame
}
}
}
}
}
}
...
...
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