It' too long I agree. Let's see that later
@@ -9,6 +9,7 | |||||
9 | #include <Data/DataProviderParameters.h> |
|
9 | #include <Data/DataProviderParameters.h> | |
10 | #include <Data/IDataProvider.h> |
|
10 | #include <Data/IDataProvider.h> | |
11 | #include <Data/IDataSeries.h> |
|
11 | #include <Data/IDataSeries.h> | |
|
12 | #include <Data/VariableRequest.h> | |||
12 | #include <Time/TimeController.h> |
|
13 | #include <Time/TimeController.h> | |
13 |
|
14 | |||
14 | #include <QMutex> |
|
15 | #include <QMutex> | |
@@ -16,6 +17,7 | |||||
16 | #include <QUuid> |
|
17 | #include <QUuid> | |
17 | #include <QtCore/QItemSelectionModel> |
|
18 | #include <QtCore/QItemSelectionModel> | |
18 |
|
19 | |||
|
20 | #include <deque> | |||
19 | #include <set> |
|
21 | #include <set> | |
20 | #include <unordered_map> |
|
22 | #include <unordered_map> | |
21 |
|
23 | |||
@@ -97,7 +99,8 struct VariableController::VariableControllerPrivate { | |||||
97 | } |
|
99 | } | |
98 |
|
100 | |||
99 |
|
101 | |||
100 |
void processRequest(std::shared_ptr<Variable> var, const SqpRange &rangeRequested |
|
102 | void processRequest(std::shared_ptr<Variable> var, const SqpRange &rangeRequested, | |
|
103 | QUuid varRequestId); | |||
101 |
|
104 | |||
102 | QVector<SqpRange> provideNotInCacheDateTimeList(std::shared_ptr<Variable> variable, |
|
105 | QVector<SqpRange> provideNotInCacheDateTimeList(std::shared_ptr<Variable> variable, | |
103 | const SqpRange &dateTime); |
|
106 | const SqpRange &dateTime); | |
@@ -108,6 +111,11 struct VariableController::VariableControllerPrivate { | |||||
108 |
|
111 | |||
109 | void registerProvider(std::shared_ptr<IDataProvider> provider); |
|
112 | void registerProvider(std::shared_ptr<IDataProvider> provider); | |
110 |
|
113 | |||
|
114 | void storeVariableRequest(QUuid varId, QUuid varRequestId, const VariableRequest &varRequest); | |||
|
115 | QUuid acceptVariableRequest(QUuid varId, std::shared_ptr<IDataSeries> dataSeries); | |||
|
116 | void updateVariableRequest(QUuid varRequestId); | |||
|
117 | void cancelVariableRequest(QUuid varRequestId); | |||
|
118 | ||||
111 | QMutex m_WorkingMutex; |
|
119 | QMutex m_WorkingMutex; | |
112 | /// Variable model. The VariableController has the ownership |
|
120 | /// Variable model. The VariableController has the ownership | |
113 | VariableModel *m_VariableModel; |
|
121 | VariableModel *m_VariableModel; | |
@@ -128,6 +136,10 struct VariableController::VariableControllerPrivate { | |||||
128 | std::map<QUuid, QUuid> m_VariableIdGroupIdMap; |
|
136 | std::map<QUuid, QUuid> m_VariableIdGroupIdMap; | |
129 | std::set<std::shared_ptr<IDataProvider> > m_ProviderSet; |
|
137 | std::set<std::shared_ptr<IDataProvider> > m_ProviderSet; | |
130 |
|
138 | |||
|
139 | std::map<QUuid, std::map<QUuid, VariableRequest> > m_VarRequestIdToVarIdVarRequestMap; | |||
|
140 | ||||
|
141 | std::map<QUuid, std::deque<QUuid> > m_VarIdToVarRequestIdQueueMap; | |||
|
142 | ||||
131 |
|
143 | |||
132 | VariableController *q; |
|
144 | VariableController *q; | |
133 | }; |
|
145 | }; | |
@@ -241,7 +253,10 VariableController::createVariable(const QString &name, const QVariantHash &meta | |||||
241 | impl->m_VariableToIdentifierMap[newVariable] = identifier; |
|
253 | impl->m_VariableToIdentifierMap[newVariable] = identifier; | |
242 |
|
254 | |||
243 |
|
255 | |||
244 | impl->processRequest(newVariable, range); |
|
256 | auto varRequestId = QUuid::createUuid(); | |
|
257 | qCInfo(LOG_VariableController()) << "processRequest for" << name << varRequestId; | |||
|
258 | impl->processRequest(newVariable, range, varRequestId); | |||
|
259 | impl->updateVariableRequest(varRequestId); | |||
245 |
|
260 | |||
246 | return newVariable; |
|
261 | return newVariable; | |
247 | } |
|
262 | } | |
@@ -249,41 +264,32 VariableController::createVariable(const QString &name, const QVariantHash &meta | |||||
249 |
|
264 | |||
250 | void VariableController::onDateTimeOnSelection(const SqpRange &dateTime) |
|
265 | void VariableController::onDateTimeOnSelection(const SqpRange &dateTime) | |
251 | { |
|
266 | { | |
252 | // TODO check synchronisation |
|
267 | // TODO check synchronisation and Rescale | |
253 | qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection" |
|
268 | qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection" | |
254 | << QThread::currentThread()->objectName(); |
|
269 | << QThread::currentThread()->objectName(); | |
255 | auto selectedRows = impl->m_VariableSelectionModel->selectedRows(); |
|
270 | auto selectedRows = impl->m_VariableSelectionModel->selectedRows(); | |
|
271 | auto varRequestId = QUuid::createUuid(); | |||
256 |
|
272 | |||
257 | for (const auto &selectedRow : qAsConst(selectedRows)) { |
|
273 | for (const auto &selectedRow : qAsConst(selectedRows)) { | |
258 | if (auto selectedVariable = impl->m_VariableModel->variable(selectedRow.row())) { |
|
274 | if (auto selectedVariable = impl->m_VariableModel->variable(selectedRow.row())) { | |
259 | selectedVariable->setRange(dateTime); |
|
275 | selectedVariable->setRange(dateTime); | |
260 | impl->processRequest(selectedVariable, dateTime); |
|
276 | impl->processRequest(selectedVariable, dateTime, varRequestId); | |
261 |
|
277 | |||
262 | // notify that rescale operation has to be done |
|
278 | // notify that rescale operation has to be done | |
263 | emit rangeChanged(selectedVariable, dateTime); |
|
279 | emit rangeChanged(selectedVariable, dateTime); | |
264 | } |
|
280 | } | |
265 | } |
|
281 | } | |
|
282 | impl->updateVariableRequest(varRequestId); | |||
266 | } |
|
283 | } | |
267 |
|
284 | |||
268 | void VariableController::onDataProvided(QUuid vIdentifier, const SqpRange &rangeRequested, |
|
285 | void VariableController::onDataProvided(QUuid vIdentifier, const SqpRange &rangeRequested, | |
269 | const SqpRange &cacheRangeRequested, |
|
286 | const SqpRange &cacheRangeRequested, | |
270 | QVector<AcquisitionDataPacket> dataAcquired) |
|
287 | QVector<AcquisitionDataPacket> dataAcquired) | |
271 | { |
|
288 | { | |
272 | if (auto var = impl->findVariable(vIdentifier)) { |
|
289 | auto retrievedDataSeries = impl->retrieveDataSeries(dataAcquired); | |
273 | var->setRange(rangeRequested); |
|
290 | auto varRequestId = impl->acceptVariableRequest(vIdentifier, retrievedDataSeries); | |
274 | var->setCacheRange(cacheRangeRequested); |
|
291 | if (!varRequestId.isNull()) { | |
275 | qCDebug(LOG_VariableController()) << tr("1: onDataProvided") << rangeRequested; |
|
292 | impl->updateVariableRequest(varRequestId); | |
276 | qCDebug(LOG_VariableController()) << tr("2: onDataProvided") << cacheRangeRequested; |
|
|||
277 |
|
||||
278 | auto retrievedDataSeries = impl->retrieveDataSeries(dataAcquired); |
|
|||
279 | qCDebug(LOG_VariableController()) << tr("3: onDataProvided") |
|
|||
280 | << retrievedDataSeries->range(); |
|
|||
281 | var->mergeDataSeries(retrievedDataSeries); |
|
|||
282 | qCDebug(LOG_VariableController()) << tr("4: onDataProvided"); |
|
|||
283 | emit var->updated(); |
|
|||
284 | } |
|
|||
285 | else { |
|
|||
286 | qCCritical(LOG_VariableController()) << tr("Impossible to provide data to a null variable"); |
|
|||
287 | } |
|
293 | } | |
288 | } |
|
294 | } | |
289 |
|
295 | |||
@@ -369,9 +375,11 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||||
369 | // First we check if the cache contains some of them. |
|
375 | // First we check if the cache contains some of them. | |
370 | // For the other, we ask the provider to give them. |
|
376 | // For the other, we ask the provider to give them. | |
371 |
|
377 | |||
|
378 | auto varRequestId = QUuid::createUuid(); | |||
|
379 | ||||
372 | for (const auto &var : variables) { |
|
380 | for (const auto &var : variables) { | |
373 |
qC |
|
381 | qCInfo(LOG_VariableController()) << "processRequest for" << var->name() << varRequestId; | |
374 | impl->processRequest(var, range); |
|
382 | impl->processRequest(var, range, varRequestId); | |
375 | } |
|
383 | } | |
376 |
|
384 | |||
377 | if (synchronise) { |
|
385 | if (synchronise) { | |
@@ -409,7 +417,7 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||||
409 | << var->name(); |
|
417 | << var->name(); | |
410 | auto vSyncRangeRequested |
|
418 | auto vSyncRangeRequested | |
411 | = computeSynchroRangeRequested(var->range(), range, oldRange); |
|
419 | = computeSynchroRangeRequested(var->range(), range, oldRange); | |
412 | impl->processRequest(var, vSyncRangeRequested); |
|
420 | impl->processRequest(var, vSyncRangeRequested, varRequestId); | |
413 | } |
|
421 | } | |
414 | else { |
|
422 | else { | |
415 | qCCritical(LOG_VariableController()) |
|
423 | qCCritical(LOG_VariableController()) | |
@@ -420,6 +428,8 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||||
420 | } |
|
428 | } | |
421 | } |
|
429 | } | |
422 | } |
|
430 | } | |
|
431 | ||||
|
432 | impl->updateVariableRequest(varRequestId); | |||
423 | } |
|
433 | } | |
424 |
|
434 | |||
425 |
|
435 | |||
@@ -463,22 +473,37 AcquisitionZoomType VariableController::getZoomType(const SqpRange &range, const | |||||
463 | } |
|
473 | } | |
464 |
|
474 | |||
465 | void VariableController::VariableControllerPrivate::processRequest(std::shared_ptr<Variable> var, |
|
475 | void VariableController::VariableControllerPrivate::processRequest(std::shared_ptr<Variable> var, | |
466 |
const SqpRange &rangeRequested |
|
476 | const SqpRange &rangeRequested, | |
|
477 | QUuid varRequestId) | |||
467 | { |
|
478 | { | |
468 |
|
479 | |||
469 | auto varRangesRequested |
|
480 | // TODO: protect at | |
470 | = m_VariableCacheStrategy->computeCacheRange(var->range(), rangeRequested); |
|
481 | auto varRequest = VariableRequest{}; | |
471 | auto notInCacheRangeList = var->provideNotInCacheRangeList(varRangesRequested.second); |
|
482 | auto varId = m_VariableToIdentifierMap.at(var); | |
472 | auto inCacheRangeList = var->provideInCacheRangeList(varRangesRequested.second); |
|
483 | ||
|
484 | ||||
|
485 | auto varStrategyRangesRequested | |||
|
486 | = m_VariableCacheStrategy->computeStrategyRanges(var->range(), rangeRequested); | |||
|
487 | auto notInCacheRangeList = var->provideNotInCacheRangeList(varStrategyRangesRequested.second); | |||
|
488 | auto inCacheRangeList = var->provideInCacheRangeList(varStrategyRangesRequested.second); | |||
473 |
|
489 | |||
474 | if (!notInCacheRangeList.empty()) { |
|
490 | if (!notInCacheRangeList.empty()) { | |
475 | auto identifier = m_VariableToIdentifierMap.at(var); |
|
491 | varRequest.m_RangeRequested = varStrategyRangesRequested.first; | |
|
492 | varRequest.m_CacheRangeRequested = varStrategyRangesRequested.second; | |||
|
493 | // store VarRequest | |||
|
494 | storeVariableRequest(varId, varRequestId, varRequest); | |||
|
495 | ||||
476 | auto varProvider = m_VariableToProviderMap.at(var); |
|
496 | auto varProvider = m_VariableToProviderMap.at(var); | |
477 | if (varProvider != nullptr) { |
|
497 | if (varProvider != nullptr) { | |
478 | m_VariableAcquisitionWorker->pushVariableRequest( |
|
498 | auto varRequestIdCanceled = m_VariableAcquisitionWorker->pushVariableRequest( | |
479 | identifier, varRangesRequested.first, varRangesRequested.second, |
|
499 | varRequestId, varId, varStrategyRangesRequested.first, | |
|
500 | varStrategyRangesRequested.second, | |||
480 | DataProviderParameters{std::move(notInCacheRangeList), var->metadata()}, |
|
501 | DataProviderParameters{std::move(notInCacheRangeList), var->metadata()}, | |
481 | varProvider); |
|
502 | varProvider); | |
|
503 | ||||
|
504 | if (!varRequestIdCanceled.isNull()) { | |||
|
505 | cancelVariableRequest(varRequestIdCanceled); | |||
|
506 | } | |||
482 | } |
|
507 | } | |
483 | else { |
|
508 | else { | |
484 | qCCritical(LOG_VariableController()) |
|
509 | qCCritical(LOG_VariableController()) | |
@@ -490,10 +515,13 void VariableController::VariableControllerPrivate::processRequest(std::shared_p | |||||
490 | } |
|
515 | } | |
491 | } |
|
516 | } | |
492 | else { |
|
517 | else { | |
493 | var->setRange(rangeRequested); |
|
518 | ||
494 |
var |
|
519 | varRequest.m_RangeRequested = varStrategyRangesRequested.first; | |
495 | var->setDataSeries(var->dataSeries()->subDataSeries(varRangesRequested.second)); |
|
520 | varRequest.m_CacheRangeRequested = varStrategyRangesRequested.second; | |
496 | emit var->updated(); |
|
521 | // store VarRequest | |
|
522 | storeVariableRequest(varId, varRequestId, varRequest); | |||
|
523 | acceptVariableRequest(varId, | |||
|
524 | var->dataSeries()->subDataSeries(varStrategyRangesRequested.second)); | |||
497 | } |
|
525 | } | |
498 | } |
|
526 | } | |
499 |
|
527 | |||
@@ -550,3 +578,157 void VariableController::VariableControllerPrivate::registerProvider( | |||||
550 | qCDebug(LOG_VariableController()) << tr("Cannot register provider, it already exists "); |
|
578 | qCDebug(LOG_VariableController()) << tr("Cannot register provider, it already exists "); | |
551 | } |
|
579 | } | |
552 | } |
|
580 | } | |
|
581 | ||||
|
582 |
void VariableController::VariableControllerPrivate::storeVariableRequest(
|
|||
|
583 | QUuid varId, QUuid varRequestId, const VariableRequest &varRequest) | |||
|
584 | { | |||
|
585 | // First request for the variable. we can create an entry for it | |||
|
586 | auto varIdToVarRequestIdQueueMapIt = m_VarIdToVarRequestIdQueueMap.find(varId); | |||
|
587 | if (varIdToVarRequestIdQueueMapIt == m_VarIdToVarRequestIdQueueMap.cend()) { | |||
|
588 | auto varRequestIdQueue = std::deque<QUuid>{}; | |||
|
589 | qCDebug(LOG_VariableController()) << tr("Store REQUEST in QUEUE"); | |||
|
590 | varRequestIdQueue.push_back(varRequestId); | |||
|
591 | m_VarIdToVarRequestIdQueueMap.insert(std::make_pair(varId, std::move(varRequestIdQueue))); | |||
|
592 | } | |||
|
593 | else { | |||
|
594 | qCDebug(LOG_VariableController()) << tr("Store REQUEST in EXISTING QUEUE"); | |||
|
595 | auto &varRequestIdQueue = varIdToVarRequestIdQueueMapIt->second; | |||
|
596 | varRequestIdQueue.push_back(varRequestId); | |||
|
597 | } | |||
|
598 | ||||
|
599 | auto varRequestIdToVarIdVarRequestMapIt = m_VarRequestIdToVarIdVarRequestMap.find(varRequestId); | |||
|
600 | if (varRequestIdToVarIdVarRequestMapIt == m_VarRequestIdToVarIdVarRequestMap.cend()) { | |||
|
601 | auto varIdToVarRequestMap = std::map<QUuid, VariableRequest>{}; | |||
|
602 | varIdToVarRequestMap.insert(std::make_pair(varId, varRequest)); | |||
|
603 | qCDebug(LOG_VariableController()) << tr("Store REQUESTID in MAP"); | |||
|
604 | m_VarRequestIdToVarIdVarRequestMap.insert( | |||
|
605 | std::make_pair(varRequestId, std::move(varIdToVarRequestMap))); | |||
|
606 | } | |||
|
607 | else { | |||
|
608 | auto &varIdToVarRequestMap = varRequestIdToVarIdVarRequestMapIt->second; | |||
|
609 | qCDebug(LOG_VariableController()) << tr("Store REQUESTID in EXISTING MAP"); | |||
|
610 | varIdToVarRequestMap.insert(std::make_pair(varId, varRequest)); | |||
|
611 | } | |||
|
612 | } | |||
|
613 | ||||
|
614 | QUuid VariableController::VariableControllerPrivate::acceptVariableRequest( | |||
|
615 | QUuid varId, std::shared_ptr<IDataSeries> dataSeries) | |||
|
616 | { | |||
|
617 | QUuid varRequestId; | |||
|
618 | auto varIdToVarRequestIdQueueMapIt = m_VarIdToVarRequestIdQueueMap.find(varId); | |||
|
619 | if (varIdToVarRequestIdQueueMapIt != m_VarIdToVarRequestIdQueueMap.cend()) { | |||
|
620 | auto &varRequestIdQueue = varIdToVarRequestIdQueueMapIt->second; | |||
|
621 | varRequestId = varRequestIdQueue.front(); | |||
|
622 | auto varRequestIdToVarIdVarRequestMapIt | |||
|
623 | = m_VarRequestIdToVarIdVarRequestMap.find(varRequestId); | |||
|
624 | if (varRequestIdToVarIdVarRequestMapIt != m_VarRequestIdToVarIdVarRequestMap.cend()) { | |||
|
625 | auto &varIdToVarRequestMap = varRequestIdToVarIdVarRequestMapIt->second; | |||
|
626 | auto varIdToVarRequestMapIt = varIdToVarRequestMap.find(varId); | |||
|
627 | if (varIdToVarRequestMapIt != varIdToVarRequestMap.cend()) { | |||
|
628 | qCDebug(LOG_VariableController()) << tr("acceptVariableRequest"); | |||
|
629 | auto &varRequest = varIdToVarRequestMapIt->second; | |||
|
630 | varRequest.m_DataSeries = dataSeries; | |||
|
631 | varRequest.m_CanUpdate = true; | |||
|
632 | } | |||
|
633 | else { | |||
|
634 | qCDebug(LOG_VariableController()) | |||
|
635 | << tr("Impossible to acceptVariableRequest of a unknown variable id attached " | |||
|
636 | "to a variableRequestId") | |||
|
637 | << varRequestId << varId; | |||
|
638 | } | |||
|
639 | } | |||
|
640 | else { | |||
|
641 | qCCritical(LOG_VariableController()) | |||
|
642 | << tr("Impossible to acceptVariableRequest of a unknown variableRequestId") | |||
|
643 | << varRequestId; | |||
|
644 | } | |||
|
645 | ||||
|
646 | qCDebug(LOG_VariableController()) << tr("1: erase REQUEST in QUEUE ?") | |||
|
647 | << varRequestIdQueue.size(); | |||
|
648 | varRequestIdQueue.pop_front(); | |||
|
649 | qCDebug(LOG_VariableController()) << tr("2: erase REQUEST in QUEUE ?") | |||
|
650 | << varRequestIdQueue.size(); | |||
|
651 | if (varRequestIdQueue.empty()) { | |||
|
652 | m_VarIdToVarRequestIdQueueMap.erase(varId); | |||
|
653 | } | |||
|
654 | } | |||
|
655 | else { | |||
|
656 | qCCritical(LOG_VariableController()) | |||
|
657 | << tr("Impossible to acceptVariableRequest of a unknown variable id") << varId; | |||
|
658 | } | |||
|
659 | ||||
|
660 | return varRequestId; | |||
|
661 | } | |||
|
662 | ||||
|
663 | void VariableController::VariableControllerPrivate::updateVariableRequest(QUuid varRequestId) | |||
|
664 | { | |||
|
665 | ||||
|
666 | auto varRequestIdToVarIdVarRequestMapIt = m_VarRequestIdToVarIdVarRequestMap.find(varRequestId); | |||
|
667 | if (varRequestIdToVarIdVarRequestMapIt != m_VarRequestIdToVarIdVarRequestMap.cend()) { | |||
|
668 | bool processVariableUpdate = true; | |||
|
669 | auto &varIdToVarRequestMap = varRequestIdToVarIdVarRequestMapIt->second; | |||
|
670 | for (auto varIdToVarRequestMapIt = varIdToVarRequestMap.cbegin(); | |||
|
671 | (varIdToVarRequestMapIt != varIdToVarRequestMap.cend()) && processVariableUpdate; | |||
|
672 | ++varIdToVarRequestMapIt) { | |||
|
673 | processVariableUpdate &= varIdToVarRequestMapIt->second.m_CanUpdate; | |||
|
674 | qCDebug(LOG_VariableController()) << tr("updateVariableRequest") | |||
|
675 | << processVariableUpdate; | |||
|
676 | } | |||
|
677 | ||||
|
678 | if (processVariableUpdate) { | |||
|
679 | for (auto varIdToVarRequestMapIt = varIdToVarRequestMap.cbegin(); | |||
|
680 | varIdToVarRequestMapIt != varIdToVarRequestMap.cend(); ++varIdToVarRequestMapIt) { | |||
|
681 | if (auto var = findVariable(varIdToVarRequestMapIt->first)) { | |||
|
682 | auto &varRequest = varIdToVarRequestMapIt->second; | |||
|
683 | var->setRange(varRequest.m_RangeRequested); | |||
|
684 | var->setCacheRange(varRequest.m_CacheRangeRequested); | |||
|
685 | qCInfo(LOG_VariableController()) << tr("1: onDataProvided") | |||
|
686 | << varRequest.m_RangeRequested; | |||
|
687 | qCInfo(LOG_VariableController()) << tr("2: onDataProvided") | |||
|
688 | << varRequest.m_CacheRangeRequested; | |||
|
689 | var->mergeDataSeries(varRequest.m_DataSeries); | |||
|
690 | qCInfo(LOG_VariableController()) << tr("3: onDataProvided") | |||
|
691 | << varRequest.m_DataSeries->range(); | |||
|
692 | qCDebug(LOG_VariableController()) << tr("4: onDataProvided"); | |||
|
693 | emit var->updated(); | |||
|
694 | } | |||
|
695 | else { | |||
|
696 | qCCritical(LOG_VariableController()) | |||
|
697 | << tr("Impossible to update data to a null variable"); | |||
|
698 | } | |||
|
699 | } | |||
|
700 | ||||
|
701 | // cleaning varRequestId | |||
|
702 | qCDebug(LOG_VariableController()) << tr("0: erase REQUEST in MAP ?") | |||
|
703 | << m_VarRequestIdToVarIdVarRequestMap.size(); | |||
|
704 | m_VarRequestIdToVarIdVarRequestMap.erase(varRequestId); | |||
|
705 | qCDebug(LOG_VariableController()) << tr("1: erase REQUEST in MAP ?") | |||
|
706 | << m_VarRequestIdToVarIdVarRequestMap.size(); | |||
|
707 | } | |||
|
708 | } | |||
|
709 | else { | |||
|
710 | qCCritical(LOG_VariableController()) | |||
|
711 | << tr("Cannot updateVariableRequest for a unknow varRequestId") << varRequestId; | |||
|
712 | } | |||
|
713 | } | |||
|
714 | ||||
|
715 | void VariableController::VariableControllerPrivate::cancelVariableRequest(QUuid varRequestId) | |||
|
716 | { | |||
|
717 | // cleaning varRequestId | |||
|
718 | m_VarRequestIdToVarIdVarRequestMap.erase(varRequestId); | |||
|
719 | ||||
|
720 | for (auto varIdToVarRequestIdQueueMapIt = m_VarIdToVarRequestIdQueueMap.begin(); | |||
|
721 | varIdToVarRequestIdQueueMapIt != m_VarIdToVarRequestIdQueueMap.end();) { | |||
|
722 | auto &varRequestIdQueue = varIdToVarRequestIdQueueMapIt->second; | |||
|
723 | varRequestIdQueue.erase( | |||
|
724 | std::remove(varRequestIdQueue.begin(), varRequestIdQueue.end(), varRequestId), | |||
|
725 | varRequestIdQueue.end()); | |||
|
726 | if (varRequestIdQueue.empty()) { | |||
|
727 | varIdToVarRequestIdQueueMapIt | |||
|
728 | = m_VarIdToVarRequestIdQueueMap.erase(varIdToVarRequestIdQueueMapIt); | |||
|
729 | } | |||
|
730 | else { | |||
|
731 | ++varIdToVarRequestIdQueueMapIt; | |||
|
732 | } | |||
|
733 | } | |||
|
734 | } |
General Comments 3
Pull request updated. Auto status change to "Under Review"
Changed commits: * 1 added * 0 removed Changed files: * M core/include/Data/AcquisitionRequest.h * M core/include/Variable/VariableAcquisitionWorker.h * M core/include/Variable/VariableCacheStrategy.h * M core/include/Variable/VariableController.h * M core/src/Variable/VariableAcquisitionWorker.cpp * M core/src/Variable/VariableCacheStrategy.cpp * M core/src/Variable/VariableController.cpp * M gui/src/Visualization/VisualizationZoneWidget.cpp * M plugins/amda/include/AmdaPlugin.h * M plugins/amda/src/AmdaProvider.cpp * M plugins/amda/tests/TestAmdaAcquisition.cpp * M plugins/mockplugin/include/MockPlugin.h * R COPYING * R app/src/MainWindow.cpp * R app/ui/MainWindow.ui * R cmake/sciqlop_package_qt.cmake * R core/include/Common/DateUtils.h * R core/include/Common/MetaTypes.h * R core/include/Common/SortUtils.h * R core/include/CoreGlobal.h * R core/include/Data/AcquisitionDataPacket.h * R core/include/Data/ArrayData.h * R core/include/Data/DataProviderParameters.h * R core/include/Data/DataSeries.h * R core/include/Data/DataSeriesIterator.h * R core/include/Data/IDataProvider.h * R core/include/Data/IDataSeries.h * R core/include/Data/ScalarSeries.h * R core/include/Data/SqpRange.h * R core/include/Data/VectorSeries.h * R core/include/DataSource/DataSourceItemAction.h * R core/include/Network/NetworkController.h * R core/include/Plugin/PluginManager.h * R core/include/Settings/ISqpSettingsBindable.h * R core/include/Settings/SqpSettingsDefs.h * R core/include/Time/TimeController.h * R core/include/Variable/Variable.h * R core/include/Variable/VariableCacheController.h * R core/include/Variable/VariableModel.h * R core/include/Variable/VariableSynchronizationGroup.h * R core/include/Visualization/VisualizationController.h * R core/src/Common/DateUtils.cpp * R core/src/Data/DataSeriesIterator.cpp * R core/src/Data/ScalarSeries.cpp * R core/src/Data/VectorSeries.cpp * R core/src/DataSource/DataSourceItemAction.cpp * R core/src/Network/NetworkController.cpp * R core/src/Plugin/PluginManager.cpp * R core/src/Settings/SqpSettingsDefs.cpp * R core/src/Time/TimeController.cpp * R core/src/Variable/Variable.cpp * R core/src/Variable/VariableCacheController.cpp * R core/src/Variable/VariableModel.cpp * R core/src/Variable/VariableSynchronizationGroup.cpp * R core/src/Visualization/VisualizationController.cpp * R core/tests/Data/TestDataSeries.cpp * R core/tests/Data/TestOneDimArrayData.cpp * R core/tests/Data/TestTwoDimArrayData.cpp * R core/tests/Variable/TestVariable.cpp * R core/tests/Variable/TestVariableCacheController.cpp * R gui/include/Common/ColorUtils.h * R gui/include/DataSource/DataSourceTreeWidgetHelper.h * R gui/include/DataSource/DataSourceTreeWidgetItem.h * R gui/include/DataSource/DataSourceWidget.h * R gui/include/Settings/SqpSettingsDialog.h * R gui/include/Settings/SqpSettingsGeneralWidget.h * R gui/include/SidePane/SqpSidePane.h * R gui/include/TimeWidget/TimeWidget.h * R gui/include/Variable/VariableInspectorWidget.h * R gui/include/Variable/VariableMenuHeaderWidget.h * R gui/include/Visualization/IVariableContainer.h * R gui/include/Visualization/IVisualizationWidget.h * R gui/include/Visualization/IVisualizationWidgetVisitor.h * R gui/include/Visualization/VisualizationDefs.h * R gui/include/Visualization/VisualizationGraphHelper.h * R gui/include/Visualization/VisualizationGraphRenderingDelegate.h * R gui/include/Visualization/VisualizationGraphWidget.h * R gui/include/Visualization/VisualizationTabWidget.h * R gui/include/Visualization/VisualizationWidget.h * R gui/include/Visualization/VisualizationZoneWidget.h * R gui/include/Visualization/operations/GenerateVariableMenuOperation.h * R gui/include/Visualization/operations/MenuBuilder.h * R gui/include/Visualization/operations/RemoveVariableOperation.h * R gui/include/Visualization/operations/RescaleAxeOperation.h * R gui/include/Visualization/qcustomplot.h * R gui/resources/icones/dataSourceComponent.png * R gui/resources/icones/dataSourceNode.png * R gui/resources/icones/dataSourceProduct.png * R gui/resources/icones/dataSourceRoot.png * R gui/resources/icones/delete.png * R gui/resources/icones/next.png * R gui/resources/icones/openInspector.png * R gui/resources/icones/plot.png * R gui/resources/icones/previous.png * R gui/resources/icones/sciqlop2PNG_1024.png * R gui/resources/icones/unplot.png * R gui/resources/sqpguiresources.qrc * R gui/src/Common/ColorUtils.cpp * R gui/src/DataSource/DataSourceTreeWidgetHelper.cpp * R gui/src/DataSource/DataSourceTreeWidgetItem.cpp * R gui/src/DataSource/DataSourceWidget.cpp * R gui/src/Settings/SqpSettingsDialog.cpp * R gui/src/Settings/SqpSettingsGeneralWidget.cpp * R gui/src/SidePane/SqpSidePane.cpp * R gui/src/TimeWidget/TimeWidget.cpp * R gui/src/Variable/VariableInspectorWidget.cpp * R gui/src/Variable/VariableMenuHeaderWidget.cpp * R gui/src/Visualization/VisualizationGraphHelper.cpp * R gui/src/Visualization/VisualizationGraphRenderingDelegate.cpp * R gui/src/Visualization/VisualizationGraphWidget.cpp * R gui/src/Visualization/VisualizationTabWidget.cpp * R gui/src/Visualization/VisualizationWidget.cpp * R gui/src/Visualization/operations/GenerateVariableMenuOperation.cpp * R gui/src/Visualization/operations/MenuBuilder.cpp * R gui/src/Visualization/operations/RemoveVariableOperation.cpp * R gui/src/Visualization/operations/RescaleAxeOperation.cpp * R gui/src/Visualization/qcustomplot.cpp * R gui/ui/DataSource/DataSourceWidget.ui * R gui/ui/Settings/SqpSettingsDialog.ui * R gui/ui/Settings/SqpSettingsGeneralWidget.ui * R gui/ui/SidePane/SqpSidePane.ui * R gui/ui/TimeWidget/TimeWidget.ui * R gui/ui/Variable/VariableInspectorWidget.ui * R gui/ui/Variable/VariableMenuHeaderWidget.ui * R gui/ui/Visualization/VisualizationGraphWidget.ui * R gui/ui/Visualization/VisualizationTabWidget.ui * R gui/ui/Visualization/VisualizationWidget.ui * R gui/ui/Visualization/VisualizationZoneWidget.ui * R gui/vera-exclusions/exclusions.txt * R plugin/CMakeLists.txt * R plugin/cmake/Findsciqlop-plugin.cmake * R plugin/include/Plugin/IPlugin.h * R plugins/amda/CMakeLists.txt * R plugins/amda/cmake/Findsciqlop-amda.cmake * R plugins/amda/include/AmdaDefs.h * R plugins/amda/include/AmdaGlobal.h * R plugins/amda/include/AmdaParser.h * R plugins/amda/include/AmdaProvider.h * R plugins/amda/include/AmdaResultParser.h * R plugins/amda/resources/amda.json * R plugins/amda/resources/amdaresources.qrc * R plugins/amda/resources/samples/AmdaSample.json * R plugins/amda/resources/samples/AmdaSampleV2.json * R plugins/amda/src/AmdaDefs.cpp * R plugins/amda/src/AmdaParser.cpp * R plugins/amda/src/AmdaPlugin.cpp * R plugins/amda/src/AmdaResultParser.cpp * R plugins/amda/tests-resources/TestAmdaAcquisition/AmdaData-2012-01-01-12-00-00_2012-01-03-12-00-00.txt * R plugins/amda/tests-resources/TestAmdaParser/TwoRootsFile.json * R plugins/amda/tests-resources/TestAmdaParser/ValidFile1.json * R plugins/amda/tests-resources/TestAmdaParser/WrongRootKey.json * R plugins/amda/tests-resources/TestAmdaParser/WrongRootType.json * R plugins/amda/tests-resources/TestAmdaResultParser/FileNotFound.txt * R plugins/amda/tests-resources/TestAmdaResultParser/NaNValue.txt * R plugins/amda/tests-resources/TestAmdaResultParser/NaNX.txt * R plugins/amda/tests-resources/TestAmdaResultParser/NoUnit.txt * R plugins/amda/tests-resources/TestAmdaResultParser/TooManyValues.txt * R plugins/amda/tests-resources/TestAmdaResultParser/ValidScalar1.txt * R plugins/amda/tests-resources/TestAmdaResultParser/ValidVector1.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongDate.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongUnit.txt * R plugins/amda/tests-resources/TestAmdaResultParser/WrongValue.txt * R plugins/amda/tests/TestAmdaParser.cpp * R plugins/amda/tests/TestAmdaResultParser.cpp * R plugins/mockplugin/CMakeLists.txt * R plugins/mockplugin/cmake/Findsciqlop-mockplugin.cmake * R plugins/mockplugin/include/CosinusProvider.h * R plugins/mockplugin/include/MockPluginGlobal.h * R plugins/mockplugin/resources/mockplugin.json * R plugins/mockplugin/src/CosinusProvider.cpp * R plugins/mockplugin/src/MockPlugin.cpp * R README.md * R app/CMakeLists.txt * R app/include/MainWindow.h * R app/src/Main.cpp * R app/vera-exclusions/exclusions.txt * R cmake/sciqlop.cmake * R cmake/sciqlop_applications.cmake * R cmake/sciqlop_package.cmake * R cmake/sciqlop_params.cmake * R core/CMakeLists.txt * R core/include/Common/spimpl.h * R core/include/DataSource/DataSourceController.h * R core/include/DataSource/DataSourceItem.h * R core/src/DataSource/DataSourceController.cpp * R core/src/DataSource/DataSourceItem.cpp * R core/tests/DataSource/TestDataSourceController.cpp * R core/vera-exclusions/exclusions.txt * R formatting/cmake/use_clangformat.cmake * R formatting/vera-exclusions/exclusions.txt * R gui/CMakeLists.txt * R gui/include/SqpApplication.h * R gui/src/SqpApplication.cpp * R LICENSE * R app/src/mainwindow.cpp * R app/src/mainwindow.ui
Status change > Approved
You need to be logged in to leave comments.
Login now