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
c344f24b
Commit
c344f24b
authored
Mar 24, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better mission item indicators, fix click to set waypoint
parent
e5af2eae
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
64 deletions
+77
-64
MissionItemIndicator.qml
src/FlightMap/MapItems/MissionItemIndicator.qml
+1
-0
FWLandingPatternMapVisual.qml
src/MissionEditor/FWLandingPatternMapVisual.qml
+2
-0
MissionItemEditor.qml
src/MissionEditor/MissionItemEditor.qml
+1
-1
MissionItemStatus.qml
src/MissionEditor/MissionItemStatus.qml
+2
-1
MissionSettingsMapVisual.qml
src/MissionEditor/MissionSettingsMapVisual.qml
+1
-1
SimpleItemMapVisual.qml
src/MissionEditor/SimpleItemMapVisual.qml
+1
-1
SurveyMapVisual.qml
src/MissionEditor/SurveyMapVisual.qml
+2
-0
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+5
-5
VisualMissionItem.h
src/MissionManager/VisualMissionItem.h
+1
-0
MissionItemIndexLabel.qml
src/QmlControls/MissionItemIndexLabel.qml
+61
-55
No files found.
src/FlightMap/MapItems/MissionItemIndicator.qml
View file @
c344f24b
...
@@ -32,6 +32,7 @@ MapQuickItem {
...
@@ -32,6 +32,7 @@ MapQuickItem {
id
:
_label
id
:
_label
checked
:
_isCurrentItem
checked
:
_isCurrentItem
label
:
missionItem
?
missionItem
.
abbreviation
:
""
label
:
missionItem
?
missionItem
.
abbreviation
:
""
index
:
missionItem
?
missionItem
.
sequenceNumber
:
0
gimbalYaw
:
missionItem
.
missionGimbalYaw
gimbalYaw
:
missionItem
.
missionGimbalYaw
vehicleYaw
:
missionItem
.
missionVehicleYaw
vehicleYaw
:
missionItem
.
missionVehicleYaw
showGimbalYaw
:
missionItem
.
showMissionGimbalYaw
showGimbalYaw
:
missionItem
.
showMissionGimbalYaw
...
...
src/MissionEditor/FWLandingPatternMapVisual.qml
View file @
c344f24b
...
@@ -204,6 +204,7 @@ Item {
...
@@ -204,6 +204,7 @@ Item {
sourceItem
:
sourceItem
:
MissionItemIndexLabel
{
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
"
Loiter
"
label
:
"
Loiter
"
checked
:
_missionItem
.
isCurrentItem
checked
:
_missionItem
.
isCurrentItem
...
@@ -238,6 +239,7 @@ Item {
...
@@ -238,6 +239,7 @@ Item {
sourceItem
:
sourceItem
:
MissionItemIndexLabel
{
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
"
Land
"
label
:
"
Land
"
checked
:
_missionItem
.
isCurrentItem
checked
:
_missionItem
.
isCurrentItem
...
...
src/MissionEditor/MissionItemEditor.qml
View file @
c344f24b
...
@@ -51,7 +51,7 @@ Rectangle {
...
@@ -51,7 +51,7 @@ Rectangle {
anchors.verticalCenter
:
commandPicker
.
verticalCenter
anchors.verticalCenter
:
commandPicker
.
verticalCenter
anchors.leftMargin
:
_margin
anchors.leftMargin
:
_margin
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
text
:
missionItem
.
abbreviation
text
:
missionItem
.
abbreviation
.
charAt
(
0
)
color
:
_outerTextColor
color
:
_outerTextColor
}
}
...
...
src/MissionEditor/MissionItemStatus.qml
View file @
c344f24b
...
@@ -84,7 +84,8 @@ Rectangle {
...
@@ -84,7 +84,8 @@ Rectangle {
y
:
availableHeight
-
(
availableHeight
*
object
.
altPercent
)
y
:
availableHeight
-
(
availableHeight
*
object
.
altPercent
)
small
:
true
small
:
true
checked
:
object
.
isCurrentItem
checked
:
object
.
isCurrentItem
label
:
object
.
abbreviation
label
:
object
.
abbreviation
.
charAt
(
0
)
index
:
object
.
sequenceNumber
visible
:
object
.
relativeAltitude
?
true
:
(
object
.
homePosition
||
graphAbsolute
)
visible
:
object
.
relativeAltitude
?
true
:
(
object
.
homePosition
||
graphAbsolute
)
}
}
}
}
...
...
src/MissionEditor/MissionSettingsMapVisual.qml
View file @
c344f24b
...
@@ -114,7 +114,7 @@ Item {
...
@@ -114,7 +114,7 @@ Item {
model
:
_missionItem
.
childItems
model
:
_missionItem
.
childItems
delegate
:
MissionItemIndexLabel
{
delegate
:
MissionItemIndexLabel
{
label
:
object
.
abbreviation
label
:
object
.
abbreviation
.
length
===
0
?
object
.
sequenceNumber
:
object
.
abbreviation
.
charAt
(
0
)
checked
:
object
.
isCurrentItem
checked
:
object
.
isCurrentItem
z
:
2
z
:
2
specifiesCoordinate
:
false
specifiesCoordinate
:
false
...
...
src/MissionEditor/SimpleItemMapVisual.qml
View file @
c344f24b
...
@@ -116,7 +116,7 @@ Item {
...
@@ -116,7 +116,7 @@ Item {
delegate
:
MissionItemIndexLabel
{
delegate
:
MissionItemIndexLabel
{
z
:
2
z
:
2
label
:
object
.
abbreviation
label
:
object
.
abbreviation
.
length
===
0
?
object
.
sequenceNumber
:
object
.
abbreviation
.
charAt
(
0
)
checked
:
object
.
isCurrentItem
checked
:
object
.
isCurrentItem
specifiesCoordinate
:
false
specifiesCoordinate
:
false
...
...
src/MissionEditor/SurveyMapVisual.qml
View file @
c344f24b
...
@@ -150,6 +150,7 @@ Item {
...
@@ -150,6 +150,7 @@ Item {
sourceItem
:
sourceItem
:
MissionItemIndexLabel
{
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
"
Entry
"
label
:
"
Entry
"
checked
:
_missionItem
.
isCurrentItem
checked
:
_missionItem
.
isCurrentItem
...
@@ -171,6 +172,7 @@ Item {
...
@@ -171,6 +172,7 @@ Item {
sourceItem
:
sourceItem
:
MissionItemIndexLabel
{
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
"
Exit
"
label
:
"
Exit
"
checked
:
_missionItem
.
isCurrentItem
checked
:
_missionItem
.
isCurrentItem
...
...
src/MissionManager/SimpleMissionItem.cc
View file @
c344f24b
...
@@ -336,15 +336,15 @@ QString SimpleMissionItem::abbreviation() const
...
@@ -336,15 +336,15 @@ QString SimpleMissionItem::abbreviation() const
switch
(
command
())
{
switch
(
command
())
{
default:
default:
return
QString
::
number
(
sequenceNumber
()
);
return
QString
(
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_TAKEOFF
:
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_TAKEOFF
:
return
QStringLiteral
(
"T"
);
return
QStringLiteral
(
"T
akeoff
"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_LAND
:
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_LAND
:
return
QStringLiteral
(
"L"
);
return
QStringLiteral
(
"L
and
"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_TAKEOFF
:
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_TAKEOFF
:
return
QStringLiteral
(
"VT"
);
return
QStringLiteral
(
"VT
OL Takeoff
"
);
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_LAND
:
case
MavlinkQmlSingleton
:
:
MAV_CMD_NAV_VTOL_LAND
:
return
QStringLiteral
(
"V
L
"
);
return
QStringLiteral
(
"V
TOL Land
"
);
}
}
}
}
...
...
src/MissionManager/VisualMissionItem.h
View file @
c344f24b
...
@@ -56,6 +56,7 @@ public:
...
@@ -56,6 +56,7 @@ public:
Q_PROPERTY
(
bool
dirty
READ
dirty
WRITE
setDirty
NOTIFY
dirtyChanged
)
///< Item is dirty and requires save/send
Q_PROPERTY
(
bool
dirty
READ
dirty
WRITE
setDirty
NOTIFY
dirtyChanged
)
///< Item is dirty and requires save/send
Q_PROPERTY
(
bool
isCurrentItem
READ
isCurrentItem
WRITE
setIsCurrentItem
NOTIFY
isCurrentItemChanged
)
Q_PROPERTY
(
bool
isCurrentItem
READ
isCurrentItem
WRITE
setIsCurrentItem
NOTIFY
isCurrentItemChanged
)
Q_PROPERTY
(
int
sequenceNumber
READ
sequenceNumber
WRITE
setSequenceNumber
NOTIFY
sequenceNumberChanged
)
Q_PROPERTY
(
int
sequenceNumber
READ
sequenceNumber
WRITE
setSequenceNumber
NOTIFY
sequenceNumberChanged
)
Q_PROPERTY
(
int
lastSequenceNumber
READ
lastSequenceNumber
NOTIFY
lastSequenceNumberChanged
)
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
specifiesCoordinateChanged
)
///< true: Item is associated with a coordinate position
Q_PROPERTY
(
bool
specifiesCoordinate
READ
specifiesCoordinate
NOTIFY
specifiesCoordinateChanged
)
///< true: Item is associated with a coordinate position
Q_PROPERTY
(
bool
isStandaloneCoordinate
READ
isStandaloneCoordinate
NOTIFY
isStandaloneCoordinateChanged
)
///< true: Waypoint line does not go through item
Q_PROPERTY
(
bool
isStandaloneCoordinate
READ
isStandaloneCoordinate
NOTIFY
isStandaloneCoordinateChanged
)
///< true: Waypoint line does not go through item
Q_PROPERTY
(
bool
specifiesAltitudeOnly
READ
specifiesAltitudeOnly
NOTIFY
specifiesAltitudeOnlyChanged
)
///< true: Item has altitude only, no full coordinate
Q_PROPERTY
(
bool
specifiesAltitudeOnly
READ
specifiesAltitudeOnly
NOTIFY
specifiesAltitudeOnlyChanged
)
///< true: Item has altitude only, no full coordinate
...
...
src/QmlControls/MissionItemIndexLabel.qml
View file @
c344f24b
...
@@ -7,27 +7,34 @@ import QGroundControl.Palette 1.0
...
@@ -7,27 +7,34 @@ import QGroundControl.Palette 1.0
Canvas
{
Canvas
{
id
:
root
id
:
root
width
:
_width
width
:
_width
height
:
width
height
:
_height
signal
clicked
signal
clicked
property
string
label
property
string
label
///< Label to show to the side of the index indicator
property
int
index
:
0
///< Index to show in the indicator, 0 will show label instead
property
bool
checked
:
false
property
bool
checked
:
false
property
bool
small
:
false
property
bool
small
:
false
property
var
color
:
checked
?
"
green
"
:
qgcPal
.
mapButtonHighlight
property
var
color
:
checked
?
"
green
"
:
qgcPal
.
mapButtonHighlight
property
real
anchorPointX
:
_
width
/
2
property
real
anchorPointX
:
_
height
/
2
property
real
anchorPointY
:
_
width
/
2
property
real
anchorPointY
:
_
height
/
2
property
bool
specifiesCoordinate
:
true
property
bool
specifiesCoordinate
:
true
property
real
gimbalYaw
property
real
gimbalYaw
property
real
vehicleYaw
property
real
vehicleYaw
property
bool
showGimbalYaw
:
false
property
bool
showGimbalYaw
:
false
property
real
_width
:
showGimbalYaw
?
_gimbalYawRadius
*
2
:
_indicatorRadius
*
2
property
real
_width
:
showGimbalYaw
?
Math
.
max
(
_gimbalWidth
,
labelControl
.
visible
?
labelControl
.
width
:
indicator
.
width
)
:
(
labelControl
.
visible
?
labelControl
.
width
:
indicator
.
width
)
property
bool
_singleChar
:
_label
.
text
.
length
<=
1
property
real
_height
:
showGimbalYaw
?
_gimbalYawWidth
:
(
labelControl
.
visible
?
labelControl
.
height
:
indicator
.
height
)
property
real
_gimbalYawRadius
:
ScreenTools
.
defaultFontPixelHeight
property
real
_gimbalYawRadius
:
ScreenTools
.
defaultFontPixelHeight
property
real
_indicatorRadius
:
small
?
(
ScreenTools
.
defaultFontPixelHeight
*
ScreenTools
.
smallFontPointRatio
*
1.25
/
2
)
:
(
ScreenTools
.
defaultFontPixelHeight
*
0.66
)
property
real
_gimbalYawWidth
:
_gimbalYawRadius
*
2
property
real
_gimbalRadians
:
degreesToRadians
(
vehicleYaw
+
gimbalYaw
-
90
)
property
real
_indicatorRadius
:
small
?
(
ScreenTools
.
defaultFontPixelHeight
*
ScreenTools
.
smallFontPointRatio
*
1.25
/
2
)
:
(
ScreenTools
.
defaultFontPixelHeight
*
0.66
)
property
real
_gimbalRadians
:
degreesToRadians
(
vehicleYaw
+
gimbalYaw
-
90
)
property
real
_labelMargin
:
2
property
real
_labelRadius
:
_indicatorRadius
+
_labelMargin
property
string
_label
:
index
===
0
?
""
:
label
property
string
_index
:
index
===
0
?
label
:
index
onColorChanged
:
requestPaint
()
onColorChanged
:
requestPaint
()
onShowGimbalYawChanged
:
requestPaint
()
onShowGimbalYawChanged
:
requestPaint
()
...
@@ -54,63 +61,62 @@ Canvas {
...
@@ -54,63 +61,62 @@ Canvas {
}
}
}
}
function
paintSingleCoordinate
(
context
)
{
context
.
beginPath
()
context
.
arc
(
_width
/
2
,
_width
/
2
,
_width
/
2
,
(
Math
.
PI
/
8
)
*
7
,
Math
.
PI
/
8
);
context
.
lineTo
(
_width
/
2
,
_width
*
1.5
)
context
.
closePath
()
context
.
fillStyle
=
color
context
.
fill
()
}
function
paintSingleNoCoordinate
(
context
)
{
context
.
save
()
context
.
beginPath
()
context
.
translate
(
anchorPointX
,
anchorPointY
)
context
.
arc
(
0
,
0
,
_indicatorRadius
,
Math
.
PI
*
2
,
0
);
context
.
closePath
()
context
.
fillStyle
=
color
context
.
fill
()
context
.
restore
()
}
function
paintMultipleCoordinate
(
context
)
{
context
.
arc
(
_width
/
2
,
_width
/
2
,
_width
/
2
,
(
Math
.
PI
/
8
)
*
7
,
(
Math
.
PI
/
2
)
*
3
);
context
.
lineTo
(
_label
.
width
,
0
)
context
.
arc
(
_label
.
width
,
_width
/
2
,
_width
/
2
,
(
Math
.
PI
/
2
)
*
3
,
Math
.
PI
/
2
);
context
.
lineTo
((
_width
/
4
)
*
3
,
_width
)
context
.
lineTo
(
_width
/
2
,
_width
*
1.5
)
}
onPaint
:
{
onPaint
:
{
var
context
=
getContext
(
"
2d
"
)
var
context
=
getContext
(
"
2d
"
)
context
.
clearRect
(
0
,
0
,
width
,
height
)
context
.
clearRect
(
0
,
0
,
width
,
height
)
paintGimbalYaw
(
context
)
paintGimbalYaw
(
context
)
/*
if (_singleChar) {
if (specifiesCoordinate) {
paintSingleCoordinate(context)
} else {
paintSingleNoCoordinate(context)
}
} else {
paintMultipleCoordinate(context)
}
*/
paintSingleNoCoordinate
(
context
)
}
}
Rectangle
{
id
:
labelControl
anchors.leftMargin
:
-
_labelMargin
anchors.topMargin
:
-
_labelMargin
anchors.left
:
indicator
.
left
anchors.top
:
indicator
.
top
height
:
_labelRadius
*
2
width
:
labelControlLabel
.
contentWidth
+
(
_labelMargin
*
3
)
+
indicator
.
width
color
:
"
white
"
opacity
:
0.5
radius
:
_labelRadius
visible
:
_label
.
length
!==
0
}
QGCLabel
{
QGCLabel
{
id
:
_label
id
:
labelControlLabel
anchors.centerIn
:
parent
anchors.leftMargin
:
indicator
.
width
+
_labelMargin
width
:
_indicatorRadius
*
2
anchors.left
:
labelControl
.
left
height
:
width
anchors.rightMargin
:
_labelMargin
horizontalAlignment
:
Text
.
AlignHCenter
anchors.right
:
labelControl
.
right
anchors.top
:
labelControl
.
top
anchors.bottom
:
labelControl
.
bottom
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
"
white
"
color
:
"
white
"
font.pointSize
:
ScreenTools
.
defaultFontPointSize
font.pointSize
:
ScreenTools
.
defaultFontPointSize
fontSizeMode
:
Text
.
HorizontalFit
fontSizeMode
:
Text
.
HorizontalFit
text
:
label
text
:
_label
}
Rectangle
{
id
:
indicator
anchors.horizontalCenter
:
parent
.
left
anchors.verticalCenter
:
parent
.
top
anchors.horizontalCenterOffset
:
anchorPointX
anchors.verticalCenterOffset
:
anchorPointY
width
:
_indicatorRadius
*
2
height
:
width
color
:
root
.
color
radius
:
_indicatorRadius
QGCLabel
{
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
"
white
"
font.pointSize
:
ScreenTools
.
defaultFontPointSize
fontSizeMode
:
Text
.
HorizontalFit
text
:
_index
}
}
}
QGCMouseArea
{
QGCMouseArea
{
...
...
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