Commit c55bcd87 authored by Gus Grubba's avatar Gus Grubba

Handle ROI visibility from actual state given by the vehicle.

parent 88ae35fd
...@@ -44,7 +44,6 @@ FlightMap { ...@@ -44,7 +44,6 @@ FlightMap {
property var _geoFenceController: missionController.geoFenceController property var _geoFenceController: missionController.geoFenceController
property var _rallyPointController: missionController.rallyPointController property var _rallyPointController: missionController.rallyPointController
property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeVehicleCoordinate: activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate() property var _activeVehicleCoordinate: activeVehicle ? activeVehicle.coordinate : QtPositioning.coordinate()
property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2) property real _toolButtonTopMargin: parent.height - mainWindow.height + (ScreenTools.defaultFontPixelHeight / 2)
property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false property bool _airspaceEnabled: QGroundControl.airmapSupported ? (QGroundControl.settingsManager.airMapSettings.enableAirMap.rawValue && QGroundControl.airspaceManager.connected): false
...@@ -404,7 +403,7 @@ FlightMap { ...@@ -404,7 +403,7 @@ FlightMap {
// ROI Location visuals // ROI Location visuals
MapQuickItem { MapQuickItem {
id: roiLocationItem id: roiLocationItem
visible: false visible: activeVehicle && activeVehicle.isROIEnabled
z: QGroundControl.zOrderMapItems z: QGroundControl.zOrderMapItems
anchorPoint.x: sourceItem.anchorPointX anchorPoint.x: sourceItem.anchorPointX
anchorPoint.y: sourceItem.anchorPointY anchorPoint.y: sourceItem.anchorPointY
...@@ -414,30 +413,18 @@ FlightMap { ...@@ -414,30 +413,18 @@ FlightMap {
label: qsTr("ROI here", "Make this a Region Of Interest") label: qsTr("ROI here", "Make this a Region Of Interest")
} }
Connections { //-- Visibilty controlled by actual state
target: mainWindow
onActiveVehicleChanged: {
if (!activeVehicle) {
roiLocationItem.visible = false
}
}
}
function show(coord) { function show(coord) {
roiLocationItem.coordinate = coord roiLocationItem.coordinate = coord
roiLocationItem.visible = true
} }
function hide() { function hide() {
roiLocationItem.visible = false
} }
function actionConfirmed() { function actionConfirmed() {
hide()
} }
function actionCancelled() { function actionCancelled() {
hide()
} }
} }
...@@ -496,7 +483,6 @@ FlightMap { ...@@ -496,7 +483,6 @@ FlightMap {
onTriggered: { onTriggered: {
roiLocationItem.show(clickMenu.coord) roiLocationItem.show(clickMenu.coord)
gotoLocationItem.hide()
guidedActionsController.confirmAction(guidedActionsController.actionROI, clickMenu.coord, orbitMapCircle) guidedActionsController.confirmAction(guidedActionsController.actionROI, clickMenu.coord, orbitMapCircle)
} }
} }
......
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