Commit 112a6443 authored by Don Gagne's avatar Don Gagne

Hide waypoint indicators unless they are really needed

parent 36ee9318
......@@ -233,7 +233,7 @@ FlightMap {
map: flightMap
largeMapView: mainIsMap
masterController: masterController
isActiveVehicle: _vehicle.active
vehicle: _vehicle
property var _vehicle: object
......
......@@ -23,26 +23,26 @@ Item {
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 bool isActiveVehicle ///< true: vehicle associated with plan is active, false: in-active
property var vehicle ///< Vehicle associated with these items
property var _map: map
property var _vehicle: vehicle
property var _missionController: masterController.missionController
property var _geoFenceController: masterController.geoFenceController
property var _rallyPointController: masterController.rallyPointController
property var _missionLineViewComponent
property bool _isActiveVehicle: vehicle.active
property string fmode: vehicle.flightMode
// Add the mission item visuals to the map
Repeater {
model: largeMapView ? _missionController.visualItems : 0
model: _isActiveVehicle && largeMapView ? _missionController.visualItems : 0
delegate: MissionItemMapVisual {
map: _map
onClicked: {
if (isActiveVehicle) {
// Only active vehicle supports click to change current mission item
guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1))
}
}
vehicle: _vehicle
onClicked: guidedActionsController.confirmAction(guidedActionsController.actionSetWaypoint, Math.max(object.sequenceNumber, 1))
}
}
......
......@@ -22,6 +22,7 @@ Item {
id: _root
property var map ///< Map control to place item in
property var vehicle ///< Vehicle associated with this item
signal clicked(int sequenceNumber)
......@@ -33,7 +34,7 @@ Item {
if (component.status === Component.Error) {
console.log("Error loading Qml: ", object.mapVisualQML, component.errorString())
}
_visualItem = component.createObject(map, { "map": _root.map })
_visualItem = component.createObject(map, { "map": _root.map, vehicle: _root.vehicle })
_visualItem.clicked.connect(_root.clicked)
}
}
......
......@@ -23,6 +23,7 @@ Item {
id: _root
property var map ///< Map control to place item in
property var vehicle ///< Vehicle associated with this item
property var _missionItem: object
property var _itemVisual
......@@ -104,7 +105,7 @@ Item {
MissionItemIndicator {
coordinate: _missionItem.coordinate
visible: _missionItem.specifiesCoordinate
visible: _missionItem.specifiesCoordinate && (_missionItem.homePosition || map.planView || _missionItem.isCurrentItem || (vehicle.flightMode === vehicle.pauseFlightMode && vehicle.armed))
z: QGroundControl.zOrderMapItems
missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber
......
......@@ -13,6 +13,9 @@ Item {
function createObject(sourceComponent, parentObject, parentObjectIsMap) {
var obj = sourceComponent.createObject(parentObject)
if (obj.status === Component.Error) {
console.log(obj.errorString())
}
rgDynamicObjects.push(obj)
if (arguments.length < 3) {
parentObjectIsMap = false
......
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