##// END OF EJS Templates
Improve synchro robustness.
perrinel -
r815:e8f1dd84704e
parent child
Show More
@@ -71,7 +71,7 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v
71 71
72 72 // Request creation
73 73 auto acqRequest = AcquisitionRequest{};
74 qCInfo(LOG_VariableAcquisitionWorker()) << tr("TpushVariableRequest ") << vIdentifier
74 qCDebug(LOG_VariableAcquisitionWorker()) << tr("PushVariableRequest ") << vIdentifier
75 75 << varRequestId;
76 76 acqRequest.m_VarRequestId = varRequestId;
77 77 acqRequest.m_vIdentifier = vIdentifier;
@@ -101,7 +101,7 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v
101 101 impl->unlock();
102 102
103 103 // remove old acqIdentifier from the worker
104 impl->cancelVarRequest(oldAcqId);
104 impl->cancelVarRequest(varRequestIdCanceled);
105 105 // impl->m_AcqIdentifierToAcqRequestMap.erase(oldAcqId);
106 106 }
107 107 else {
@@ -343,7 +343,8 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::updateToNextRe
343 343 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::cancelVarRequest(
344 344 QUuid varRequestId)
345 345 {
346 qInfo() << "VariableAcquisitionWorkerPrivate::cancelVarRequest 0";
346 qCCritical(LOG_VariableAcquisitionWorker())
347 << "VariableAcquisitionWorkerPrivate::cancelVarRequest 0";
347 348 lockRead();
348 349 // get all AcqIdentifier in link with varRequestId
349 350 QVector<QUuid> acqIdsToRm;
@@ -359,29 +360,35 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::cancelVarReque
359 360 for (auto acqId : acqIdsToRm) {
360 361 removeAcqRequest(acqId);
361 362 }
362 qInfo() << "VariableAcquisitionWorkerPrivate::cancelVarRequest end";
363 qCCritical(LOG_VariableAcquisitionWorker())
364 << "VariableAcquisitionWorkerPrivate::cancelVarRequest end";
363 365 }
364 366
365 367 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::removeAcqRequest(
366 368 QUuid acqRequestId)
367 369 {
368 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 0";
370 qCDebug(LOG_VariableAcquisitionWorker())
371 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 0";
369 372 QUuid vIdentifier;
370 373 std::shared_ptr<IDataProvider> provider;
371 374 lockRead();
372 375 auto acqIt = m_AcqIdentifierToAcqRequestMap.find(acqRequestId);
373 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 1";
376 qCDebug(LOG_VariableAcquisitionWorker())
377 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 1";
374 378 if (acqIt != m_AcqIdentifierToAcqRequestMap.cend()) {
375 379 vIdentifier = acqIt->second.m_vIdentifier;
376 380 provider = acqIt->second.m_Provider;
377 381
378 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 2";
382 qCDebug(LOG_VariableAcquisitionWorker())
383 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 2";
379 384 auto it = m_VIdentifierToCurrrentAcqIdNextIdPairMap.find(vIdentifier);
380 385 if (it != m_VIdentifierToCurrrentAcqIdNextIdPairMap.cend()) {
381 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 3";
386 qCDebug(LOG_VariableAcquisitionWorker())
387 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 3";
382 388 if (it->second.first == acqRequestId) {
383 389 // acqRequest is currently running -> let's aborting it
384 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 4";
390 qCDebug(LOG_VariableAcquisitionWorker())
391 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 4";
385 392 unlock();
386 393
387 394 // Remove the current request from the worker
@@ -389,34 +396,41 void VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate::removeAcqReque
389 396
390 397 // notify the request aborting to the provider
391 398 provider->requestDataAborting(acqRequestId);
392 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 5";
399 qCDebug(LOG_VariableAcquisitionWorker())
400 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 5";
393 401 }
394 402 else if (it->second.second == acqRequestId) {
395 403 it->second.second = QUuid();
396 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 6";
404 qCDebug(LOG_VariableAcquisitionWorker())
405 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 6";
397 406 unlock();
398 407 }
399 408 else {
400 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 7";
409 qCDebug(LOG_VariableAcquisitionWorker())
410 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 7";
401 411 unlock();
402 412 }
403 413 }
404 414 else {
405 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 8";
415 qCDebug(LOG_VariableAcquisitionWorker())
416 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 8";
406 417 unlock();
407 418 }
408 419 }
409 420 else {
410 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 9";
421 qCDebug(LOG_VariableAcquisitionWorker())
422 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 9";
411 423 unlock();
412 424 }
413 425
414 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 10";
426 qCDebug(LOG_VariableAcquisitionWorker())
427 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 10";
415 428 lockWrite();
416 429
417 430 m_AcqIdentifierToAcqDataPacketVectorMap.erase(acqRequestId);
418 431 m_AcqIdentifierToAcqRequestMap.erase(acqRequestId);
419 432
420 433 unlock();
421 qInfo() << "VariableAcquisitionWorkerPrivate::removeAcqRequest 11";
434 qCDebug(LOG_VariableAcquisitionWorker())
435 << "VariableAcquisitionWorkerPrivate::removeAcqRequest 11";
422 436 }
@@ -554,23 +554,23 AcquisitionZoomType VariableController::getZoomType(const SqpRange &range, const
554 554 // t1.m_TStart <= t2.m_TStart && t2.m_TEnd <= t1.m_TEnd
555 555 auto zoomType = AcquisitionZoomType::Unknown;
556 556 if (range.m_TStart <= oldRange.m_TStart && oldRange.m_TEnd <= range.m_TEnd) {
557 qCCritical(LOG_VariableController()) << "zoomtype: ZoomOut";
557 qCDebug(LOG_VariableController()) << "zoomtype: ZoomOut";
558 558 zoomType = AcquisitionZoomType::ZoomOut;
559 559 }
560 560 else if (range.m_TStart > oldRange.m_TStart && range.m_TEnd > oldRange.m_TEnd) {
561 qCCritical(LOG_VariableController()) << "zoomtype: PanRight";
561 qCDebug(LOG_VariableController()) << "zoomtype: PanRight";
562 562 zoomType = AcquisitionZoomType::PanRight;
563 563 }
564 564 else if (range.m_TStart < oldRange.m_TStart && range.m_TEnd < oldRange.m_TEnd) {
565 qCCritical(LOG_VariableController()) << "zoomtype: PanLeft";
565 qCDebug(LOG_VariableController()) << "zoomtype: PanLeft";
566 566 zoomType = AcquisitionZoomType::PanLeft;
567 567 }
568 568 else if (range.m_TStart > oldRange.m_TStart && oldRange.m_TEnd > range.m_TEnd) {
569 qCCritical(LOG_VariableController()) << "zoomtype: ZoomIn";
569 qCDebug(LOG_VariableController()) << "zoomtype: ZoomIn";
570 570 zoomType = AcquisitionZoomType::ZoomIn;
571 571 }
572 572 else {
573 qCCritical(LOG_VariableController()) << "getZoomType: Unknown type detected";
573 qCDebug(LOG_VariableController()) << "getZoomType: Unknown type detected";
574 574 }
575 575 return zoomType;
576 576 }
@@ -768,7 +768,7 QUuid VariableController::VariableControllerPrivate::acceptVariableRequest(
768 768
769 769 varRequestIdQueue.pop_front();
770 770 if (varRequestIdQueue.empty()) {
771 qCCritical(LOG_VariableController())
771 qCDebug(LOG_VariableController())
772 772 << tr("TORM Erase REQUEST because it has been accepted") << varId;
773 773 m_VarIdToVarRequestIdQueueMap.erase(varId);
774 774 }
General Comments 0
You need to be logged in to leave comments. Login now