Commit 429cf82d authored by Stefan Dunca's avatar Stefan Dunca

Show mission items in Geofence and Rally Point edit mode

Propagate opacity and interactive properties to mission items
Set opacity to 0.5 for items that are not part of the current
edit view
parent a675b2b2
...@@ -38,6 +38,7 @@ MapQuickItem { ...@@ -38,6 +38,7 @@ MapQuickItem {
showGimbalYaw: !isNaN(missionItem.missionGimbalYaw) showGimbalYaw: !isNaN(missionItem.missionGimbalYaw)
highlightSelected: true highlightSelected: true
onClicked: _item.clicked() onClicked: _item.clicked()
opacity: _item.opacity
property bool _isCurrentItem: missionItem ? missionItem.isCurrentItem || missionItem.hasCurrentChildItem : false property bool _isCurrentItem: missionItem ? missionItem.isCurrentItem || missionItem.hasCurrentChildItem : false
} }
......
...@@ -71,6 +71,7 @@ Rectangle { ...@@ -71,6 +71,7 @@ Rectangle {
drag.maximumX: itemDragger.parent.width - parent.width drag.maximumX: itemDragger.parent.width - parent.width
drag.maximumY: itemDragger.parent.height - parent.height drag.maximumY: itemDragger.parent.height - parent.height
preventStealing: true preventStealing: true
enabled: itemDragger.visible
onClicked: { onClicked: {
focus = true focus = true
......
...@@ -303,7 +303,7 @@ Item { ...@@ -303,7 +303,7 @@ Item {
sourceItem: SplitIndicator { sourceItem: SplitIndicator {
z: _zorderSplitHandle z: _zorderSplitHandle
onClicked: mapPolygon.splitPolygonSegment(mapQuickItem.vertexIndex) onClicked: if(_root.interactive) mapPolygon.splitPolygonSegment(mapQuickItem.vertexIndex)
} }
} }
} }
...@@ -368,7 +368,7 @@ Item { ...@@ -368,7 +368,7 @@ Item {
} }
} }
onClicked: menu.popupVertex(polygonVertex) onClicked: if(_root.interactive) menu.popupVertex(polygonVertex)
} }
} }
...@@ -577,7 +577,7 @@ Item { ...@@ -577,7 +577,7 @@ Item {
z: QGroundControl.zOrderMapItems + 1 // Over item indicators z: QGroundControl.zOrderMapItems + 1 // Over item indicators
onClicked: { onClicked: {
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolygon.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)) mapPolygon.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
} }
} }
...@@ -599,7 +599,7 @@ Item { ...@@ -599,7 +599,7 @@ Item {
height: width height: width
radius: width / 2 radius: width / 2
color: "white" color: "white"
opacity: .90 opacity: interiorOpacity * .90
} }
} }
} }
......
...@@ -175,6 +175,7 @@ Item { ...@@ -175,6 +175,7 @@ Item {
line.color: lineColor line.color: lineColor
path: mapPolyline.path path: mapPolyline.path
visible: _root.visible visible: _root.visible
opacity: _root.opacity
} }
} }
...@@ -186,6 +187,7 @@ Item { ...@@ -186,6 +187,7 @@ Item {
anchorPoint.x: sourceItem.width / 2 anchorPoint.x: sourceItem.width / 2
anchorPoint.y: sourceItem.height / 2 anchorPoint.y: sourceItem.height / 2
z: _zorderSplitHandle z: _zorderSplitHandle
opacity: _root.opacity
property int vertexIndex property int vertexIndex
...@@ -205,6 +207,8 @@ Item { ...@@ -205,6 +207,8 @@ Item {
property var _splitHandle property var _splitHandle
property var _vertices: mapPolyline.path property var _vertices: mapPolyline.path
opacity: _root.opacity
function _setHandlePosition() { function _setHandlePosition() {
var nextIndex = index + 1 var nextIndex = index + 1
var distance = _vertices[index].distanceTo(_vertices[nextIndex]) var distance = _vertices[index].distanceTo(_vertices[nextIndex])
...@@ -238,6 +242,7 @@ Item { ...@@ -238,6 +242,7 @@ Item {
mapControl: _root.mapControl mapControl: _root.mapControl
id: dragArea id: dragArea
z: _zorderDragHandle z: _zorderDragHandle
opacity: _root.opacity
property int polylineVertex property int polylineVertex
...@@ -267,6 +272,7 @@ Item { ...@@ -267,6 +272,7 @@ Item {
anchorPoint.x: dragHandle.width / 2 anchorPoint.x: dragHandle.width / 2
anchorPoint.y: dragHandle.height / 2 anchorPoint.y: dragHandle.height / 2
z: _zorderDragHandle z: _zorderDragHandle
opacity: _root.opacity
property int polylineVertex property int polylineVertex
...@@ -292,6 +298,8 @@ Item { ...@@ -292,6 +298,8 @@ Item {
delegate: Item { delegate: Item {
property var _visuals: [ ] property var _visuals: [ ]
opacity: _root.opacity
Component.onCompleted: { Component.onCompleted: {
var dragHandle = dragHandleComponent.createObject(mapControl) var dragHandle = dragHandleComponent.createObject(mapControl)
dragHandle.coordinate = Qt.binding(function() { return object.coordinate }) dragHandle.coordinate = Qt.binding(function() { return object.coordinate })
...@@ -366,7 +374,7 @@ Item { ...@@ -366,7 +374,7 @@ Item {
z: QGroundControl.zOrderMapItems + 1 // Over item indicators z: QGroundControl.zOrderMapItems + 1 // Over item indicators
onClicked: { onClicked: {
if (mouse.button === Qt.LeftButton) { if (mouse.button === Qt.LeftButton && _root.interactive) {
mapPolyline.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */)) mapPolyline.appendVertex(mapControl.toCoordinate(Qt.point(mouse.x, mouse.y), false /* clipToViewPort */))
} }
} }
......
...@@ -25,9 +25,10 @@ TransectStyleMapVisuals { ...@@ -25,9 +25,10 @@ TransectStyleMapVisuals {
id: mapPolylineVisuals id: mapPolylineVisuals
mapControl: map mapControl: map
mapPolyline: object.corridorPolyline mapPolyline: object.corridorPolyline
interactive: _currentItem interactive: _currentItem && parent.interactive
lineWidth: 3 lineWidth: 3
lineColor: "#be781c" lineColor: "#be781c"
visible: _currentItem visible: _currentItem
opacity: parent.opacity
} }
} }
...@@ -24,6 +24,7 @@ Item { ...@@ -24,6 +24,7 @@ Item {
id: _root id: _root
property var map ///< Map control to place item in property var map ///< Map control to place item in
property bool interactive: true
signal clicked(int sequenceNumber) signal clicked(int sequenceNumber)
...@@ -178,6 +179,7 @@ Item { ...@@ -178,6 +179,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: map anchors.fill: map
z: QGroundControl.zOrderMapItems + 1 // Over item indicators z: QGroundControl.zOrderMapItems + 1 // Over item indicators
visible: _root.interactive
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
...@@ -199,6 +201,7 @@ Item { ...@@ -199,6 +201,7 @@ Item {
mapControl: _root.map mapControl: _root.map
itemIndicator: _loiterPointObject itemIndicator: _loiterPointObject
itemCoordinate: _missionItem.loiterCoordinate itemCoordinate: _missionItem.loiterCoordinate
visible: _root.interactive
property bool _preventReentrancy: false property bool _preventReentrancy: false
...@@ -224,6 +227,7 @@ Item { ...@@ -224,6 +227,7 @@ Item {
mapControl: _root.map mapControl: _root.map
itemIndicator: _landingPointObject itemIndicator: _landingPointObject
itemCoordinate: _missionItem.landingCoordinate itemCoordinate: _missionItem.landingCoordinate
visible: _root.interactive
onItemCoordinateChanged: _missionItem.moveLandingPosition(itemCoordinate) onItemCoordinateChanged: _missionItem.moveLandingPosition(itemCoordinate)
} }
......
...@@ -39,8 +39,8 @@ Item { ...@@ -39,8 +39,8 @@ Item {
property int _borderWidthExclusion: 0 property int _borderWidthExclusion: 0
property color _interiorColorExclusion: "orange" property color _interiorColorExclusion: "orange"
property color _interiorColorInclusion: "transparent" property color _interiorColorInclusion: "transparent"
property real _interiorOpacityExclusion: 0.2 property real _interiorOpacityExclusion: 0.2 * opacity
property real _interiorOpacityInclusion: 1 property real _interiorOpacityInclusion: 1 * opacity
function addPolygon(inclusionPolygon) { function addPolygon(inclusionPolygon) {
// Initial polygon is inset to take 2/3rds space // Initial polygon is inset to take 2/3rds space
...@@ -104,6 +104,7 @@ Item { ...@@ -104,6 +104,7 @@ Item {
borderColor: _borderColor borderColor: _borderColor
interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion
interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion
interactive: _root.interactive && mapPolygon && mapPolygon.interactive
} }
} }
...@@ -118,6 +119,7 @@ Item { ...@@ -118,6 +119,7 @@ Item {
borderColor: _borderColor borderColor: _borderColor
interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion interiorColor: object.inclusion ? _interiorColorInclusion : _interiorColorExclusion
interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion interiorOpacity: object.inclusion ? _interiorOpacityInclusion : _interiorOpacityExclusion
interactive: _root.interactive && mapCircle && mapCircle.interactive
} }
} }
...@@ -146,7 +148,7 @@ Item { ...@@ -146,7 +148,7 @@ Item {
MissionItemIndicatorDrag { MissionItemIndicatorDrag {
mapControl: map mapControl: map
itemCoordinate: myGeoFenceController.breachReturnPoint itemCoordinate: myGeoFenceController.breachReturnPoint
//visible: itemCoordinate.isValid visible: _root.interactive
onItemCoordinateChanged: myGeoFenceController.breachReturnPoint = itemCoordinate onItemCoordinateChanged: myGeoFenceController.breachReturnPoint = itemCoordinate
} }
...@@ -162,6 +164,7 @@ Item { ...@@ -162,6 +164,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: myGeoFenceController.breachReturnPoint coordinate: myGeoFenceController.breachReturnPoint
opacity: _root.opacity
sourceItem: MissionItemIndexLabel { sourceItem: MissionItemIndexLabel {
label: qsTr("B", "Breach Return Point item indicator") label: qsTr("B", "Breach Return Point item indicator")
......
...@@ -23,6 +23,7 @@ Item { ...@@ -23,6 +23,7 @@ Item {
property var map ///< Map control to place item in property var map ///< Map control to place item in
property var vehicle ///< Vehicle associated with this item property var vehicle ///< Vehicle associated with this item
property var interactive: true ///< Vehicle associated with this item
signal clicked(int sequenceNumber) signal clicked(int sequenceNumber)
...@@ -34,7 +35,7 @@ Item { ...@@ -34,7 +35,7 @@ Item {
if (component.status === Component.Error) { if (component.status === Component.Error) {
console.log("Error loading Qml: ", object.mapVisualQML, component.errorString()) console.log("Error loading Qml: ", object.mapVisualQML, component.errorString())
} }
_visualItem = component.createObject(map, { "map": _root.map, vehicle: _root.vehicle }) _visualItem = component.createObject(map, { "map": _root.map, vehicle: _root.vehicle, 'opacity': Qt.binding(function() { return _root.opacity }), 'interactive': Qt.binding(function() { return _root.interactive }) })
_visualItem.clicked.connect(_root.clicked) _visualItem.clicked.connect(_root.clicked)
} }
} }
......
...@@ -390,6 +390,7 @@ Item { ...@@ -390,6 +390,7 @@ Item {
property real _leftToolWidth: toolStrip.x + toolStrip.width property real _leftToolWidth: toolStrip.x + toolStrip.width
property real _rightToolWidth: rightPanel.width + rightPanel.anchors.rightMargin property real _rightToolWidth: rightPanel.width + rightPanel.anchors.rightMargin
property real _nonInteractiveOpacity: 0.5
// Initial map position duplicates Fly view position // Initial map position duplicates Fly view position
Component.onCompleted: editorMap.center = QGroundControl.flightMapPosition Component.onCompleted: editorMap.center = QGroundControl.flightMapPosition
...@@ -436,18 +437,20 @@ Item { ...@@ -436,18 +437,20 @@ Item {
// Add the mission item visuals to the map // Add the mission item visuals to the map
Repeater { Repeater {
model: _editingLayer == _layerMission ? _missionController.visualItems : undefined model: _missionController.visualItems
delegate: MissionItemMapVisual { delegate: MissionItemMapVisual {
map: editorMap map: editorMap
onClicked: _missionController.setCurrentPlanViewSeqNum(sequenceNumber, false) onClicked: _missionController.setCurrentPlanViewSeqNum(sequenceNumber, false)
visible: _editingLayer == _layerMission opacity: _editingLayer == _layerMission ? 1 : editorMap._nonInteractiveOpacity
interactive: _editingLayer == _layerMission
} }
} }
// Add lines between waypoints // Add lines between waypoints
MissionLineView { MissionLineView {
showSpecialVisual: _missionController.isROIBeginCurrentItem showSpecialVisual: _missionController.isROIBeginCurrentItem
model: _editingLayer == _layerMission ? _missionController.waypointLines : undefined model: _missionController.waypointLines
opacity: _editingLayer == _layerMission ? 1 : editorMap._nonInteractiveOpacity
} }
// Direction arrows in waypoint lines // Direction arrows in waypoint lines
...@@ -464,13 +467,14 @@ Item { ...@@ -464,13 +467,14 @@ Item {
// Incomplete segment lines // Incomplete segment lines
MapItemView { MapItemView {
model: _editingLayer == _layerMission ? _missionController.incompleteComplexItemLines : undefined model: _missionController.incompleteComplexItemLines
delegate: MapPolyline { delegate: MapPolyline {
path: [ object.coordinate1, object.coordinate2 ] path: [ object.coordinate1, object.coordinate2 ]
line.width: 1 line.width: 1
line.color: "red" line.color: "red"
z: QGroundControl.zOrderWaypointLines z: QGroundControl.zOrderWaypointLines
opacity: _editingLayer == _layerMission ? 1 : editorMap._nonInteractiveOpacity
} }
} }
...@@ -513,8 +517,7 @@ Item { ...@@ -513,8 +517,7 @@ Item {
// Add the vehicles to the map // Add the vehicles to the map
MapItemView { MapItemView {
model: QGroundControl.multiVehicleManager.vehicles model: QGroundControl.multiVehicleManager.vehicles
delegate: delegate: VehicleMapItem {
VehicleMapItem {
vehicle: object vehicle: object
coordinate: object.coordinate coordinate: object.coordinate
map: editorMap map: editorMap
...@@ -529,6 +532,7 @@ Item { ...@@ -529,6 +532,7 @@ Item {
interactive: _editingLayer == _layerGeoFence interactive: _editingLayer == _layerGeoFence
homePosition: _missionController.plannedHomePosition homePosition: _missionController.plannedHomePosition
planView: true planView: true
opacity: _editingLayer != _layerGeoFence ? editorMap._nonInteractiveOpacity : 1
} }
RallyPointMapVisuals { RallyPointMapVisuals {
...@@ -536,6 +540,7 @@ Item { ...@@ -536,6 +540,7 @@ Item {
myRallyPointController: _rallyPointController myRallyPointController: _rallyPointController
interactive: _editingLayer == _layerRallyPoints interactive: _editingLayer == _layerRallyPoints
planView: true planView: true
opacity: _editingLayer != _layerRallyPoints ? editorMap._nonInteractiveOpacity : 1
} }
// Airspace overlap support // Airspace overlap support
...@@ -851,6 +856,7 @@ Item { ...@@ -851,6 +856,7 @@ Item {
flightMap: editorMap flightMap: editorMap
visible: _editingLayer == _layerGeoFence visible: _editingLayer == _layerGeoFence
} }
// Rally Point Editor // Rally Point Editor
RallyPointEditorHeader { RallyPointEditorHeader {
id: rallyPointHeader id: rallyPointHeader
......
...@@ -47,7 +47,7 @@ Item { ...@@ -47,7 +47,7 @@ Item {
MissionItemIndicatorDrag { MissionItemIndicatorDrag {
mapControl: _root.map mapControl: _root.map
itemCoordinate: rallyPointObject.coordinate itemCoordinate: rallyPointObject.coordinate
visible: rallyPointObject === myRallyPointController.currentRallyPoint visible: rallyPointObject === myRallyPointController.currentRallyPoint && _root.interactive
property var rallyPointObject property var rallyPointObject
...@@ -63,6 +63,7 @@ Item { ...@@ -63,6 +63,7 @@ Item {
anchorPoint.x: sourceItem.anchorPointX anchorPoint.x: sourceItem.anchorPointX
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
opacity: _root.opacity
property var rallyPointObject property var rallyPointObject
...@@ -84,6 +85,7 @@ Item { ...@@ -84,6 +85,7 @@ Item {
model: _rallyPoints model: _rallyPoints
delegate: Item { delegate: Item {
opacity: _root.opacity
property var _visuals: [ ] property var _visuals: [ ]
Component.onCompleted: { Component.onCompleted: {
......
...@@ -24,6 +24,7 @@ Item { ...@@ -24,6 +24,7 @@ Item {
property var map ///< Map control to place item in property var map ///< Map control to place item in
property var vehicle ///< Vehicle associated with this item property var vehicle ///< Vehicle associated with this item
property bool interactive: true
property var _missionItem: object property var _missionItem: object
property var _itemVisual property var _itemVisual
...@@ -95,6 +96,7 @@ Item { ...@@ -95,6 +96,7 @@ Item {
mapControl: _root.map mapControl: _root.map
itemIndicator: _itemVisual itemIndicator: _itemVisual
itemCoordinate: _missionItem.coordinate itemCoordinate: _missionItem.coordinate
visible: _root.interactive
onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate onItemCoordinateChanged: _missionItem.coordinate = itemCoordinate
} }
...@@ -109,7 +111,8 @@ Item { ...@@ -109,7 +111,8 @@ Item {
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
missionItem: _missionItem missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber sequenceNumber: _missionItem.sequenceNumber
onClicked: _root.clicked(_missionItem.sequenceNumber) onClicked: if(_root.interactive) _root.clicked(_missionItem.sequenceNumber)
opacity: _root.opacity
} }
} }
} }
...@@ -27,6 +27,7 @@ Item { ...@@ -27,6 +27,7 @@ Item {
property var _missionItem: object property var _missionItem: object
property var _structurePolygon: object.structurePolygon property var _structurePolygon: object.structurePolygon
property var _flightPolygon: object.flightPolygon property var _flightPolygon: object.flightPolygon
property bool interactive: parent.interactive
signal clicked(int sequenceNumber) signal clicked(int sequenceNumber)
...@@ -43,11 +44,11 @@ Item { ...@@ -43,11 +44,11 @@ Item {
QGCMapPolygonVisuals { QGCMapPolygonVisuals {
mapControl: map mapControl: map
mapPolygon: _structurePolygon mapPolygon: _structurePolygon
interactive: _missionItem.isCurrentItem interactive: _missionItem.isCurrentItem && _root.interactive
borderWidth: 1 borderWidth: 1
borderColor: "black" borderColor: "black"
interiorColor: "green" interiorColor: "green"
interiorOpacity: 0.25 interiorOpacity: 0.5 * _root.opacity
} }
QGCMapPolygonVisuals { QGCMapPolygonVisuals {
...@@ -56,6 +57,7 @@ Item { ...@@ -56,6 +57,7 @@ Item {
interactive: false interactive: false
borderWidth: 2 borderWidth: 2
borderColor: "white" borderColor: "white"
interiorOpacity: _root.opacity
} }
// Entry point // Entry point
...@@ -67,7 +69,7 @@ Item { ...@@ -67,7 +69,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.coordinate coordinate: _missionItem.coordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid && _root.interactive
sourceItem: MissionItemIndexLabel { sourceItem: MissionItemIndexLabel {
index: _missionItem.sequenceNumber index: _missionItem.sequenceNumber
...@@ -87,7 +89,7 @@ Item { ...@@ -87,7 +89,7 @@ Item {
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.exitCoordinate coordinate: _missionItem.exitCoordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid && _root.interactive
sourceItem: MissionItemIndexLabel { sourceItem: MissionItemIndexLabel {
index: _missionItem.lastSequenceNumber index: _missionItem.lastSequenceNumber
......
...@@ -24,6 +24,7 @@ Item { ...@@ -24,6 +24,7 @@ Item {
property var map ///< Map control to place item in property var map ///< Map control to place item in
property var vehicle ///< Vehicle associated with this item property var vehicle ///< Vehicle associated with this item
property bool interactive: true
property var _missionItem: object property var _missionItem: object
property var _takeoffIndicatorItem property var _takeoffIndicatorItem
...@@ -78,6 +79,7 @@ Item { ...@@ -78,6 +79,7 @@ Item {
mapControl: _root.map mapControl: _root.map
itemIndicator: _takeoffIndicatorItem itemIndicator: _takeoffIndicatorItem
itemCoordinate: _missionItem.specifiesCoordinate ? _missionItem.coordinate : _missionItem.launchCoordinate itemCoordinate: _missionItem.specifiesCoordinate ? _missionItem.coordinate : _missionItem.launchCoordinate
visible: _root.interactive
onItemCoordinateChanged: { onItemCoordinateChanged: {
if (_missionItem.specifiesCoordinate) { if (_missionItem.specifiesCoordinate) {
...@@ -96,7 +98,7 @@ Item { ...@@ -96,7 +98,7 @@ Item {
mapControl: _root.map mapControl: _root.map
itemIndicator: _launchIndicatorItem itemIndicator: _launchIndicatorItem
itemCoordinate: _missionItem.launchCoordinate itemCoordinate: _missionItem.launchCoordinate
visible: !_missionItem.launchTakeoffAtSameLocation visible: !_missionItem.launchTakeoffAtSameLocation && _root.interactive
onItemCoordinateChanged: _missionItem.launchCoordinate = itemCoordinate onItemCoordinateChanged: _missionItem.launchCoordinate = itemCoordinate
} }
...@@ -111,6 +113,7 @@ Item { ...@@ -111,6 +113,7 @@ Item {
missionItem: _missionItem missionItem: _missionItem
sequenceNumber: _missionItem.sequenceNumber sequenceNumber: _missionItem.sequenceNumber
onClicked: _root.clicked(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
opacity: _root.opacity
} }
} }
...@@ -121,7 +124,7 @@ Item { ...@@ -121,7 +124,7 @@ Item {
coordinate: _missionItem.launchCoordinate coordinate: _missionItem.launchCoordinate
anchorPoint.x: sourceItem.anchorPointX anchorPoint.x: sourceItem.anchorPointX
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
visible: !_missionItem.launchTakeoffAtSameLocation visible: !_missionItem.launchTakeoffAtSameLocation && _root.interactive
sourceItem: sourceItem:
MissionItemIndexLabel { MissionItemIndexLabel {
...@@ -129,6 +132,7 @@ Item { ...@@ -129,6 +132,7 @@ Item {
label: qsTr("Launch") label: qsTr("Launch")
highlightSelected: true highlightSelected: true
onClicked: _root.clicked(_missionItem.sequenceNumber) onClicked: _root.clicked(_missionItem.sequenceNumber)
visible: _root.interactive
} }
} }
} }
...@@ -140,7 +144,7 @@ Item { ...@@ -140,7 +144,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: map anchors.fill: map
z: QGroundControl.zOrderMapItems + 1 // Over item indicators z: QGroundControl.zOrderMapItems + 1 // Over item indicators
visible: !_missionItem.launchCoordinate.isValid visible: !_missionItem.launchCoordinate.isValid && _root.interactive
readonly property int _decimalPlaces: 8 readonly property int _decimalPlaces: 8
......
...@@ -24,6 +24,7 @@ Item { ...@@ -24,6 +24,7 @@ Item {
property var map ///< Map control to place item in property var map ///< Map control to place item in
property bool polygonInteractive: true property bool polygonInteractive: true
property bool interactive: true
property var _missionItem: object property var _missionItem: object
property var _mapPolygon: object.surveyAreaPolygon property var _mapPolygon: object.surveyAreaPolygon
...@@ -70,11 +71,11 @@ Item { ...@@ -70,11 +71,11 @@ Item {
id: mapPolygonVisuals id: mapPolygonVisuals
mapControl: map mapControl: map
mapPolygon: _mapPolygon mapPolygon: _mapPolygon
interactive: polygonInteractive && _missionItem.isCurrentItem interactive: polygonInteractive && _missionItem.isCurrentItem && _root.interactive
borderWidth: 1 borderWidth: 1
borderColor: "black" borderColor: "black"
interiorColor: QGroundControl.globalPalette.surveyPolygonInterior interiorColor: QGroundControl.globalPalette.surveyPolygonInterior
interiorOpacity: 0.5 interiorOpacity: 0.5 * _root.opacity
} }
// Full set of transects lines. Shown when item is selected. // Full set of transects lines. Shown when item is selected.
...@@ -86,6 +87,7 @@ Item { ...@@ -86,6 +87,7 @@ Item {
line.width: 2 line.width: 2
path: _transectPoints path: _transectPoints
visible: _currentItem visible: _currentItem
opacity: _root.opacity
} }
} }
...@@ -98,6 +100,7 @@ Item { ...@@ -98,6 +100,7 @@ Item {
line.width: 2 line.width: 2
path: _showPartialEntryExit ? [ _transectPoints[0], _transectPoints[1] ] : [] path: _showPartialEntryExit ? [ _transectPoints[0], _transectPoints[1] ] : []
visible: _showPartialEntryExit visible: _showPartialEntryExit
opacity: _root.opacity
} }
} }
Component { Component {
...@@ -108,6 +111,7 @@ Item { ...@@ -108,6 +111,7 @@ Item {
line.width: 2 line.width: 2
path: _showPartialEntryExit ? [ _transectPoints[_lastPointIndex - 1], _transectPoints[_lastPointIndex] ] : [] path: _showPartialEntryExit ? [ _transectPoints[_lastPointIndex - 1], _transectPoints[_lastPointIndex] ] : []
visible: _showPartialEntryExit visible: _showPartialEntryExit
opacity: _root.opacity
} }
} }
...@@ -121,11 +125,12 @@ Item { ...@@ -121,11 +125,12 @@ Item {
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.coordinate coordinate: _missionItem.coordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid
opacity: _root.opacity
sourceItem: MissionItemIndexLabel { sourceItem: MissionItemIndexLabel {
index: _missionItem.sequenceNumber index: _missionItem.sequenceNumber
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: _root.clicked(_missionItem.sequenceNumber) onClicked: if(_root.interactive) _root.clicked(_missionItem.sequenceNumber)
} }
} }
} }
...@@ -138,6 +143,7 @@ Item { ...@@ -138,6 +143,7 @@ Item {
toCoord: _transectPoints[_firstTrueTransectIndex + 1] toCoord: _transectPoints[_firstTrueTransectIndex + 1]
arrowPosition: 1 arrowPosition: 1
visible: _currentItem visible: _currentItem
opacity: _root.opacity
} }
} }
...@@ -149,6 +155,7 @@ Item { ...@@ -149,6 +155,7 @@ Item {
toCoord: _transectPoints[nextTrueTransectIndex + 1] toCoord: _transectPoints[nextTrueTransectIndex + 1]
arrowPosition: 1 arrowPosition: 1
visible: _currentItem && _transectCount > 3 visible: _currentItem && _transectCount > 3
opacity: _root.opacity
property int nextTrueTransectIndex: _firstTrueTransectIndex + (_hasTurnaround ? 4 : 2) property int nextTrueTransectIndex: _firstTrueTransectIndex + (_hasTurnaround ? 4 : 2)
} }
...@@ -162,6 +169,7 @@ Item { ...@@ -162,6 +169,7 @@ Item {
toCoord: _transectPoints[_lastTrueTransectIndex] toCoord: _transectPoints[_lastTrueTransectIndex]
arrowPosition: 3 arrowPosition: 3
visible: _currentItem visible: _currentItem
opacity: _root.opacity
} }
} }
...@@ -173,6 +181,7 @@ Item { ...@@ -173,6 +181,7 @@ Item {
toCoord: _transectPoints[prevTrueTransectIndex] toCoord: _transectPoints[prevTrueTransectIndex]
arrowPosition: 13 arrowPosition: 13
visible: _currentItem && _transectCount > 3 visible: _currentItem && _transectCount > 3
opacity: _root.opacity
property int prevTrueTransectIndex: _lastTrueTransectIndex - (_hasTurnaround ? 4 : 2) property int prevTrueTransectIndex: _lastTrueTransectIndex - (_hasTurnaround ? 4 : 2)
} }
...@@ -188,11 +197,12 @@ Item { ...@@ -188,11 +197,12 @@ Item {
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
coordinate: _missionItem.exitCoordinate coordinate: _missionItem.exitCoordinate
visible: _missionItem.exitCoordinate.isValid visible: _missionItem.exitCoordinate.isValid
opacity: _root.opacity
sourceItem: MissionItemIndexLabel { sourceItem: MissionItemIndexLabel {
index: _missionItem.lastSequenceNumber index: _missionItem.lastSequenceNumber
checked: _missionItem.isCurrentItem checked: _missionItem.isCurrentItem
onClicked: _root.clicked(_missionItem.sequenceNumber) onClicked: if(_root.interactive) _root.clicked(_missionItem.sequenceNumber)
} }
} }
} }
......
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