Commit e48bf87f authored by Don Gagne's avatar Don Gagne

parent a5db2eef
...@@ -34,16 +34,14 @@ Rectangle { ...@@ -34,16 +34,14 @@ Rectangle {
property int action property int action
property var actionData property var actionData
property bool hideTrigger: false property bool hideTrigger: false
property var mapIndicator
property real _margins: ScreenTools.defaultFontPixelWidth property real _margins: ScreenTools.defaultFontPixelWidth
property bool _emergencyAction: action === guidedController.actionEmergencyStop property bool _emergencyAction: action === guidedController.actionEmergencyStop
onHideTriggerChanged: { onHideTriggerChanged: {
if (hideTrigger) { if (hideTrigger) {
hideTrigger = false confirmCancelled()
altitudeSlider.visible = false
visibleTimer.stop()
visible = false
} }
} }
...@@ -57,6 +55,17 @@ Rectangle { ...@@ -57,6 +55,17 @@ Rectangle {
} }
} }
function confirmCancelled() {
altitudeSlider.visible = false
visible = false
hideTrigger = false
visibleTimer.stop()
if (mapIndicator) {
mapIndicator.actionCancelled()
mapIndicator = undefined
}
}
Timer { Timer {
id: visibleTimer id: visibleTimer
interval: 1000 interval: 1000
...@@ -107,12 +116,10 @@ Rectangle { ...@@ -107,12 +116,10 @@ Rectangle {
} }
hideTrigger = false hideTrigger = false
guidedController.executeAction(_root.action, _root.actionData, altitudeChange) guidedController.executeAction(_root.action, _root.actionData, altitudeChange)
} if (mapIndicator) {
mapIndicator.actionConfirmed()
onReject: { mapIndicator = undefined
altitudeSlider.visible = false }
_root.visible = false
hideTrigger = false
} }
} }
} }
...@@ -127,12 +134,10 @@ Rectangle { ...@@ -127,12 +134,10 @@ Rectangle {
source: "/res/XDelete.svg" source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
color: qgcPal.text color: qgcPal.text
QGCMouseArea { QGCMouseArea {
fillItem: parent fillItem: parent
onClicked: { onClicked: confirmCancelled()
altitudeSlider.visible = false
_root.visible = false
}
} }
} }
} }
...@@ -209,12 +209,13 @@ Item { ...@@ -209,12 +209,13 @@ Item {
} }
// Called when an action is about to be executed in order to confirm // Called when an action is about to be executed in order to confirm
function confirmAction(actionCode, actionData) { function confirmAction(actionCode, actionData, mapIndicator) {
var showImmediate = true var showImmediate = true
closeAll() closeAll()
confirmDialog.action = actionCode confirmDialog.action = actionCode
confirmDialog.actionData = actionData confirmDialog.actionData = actionData
confirmDialog.hideTrigger = true confirmDialog.hideTrigger = true
confirmDialog.mapIndicator = mapIndicator
_actionData = actionData _actionData = actionData
switch (actionCode) { switch (actionCode) {
case actionArm: case actionArm:
...@@ -385,7 +386,6 @@ Item { ...@@ -385,7 +386,6 @@ Item {
break break
case actionOrbit: case actionOrbit:
_activeVehicle.guidedModeOrbit(orbitMapCircle.center, orbitMapCircle.radius() * (orbitMapCircle.clockwiseRotation ? 1 : -1), _activeVehicle.altitudeAMSL.rawValue + actionAltitudeChange) _activeVehicle.guidedModeOrbit(orbitMapCircle.center, orbitMapCircle.radius() * (orbitMapCircle.clockwiseRotation ? 1 : -1), _activeVehicle.altitudeAMSL.rawValue + actionAltitudeChange)
orbitMapCircle.hide()
break break
case actionLandAbort: case actionLandAbort:
_activeVehicle.abortLanding(50) // hardcoded value for climbOutAltitude that is currently ignored _activeVehicle.abortLanding(50) // hardcoded value for climbOutAltitude that is currently ignored
......
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