Commit 890bb67b authored by DonLakeFlyer's avatar DonLakeFlyer

New Continue Mission action

parent 17ae0fb5
......@@ -519,6 +519,12 @@ QGCView {
}
}
onShowContinueMissionChanged: {
if (showContinueMission) {
confirmAction(actionContinueMission)
}
}
onShowResumeMissionChanged: {
if (showResumeMission) {
confirmAction(actionResumeMission)
......
......@@ -37,6 +37,7 @@ Item {
readonly property string takeoffTitle: qsTr("Takeoff")
readonly property string landTitle: qsTr("Land")
readonly property string startMissionTitle: qsTr("Start Mission")
readonly property string continueMissionTitle: qsTr("Continue Mission")
readonly property string resumeMissionTitle: qsTr("Resume Mission")
readonly property string pauseTitle: qsTr("Pause")
readonly property string changeAltTitle: qsTr("Change Altitude")
......@@ -50,6 +51,7 @@ Item {
readonly property string emergencyStopMessage: qsTr("WARNING: This still stop all motors. If vehicle is currently in air it will crash.")
readonly property string takeoffMessage: qsTr("Takeoff from ground and hold position.")
readonly property string startMissionMessage: qsTr("Start the mission which is currently displayed above. If the vehicle is on the ground it will takeoff.")
readonly property string continueMissionMessage: qsTr("Continue the mission from the current waypoint.")
property string resumeMissionMessage: qsTr("Resume the mission which is displayed above. This will re-generate the mission from waypoint %1, takeoff and continue the mission.").arg(_resumeMissionIndex)
readonly property string resumeMissionReadyMessage: qsTr("Review the modified mission above. Confirm if you want to takeoff and begin mission.")
readonly property string landMessage: qsTr("Land the vehicle at the current position.")
......@@ -73,29 +75,32 @@ Item {
readonly property int actionOrbit: 10
readonly property int actionLandAbort: 11
readonly property int actionStartMission: 12
readonly property int actionResumeMission: 13
readonly property int actionResumeMissionReady: 14
readonly property int actionPause: 15
readonly property int actionContinueMission: 13
readonly property int actionResumeMission: 14
readonly property int actionResumeMissionReady: 15
readonly property int actionPause: 16
property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _activeVehicle.flying
property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _vehicleFlying
property bool showArm: _activeVehicle && !_vehicleArmed
property bool showDisarm: _activeVehicle && _vehicleArmed && !_activeVehicle.flying
property bool showRTL: _activeVehicle && _vehicleArmed && _activeVehicle.guidedModeSupported && _activeVehicle.flying && !_vehicleInRTLMode
property bool showTakeoff: _activeVehicle && _activeVehicle.guidedModeSupported && !_activeVehicle.flying && !_activeVehicle.fixedWing
property bool showDisarm: _activeVehicle && _vehicleArmed && !_vehicleFlying
property bool showRTL: _activeVehicle && _vehicleArmed && _activeVehicle.guidedModeSupported && _vehicleFlying && !_vehicleInRTLMode
property bool showTakeoff: _activeVehicle && _activeVehicle.guidedModeSupported && !_vehicleFlying && !_activeVehicle.fixedWing
property bool showLand: _activeVehicle && _activeVehicle.guidedModeSupported && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode
property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive
property bool showResumeMission: _activeVehicle && !_activeVehicle.flying && _missionAvailable && _resumeMissionIndex > 0
property bool showPause: _activeVehicle && _vehicleArmed && _activeVehicle.pauseVehicleSupported && _activeVehicle.flying && !_vehiclePaused
property bool showChangeAlt: (_activeVehicle && _activeVehicle.flying) && _activeVehicle.guidedModeSupported && _vehicleArmed && !_missionActive
property bool showOrbit: !_hideOrbit && _activeVehicle && _activeVehicle.flying && _activeVehicle.orbitModeSupported && _vehicleArmed && !_missionActive
property bool showLandAbort: _activeVehicle && _activeVehicle.flying && _activeVehicle.fixedWing
property bool showGotoLocation: _activeVehicle && _activeVehicle.guidedMode && _activeVehicle.flying
property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive && !_vehicleFlying
property bool showContinueMission: _activeVehicle && _missionAvailable && !_missionActive && _vehicleFlying
property bool showResumeMission: _activeVehicle && !_vehicleFlying && _missionAvailable && _resumeMissionIndex > 0
property bool showPause: _activeVehicle && _vehicleArmed && _activeVehicle.pauseVehicleSupported && _vehicleFlying && !_vehiclePaused
property bool showChangeAlt: (_activeVehicle && _vehicleFlying) && _activeVehicle.guidedModeSupported && _vehicleArmed && !_missionActive
property bool showOrbit: !_hideOrbit && _activeVehicle && _vehicleFlying && _activeVehicle.orbitModeSupported && _vehicleArmed && !_missionActive
property bool showLandAbort: _activeVehicle && _vehicleFlying && _activeVehicle.fixedWing
property bool showGotoLocation: _activeVehicle && _activeVehicle.guidedMode && _vehicleFlying
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property string _flightMode: _activeVehicle ? _activeVehicle.flightMode : ""
property bool _missionAvailable: missionController.containsItems
property bool _missionActive: _activeVehicle ? _vehicleArmed && (_vehicleInLandMode || _vehicleInRTLMode || _vehicleInMissionMode) : false
property bool _vehicleArmed: _activeVehicle ? _activeVehicle.armed : false
property bool _vehicleFlying: _activeVehicle ? _activeVehicle.flying : false
property bool _vehiclePaused: false
property bool _vehicleInMissionMode: false
property bool _vehicleInRTLMode: false
......@@ -119,7 +124,7 @@ Item {
_actionData = actionData
switch (actionCode) {
case actionArm:
if (_activeVehicle.flying) {
if (_vehicleFlying) {
return
}
confirmDialog.title = armTitle
......@@ -127,7 +132,7 @@ Item {
confirmDialog.hideTrigger = Qt.binding(function() { return !showArm })
break;
case actionDisarm:
if (_activeVehicle.flying) {
if (_vehicleFlying) {
return
}
confirmDialog.title = disarmTitle
......@@ -149,6 +154,11 @@ Item {
confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission })
break;
case actionContinueMission:
confirmDialog.title = continueMissionTitle
confirmDialog.message = continueMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showContinueMission })
break;
case actionResumeMission:
confirmDialog.title = resumeMissionTitle
confirmDialog.message = resumeMissionMessage
......@@ -224,6 +234,7 @@ Item {
_activeVehicle.startMission()
break
case actionStartMission:
case actionContinueMission:
_activeVehicle.startMission()
break
case actionArm:
......
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