From 1e856cc12f98e5d8c5cbb7f27284abdb1e3849a0 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 23 Jan 2018 17:32:20 +0100 Subject: [PATCH] PlanManager: fix mission download progress By adding a member variable for the total mission item count, we can actually correctly estimate the progress. --- src/MissionManager/PlanManager.cc | 4 +++- src/MissionManager/PlanManager.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MissionManager/PlanManager.cc b/src/MissionManager/PlanManager.cc index 33a609f5d..284d213d7 100644 --- a/src/MissionManager/PlanManager.cc +++ b/src/MissionManager/PlanManager.cc @@ -30,6 +30,7 @@ PlanManager::PlanManager(Vehicle* vehicle, MAV_MISSION_TYPE planType) , _transactionInProgress(TransactionNone) , _resumeMission(false) , _lastMissionRequest(-1) + , _missionItemCountToRead(-1) , _currentMissionIndex(-1) , _lastCurrentIndex(-1) { @@ -317,6 +318,7 @@ void PlanManager::_handleMissionCount(const mavlink_message_t& message) for (int i=0; i _itemIndicesToWrite; ///< List of mission items which still need to be written to vehicle QList _itemIndicesToRead; ///< List of mission items which still need to be requested from vehicle int _lastMissionRequest; ///< Index of item last requested by MISSION_REQUEST + int _missionItemCountToRead;///< Count of all mission items to read QList _missionItems; ///< Set of mission items on vehicle QList _writeMissionItems; ///< Set of mission items currently being written to vehicle -- 2.22.0