Commit e48bf87f authored by Don Gagne's avatar Don Gagne

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