Auto status change to "Under Review"
@@ -55,11 +55,15 signals: | |||
|
55 | 55 | const SqpRange &dataRangeAcquired); |
|
56 | 56 | |
|
57 | 57 | /** |
|
58 | * @brief dataProvided send dataSeries under dateTime and that corresponds of the data | |
|
59 | * identified by identifier | |
|
58 | * @brief dataProvidedProgress notify the progression of the data identifier by acqIdentifier | |
|
60 | 59 |
|
|
61 | 60 | void dataProvidedProgress(QUuid acqIdentifier, double progress); |
|
62 | 61 | |
|
62 | /** | |
|
63 | * @brief dataProvidedFailed notify that data acquisition has failed | |
|
64 | */ | |
|
65 | void dataProvidedFailed(QUuid acqIdentifier); | |
|
66 | ||
|
63 | 67 | |
|
64 | 68 | /** |
|
65 | 69 | * @brief requestConstructed send a request for the data identified by acqIdentifier |
@@ -43,10 +43,15 signals: | |||
|
43 | 43 | |
|
44 | 44 | void variableRequestInProgress(QUuid vIdentifier, double progress); |
|
45 | 45 | |
|
46 | ||
|
47 | void variableCanceledRequested(QUuid vIdentifier); | |
|
48 | ||
|
49 | ||
|
46 | 50 | public slots: |
|
47 | 51 | void onVariableDataAcquired(QUuid acqIdentifier, std::shared_ptr<IDataSeries> dataSeries, |
|
48 | 52 | SqpRange dataRangeAcquired); |
|
49 | 53 | void onVariableRetrieveDataInProgress(QUuid acqIdentifier, double progress); |
|
54 | void onVariableAcquisitionFailed(QUuid acqIdentifier); | |
|
50 | 55 | |
|
51 | 56 | private: |
|
52 | 57 | void waitForFinish(); |
@@ -106,6 +106,7 public slots: | |||
|
106 | 106 | |
|
107 | 107 | /// Cancel the current request for the variable |
|
108 | 108 | void onAbortProgressRequested(std::shared_ptr<Variable> variable); |
|
109 | void onAbortAcquisitionRequested(QUuid vIdentifier); | |
|
109 | 110 | |
|
110 | 111 | // synchronization group methods |
|
111 | 112 | void onAddSynchronizationGroupId(QUuid synchronizationGroupId); |
@@ -67,6 +67,7 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v | |||
|
67 | 67 | |
|
68 | 68 | // Request creation |
|
69 | 69 | auto acqRequest = AcquisitionRequest{}; |
|
70 | qCInfo(LOG_VariableAcquisitionWorker()) << tr("TpushVariableRequest ") << vIdentifier; | |
|
70 | 71 | acqRequest.m_VarRequestId = varRequestId; |
|
71 | 72 | acqRequest.m_vIdentifier = vIdentifier; |
|
72 | 73 | acqRequest.m_DataProviderParameters = parameters; |
@@ -157,7 +158,8 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti | |||
|
157 | 158 | auto finalProgression = currentAlreadyProgress + currentPartProgress; |
|
158 | 159 | emit variableRequestInProgress(aIdToARit->second.m_vIdentifier, finalProgression); |
|
159 | 160 | qCDebug(LOG_VariableAcquisitionWorker()) |
|
160 |
<< tr("TORM: onVariableRetrieveDataInProgress ") |
|
|
161 | << tr("TORM: onVariableRetrieveDataInProgress ") | |
|
162 | << QThread::currentThread()->objectName() << aIdToARit->second.m_vIdentifier | |
|
161 | 163 | << currentPartSize << currentAlreadyProgress << currentPartProgress << finalProgression; |
|
162 | 164 | if (finalProgression == 100.0) { |
|
163 | 165 | emit variableRequestInProgress(aIdToARit->second.m_vIdentifier, 0.0); |
@@ -166,6 +168,26 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti | |||
|
166 | 168 | impl->unlock(); |
|
167 | 169 | } |
|
168 | 170 | |
|
171 | void VariableAcquisitionWorker::onVariableAcquisitionFailed(QUuid acqIdentifier) | |
|
172 | { | |
|
173 | qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed") | |
|
174 | << QThread::currentThread(); | |
|
175 | impl->lockRead(); | |
|
176 | auto it = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier); | |
|
177 | if (it != impl->m_AcqIdentifierToAcqRequestMap.cend()) { | |
|
178 | auto request = it->second; | |
|
179 | impl->unlock(); | |
|
180 | qCInfo(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed") | |
|
181 | << acqIdentifier << request.m_vIdentifier | |
|
182 | << QThread::currentThread(); | |
|
183 | emit variableCanceledRequested(request.m_vIdentifier); | |
|
184 | } | |
|
185 | else { | |
|
186 | impl->unlock(); | |
|
187 | // TODO log no acqIdentifier recognized | |
|
188 | } | |
|
189 | } | |
|
190 | ||
|
169 | 191 | void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, |
|
170 | 192 | std::shared_ptr<IDataSeries> dataSeries, |
|
171 | 193 | SqpRange dataRangeAcquired) |
@@ -151,12 +151,17 VariableController::VariableController(QObject *parent) | |||
|
151 | 151 | connect(impl->m_VariableModel, &VariableModel::abortProgessRequested, this, |
|
152 | 152 | &VariableController::onAbortProgressRequested); |
|
153 | 153 | |
|
154 | connect(impl->m_VariableAcquisitionWorker.get(), | |
|
155 | &VariableAcquisitionWorker::variableCanceledRequested, this, | |
|
156 | &VariableController::onAbortAcquisitionRequested); | |
|
157 | ||
|
154 | 158 | connect(impl->m_VariableAcquisitionWorker.get(), &VariableAcquisitionWorker::dataProvided, this, |
|
155 | 159 | &VariableController::onDataProvided); |
|
156 | 160 | connect(impl->m_VariableAcquisitionWorker.get(), |
|
157 | 161 | &VariableAcquisitionWorker::variableRequestInProgress, this, |
|
158 | 162 | &VariableController::onVariableRetrieveDataInProgress); |
|
159 | 163 | |
|
164 | ||
|
160 | 165 | connect(&impl->m_VariableAcquisitionWorkerThread, &QThread::started, |
|
161 | 166 | impl->m_VariableAcquisitionWorker.get(), &VariableAcquisitionWorker::initialize); |
|
162 | 167 | connect(&impl->m_VariableAcquisitionWorkerThread, &QThread::finished, |
@@ -273,6 +278,7 VariableController::createVariable(const QString &name, const QVariantHash &meta | |||
|
273 | 278 | |
|
274 | 279 | // Associate the provider |
|
275 | 280 | impl->m_VariableToProviderMap[newVariable] = provider; |
|
281 | qCInfo(LOG_VariableController()) << "createVariable: " << identifier; | |
|
276 | 282 | impl->m_VariableToIdentifierMap[newVariable] = identifier; |
|
277 | 283 | |
|
278 | 284 | |
@@ -358,6 +364,20 void VariableController::onAbortProgressRequested(std::shared_ptr<Variable> vari | |||
|
358 | 364 | } |
|
359 | 365 | } |
|
360 | 366 | |
|
367 | void VariableController::onAbortAcquisitionRequested(QUuid vIdentifier) | |
|
368 | { | |
|
369 | qCDebug(LOG_VariableController()) << "TORM: variableController::onAbortAcquisitionRequested" | |
|
370 | << QThread::currentThread()->objectName() << vIdentifier; | |
|
371 | ||
|
372 | if (auto var = impl->findVariable(vIdentifier)) { | |
|
373 | this->onAbortProgressRequested(var); | |
|
374 | } | |
|
375 | else { | |
|
376 | qCCritical(LOG_VariableController()) | |
|
377 | << tr("Impossible to abort Acquisition Requestof a null variable"); | |
|
378 | } | |
|
379 | } | |
|
380 | ||
|
361 | 381 | void VariableController::onAddSynchronizationGroupId(QUuid synchronizationGroupId) |
|
362 | 382 | { |
|
363 | 383 | qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronizationGroupId" |
@@ -645,6 +665,9 void VariableController::VariableControllerPrivate::registerProvider( | |||
|
645 | 665 | connect(provider.get(), &IDataProvider::dataProvidedProgress, |
|
646 | 666 | m_VariableAcquisitionWorker.get(), |
|
647 | 667 | &VariableAcquisitionWorker::onVariableRetrieveDataInProgress); |
|
668 | connect(provider.get(), &IDataProvider::dataProvidedFailed, | |
|
669 | m_VariableAcquisitionWorker.get(), | |
|
670 | &VariableAcquisitionWorker::onVariableAcquisitionFailed); | |
|
648 | 671 | } |
|
649 | 672 | else { |
|
650 | 673 | qCDebug(LOG_VariableController()) << tr("Cannot register provider, it already exists "); |
@@ -715,12 +738,10 QUuid VariableController::VariableControllerPrivate::acceptVariableRequest( | |||
|
715 | 738 | << varRequestId; |
|
716 | 739 | } |
|
717 | 740 | |
|
718 | qCDebug(LOG_VariableController()) << tr("1: erase REQUEST in QUEUE ?") | |
|
719 | << varRequestIdQueue.size(); | |
|
720 | 741 | varRequestIdQueue.pop_front(); |
|
721 | qCDebug(LOG_VariableController()) << tr("2: erase REQUEST in QUEUE ?") | |
|
722 | << varRequestIdQueue.size(); | |
|
723 | 742 | if (varRequestIdQueue.empty()) { |
|
743 | qCDebug(LOG_VariableController()) | |
|
744 | << tr("TORM Erase REQUEST because it has been accepted") << varId; | |
|
724 | 745 | m_VarIdToVarRequestIdQueueMap.erase(varId); |
|
725 | 746 | } |
|
726 | 747 | } |
@@ -82,7 +82,7 void AmdaProvider::requestDataLoading(QUuid acqIdentifier, const DataProviderPar | |||
|
82 | 82 | const auto times = parameters.m_Times; |
|
83 | 83 | const auto data = parameters.m_Data; |
|
84 | 84 | for (const auto &dateTime : qAsConst(times)) { |
|
85 |
qC |
|
|
85 | qCDebug(LOG_AmdaProvider()) << tr("TORM AmdaProvider::requestDataLoading ") << acqIdentifier | |
|
86 | 86 | << dateTime; |
|
87 | 87 | this->retrieveData(acqIdentifier, dateTime, data); |
|
88 | 88 | |
@@ -125,8 +125,8 void AmdaProvider::onReplyDownloadProgress(QUuid acqIdentifier, | |||
|
125 | 125 | // This case can happened when a progression is send after the request has been |
|
126 | 126 | // finished. |
|
127 | 127 | // Generaly the case when aborting a request |
|
128 |
qC |
|
|
129 |
|
|
|
128 | qCDebug(LOG_AmdaProvider()) << tr("Can't retrieve Request in progress") << acqIdentifier | |
|
129 | << networkRequest.get() << progress; | |
|
130 | 130 | } |
|
131 | 131 | |
|
132 | 132 | // Compute the current final progress and notify it |
@@ -199,6 +199,7 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
199 | 199 | } |
|
200 | 200 | else { |
|
201 | 201 | /// @todo ALX : debug |
|
202 | emit dataProvidedFailed(dataId); | |
|
202 | 203 | } |
|
203 | 204 | } |
|
204 | 205 | qCDebug(LOG_AmdaProvider()) << tr("acquisition requests erase because of finishing") |
@@ -207,6 +208,7 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
207 | 208 | } |
|
208 | 209 | else { |
|
209 | 210 | qCCritical(LOG_AmdaProvider()) << tr("httpDownloadFinished ERROR"); |
|
211 | emit dataProvidedFailed(dataId); | |
|
210 | 212 | } |
|
211 | 213 | |
|
212 | 214 | }; |
@@ -228,12 +230,16 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
228 | 230 | updateRequestProgress(dataId, request, 0.0); |
|
229 | 231 | emit requestConstructed(request, dataId, httpDownloadFinished); |
|
230 | 232 | } |
|
233 | else { | |
|
234 | emit dataProvidedFailed(dataId); | |
|
235 | } | |
|
231 | 236 | } |
|
232 | 237 | else { |
|
233 | 238 | qCDebug(LOG_AmdaProvider()) |
|
234 | 239 | << tr("acquisition requests erase because of aborting") << dataId; |
|
235 | 240 | qCCritical(LOG_AmdaProvider()) << tr("httpFinishedLambda ERROR"); |
|
236 | 241 | m_AcqIdToRequestProgressMap.erase(dataId); |
|
242 | emit dataProvidedFailed(dataId); | |
|
237 | 243 | } |
|
238 | 244 | }; |
|
239 | 245 |
General Comments 2
Pull request updated. Auto status change to "Under Review"
Changed commits: * 2 added * 0 removed Changed files: * A core/include/Variable/VariableAcquisitionWorker.h * M core/include/Data/IDataProvider.h * M core/include/Variable/VariableController.h * M core/src/Network/NetworkController.cpp * M core/src/Variable/VariableAcquisitionWorker.cpp * M core/src/Variable/VariableController.cpp * M plugins/amda/src/AmdaProvider.cpp
You need to be logged in to leave comments.
Login now