Commit 75f3cba8 authored by Don Gagne's avatar Don Gagne

parent fb13763f
...@@ -295,6 +295,7 @@ FlightMap { ...@@ -295,6 +295,7 @@ FlightMap {
} }
} }
// GoTo Location visuals
MapQuickItem { MapQuickItem {
id: gotoLocationItem id: gotoLocationItem
visible: false visible: false
...@@ -308,6 +309,15 @@ FlightMap { ...@@ -308,6 +309,15 @@ FlightMap {
label: qsTr("Goto here", "Goto here waypoint") label: qsTr("Goto here", "Goto here waypoint")
} }
property bool inGotoFlightMode: _activeVehicle ? _activeVehicle.flightMode === _activeVehicle.gotoFlightMode : false
onInGotoFlightModeChanged: {
if (!inGotoFlightMode && visible) {
// Hide goto indicator when vehicle falls out of guided mode
visible = false
}
}
function show(coord) { function show(coord) {
gotoLocationItem.coordinate = coord gotoLocationItem.coordinate = coord
gotoLocationItem.visible = true gotoLocationItem.visible = true
...@@ -316,10 +326,17 @@ FlightMap { ...@@ -316,10 +326,17 @@ FlightMap {
function hide() { function hide() {
gotoLocationItem.visible = false gotoLocationItem.visible = false
} }
}
// Orbit visuals function actionConfirmed() {
// We leave the indicator visible. The handling for onInGuidedModeChanged will hide it.
}
function actionCancelled() {
hide()
}
}
// Orbit editing visuals
QGCMapCircleVisuals { QGCMapCircleVisuals {
id: orbitMapCircle id: orbitMapCircle
mapControl: parent mapControl: parent
...@@ -341,6 +358,15 @@ FlightMap { ...@@ -341,6 +358,15 @@ FlightMap {
orbitMapCircle.visible = false orbitMapCircle.visible = false
} }
function actionConfirmed() {
// Live orbit status is handled by telemetry so we hide here and telemetry will show again.
hide()
}
function actionCancelled() {
hide()
}
function radius() { function radius() {
return _mapCircle.radius.rawValue return _mapCircle.radius.rawValue
} }
...@@ -357,7 +383,6 @@ FlightMap { ...@@ -357,7 +383,6 @@ FlightMap {
} }
// Orbit telemetry visuals // Orbit telemetry visuals
QGCMapCircleVisuals { QGCMapCircleVisuals {
id: orbitTelemetryCircle id: orbitTelemetryCircle
mapControl: parent mapControl: parent
...@@ -395,7 +420,7 @@ FlightMap { ...@@ -395,7 +420,7 @@ FlightMap {
onTriggered: { onTriggered: {
gotoLocationItem.show(clickMenu.coord) gotoLocationItem.show(clickMenu.coord)
orbitMapCircle.hide() orbitMapCircle.hide()
guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickMenu.coord) guidedActionsController.confirmAction(guidedActionsController.actionGoto, clickMenu.coord, gotoLocationItem)
} }
} }
...@@ -406,7 +431,7 @@ FlightMap { ...@@ -406,7 +431,7 @@ FlightMap {
onTriggered: { onTriggered: {
orbitMapCircle.show(clickMenu.coord) orbitMapCircle.show(clickMenu.coord)
gotoLocationItem.hide() gotoLocationItem.hide()
guidedActionsController.confirmAction(guidedActionsController.actionOrbit, clickMenu.coord) guidedActionsController.confirmAction(guidedActionsController.actionOrbit, 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