Commit 0690559b authored by DonLakeFlyer's avatar DonLakeFlyer

Add support for multi-vehicle variants

parent 98221f29
...@@ -64,6 +64,7 @@ Item { ...@@ -64,6 +64,7 @@ Item {
readonly property string orbitMessage: qsTr("Orbit the vehicle around the current location.") readonly property string orbitMessage: qsTr("Orbit the vehicle around the current location.")
readonly property string landAbortMessage: qsTr("Abort the landing sequence.") readonly property string landAbortMessage: qsTr("Abort the landing sequence.")
readonly property string pauseMessage: qsTr("Pause the vehicle at it's current position.") readonly property string pauseMessage: qsTr("Pause the vehicle at it's current position.")
readonly property string mvPauseMessage: qsTr("Pause all vehicles at their current position.")
readonly property int actionRTL: 1 readonly property int actionRTL: 1
readonly property int actionLand: 2 readonly property int actionLand: 2
...@@ -81,6 +82,8 @@ Item { ...@@ -81,6 +82,8 @@ Item {
readonly property int actionResumeMission: 14 readonly property int actionResumeMission: 14
readonly property int actionResumeMissionReady: 15 readonly property int actionResumeMissionReady: 15
readonly property int actionPause: 16 readonly property int actionPause: 16
readonly property int actionMVPause: 17
readonly property int actionMVStartMission: 18
property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _vehicleFlying property bool showEmergenyStop: !_hideEmergenyStop && _activeVehicle && _vehicleArmed && _vehicleFlying
property bool showArm: _activeVehicle && !_vehicleArmed property bool showArm: _activeVehicle && !_vehicleArmed
...@@ -195,6 +198,11 @@ Item { ...@@ -195,6 +198,11 @@ Item {
confirmDialog.message = startMissionMessage confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission }) confirmDialog.hideTrigger = Qt.binding(function() { return !showStartMission })
break; break;
case actionMVStartMission:
confirmDialog.title = startMissionTitle
confirmDialog.message = startMissionMessage
confirmDialog.hideTrigger = true
break;
case actionContinueMission: case actionContinueMission:
confirmDialog.title = continueMissionTitle confirmDialog.title = continueMissionTitle
confirmDialog.message = continueMissionMessage confirmDialog.message = continueMissionMessage
...@@ -251,6 +259,11 @@ Item { ...@@ -251,6 +259,11 @@ Item {
confirmDialog.message = pauseMessage confirmDialog.message = pauseMessage
confirmDialog.hideTrigger = Qt.binding(function() { return !showPause }) confirmDialog.hideTrigger = Qt.binding(function() { return !showPause })
break; break;
case actionMVPause:
confirmDialog.title = pauseTitle
confirmDialog.message = mvPauseMessage
confirmDialog.hideTrigger = true
break;
default: default:
console.warn("Unknown actionCode", actionCode) console.warn("Unknown actionCode", actionCode)
return return
...@@ -281,6 +294,13 @@ Item { ...@@ -281,6 +294,13 @@ Item {
case actionContinueMission: case actionContinueMission:
_activeVehicle.startMission() _activeVehicle.startMission()
break break
case actionMVStartMission:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.startMission()
}
break
case actionArm: case actionArm:
_activeVehicle.armed = true _activeVehicle.armed = true
break break
...@@ -308,6 +328,13 @@ Item { ...@@ -308,6 +328,13 @@ Item {
case actionPause: case actionPause:
_activeVehicle.pauseVehicle() _activeVehicle.pauseVehicle()
break break
case actionMVPause:
var rgVehicle = QGroundControl.multiVehicleManager.vehicles
for (var i=0; i<rgVehicle.count; i++) {
var vehicle = rgVehicle.get(i)
vehicle.pauseVehicle()
}
break
default: default:
console.warn(qsTr("Internal error: unknown actionCode"), actionCode) console.warn(qsTr("Internal error: unknown actionCode"), actionCode)
break break
......
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