diff --git a/src/FlightDisplay/GuidedActionsController.qml b/src/FlightDisplay/GuidedActionsController.qml index e1a18718912cdb60b329fe6cacb080d87b99431e..0e08e0cbf6f54e4e0f0ad4fc19f093ab08c685bf 100644 --- a/src/FlightDisplay/GuidedActionsController.qml +++ b/src/FlightDisplay/GuidedActionsController.qml @@ -101,13 +101,15 @@ Item { property bool showLand: _activeVehicle && _activeVehicle.guidedModeSupported && _vehicleArmed && !_activeVehicle.fixedWing && !_vehicleInLandMode property bool showStartMission: _activeVehicle && _missionAvailable && !_missionActive && !_vehicleFlying property bool showContinueMission: _activeVehicle && _missionAvailable && !_missionActive && _vehicleFlying && (_currentMissionIndex < missionController.visualItems.count - 1) - property bool showResumeMission: _activeVehicle && !_vehicleArmed && _vehicleWasFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < missionController.visualItems.count - 2) 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 && _vehicleLanding property bool showGotoLocation: _activeVehicle && _vehicleFlying + // Note: The 'missionController.visualItems.count - 3' is a hack to not trigger resume mission when a mission ends with an RTL item + property bool showResumeMission: _activeVehicle && !_vehicleArmed && _vehicleWasFlying && _missionAvailable && _resumeMissionIndex > 0 && (_resumeMissionIndex < missionController.visualItems.count - 3) + property bool guidedUIVisible: guidedActionConfirm.visible || guidedActionList.visible property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle diff --git a/src/MissionManager/MissionManager.cc b/src/MissionManager/MissionManager.cc index 4ed0dcc332e582759288a275ffec452c0eb8032a..e5fc3bd1ff83cd2dd837afca48da9b4660cb5175 100644 --- a/src/MissionManager/MissionManager.cc +++ b/src/MissionManager/MissionManager.cc @@ -242,7 +242,7 @@ void MissionManager::_handleMissionCurrent(const mavlink_message_t& message) emit currentIndexChanged(_currentMissionIndex); } - if (_currentMissionIndex != _lastCurrentIndex) { + if (_currentMissionIndex != _lastCurrentIndex && _cachedLastCurrentIndex != _currentMissionIndex) { // We have to be careful of an RTL sequence causing a change of index to the DO_LAND_START sequence. This also triggers // a flight mode change away from mission flight mode. So we only update _lastCurrentIndex when the flight mode is mission. // But we can run into problems where we may get the MISSION_CURRENT message for the RTL/DO_LAND_START sequenc change prior