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
a6cffd54
Commit
a6cffd54
authored
Feb 18, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2841 from DonLakeFlyer/Gradient
Plan: Add Gradient to bottom item status
parents
f1075263
fd7afab6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
17 deletions
+24
-17
MissionItemStatus.qml
src/MissionEditor/MissionItemStatus.qml
+22
-16
MissionController.cc
src/MissionManager/MissionController.cc
+2
-1
No files found.
src/MissionEditor/MissionItemStatus.qml
View file @
a6cffd54
...
...
@@ -34,7 +34,7 @@ Rectangle {
property
real
expandedWidth
///< Width of control when expanded
width
:
_expanded
?
expandedWidth
:
_collapsedWidth
height
:
expandLabel
.
y
+
expand
Label
.
height
+
_margins
height
:
azimuthLabel
.
y
+
azimuth
Label
.
height
+
_margins
radius
:
ScreenTools
.
defaultFontPixelWidth
color
:
qgcPal
.
window
opacity
:
0.80
...
...
@@ -44,13 +44,16 @@ Rectangle {
property
real
_collapsedWidth
:
distanceLabel
.
width
+
(
margins
*
2
)
property
bool
_expanded
:
true
property
real
_distance
:
_currentMissionItem
?
_currentMissionItem
.
distance
:
-
1
property
real
_altDifference
:
_currentMissionItem
?
_currentMissionItem
.
altDifference
:
-
1
property
real
_azimuth
:
_currentMissionItem
?
_currentMissionItem
.
azimuth
:
-
1
property
real
_isHomePosition
:
_currentMissionItem
?
_currentMissionItem
.
homePosition
:
false
property
bool
_statusValid
:
_distance
!=
-
1
property
string
_distanceText
:
_statusValid
?
Math
.
round
(
_distance
)
+
"
meters
"
:
""
property
string
_altText
:
_statusValid
?
Math
.
round
(
_altDifference
)
+
"
meters
"
:
""
property
real
_distance
:
_statusValid
?
_currentMissionItem
.
distance
:
0
property
real
_altDifference
:
_statusValid
?
_currentMissionItem
.
altDifference
:
0
property
real
_gradient
:
_statusValid
?
Math
.
atan
(
_currentMissionItem
.
altDifference
/
_currentMissionItem
.
distance
)
:
0
property
real
_gradientPercent
:
isNaN
(
_gradient
)
?
0
:
_gradient
*
100
property
real
_azimuth
:
_statusValid
?
_currentMissionItem
.
azimuth
:
-
1
property
real
_isHomePosition
:
_statusValid
?
_currentMissionItem
.
homePosition
:
false
property
bool
_statusValid
:
currentMissionItem
!=
undefined
property
string
_distanceText
:
_statusValid
?
_distance
.
toFixed
(
2
)
+
"
m
"
:
""
property
string
_altText
:
_statusValid
?
_altDifference
.
toFixed
(
2
)
+
"
m
"
:
""
property
string
_gradientText
:
_statusValid
?
_gradientPercent
.
toFixed
(
0
)
+
"
%
"
:
""
property
string
_azimuthText
:
_statusValid
?
Math
.
round
(
_azimuth
)
:
""
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
...
...
@@ -76,17 +79,17 @@ Rectangle {
}
QGCLabel
{
id
:
azimuth
Label
anchors.left
:
alt
Label
.
left
id
:
gradient
Label
anchors.left
:
distance
Label
.
left
anchors.top
:
altLabel
.
bottom
text
:
"
Azimuth:
"
+
_azimuth
Text
text
:
"
Gradient:
"
+
_gradient
Text
}
QGCLabel
{
id
:
expand
Label
anchors.left
:
azimuth
Label
.
left
anchors.top
:
azimuth
Label
.
bottom
text
:
_expanded
?
"
<<
"
:
"
>>
"
id
:
azimuth
Label
anchors.left
:
distance
Label
.
left
anchors.top
:
gradient
Label
.
bottom
text
:
"
Azimuth:
"
+
_azimuthText
}
QGCFlickable
{
...
...
@@ -128,12 +131,15 @@ Rectangle {
visible
:
object
.
relativeAltitude
?
true
:
(
object
.
homePosition
||
graphAbsolute
)
}
/*
Taking these off for now since there really isn't room for the numbers
QGCLabel {
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: ScreenTools.smallFontPixelSize
text
:
(
object
.
relativeAltitude
?
""
:
"
=
"
)
+
object
.
coordinate
.
altitude
text: (object.relativeAltitude ? "" : "=") + object.coordinate.altitude
.toFixed(0)
}
*/
}
}
...
...
src/MissionManager/MissionController.cc
View file @
a6cffd54
...
...
@@ -778,7 +778,8 @@ bool MissionController::_findLastAltitude(double* lastAltitude)
bool
found
=
false
;
double
foundAltitude
;
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
// Don't use home position
for
(
int
i
=
1
;
i
<
_missionItems
->
count
();
i
++
)
{
MissionItem
*
item
=
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
));
if
(
item
->
specifiesCoordinate
()
&&
!
item
->
standaloneCoordinate
())
{
...
...
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