Commit 1dbacddf authored by Don Gagne's avatar Don Gagne

New PlanMapItems control

Used to display items associated with Flight Plan on Map
parent fcf2d7a0
...@@ -152,6 +152,7 @@ ...@@ -152,6 +152,7 @@
<file alias="QGroundControl/FlightMap/MissionItemIndicatorDrag.qml">src/FlightMap/MapItems/MissionItemIndicatorDrag.qml</file> <file alias="QGroundControl/FlightMap/MissionItemIndicatorDrag.qml">src/FlightMap/MapItems/MissionItemIndicatorDrag.qml</file>
<file alias="QGroundControl/FlightMap/MissionItemView.qml">src/FlightMap/MapItems/MissionItemView.qml</file> <file alias="QGroundControl/FlightMap/MissionItemView.qml">src/FlightMap/MapItems/MissionItemView.qml</file>
<file alias="QGroundControl/FlightMap/MissionLineView.qml">src/FlightMap/MapItems/MissionLineView.qml</file> <file alias="QGroundControl/FlightMap/MissionLineView.qml">src/FlightMap/MapItems/MissionLineView.qml</file>
<file alias="QGroundControl/FlightMap/PlanMapItems.qml">src/FlightMap/MapItems/PlanMapItems.qml</file>
<file alias="QGroundControl/FlightMap/PolygonEditor.qml">src/FlightMap/MapItems/PolygonEditor.qml</file> <file alias="QGroundControl/FlightMap/PolygonEditor.qml">src/FlightMap/MapItems/PolygonEditor.qml</file>
<file alias="QGroundControl/FlightMap/QGCArtificialHorizon.qml">src/FlightMap/Widgets/QGCArtificialHorizon.qml</file> <file alias="QGroundControl/FlightMap/QGCArtificialHorizon.qml">src/FlightMap/Widgets/QGCArtificialHorizon.qml</file>
<file alias="QGroundControl/FlightMap/QGCAttitudeHUD.qml">src/FlightMap/Widgets/QGCAttitudeHUD.qml</file> <file alias="QGroundControl/FlightMap/QGCAttitudeHUD.qml">src/FlightMap/Widgets/QGCAttitudeHUD.qml</file>
......
...@@ -206,19 +206,11 @@ FlightMap { ...@@ -206,19 +206,11 @@ FlightMap {
} }
} }
// Add the mission item visuals to the map // Add the items associated with the flight place to the map
Repeater { PlanMapItems {
model: _mainIsMap ? _missionController.visualItems : 0 map: flightMap
largeMapView: _mainIsMap
delegate: MissionItemMapVisual { masterController: _planMasterController
map: flightMap
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1))
}
}
// Add lines between waypoints
MissionLineView {
model: _mainIsMap ? _missionController.waypointLines : 0
} }
GeoFenceMapVisuals { GeoFenceMapVisuals {
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.3
import QtLocation 5.3
import QtPositioning 5.3
import QGroundControl 1.0
import QGroundControl.Controls 1.0
import QGroundControl.FlightMap 1.0
// Adds visual items associated with the Flight Plan to the map
Item {
id: _root
property var map ///< Map control to show items on
property bool largeMapView ///< true: map takes up entire view, false: map is in small window
property var masterController ///< Reference to PlanMasterController for vehicle
property var _map: map
property var _missionController: masterController.missionController
property var _geoFenceController: masterController.geoFenceController
property var _rallyPointController: masterController.rallyPointController
property var _missionLineViewComponent
// Add the mission item visuals to the map
Repeater {
model: largeMapView ? _missionController.visualItems : 0
delegate: MissionItemMapVisual {
map: _map
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1))
}
}
// Waypiont lines
Instantiator {
model: largeMapView ? _missionController.waypointLines : 0
Item {
property var _missionLineViewComponent
Component.onCompleted: {
_missionLineViewComponent = missionLineViewComponent.createObject(map, {"object": object})
if (_missionLineViewComponent.status === Component.Error)
console.log(_missionLineViewComponent.errorString())
map.addMapItem(_missionLineViewComponent)
}
Component.onDestruction: {
_missionLineViewComponent.destroy()
}
}
}
Component {
id: missionLineViewComponent
MapPolyline {
line.width: 3
line.color: "#be781c" // Hack, can't get palette to work in here
z: QGroundControl.zOrderWaypointLines
path: object ? [ object.coordinate1, object.coordinate2] : undefined
property var object
}
}
}
...@@ -27,5 +27,6 @@ MissionItemIndicator 1.0 MissionItemIndicator.qml ...@@ -27,5 +27,6 @@ MissionItemIndicator 1.0 MissionItemIndicator.qml
MissionItemIndicatorDrag 1.0 MissionItemIndicatorDrag.qml MissionItemIndicatorDrag 1.0 MissionItemIndicatorDrag.qml
MissionItemView 1.0 MissionItemView.qml MissionItemView 1.0 MissionItemView.qml
MissionLineView 1.0 MissionLineView.qml MissionLineView 1.0 MissionLineView.qml
PlanMapItems 1.0 PlanMapItems.qml
PolygonEditor 1.0 PolygonEditor.qml PolygonEditor 1.0 PolygonEditor.qml
VehicleMapItem 1.0 VehicleMapItem.qml VehicleMapItem 1.0 VehicleMapItem.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment