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
0f3a3ee2
Commit
0f3a3ee2
authored
Aug 31, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Mission Items to Fly View
parent
81621c14
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
450 additions
and
57 deletions
+450
-57
qgroundcontrol.qrc
qgroundcontrol.qrc
+12
-2
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+20
-17
FlightMap.qml
src/FlightMap/FlightMap.qml
+167
-9
MissionMapItem.qml
src/FlightMap/MapItems/MissionMapItem.qml
+41
-0
qmldir
src/FlightMap/qmldir
+2
-2
MissionItemIndexLabel.qml
src/QmlControls/MissionItemIndexLabel.qml
+24
-0
MissionItemSummary.qml
src/QmlControls/MissionItemSummary.qml
+34
-0
QGroundControl.Controls.qmldir
src/QmlControls/QGroundControl.Controls.qmldir
+23
-20
Vehicle.cc
src/Vehicle/Vehicle.cc
+1
-1
Vehicle.h
src/Vehicle/Vehicle.h
+4
-3
Waypoint.cc
src/Waypoint.cc
+112
-1
Waypoint.h
src/Waypoint.h
+10
-2
No files found.
qgroundcontrol.qrc
View file @
0f3a3ee2
...
...
@@ -70,6 +70,9 @@
<file alias="QGroundControl/FactControls/FactCheckBox.qml">src/FactSystem/FactControls/FactCheckBox.qml</file>
<file alias="QGroundControl/FactControls/FactComboBox.qml">src/FactSystem/FactControls/FactComboBox.qml</file>
<file alias="QGroundControl/Controls/qmldir">src/QmlControls/QGroundControl.Controls.qmldir</file>
<!-- Controls module -->
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCRadioButton.qml">src/QmlControls/QGCRadioButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
...
...
@@ -81,7 +84,6 @@
<file alias="QGroundControl/Controls/QGCMovableItem.qml">src/QmlControls/QGCMovableItem.qml</file>
<file alias="QGroundControl/ScreenTools/qmldir">src/QmlControls/QGroundControl.ScreenTools.qmldir</file>
<file alias="QGroundControl/ScreenTools/ScreenTools.qml">src/QmlControls/ScreenTools.qml</file>
<file alias="ScreenToolsFontQuery.qml">src/QmlControls/ScreenToolsFontQuery.qml</file>
<file alias="QGroundControl/Controls/SubMenuButton.qml">src/QmlControls/SubMenuButton.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
...
...
@@ -94,6 +96,10 @@
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/ModeSwitchDisplay.qml">src/QmlControls/ModeSwitchDisplay.qml</file>
<file alias="QGroundControl/Controls/MissionItemIndexLabel.qml">src/QmlControls/MissionItemIndexLabel.qml</file>
<file alias="QGroundControl/Controls/MissionItemSummary.qml">src/QmlControls/MissionItemSummary.qml</file>
<file alias="ScreenToolsFontQuery.qml">src/QmlControls/ScreenToolsFontQuery.qml</file>
<file alias="ParameterEditorWidget.qml">src/ViewWidgets/ParameterEditorWidget.qml</file>
<file alias="CustomCommandWidget.qml">src/ViewWidgets/CustomCommandWidget.qml</file>
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
...
...
@@ -125,6 +131,7 @@
<file alias="QGroundControl/FlightMap/FlightMap.qml">src/FlightMap/FlightMap.qml</file>
<file alias="QGroundControl/FlightMap/QGCVideoBackground.qml">src/FlightMap/QGCVideoBackground.qml</file>
<!-- FlightMap Widgets -->
<file alias="QGroundControl/FlightMap/QGCAltitudeWidget.qml">src/FlightMap/Widgets/QGCAltitudeWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCArtificialHorizon.qml">src/FlightMap/Widgets/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeWidget.qml">src/FlightMap/Widgets/QGCAttitudeWidget.qml</file>
...
...
@@ -138,8 +145,11 @@
<file alias="QGroundControl/FlightMap/QGCSlider.qml">src/FlightMap/Widgets/QGCSlider.qml</file>
<file alias="QGroundControl/FlightMap/QGCSpeedWidget.qml">src/FlightMap/Widgets/QGCSpeedWidget.qml</file>
<file alias="QGroundControl/FlightMap/QGCWaypointEditor.qml">src/FlightMap/Widgets/QGCWaypointEditor.qml</file>
<file alias="QGroundControl/FlightMap/QGCWaypoint.qml">src/FlightMap/MapItems/QGCWaypoint.qml</file>
<!-- FlightMap MapQuickItems -->
<file alias="QGroundControl/FlightMap/MissionMapItem.qml">src/FlightMap/MapItems/MissionMapItem.qml</file>
<file alias="QGroundControl/FlightMap/VehicleMapItem.qml">src/FlightMap/MapItems/VehicleMapItem.qml</file>
</qresource>
<qresource prefix="/res">
<file alias="LeftArrow">resources/LeftArrow.svg</file>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
0f3a3ee2
...
...
@@ -52,9 +52,11 @@ Item {
property
real
_roll
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
roll
)
?
_defaultRoll
:
_activeVehicle
.
roll
)
:
_defaultRoll
property
real
_pitch
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
pitch
)
?
_defaultPitch
:
_activeVehicle
.
pitch
)
:
_defaultPitch
property
real
_heading
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
heading
)
?
_defaultHeading
:
_activeVehicle
.
heading
)
:
_defaultHeading
property
real
_latitude
:
_activeVehicle
?
((
_activeVehicle
.
latitude
===
0
)
?
_defaultLatitude
:
_activeVehicle
.
latitude
)
:
_defaultLatitude
property
real
_longitude
:
_activeVehicle
?
((
_activeVehicle
.
longitude
===
0
)
?
_defaultLongitude
:
_activeVehicle
.
longitude
)
:
_defaultLongitude
property
real
_heading
:
_activeVehicle
?
(
isNaN
(
_activeVehicle
.
heading
)
?
_defaultHeading
:
_activeVehicle
.
heading
)
:
_defaultHeading
property
real
_altitudeWGS84
:
_activeVehicle
?
_activeVehicle
.
altitudeWGS84
:
_defaultAltitudeWGS84
property
real
_groundSpeed
:
_activeVehicle
?
_activeVehicle
.
groundSpeed
:
_defaultGroundSpeed
property
real
_airSpeed
:
_activeVehicle
?
_activeVehicle
.
airSpeed
:
_defaultAirSpeed
...
...
@@ -69,20 +71,21 @@ Item {
}
FlightMap
{
id
:
flightMap
anchors.fill
:
parent
mapName
:
"
FlightDisplayView
"
latitude
:
_latitude
longitude
:
_longitude
z
:
10
showVehicles
:
true
id
:
flightMap
anchors.fill
:
parent
mapName
:
"
FlightDisplayView
"
latitude
:
parent
.
_latitude
longitude
:
parent
.
_longitude
z
:
10
showVehicles
:
true
showMissionItems
:
true
}
QGCCompassWidget
{
x
:
ScreenTools
.
defaultFontPixelSize
*
(
7.1
)
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
heading
:
_heading
heading
:
parent
.
_heading
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
flightMap
.
z
+
2
}
...
...
@@ -92,8 +95,8 @@ Item {
anchors.right
:
parent
.
right
y
:
ScreenTools
.
defaultFontPixelSize
*
(
0.42
)
size
:
ScreenTools
.
defaultFontPixelSize
*
(
13.3
)
rollAngle
:
_roll
pitchAngle
:
_pitch
rollAngle
:
parent
.
_roll
pitchAngle
:
parent
.
_pitch
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
flightMap
.
z
+
2
}
...
...
@@ -102,7 +105,7 @@ Item {
anchors.right
:
parent
.
right
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
altitude
:
_altitudeWGS84
altitude
:
parent
.
_altitudeWGS84
z
:
30
}
...
...
@@ -110,15 +113,15 @@ Item {
anchors.left
:
parent
.
left
width
:
ScreenTools
.
defaultFontPixelSize
*
(
5
)
height
:
parent
.
height
*
0.65
>
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
?
ScreenTools
.
defaultFontPixelSize
*
(
23.4
)
:
parent
.
height
*
0.65
speed
:
_groundSpeed
speed
:
parent
.
_groundSpeed
z
:
40
}
QGCCurrentSpeed
{
anchors.left
:
parent
.
left
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
airspeed
:
_airSpeed
groundspeed
:
_groundSpeed
airspeed
:
parent
.
_airSpeed
groundspeed
:
parent
.
_groundSpeed
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
50
}
...
...
@@ -126,8 +129,8 @@ Item {
QGCCurrentAltitude
{
anchors.right
:
parent
.
right
width
:
ScreenTools
.
defaultFontPixelSize
*
(
6.25
)
altitude
:
_altitudeWGS84
vertZ
:
_climbRate
altitude
:
parent
.
_altitudeWGS84
vertZ
:
parent
.
_climbRate
active
:
multiVehicleManager
.
activeVehicleAvailable
z
:
60
}
...
...
src/FlightMap/FlightMap.qml
View file @
0f3a3ee2
...
...
@@ -50,12 +50,15 @@ Item {
property
string
mapName
:
'
defaultMap
'
property
alias
mapItem
:
map
property
alias
mapMenu
:
mapTypeMenu
property
bool
showVehicles
:
false
property
bool
showVehicles
:
false
property
bool
showMissionItems
:
false
Component.onCompleted
:
{
map
.
zoomLevel
=
18
mapTypeMenu
.
update
();
addExistingVehicles
()
updateMissionItemsConnections
()
updateMissionItems
()
}
//-- Menu to select supported map types
...
...
@@ -143,7 +146,6 @@ Item {
// we need to keep a separate array of Vehicles which must be at the top level of the object
// hierarchy in order for the dynamically added object to see it.
property
var
_vehicles
:
[]
///< List of known vehicles
property
var
_vehicleMapItems
:
[]
///< List of known vehicle map items
...
...
@@ -155,6 +157,10 @@ Item {
}
function
addVehicle
(
vehicle
)
{
if
(
!
showVehicles
)
{
return
}
var
qmlItemTemplate
=
"
VehicleMapItem {
"
+
"
coordinate: _vehicles[%1].coordinate;
"
+
"
heading: _vehicles[%1].heading
"
+
...
...
@@ -173,6 +179,10 @@ Item {
}
function
removeVehicle
(
vehicle
)
{
if
(
!
showVehicles
)
{
return
}
for
(
var
i
=
0
;
i
<
_vehicles
.
length
;
i
++
)
{
if
(
_vehicles
[
i
]
==
vehicle
)
{
_vehicles
[
i
]
=
undefined
...
...
@@ -184,12 +194,103 @@ Item {
}
function
addExistingVehicles
()
{
if
(
!
showVehicles
)
{
return
}
for
(
var
i
=
0
;
i
<
multiVehicleManager
.
vehicles
.
length
;
i
++
)
{
addVehicle
(
multiVehicleManager
.
vehicles
[
i
])
}
}
// The following code is used to show mission items on the FlightMap
property
var
_missionItems
:
[]
///< List of known vehicles
property
var
_missionMapItems
:
[]
///< List of known vehicle map items
Connections
{
target
:
multiVehicleManager
onActiveVehicleAvailableChanged
:
updateMissionItemsConnections
()
}
function
updateMissionItemsConnections
()
{
if
(
multiVehicleManager
.
activeVehicleAvailable
)
{
multiVehicleManager
.
activeVehicle
.
missionItemsChanged
.
connect
(
updateMissionItems
)
}
else
{
// Previously active vehicle is about to go away, disconnect signals
if
(
multiVehicleManager
.
activeVehicle
)
{
multiVehicleManager
.
activeVehicle
.
missionItemsChanged
.
disconnect
(
updateMissionItems
)
}
}
}
function
addMissionItem
(
missionItem
,
index
)
{
if
(
!
showMissionItems
)
{
console
.
warning
(
"
Shouldn't be called with showMissionItems=false
"
)
return
}
var
qmlItemTemplate
=
"
MissionMapItem {
"
+
"
coordinate: _missionItems[%1].coordinate;
"
+
"
index: %2
"
+
"
}
"
var
i
=
_missionItems
.
length
qmlItemTemplate
=
qmlItemTemplate
.
replace
(
"
%1
"
,
i
)
qmlItemTemplate
=
qmlItemTemplate
.
replace
(
"
%2
"
,
index
+
1
)
_missionItems
.
push
(
missionItem
)
var
mapItem
=
Qt
.
createQmlObject
(
qmlItemTemplate
,
map
)
_missionMapItems
.
push
(
mapItem
)
mapItem
.
z
=
map
.
z
+
1
map
.
addMapItem
(
mapItem
)
}
function
removeMissionItem
(
missionItem
)
{
if
(
!
showMissionItems
)
{
console
.
warning
(
"
Shouldn't be called with showMissionItems=false
"
)
return
}
for
(
var
i
=
0
;
i
<
_missionItems
.
length
;
i
++
)
{
if
(
_missionItems
[
i
]
==
missionItem
)
{
// Qml has an annoying habit of not destroying remove Qml item until it hits the main loop.
// Because of that we need to leave the the mission item references even though we have
// removed the items, otherwise we'll get references to undefined errors until we hit the main
// loop again.
//_missionItems[i] = undefined
map
.
removeMapItem
(
_missionMapItems
[
i
])
_missionMapItems
[
i
]
=
undefined
break
}
}
}
function
updateMissionItems
()
{
if
(
!
showMissionItems
)
{
return
}
var
vehicle
=
multiVehicleManager
.
activeVehicle
if
(
!
vehicle
)
{
console
.
warning
(
"
Why no active vehicle?
"
)
return
}
// Remove previous items
for
(
var
i
=
0
;
i
<
_missionItems
.
length
;
i
++
)
{
removeMissionItem
(
_missionItems
[
i
])
}
_missionMapItems
=
[]
// Add new items
for
(
var
i
=
0
;
i
<
vehicle
.
missionItems
.
length
;
i
++
)
{
addMissionItem
(
vehicle
.
missionItems
[
i
],
i
)
}
}
Plugin
{
id
:
mapPlugin
name
:
"
QGroundControl
"
...
...
@@ -267,8 +368,28 @@ Item {
}
*/
}
/// Mission item list
Row
{
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.left
:
parent
.
left
anchors.right
:
controlWidgets
.
left
anchors.bottom
:
parent
.
bottom
spacing
:
ScreenTools
.
defaultFontPixelWidth
Repeater
{
model
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
missionItems
:
0
MissionItemSummary
{
missionItem
:
modelData
missionItemIndex
:
index
+
1
}
}
}
/// Map control widgets
Column
{
id
:
controlWidgets
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
...
...
@@ -279,23 +400,60 @@ Item {
text
:
"
Options
"
menu
:
mapTypeMenu
}
Row
{
layoutDirection
:
Qt
.
RightToLeft
spacing
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
zoomIncrement
:
1.0
property
real
buttonWidth
:
(
optionsButton
.
width
-
spacing
)
/
2
readonly
property
real
_zoomIncrement
:
1.0
property
real
_buttonWidth
:
(
optionsButton
.
width
-
spacing
)
/
2
NumberAnimation
{
id
:
animateZoom
property
real
startZoom
property
real
endZoom
target
:
map
properties
:
"
zoomLevel
"
from
:
startZoom
to
:
endZoom
duration
:
500
easing
{
type
:
Easing
.
OutExpo
}
}
QGCButton
{
width
:
parent
.
buttonWidth
width
:
parent
.
_
buttonWidth
text
:
"
+
"
onClicked
:
map
.
zoomLevel
=
map
.
zoomLevel
+
parent
.
zoomIncrement
onClicked
:
{
var
endZoomLevel
=
map
.
zoomLevel
+
parent
.
_zoomIncrement
if
(
endZoomLevel
>
map
.
maximumZoomLevel
)
{
endZoomLevel
=
map
.
maximumZoomLevel
}
animateZoom
.
startZoom
=
map
.
zoomLevel
animateZoom
.
endZoom
=
endZoomLevel
animateZoom
.
start
()
}
}
QGCButton
{
width
:
parent
.
buttonWidth
width
:
parent
.
_
buttonWidth
text
:
"
-
"
onClicked
:
map
.
zoomLevel
=
map
.
zoomLevel
-
parent
.
zoomIncrement
onClicked
:
{
var
endZoomLevel
=
map
.
zoomLevel
-
parent
.
_zoomIncrement
if
(
endZoomLevel
<
map
.
minimumZoomLevel
)
{
endZoomLevel
=
map
.
minimumZoomLevel
}
animateZoom
.
startZoom
=
map
.
zoomLevel
animateZoom
.
endZoom
=
endZoomLevel
animateZoom
.
start
()
}
}
}
}
...
...
src/FlightMap/MapItems/
QGCWaypoint
.qml
→
src/FlightMap/MapItems/
MissionMapItem
.qml
View file @
0f3a3ee2
...
...
@@ -21,61 +21,21 @@ This file is part of the QGROUNDCONTROL project
======================================================================*/
/**
* @file
* @brief QGC Waypoint Marker
* @author Gus Grubba <mavlink@grubba.com>
*/
import
QtQuick
2.4
import
QtLocation
5.3
import
Q
tQuick
2.4
import
Q
tLocation
5.3
import
Q
GroundControl
.
ScreenTools
1.0
import
Q
GroundControl
.
Controls
1.0
/// Marker for displaying a mission item on the map
MapQuickItem
{
id
:
marker
property
int
waypointID
:
0
anchorPoint.x
:
markerIcon
.
width
/
2
anchorPoint.y
:
markerIcon
.
height
/
2
sourceItem
:
Rectangle
{
id
:
markerIcon
width
:
30
height
:
30
color
:
markerMouseArea
.
containsMouse
?
(
markerMouseArea
.
pressed
?
Qt
.
rgba
(
0.69
,
0.2
,
0.68
,
0.25
)
:
Qt
.
rgba
(
0.69
,
0.2
,
0.68
,
0.75
))
:
Qt
.
rgba
(
0
,
0
,
0
,
0.5
)
radius
:
8
border.color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.75
)
Text
{
id
:
number
anchors.centerIn
:
parent
font.pixelSize
:
11
font.weight
:
Font
.
DemiBold
color
:
"
white
"
text
:
marker
.
waypointID
}
MouseArea
{
id
:
markerMouseArea
enabled
:
!
map
.
readOnly
anchors.fill
:
parent
hoverEnabled
:
true
drag.target
:
marker
preventStealing
:
true
property
int
pressX
:
-
1
property
int
pressY
:
-
1
property
int
jitterThreshold
:
4
onPressed
:
{
pressX
=
mouse
.
x
;
pressY
=
mouse
.
y
;
map
.
currentMarker
=
-
1
;
for
(
var
i
=
0
;
i
<
map
.
markers
.
length
;
i
++
)
{
if
(
marker
===
map
.
markers
[
i
])
{
map
.
currentMarker
=
i
;
break
;
}
}
}
onPositionChanged
:
{
if
(
Math
.
abs
(
pressX
-
mouse
.
x
)
<
jitterThreshold
&&
Math
.
abs
(
pressY
-
mouse
.
y
)
<
jitterThreshold
)
{
map
.
updateMarker
(
marker
.
coordinate
,
marker
.
waypointID
)
}
}
property
int
index
anchorPoint.x
:
sourceItem
.
width
/
2
anchorPoint.y
:
sourceItem
.
height
/
2
sourceItem
:
MissionItemIndexLabel
{
missionItemIndex
:
index
}
}
}
src/FlightMap/qmldir
View file @
0f3a3ee2
Module QGroundControl.FlightMap
# Main view controls
FlightMap 1.0 FlightMap.qml
FlightMap
1.0 FlightMap.qml
QGCVideoBackground 1.0 QGCVideoBackground.qml
# Widgets
...
...
@@ -21,4 +21,4 @@ QGCWaypointEditor 1.0 QGCWaypointEditor.qml
# MapQuickItems
VehicleMapItem 1.0 VehicleMapItem.qml
QGCWaypoint 1.0 QGCWaypoint
.qml
MissioMapItem 1.0 MissionMapItem
.qml
src/QmlControls/MissionItemIndexLabel.qml
0 → 100644
View file @
0f3a3ee2
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
ScreenTools
1.0
Rectangle
{
property
int
missionItemIndex
///< Index to show in label
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
height
:
width
radius
:
width
/
2
border.width
:
2
border.color
:
"
white
"
color
:
"
orange
"
QGCLabel
{
anchors.fill
:
parent
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
color
:
"
white
"
text
:
missionItemIndex
}
}
src/QmlControls/MissionItemSummary.qml
0 → 100644
View file @
0f3a3ee2
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
ScreenTools
1.0
/// Mission item summary display control
Rectangle
{
property
var
missionItem
///< Mission Item object
property
int
missionItemIndex
///< Index for this item
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
height
:
ScreenTools
.
defaultFontPixelWidth
*
3
border.width
:
2
border.color
:
"
white
"
color
:
"
white
"
opacity
:
0.75
radius
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
anchors.margins
:
parent
.
radius
/
2
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
color
:
"
black
"
horizontalAlignment
:
Text
.
AlignTop
text
:
missionItem
.
type
}
MissionItemIndexLabel
{
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
missionItemIndex
:
parent
.
missionItemIndex
+
1
}
}
src/QmlControls/QGroundControl.Controls.qmldir
View file @
0f3a3ee2
Module QGroundControl.Controls
QGCLabel 1.0 QGCLabel.qml
QGCButton 1.0 QGCButton.qml
QGCRadioButton 1.0 QGCRadioButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCTextField 1.0 QGCTextField.qml
QGCComboBox 1.0 QGCComboBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
QGCToolBarButton 1.0 QGCToolBarButton.qml
QGCMovableItem 1.0 QGCMovableItem.qml
QGCLabel
1.0 QGCLabel.qml
QGCButton
1.0 QGCButton.qml
QGCRadioButton
1.0 QGCRadioButton.qml
QGCCheckBox
1.0 QGCCheckBox.qml
QGCTextField
1.0 QGCTextField.qml
QGCComboBox
1.0 QGCComboBox.qml
QGCColoredImage
1.0 QGCColoredImage.qml
QGCToolBarButton
1.0 QGCToolBarButton.qml
QGCMovableItem
1.0 QGCMovableItem.qml
SubMenuButton 1.0 SubMenuButton.qml
IndicatorButton 1.0 IndicatorButton.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml
SubMenuButton
1.0 SubMenuButton.qml
IndicatorButton
1.0 IndicatorButton.qml
VehicleRotationCal
1.0 VehicleRotationCal.qml
VehicleSummaryRow
1.0 VehicleSummaryRow.qml
ViewWidget
1.0 ViewWidget.qml
ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml
ParameterEditor
1.0 ParameterEditor.qml
ParameterEditorDialog
1.0 ParameterEditorDialog.qml
ModeSwitchDisplay 1.0 ModeSwitchDisplay.qml
QGCView 1.0 QGCView.qml
QGCViewPanel 1.0 QGCViewPanel.qml
QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewMessage 1.0 QGCViewMessage.qml
QGCView 1.0 QGCView.qml
QGCViewPanel 1.0 QGCViewPanel.qml
QGCViewDialog 1.0 QGCViewDialog.qml
QGCViewMessage 1.0 QGCViewMessage.qml
MissionItemIndexLabel 1.0 MissionItemIndexLabel.qml
MissionItemSummary 1.0 MissionItemSummary.qml
src/Vehicle/Vehicle.cc
View file @
0f3a3ee2
...
...
@@ -714,7 +714,7 @@ void Vehicle::_waypointViewOnlyListChanged()
Waypoint
*
wp
=
waypoints
[
i
];
_waypoints
.
append
(
new
Waypoint
(
*
wp
));
}
emit
waypoint
sChanged
();
emit
missionItem
sChanged
();
/*
if(_longitude == DEFAULT_LON && _latitude == DEFAULT_LAT && _waypoints.length()) {
_longitude = _waypoints[0]->getLongitude();
...
...
src/Vehicle/Vehicle.h
View file @
0f3a3ee2
...
...
@@ -87,8 +87,9 @@ public:
Q_PROPERTY
(
double
waypointDistance
READ
waypointDistance
NOTIFY
waypointDistanceChanged
)
Q_PROPERTY
(
uint16_t
currentWaypoint
READ
currentWaypoint
NOTIFY
currentWaypointChanged
)
Q_PROPERTY
(
unsigned
int
heartbeatTimeout
READ
heartbeatTimeout
NOTIFY
heartbeatTimeoutChanged
)
//-- Waypoint management
Q_PROPERTY
(
QQmlListProperty
<
Waypoint
>
waypoints
READ
waypoints
NOTIFY
waypoint
sChanged
)
Q_PROPERTY
(
QQmlListProperty
<
Waypoint
>
missionItems
READ
missionItems
NOTIFY
missionItem
sChanged
)
// Property accesors
int
id
(
void
)
{
return
_id
;
}
...
...
@@ -161,7 +162,7 @@ public:
uint16_t
currentWaypoint
()
{
return
_currentWaypoint
;
}
unsigned
int
heartbeatTimeout
()
{
return
_currentHeartbeatTimeout
;
}
QQmlListProperty
<
Waypoint
>
waypoint
s
()
{
return
QQmlListProperty
<
Waypoint
>
(
this
,
_waypoints
);
}
QQmlListProperty
<
Waypoint
>
missionItem
s
()
{
return
QQmlListProperty
<
Waypoint
>
(
this
,
_waypoints
);
}
public
slots
:
void
setLatitude
(
double
latitude
);
...
...
@@ -203,7 +204,7 @@ signals:
void
satelliteLockChanged
();
void
waypointDistanceChanged
();
void
currentWaypointChanged
();
void
waypointsChanged
();
void
missionItemsChanged
();
private
slots
:
void
_mavlinkMessageReceived
(
LinkInterface
*
link
,
mavlink_message_t
message
);
...
...
src/Waypoint.cc
View file @
0f3a3ee2
This diff is collapsed.
Click to expand it.
src/Waypoint.h
View file @
0f3a3ee2
...
...
@@ -37,6 +37,8 @@ This file is part of the PIXHAWK project
#include <QString>
#include <QtQml>
#include <QTextStream>
#include <QGeoCoordinate>
#include "QGCMAVLink.h"
#include "QGC.h"
...
...
@@ -65,6 +67,9 @@ public:
const
Waypoint
&
operator
=
(
const
Waypoint
&
other
);
Q_PROPERTY
(
QGeoCoordinate
coordinate
READ
coordinate
NOTIFY
coordinateChanged
)
Q_PROPERTY
(
QString
type
READ
type
NOTIFY
typeChanged
)
Q_PROPERTY
(
double
longitude
READ
longitude
NOTIFY
longitudeChanged
)
Q_PROPERTY
(
double
latitude
READ
latitude
NOTIFY
latitudeChanged
)
Q_PROPERTY
(
double
altitude
READ
altitude
NOTIFY
altitudeChanged
)
...
...
@@ -161,7 +166,9 @@ public:
void
save
(
QTextStream
&
saveStream
);
bool
load
(
QTextStream
&
loadStream
);
QGeoCoordinate
coordinate
(
void
);
QString
type
(
void
);
protected:
quint16
_id
;
...
...
@@ -227,7 +234,8 @@ signals:
void
latitudeChanged
();
void
longitudeChanged
();
void
altitudeChanged
();
void
coordinateChanged
(
void
);
void
typeChanged
(
QString
type
);
};
QML_DECLARE_TYPE
(
Waypoint
)
...
...
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