##// END OF EJS Templates
Fix bug when canceling acquisition
perrinel -
r1399:5f9a7b80e8f3
parent child
Show More
@@ -361,6 +361,7 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::removeAcqReque
361
361
362 m_AcqIdentifierToAcqDataPacketVectorMap.erase(acqRequestId);
362 m_AcqIdentifierToAcqDataPacketVectorMap.erase(acqRequestId);
363 m_AcqIdentifierToAcqRequestMap.erase(acqRequestId);
363 m_AcqIdentifierToAcqRequestMap.erase(acqRequestId);
364 m_VIdentifierToCurrrentAcqIdMap.erase(vIdentifier);
364
365
365 unlock();
366 unlock();
366 qCDebug(LOG_VariableAcquisitionWorker())
367 qCDebug(LOG_VariableAcquisitionWorker())
@@ -950,6 +950,17 void VariableController::VariableControllerPrivate::cancelVariableRequest(QUuid
950
950
951 auto &varIds = varGroupIdToVarIdsIt->second;
951 auto &varIds = varGroupIdToVarIdsIt->second;
952 auto varIdsEnd = varIds.end();
952 auto varIdsEnd = varIds.end();
953
954 // First pass all canUpdate of handler to false
955 for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd); ++varIdsIt) {
956 auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt);
957 if (itVarHandler != m_VarIdToVarRequestHandler.cend()) {
958
959 auto varHandler = itVarHandler->second.get();
960 varHandler->m_CanUpdate = false;
961 }
962 }
963
953 for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd); ++varIdsIt) {
964 for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd); ++varIdsIt) {
954 auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt);
965 auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt);
955 if (itVarHandler != m_VarIdToVarRequestHandler.cend()) {
966 if (itVarHandler != m_VarIdToVarRequestHandler.cend()) {
@@ -972,7 +983,6 void VariableController::VariableControllerPrivate::cancelVariableRequest(QUuid
972 itVarHandler->first);
983 itVarHandler->first);
973 }
984 }
974 m_VariableModel->setDataProgress(var, 0.0);
985 m_VariableModel->setDataProgress(var, 0.0);
975 varHandler->m_CanUpdate = false;
976 varHandler->m_State = VariableRequestHandlerState::OFF;
986 varHandler->m_State = VariableRequestHandlerState::OFF;
977 varHandler->m_RunningVarRequest = VariableRequest{};
987 varHandler->m_RunningVarRequest = VariableRequest{};
978 }
988 }
@@ -991,7 +1001,6 void VariableController::VariableControllerPrivate::cancelVariableRequest(QUuid
991 itVarHandler->first);
1001 itVarHandler->first);
992 }
1002 }
993 m_VariableModel->setDataProgress(var, 0.0);
1003 m_VariableModel->setDataProgress(var, 0.0);
994 varHandler->m_CanUpdate = false;
995 varHandler->m_State = VariableRequestHandlerState::RUNNING;
1004 varHandler->m_State = VariableRequestHandlerState::RUNNING;
996 varHandler->m_RunningVarRequest = varHandler->m_PendingVarRequest;
1005 varHandler->m_RunningVarRequest = varHandler->m_PendingVarRequest;
997 varHandler->m_PendingVarRequest = VariableRequest{};
1006 varHandler->m_PendingVarRequest = VariableRequest{};
General Comments 0
You need to be logged in to leave comments. Login now