@@ -28,8 +28,6 struct AcquisitionRequest { | |||
|
28 | 28 | QUuid m_AcqIdentifier; |
|
29 | 29 | QUuid m_vIdentifier; |
|
30 | 30 | DataProviderParameters m_DataProviderParameters; |
|
31 | SqpRange m_RangeRequested; | |
|
32 | SqpRange m_CacheRangeRequested; | |
|
33 | 31 | int m_Size; |
|
34 | 32 | int m_Progression; |
|
35 | 33 | std::shared_ptr<IDataProvider> m_Provider; |
@@ -28,8 +28,8 public: | |||
|
28 | 28 | explicit VariableAcquisitionWorker(QObject *parent = 0); |
|
29 | 29 | virtual ~VariableAcquisitionWorker(); |
|
30 | 30 | |
|
31 |
QUuid pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, |
|
|
32 |
|
|
|
31 | QUuid pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, | |
|
32 | DataProviderParameters parameters, | |
|
33 | 33 | std::shared_ptr<IDataProvider> provider); |
|
34 | 34 | |
|
35 | 35 | void abortProgressRequested(QUuid vIdentifier); |
@@ -37,9 +37,7 public: | |||
|
37 | 37 | void initialize(); |
|
38 | 38 | void finalize(); |
|
39 | 39 | signals: |
|
40 |
void dataProvided(QUuid vIdentifier, |
|
|
41 | const SqpRange &cacheRangeRequested, | |
|
42 | QVector<AcquisitionDataPacket> dataAcquired); | |
|
40 | void dataProvided(QUuid vIdentifier, QVector<AcquisitionDataPacket> dataAcquired); | |
|
43 | 41 | |
|
44 | 42 | void variableRequestInProgress(QUuid vIdentifier, double progress); |
|
45 | 43 |
@@ -112,9 +112,7 public slots: | |||
|
112 | 112 | void onUpdateDateTime(std::shared_ptr<Variable> variable, const SqpRange &dateTime); |
|
113 | 113 | |
|
114 | 114 | |
|
115 |
void onDataProvided(QUuid vIdentifier, |
|
|
116 | const SqpRange &cacheRangeRequested, | |
|
117 | QVector<AcquisitionDataPacket> dataAcquired); | |
|
115 | void onDataProvided(QUuid vIdentifier, QVector<AcquisitionDataPacket> dataAcquired); | |
|
118 | 116 | |
|
119 | 117 | void onVariableRetrieveDataInProgress(QUuid identifier, double progress); |
|
120 | 118 |
@@ -60,13 +60,12 VariableAcquisitionWorker::~VariableAcquisitionWorker() | |||
|
60 | 60 | |
|
61 | 61 | |
|
62 | 62 | QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, |
|
63 | SqpRange rangeRequested, | |
|
64 | SqpRange cacheRangeRequested, | |
|
65 | 63 | DataProviderParameters parameters, |
|
66 | 64 | std::shared_ptr<IDataProvider> provider) |
|
67 | 65 | { |
|
68 | 66 | qCDebug(LOG_VariableAcquisitionWorker()) |
|
69 |
<< tr("TORM VariableAcquisitionWorker::pushVariableRequest ") << |
|
|
67 | << tr("TORM VariableAcquisitionWorker::pushVariableRequest varRequestId: ") << varRequestId | |
|
68 | << "vId: " << vIdentifier; | |
|
70 | 69 | auto varRequestIdCanceled = QUuid(); |
|
71 | 70 | |
|
72 | 71 | // Request creation |
@@ -75,8 +74,6 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v | |||
|
75 | 74 | acqRequest.m_VarRequestId = varRequestId; |
|
76 | 75 | acqRequest.m_vIdentifier = vIdentifier; |
|
77 | 76 | acqRequest.m_DataProviderParameters = parameters; |
|
78 | acqRequest.m_RangeRequested = rangeRequested; | |
|
79 | acqRequest.m_CacheRangeRequested = cacheRangeRequested; | |
|
80 | 77 | acqRequest.m_Size = parameters.m_Times.size(); |
|
81 | 78 | acqRequest.m_Provider = provider; |
|
82 | 79 | |
@@ -230,12 +227,10 void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, | |||
|
230 | 227 | // removed the finished request |
|
231 | 228 | if (acqRequest.m_Size == acqRequest.m_Progression) { |
|
232 | 229 | auto varId = acqRequest.m_vIdentifier; |
|
233 | auto rangeRequested = acqRequest.m_RangeRequested; | |
|
234 | auto cacheRangeRequested = acqRequest.m_CacheRangeRequested; | |
|
235 | 230 | // Return the data |
|
236 | 231 | aIdToADPVit = impl->m_AcqIdentifierToAcqDataPacketVectorMap.find(acqIdentifier); |
|
237 | 232 | if (aIdToADPVit != impl->m_AcqIdentifierToAcqDataPacketVectorMap.cend()) { |
|
238 |
emit dataProvided(varId, |
|
|
233 | emit dataProvided(varId, aIdToADPVit->second); | |
|
239 | 234 | } |
|
240 | 235 | impl->unlock(); |
|
241 | 236 |
@@ -368,11 +368,6 VariableController::createVariable(const QString &name, const QVariantHash &meta | |||
|
368 | 368 | |
|
369 | 369 | this->onRequestDataLoading(QVector<std::shared_ptr<Variable> >{newVariable}, range, false); |
|
370 | 370 | |
|
371 | // auto varRequestId = QUuid::createUuid(); | |
|
372 | // qCInfo(LOG_VariableController()) << "createVariable: " << varId << varRequestId; | |
|
373 | // impl->processRequest(newVariable, range, varRequestId); | |
|
374 | // impl->updateVariableRequest(varRequestId); | |
|
375 | ||
|
376 | 371 | emit variableAdded(newVariable); |
|
377 | 372 | |
|
378 | 373 | return newVariable; |
@@ -441,8 +436,7 void VariableController::onUpdateDateTime(std::shared_ptr<Variable> variable, | |||
|
441 | 436 | this->onRequestDataLoading(QVector<std::shared_ptr<Variable> >{variable}, dateTime, synchro); |
|
442 | 437 | } |
|
443 | 438 | |
|
444 |
void VariableController::onDataProvided(QUuid vIdentifier, |
|
|
445 | const SqpRange &cacheRangeRequested, | |
|
439 | void VariableController::onDataProvided(QUuid vIdentifier, | |
|
446 | 440 | QVector<AcquisitionDataPacket> dataAcquired) |
|
447 | 441 | { |
|
448 | 442 | qCDebug(LOG_VariableController()) << tr("onDataProvided") << QThread::currentThread(); |
@@ -455,10 +449,11 void VariableController::onDataProvided(QUuid vIdentifier, const SqpRange &range | |||
|
455 | 449 | |
|
456 | 450 | void VariableController::onVariableRetrieveDataInProgress(QUuid identifier, double progress) |
|
457 | 451 | { |
|
458 | qCDebug(LOG_VariableController()) | |
|
459 | << "TORM: variableController::onVariableRetrieveDataInProgress" | |
|
452 | qCDebug(LOG_VariableController()) << "TORM: variableController::onVariableRetrieveDataInProgress" | |
|
460 | 453 | << QThread::currentThread()->objectName() << progress; |
|
461 | 454 | if (auto var = impl->findVariable(identifier)) { |
|
455 | qCDebug(LOG_VariableController()) | |
|
456 | << "TORM: variableController::onVariableRetrieveDataInProgress FOUND"; | |
|
462 | 457 | impl->m_VariableModel->setDataProgress(var, progress); |
|
463 | 458 | } |
|
464 | 459 | else { |
@@ -1059,8 +1054,7 void VariableController::VariableControllerPrivate::executeVarRequest(std::share | |||
|
1059 | 1054 | qCDebug(LOG_VariableController()) << "executeVarRequest " << varRequest.m_RangeRequested |
|
1060 | 1055 | << varRequest.m_CacheRangeRequested; |
|
1061 | 1056 | m_VariableAcquisitionWorker->pushVariableRequest( |
|
1062 |
varRequest.m_VariableGroupId, varId, |
|
|
1063 | varRequest.m_CacheRangeRequested, | |
|
1057 | varRequest.m_VariableGroupId, varId, | |
|
1064 | 1058 | DataProviderParameters{std::move(notInCacheRangeList), var->metadata()}, |
|
1065 | 1059 | varProvider); |
|
1066 | 1060 | } |
General Comments 0
You need to be logged in to leave comments.
Login now