From 00ac2d91df6400ccf1c4bc80f650a6a9f8963d89 2017-09-14 07:19:26 From: Alexandre Leroux Date: 2017-09-14 07:19:26 Subject: [PATCH] temp commit --- diff --git a/core/include/Common/spimpl.h b/core/include/Common/spimpl.h index b4d5e04..7f6e8be 100644 --- a/core/include/Common/spimpl.h +++ b/core/include/Common/spimpl.h @@ -89,8 +89,9 @@ using default_copier_t = typename default_copier::type; template struct is_default_manageable - : public std::integral_constant >::value - && std::is_same >::value> { + : public std::integral_constant >::value + && std::is_same >::value> { }; } @@ -131,10 +132,11 @@ public: } template - impl_ptr(U *u, typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT + impl_ptr(U *u, + typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT : impl_ptr(u, &details::default_delete, &details::default_copy) { } @@ -151,12 +153,12 @@ public: #ifdef SPIMPL_HAS_AUTO_PTR template - impl_ptr(std::auto_ptr &&u, typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT - : ptr_(u.release(), &details::default_delete), - copier_(&details::default_copy) + impl_ptr(std::auto_ptr &&u, + typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete), + copier_(&details::default_copy) { } #endif diff --git a/core/src/DataSource/DataSourceController.cpp b/core/src/DataSource/DataSourceController.cpp index 220945e..22441fe 100644 --- a/core/src/DataSource/DataSourceController.cpp +++ b/core/src/DataSource/DataSourceController.cpp @@ -49,14 +49,14 @@ public: DataSourceController::DataSourceController(QObject *parent) : impl{spimpl::make_unique_impl()} { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController construction") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController construction") << QThread::currentThread(); } DataSourceController::~DataSourceController() { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController destruction") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -126,8 +126,8 @@ void DataSourceController::loadProductItem(const QUuid &dataSourceUid, void DataSourceController::initialize() { - qCDebug(LOG_DataSourceController()) << tr("DataSourceController init") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END"); } diff --git a/core/src/Network/NetworkController.cpp b/core/src/Network/NetworkController.cpp index 1649cc5..dfbac8b 100644 --- a/core/src/Network/NetworkController.cpp +++ b/core/src/Network/NetworkController.cpp @@ -33,8 +33,8 @@ NetworkController::NetworkController(QObject *parent) void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid identifier, std::function callback) { - qCDebug(LOG_NetworkController()) << tr("NetworkController registered") - << QThread::currentThread()->objectName(); + qCDebug(LOG_NetworkController()) + << tr("NetworkController registered") << QThread::currentThread()->objectName(); auto reply = impl->m_AccessManager->get(request); // Store the couple reply id @@ -44,8 +44,8 @@ void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid auto onReplyFinished = [reply, this, identifier, callback]() { - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyFinished") - << QThread::currentThread() << reply; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyFinished") << QThread::currentThread() << reply; impl->lockRead(); auto it = impl->m_NetworkReplyToVariableId.find(reply); impl->unlock(); @@ -60,8 +60,8 @@ void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid emit this->replyDownloadProgress(identifier, 0); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyFinished END") - << QThread::currentThread() << reply; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyFinished END") << QThread::currentThread() << reply; }; auto onReplyProgress = [reply, this](qint64 bytesRead, qint64 totalBytes) { @@ -75,8 +75,8 @@ void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid if (it != impl->m_NetworkReplyToVariableId.cend()) { emit this->replyDownloadProgress(it->second, progress); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress END") - << QThread::currentThread() << reply; + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyProgress END") << QThread::currentThread() << reply; }; @@ -113,8 +113,8 @@ void NetworkController::finalize() void NetworkController::onReplyCanceled(QUuid identifier) { auto findReply = [identifier](const auto &entry) { return identifier == entry.second; }; - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled") - << QThread::currentThread(); + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyCanceled") << QThread::currentThread(); impl->lockRead(); @@ -124,8 +124,8 @@ void NetworkController::onReplyCanceled(QUuid identifier) if (it != end) { it->first->abort(); } - qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled END") - << QThread::currentThread(); + qCDebug(LOG_NetworkController()) + << tr("NetworkController onReplyCanceled END") << QThread::currentThread(); } void NetworkController::waitForFinish() diff --git a/core/src/Variable/Variable.cpp b/core/src/Variable/Variable.cpp index ed9c248..9f8945b 100644 --- a/core/src/Variable/Variable.cpp +++ b/core/src/Variable/Variable.cpp @@ -263,8 +263,8 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &range) co notInCache << SqpRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } @@ -298,8 +298,8 @@ QVector Variable::provideInCacheRangeList(const SqpRange &range) const inCache << impl->m_CacheRange; } else { - qCCritical(LOG_Variable()) << tr("Detection of unknown case.") - << QThread::currentThread(); + qCCritical(LOG_Variable()) + << tr("Detection of unknown case.") << QThread::currentThread(); } } diff --git a/core/src/Variable/VariableAcquisitionWorker.cpp b/core/src/Variable/VariableAcquisitionWorker.cpp index f24a269..fd75f09 100644 --- a/core/src/Variable/VariableAcquisitionWorker.cpp +++ b/core/src/Variable/VariableAcquisitionWorker.cpp @@ -40,8 +40,8 @@ VariableAcquisitionWorker::VariableAcquisitionWorker(QObject *parent) VariableAcquisitionWorker::~VariableAcquisitionWorker() { - qCInfo(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker destruction") - << QThread::currentThread(); + qCInfo(LOG_VariableAcquisitionWorker()) + << tr("VariableAcquisitionWorker destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -113,8 +113,8 @@ void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, std::shared_ptr dataSeries, SqpRange dataRangeAcquired) { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableDataAcquired on range ") - << acqIdentifier << dataRangeAcquired; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("onVariableDataAcquired on range ") << acqIdentifier << dataRangeAcquired; impl->lockWrite(); auto aIdToARit = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier); if (aIdToARit != impl->m_AcqIdentifierToAcqRequestMap.cend()) { @@ -186,8 +186,8 @@ void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, void VariableAcquisitionWorker::initialize() { - qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init") - << QThread::currentThread(); + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("VariableAcquisitionWorker init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init END"); } diff --git a/core/src/Variable/VariableCacheController.cpp b/core/src/Variable/VariableCacheController.cpp index fd1e836..9edc77c 100644 --- a/core/src/Variable/VariableCacheController.cpp +++ b/core/src/Variable/VariableCacheController.cpp @@ -30,8 +30,8 @@ VariableCacheController::VariableCacheController(QObject *parent) void VariableCacheController::addDateTime(std::shared_ptr variable, const SqpRange &dateTime) { - qCDebug(LOG_VariableCacheController()) << "VariableCacheController::addDateTime" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableCacheController()) + << "VariableCacheController::addDateTime" << QThread::currentThread()->objectName(); if (variable) { auto findVariableIte = impl->m_VariableToSqpRangeListMap.find(variable); if (findVariableIte == impl->m_VariableToSqpRangeListMap.end()) { @@ -104,8 +104,8 @@ VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr QVector VariableCacheController::dateCacheList(std::shared_ptr variable) const noexcept { - qCDebug(LOG_VariableCacheController()) << "VariableCacheController::dateCacheList" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableCacheController()) + << "VariableCacheController::dateCacheList" << QThread::currentThread()->objectName(); try { return impl->m_VariableToSqpRangeListMap.at(variable); } @@ -215,8 +215,8 @@ void VariableCacheController::displayCache(std::shared_ptr variable) c { auto variableDateTimeList = impl->m_VariableToSqpRangeListMap.find(variable); if (variableDateTimeList != impl->m_VariableToSqpRangeListMap.end()) { - qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache") - << variableDateTimeList->second; + qCInfo(LOG_VariableCacheController()) + << tr("VariableCacheController::displayCache") << variableDateTimeList->second; } else { qCWarning(LOG_VariableCacheController()) diff --git a/core/src/Variable/VariableController.cpp b/core/src/Variable/VariableController.cpp index 3aa437b..86d597f 100644 --- a/core/src/Variable/VariableController.cpp +++ b/core/src/Variable/VariableController.cpp @@ -145,8 +145,8 @@ struct VariableController::VariableControllerPrivate { VariableController::VariableController(QObject *parent) : QObject{parent}, impl{spimpl::make_unique_impl(this)} { - qCDebug(LOG_VariableController()) << tr("VariableController construction") - << QThread::currentThread(); + qCDebug(LOG_VariableController()) + << tr("VariableController construction") << QThread::currentThread(); connect(impl->m_VariableModel, &VariableModel::abortProgessRequested, this, &VariableController::onAbortProgressRequested); @@ -168,8 +168,8 @@ VariableController::VariableController(QObject *parent) VariableController::~VariableController() { - qCDebug(LOG_VariableController()) << tr("VariableController destruction") - << QThread::currentThread(); + qCDebug(LOG_VariableController()) + << tr("VariableController destruction") << QThread::currentThread(); this->waitForFinish(); } @@ -292,8 +292,8 @@ VariableController::createVariable(const QString &name, const QVariantHash &meta void VariableController::onDateTimeOnSelection(const SqpRange &dateTime) { // TODO check synchronisation and Rescale - qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection" - << QThread::currentThread()->objectName(); + qCDebug(LOG_VariableController()) + << "VariableController::onDateTimeOnSelection" << QThread::currentThread()->objectName(); auto selectedRows = impl->m_VariableSelectionModel->selectedRows(); auto varRequestId = QUuid::createUuid(); @@ -349,9 +349,9 @@ void VariableController::onAbortProgressRequested(std::shared_ptr vari void VariableController::onAddSynchronizationGroupId(QUuid synchronizationGroupId) { - qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronizationGroupId" - << QThread::currentThread()->objectName() - << synchronizationGroupId; + qCDebug(LOG_VariableController()) + << "TORM: VariableController::onAddSynchronizationGroupId" + << QThread::currentThread()->objectName() << synchronizationGroupId; auto vSynchroGroup = std::make_shared(); impl->m_GroupIdToVariableSynchronizationGroupMap.insert( std::make_pair(synchronizationGroupId, vSynchroGroup)); @@ -366,8 +366,8 @@ void VariableController::onAddSynchronized(std::shared_ptr variable, QUuid synchronizationGroupId) { - qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronized" - << synchronizationGroupId; + qCDebug(LOG_VariableController()) + << "TORM: VariableController::onAddSynchronized" << synchronizationGroupId; auto varToVarIdIt = impl->m_VariableToIdentifierMap.find(variable); if (varToVarIdIt != impl->m_VariableToIdentifierMap.cend()) { auto groupIdToVSGIt @@ -472,8 +472,8 @@ void VariableController::onRequestDataLoading(QVector // Don't process already processed var if (!variables.contains(var)) { if (var != nullptr) { - qCDebug(LOG_VariableController()) << "processRequest synchro for" - << var->name(); + qCDebug(LOG_VariableController()) + << "processRequest synchro for" << var->name(); auto vSyncRangeRequested = computeSynchroRangeRequested( var->range(), range, groupIdToOldRangeMap.at(gId)); qCDebug(LOG_VariableController()) << "synchro RR" << vSyncRangeRequested; @@ -550,10 +550,10 @@ void VariableController::VariableControllerPrivate::processRequest(std::shared_p varRequest.m_RangeRequested = varStrategyRangesRequested.first; varRequest.m_CacheRangeRequested = varStrategyRangesRequested.second; qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM processRequest RR ") << rangeRequested; - qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM processRequest R ") - << varStrategyRangesRequested.first; - qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM processRequest CR ") - << varStrategyRangesRequested.second; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("TORM processRequest R ") << varStrategyRangesRequested.first; + qCDebug(LOG_VariableAcquisitionWorker()) + << tr("TORM processRequest CR ") << varStrategyRangesRequested.second; // store VarRequest storeVariableRequest(varId, varRequestId, varRequest); @@ -566,8 +566,8 @@ void VariableController::VariableControllerPrivate::processRequest(std::shared_p varProvider); if (!varRequestIdCanceled.isNull()) { - qCInfo(LOG_VariableAcquisitionWorker()) << tr("varRequestIdCanceled: ") - << varRequestIdCanceled; + qCInfo(LOG_VariableAcquisitionWorker()) + << tr("varRequestIdCanceled: ") << varRequestIdCanceled; cancelVariableRequest(varRequestIdCanceled); } } @@ -613,8 +613,8 @@ VariableController::VariableControllerPrivate::findVariable(QUuid vIdentifier) std::shared_ptr VariableController::VariableControllerPrivate::retrieveDataSeries( const QVector acqDataPacketVector) { - qCDebug(LOG_VariableController()) << tr("TORM: retrieveDataSeries acqDataPacketVector size") - << acqDataPacketVector.size(); + qCDebug(LOG_VariableController()) + << tr("TORM: retrieveDataSeries acqDataPacketVector size") << acqDataPacketVector.size(); std::shared_ptr dataSeries; if (!acqDataPacketVector.isEmpty()) { dataSeries = acqDataPacketVector[0].m_DateSeries; @@ -631,8 +631,8 @@ void VariableController::VariableControllerPrivate::registerProvider( std::shared_ptr provider) { if (m_ProviderSet.find(provider) == m_ProviderSet.end()) { - qCDebug(LOG_VariableController()) << tr("Registering of a new provider") - << provider->objectName(); + qCDebug(LOG_VariableController()) + << tr("Registering of a new provider") << provider->objectName(); m_ProviderSet.insert(provider); connect(provider.get(), &IDataProvider::dataProvided, m_VariableAcquisitionWorker.get(), &VariableAcquisitionWorker::onVariableDataAcquired); @@ -709,11 +709,11 @@ QUuid VariableController::VariableControllerPrivate::acceptVariableRequest( << varRequestId; } - qCDebug(LOG_VariableController()) << tr("1: erase REQUEST in QUEUE ?") - << varRequestIdQueue.size(); + qCDebug(LOG_VariableController()) + << tr("1: erase REQUEST in QUEUE ?") << varRequestIdQueue.size(); varRequestIdQueue.pop_front(); - qCDebug(LOG_VariableController()) << tr("2: erase REQUEST in QUEUE ?") - << varRequestIdQueue.size(); + qCDebug(LOG_VariableController()) + << tr("2: erase REQUEST in QUEUE ?") << varRequestIdQueue.size(); if (varRequestIdQueue.empty()) { m_VarIdToVarRequestIdQueueMap.erase(varId); } @@ -737,8 +737,8 @@ void VariableController::VariableControllerPrivate::updateVariableRequest(QUuid (varIdToVarRequestMapIt != varIdToVarRequestMap.cend()) && processVariableUpdate; ++varIdToVarRequestMapIt) { processVariableUpdate &= varIdToVarRequestMapIt->second.m_CanUpdate; - qCDebug(LOG_VariableController()) << tr("updateVariableRequest") - << processVariableUpdate; + qCDebug(LOG_VariableController()) + << tr("updateVariableRequest") << processVariableUpdate; } if (processVariableUpdate) { @@ -748,13 +748,13 @@ void VariableController::VariableControllerPrivate::updateVariableRequest(QUuid auto &varRequest = varIdToVarRequestMapIt->second; var->setRange(varRequest.m_RangeRequested); var->setCacheRange(varRequest.m_CacheRangeRequested); - qCDebug(LOG_VariableController()) << tr("1: onDataProvided") - << varRequest.m_RangeRequested; - qCDebug(LOG_VariableController()) << tr("2: onDataProvided") - << varRequest.m_CacheRangeRequested; + qCDebug(LOG_VariableController()) + << tr("1: onDataProvided") << varRequest.m_RangeRequested; + qCDebug(LOG_VariableController()) + << tr("2: onDataProvided") << varRequest.m_CacheRangeRequested; var->mergeDataSeries(varRequest.m_DataSeries); - qCDebug(LOG_VariableController()) << tr("3: onDataProvided") - << varRequest.m_DataSeries->range(); + qCDebug(LOG_VariableController()) + << tr("3: onDataProvided") << varRequest.m_DataSeries->range(); qCDebug(LOG_VariableController()) << tr("4: onDataProvided"); /// @todo MPL: confirm @@ -770,11 +770,11 @@ void VariableController::VariableControllerPrivate::updateVariableRequest(QUuid } // cleaning varRequestId - qCDebug(LOG_VariableController()) << tr("0: erase REQUEST in MAP ?") - << m_VarRequestIdToVarIdVarRequestMap.size(); + qCDebug(LOG_VariableController()) + << tr("0: erase REQUEST in MAP ?") << m_VarRequestIdToVarIdVarRequestMap.size(); m_VarRequestIdToVarIdVarRequestMap.erase(varRequestId); - qCDebug(LOG_VariableController()) << tr("1: erase REQUEST in MAP ?") - << m_VarRequestIdToVarIdVarRequestMap.size(); + qCDebug(LOG_VariableController()) + << tr("1: erase REQUEST in MAP ?") << m_VarRequestIdToVarIdVarRequestMap.size(); } } else { diff --git a/core/src/Variable/VariableController.cpp~RF14af5971.TMP b/core/src/Variable/VariableController.cpp~RF14af5971.TMP new file mode 100644 index 0000000..50b88cc --- /dev/null +++ b/core/src/Variable/VariableController.cpp~RF14af5971.TMP @@ -0,0 +1,775 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include