##// END OF EJS Templates
temp commit
Alexandre Leroux -
r960:72dc8e8c83d1
parent child
Show More
@@ -89,8 +89,9 using default_copier_t = typename default_copier<T>::type;
89 89
90 90 template <class T, class D, class C>
91 91 struct is_default_manageable
92 : public std::integral_constant<bool, std::is_same<D, default_deleter_t<T> >::value
93 && std::is_same<C, default_copier_t<T> >::value> {
92 : public std::integral_constant<bool,
93 std::is_same<D, default_deleter_t<T> >::value
94 && std::is_same<C, default_copier_t<T> >::value> {
94 95 };
95 96 }
96 97
@@ -131,10 +132,11 public:
131 132 }
132 133
133 134 template <class U>
134 impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value
135 && is_default_manageable::value,
136 dummy_t_>::type
137 = dummy_t_()) SPIMPL_NOEXCEPT
135 impl_ptr(U *u,
136 typename std::enable_if<std::is_convertible<U *, pointer>::value
137 && is_default_manageable::value,
138 dummy_t_>::type
139 = dummy_t_()) SPIMPL_NOEXCEPT
138 140 : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>)
139 141 {
140 142 }
@@ -151,12 +153,12 public:
151 153
152 154 #ifdef SPIMPL_HAS_AUTO_PTR
153 155 template <class U>
154 impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value
155 && is_default_manageable::value,
156 dummy_t_>::type
157 = dummy_t_()) SPIMPL_NOEXCEPT
158 : ptr_(u.release(), &details::default_delete<T>),
159 copier_(&details::default_copy<T>)
156 impl_ptr(std::auto_ptr<U> &&u,
157 typename std::enable_if<std::is_convertible<U *, pointer>::value
158 && is_default_manageable::value,
159 dummy_t_>::type
160 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>),
161 copier_(&details::default_copy<T>)
160 162 {
161 163 }
162 164 #endif
@@ -64,14 +64,14 public:
64 64 DataSourceController::DataSourceController(QObject *parent)
65 65 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
66 66 {
67 qCDebug(LOG_DataSourceController()) << tr("DataSourceController construction")
68 << QThread::currentThread();
67 qCDebug(LOG_DataSourceController())
68 << tr("DataSourceController construction") << QThread::currentThread();
69 69 }
70 70
71 71 DataSourceController::~DataSourceController()
72 72 {
73 qCDebug(LOG_DataSourceController()) << tr("DataSourceController destruction")
74 << QThread::currentThread();
73 qCDebug(LOG_DataSourceController())
74 << tr("DataSourceController destruction") << QThread::currentThread();
75 75 this->waitForFinish();
76 76 }
77 77
@@ -161,8 +161,8 QVariantList DataSourceController::productsDataForMimeData(const QByteArray &mim
161 161
162 162 void DataSourceController::initialize()
163 163 {
164 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init")
165 << QThread::currentThread();
164 qCDebug(LOG_DataSourceController())
165 << tr("DataSourceController init") << QThread::currentThread();
166 166 impl->m_WorkingMutex.lock();
167 167 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END");
168 168 }
@@ -64,8 +64,8 void NetworkController::onProcessRequested(std::shared_ptr<QNetworkRequest> requ
64 64 impl->unlock();
65 65 }
66 66
67 qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyFinished END")
68 << QThread::currentThread() << reply;
67 qCDebug(LOG_NetworkController())
68 << tr("NetworkController onReplyFinished END") << QThread::currentThread() << reply;
69 69 };
70 70
71 71 auto onReplyProgress = [reply, request, this](qint64 bytesRead, qint64 totalBytes) {
@@ -73,9 +73,9 void NetworkController::onProcessRequested(std::shared_ptr<QNetworkRequest> requ
73 73 // NOTE: a totalbytes of 0 can happened when a request has been aborted
74 74 if (totalBytes > 0) {
75 75 double progress = (bytesRead * 100.0) / totalBytes;
76 qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress") << progress
77 << QThread::currentThread() << request.get() << reply
78 << bytesRead << totalBytes;
76 qCDebug(LOG_NetworkController())
77 << tr("NetworkController onReplyProgress") << progress << QThread::currentThread()
78 << request.get() << reply << bytesRead << totalBytes;
79 79 impl->lockRead();
80 80 auto it = impl->m_NetworkReplyToId.find(reply);
81 81 if (it != impl->m_NetworkReplyToId.cend()) {
@@ -87,8 +87,8 void NetworkController::onProcessRequested(std::shared_ptr<QNetworkRequest> requ
87 87 impl->unlock();
88 88 }
89 89
90 qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyProgress END")
91 << QThread::currentThread() << reply;
90 qCDebug(LOG_NetworkController())
91 << tr("NetworkController onReplyProgress END") << QThread::currentThread() << reply;
92 92 }
93 93 };
94 94
@@ -125,8 +125,8 void NetworkController::finalize()
125 125 void NetworkController::onReplyCanceled(QUuid identifier)
126 126 {
127 127 auto findReply = [identifier](const auto &entry) { return identifier == entry.second; };
128 qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled")
129 << QThread::currentThread() << identifier;
128 qCDebug(LOG_NetworkController())
129 << tr("NetworkController onReplyCanceled") << QThread::currentThread() << identifier;
130 130
131 131
132 132 impl->lockRead();
@@ -138,8 +138,8 void NetworkController::onReplyCanceled(QUuid identifier)
138 138 << QThread::currentThread() << identifier;
139 139 it->first->abort();
140 140 }
141 qCDebug(LOG_NetworkController()) << tr("NetworkController onReplyCanceled END")
142 << QThread::currentThread();
141 qCDebug(LOG_NetworkController())
142 << tr("NetworkController onReplyCanceled END") << QThread::currentThread();
143 143 }
144 144
145 145 void NetworkController::waitForFinish()
@@ -265,8 +265,8 QVector<SqpRange> Variable::provideNotInCacheRangeList(const SqpRange &range) co
265 265 notInCache << SqpRange{impl->m_CacheRange.m_TEnd, range.m_TEnd};
266 266 }
267 267 else {
268 qCCritical(LOG_Variable()) << tr("Detection of unknown case.")
269 << QThread::currentThread();
268 qCCritical(LOG_Variable())
269 << tr("Detection of unknown case.") << QThread::currentThread();
270 270 }
271 271 }
272 272 }
@@ -305,8 +305,8 QVector<SqpRange> Variable::provideInCacheRangeList(const SqpRange &range) const
305 305 inCache << impl->m_CacheRange;
306 306 }
307 307 else {
308 qCCritical(LOG_Variable()) << tr("Detection of unknown case.")
309 << QThread::currentThread();
308 qCCritical(LOG_Variable())
309 << tr("Detection of unknown case.") << QThread::currentThread();
310 310 }
311 311 }
312 312 }
@@ -339,8 +339,8 QVector<SqpRange> Variable::provideNotInCacheRangeList(const SqpRange &oldRange,
339 339 notInCache << SqpRange{oldRange.m_TEnd, nextRange.m_TEnd};
340 340 }
341 341 else {
342 qCCritical(LOG_Variable()) << tr("Detection of unknown case.")
343 << QThread::currentThread();
342 qCCritical(LOG_Variable())
343 << tr("Detection of unknown case.") << QThread::currentThread();
344 344 }
345 345 }
346 346 }
@@ -378,8 +378,8 QVector<SqpRange> Variable::provideInCacheRangeList(const SqpRange &oldRange,
378 378 inCache << oldRange;
379 379 }
380 380 else {
381 qCCritical(LOG_Variable()) << tr("Detection of unknown case.")
382 << QThread::currentThread();
381 qCCritical(LOG_Variable())
382 << tr("Detection of unknown case.") << QThread::currentThread();
383 383 }
384 384 }
385 385 }
@@ -53,8 +53,8 VariableAcquisitionWorker::VariableAcquisitionWorker(QObject *parent)
53 53
54 54 VariableAcquisitionWorker::~VariableAcquisitionWorker()
55 55 {
56 qCInfo(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker destruction")
57 << QThread::currentThread();
56 qCInfo(LOG_VariableAcquisitionWorker())
57 << tr("VariableAcquisitionWorker destruction") << QThread::currentThread();
58 58 this->waitForFinish();
59 59 }
60 60
@@ -71,8 +71,8 QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid v
71 71
72 72 // Request creation
73 73 auto acqRequest = AcquisitionRequest{};
74 qCDebug(LOG_VariableAcquisitionWorker()) << tr("PushVariableRequest ") << vIdentifier
75 << varRequestId;
74 qCDebug(LOG_VariableAcquisitionWorker())
75 << tr("PushVariableRequest ") << vIdentifier << varRequestId;
76 76 acqRequest.m_VarRequestId = varRequestId;
77 77 acqRequest.m_vIdentifier = vIdentifier;
78 78 acqRequest.m_DataProviderParameters = parameters;
@@ -150,8 +150,8 void VariableAcquisitionWorker::abortProgressRequested(QUuid vIdentifier)
150 150 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdentifier,
151 151 double progress)
152 152 {
153 qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableRetrieveDataInProgress ")
154 << acqIdentifier << progress;
153 qCDebug(LOG_VariableAcquisitionWorker())
154 << tr("TORM: onVariableRetrieveDataInProgress ") << acqIdentifier << progress;
155 155 impl->lockRead();
156 156 auto aIdToARit = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier);
157 157 if (aIdToARit != impl->m_AcqIdentifierToAcqRequestMap.cend()) {
@@ -176,16 +176,16 void VariableAcquisitionWorker::onVariableRetrieveDataInProgress(QUuid acqIdenti
176 176
177 177 void VariableAcquisitionWorker::onVariableAcquisitionFailed(QUuid acqIdentifier)
178 178 {
179 qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed")
180 << QThread::currentThread();
179 qCDebug(LOG_VariableAcquisitionWorker())
180 << tr("onVariableAcquisitionFailed") << QThread::currentThread();
181 181 impl->lockRead();
182 182 auto it = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier);
183 183 if (it != impl->m_AcqIdentifierToAcqRequestMap.cend()) {
184 184 auto request = it->second;
185 185 impl->unlock();
186 qCDebug(LOG_VariableAcquisitionWorker()) << tr("onVariableAcquisitionFailed")
187 << acqIdentifier << request.m_vIdentifier
188 << QThread::currentThread();
186 qCDebug(LOG_VariableAcquisitionWorker())
187 << tr("onVariableAcquisitionFailed") << acqIdentifier << request.m_vIdentifier
188 << QThread::currentThread();
189 189 emit variableCanceledRequested(request.m_vIdentifier);
190 190 }
191 191 else {
@@ -198,8 +198,8 void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier,
198 198 std::shared_ptr<IDataSeries> dataSeries,
199 199 SqpRange dataRangeAcquired)
200 200 {
201 qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableDataAcquired on range ")
202 << acqIdentifier << dataRangeAcquired;
201 qCDebug(LOG_VariableAcquisitionWorker())
202 << tr("TORM: onVariableDataAcquired on range ") << acqIdentifier << dataRangeAcquired;
203 203 impl->lockWrite();
204 204 auto aIdToARit = impl->m_AcqIdentifierToAcqRequestMap.find(acqIdentifier);
205 205 if (aIdToARit != impl->m_AcqIdentifierToAcqRequestMap.cend()) {
@@ -270,8 +270,8 void VariableAcquisitionWorker::onExecuteRequest(QUuid acqIdentifier)
270 270
271 271 void VariableAcquisitionWorker::initialize()
272 272 {
273 qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init")
274 << QThread::currentThread();
273 qCDebug(LOG_VariableAcquisitionWorker())
274 << tr("VariableAcquisitionWorker init") << QThread::currentThread();
275 275 impl->m_WorkingMutex.lock();
276 276 qCDebug(LOG_VariableAcquisitionWorker()) << tr("VariableAcquisitionWorker init END");
277 277 }
@@ -30,8 +30,8 VariableCacheController::VariableCacheController(QObject *parent)
30 30 void VariableCacheController::addDateTime(std::shared_ptr<Variable> variable,
31 31 const SqpRange &dateTime)
32 32 {
33 qCDebug(LOG_VariableCacheController()) << "VariableCacheController::addDateTime"
34 << QThread::currentThread()->objectName();
33 qCDebug(LOG_VariableCacheController())
34 << "VariableCacheController::addDateTime" << QThread::currentThread()->objectName();
35 35 if (variable) {
36 36 auto findVariableIte = impl->m_VariableToSqpRangeListMap.find(variable);
37 37 if (findVariableIte == impl->m_VariableToSqpRangeListMap.end()) {
@@ -104,8 +104,8 VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr<Variable>
104 104 QVector<SqpRange>
105 105 VariableCacheController::dateCacheList(std::shared_ptr<Variable> variable) const noexcept
106 106 {
107 qCDebug(LOG_VariableCacheController()) << "VariableCacheController::dateCacheList"
108 << QThread::currentThread()->objectName();
107 qCDebug(LOG_VariableCacheController())
108 << "VariableCacheController::dateCacheList" << QThread::currentThread()->objectName();
109 109 try {
110 110 return impl->m_VariableToSqpRangeListMap.at(variable);
111 111 }
@@ -215,8 +215,8 void VariableCacheController::displayCache(std::shared_ptr<Variable> variable) c
215 215 {
216 216 auto variableDateTimeList = impl->m_VariableToSqpRangeListMap.find(variable);
217 217 if (variableDateTimeList != impl->m_VariableToSqpRangeListMap.end()) {
218 qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache")
219 << variableDateTimeList->second;
218 qCInfo(LOG_VariableCacheController())
219 << tr("VariableCacheController::displayCache") << variableDateTimeList->second;
220 220 }
221 221 else {
222 222 qCWarning(LOG_VariableCacheController())
@@ -165,8 +165,8 struct VariableController::VariableControllerPrivate {
165 165 VariableController::VariableController(QObject *parent)
166 166 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>(this)}
167 167 {
168 qCDebug(LOG_VariableController()) << tr("VariableController construction")
169 << QThread::currentThread();
168 qCDebug(LOG_VariableController())
169 << tr("VariableController construction") << QThread::currentThread();
170 170
171 171 connect(impl->m_VariableModel, &VariableModel::abortProgessRequested, this,
172 172 &VariableController::onAbortProgressRequested);
@@ -193,8 +193,8 VariableController::VariableController(QObject *parent)
193 193
194 194 VariableController::~VariableController()
195 195 {
196 qCDebug(LOG_VariableController()) << tr("VariableController destruction")
197 << QThread::currentThread();
196 qCDebug(LOG_VariableController())
197 << tr("VariableController destruction") << QThread::currentThread();
198 198 this->waitForFinish();
199 199 }
200 200
@@ -361,8 +361,8 VariableController::createVariable(const QString &name, const QVariantHash &meta
361 361 void VariableController::onDateTimeOnSelection(const SqpRange &dateTime)
362 362 {
363 363 // NOTE: Even if acquisition request is aborting, the graphe range will be changed
364 qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection"
365 << QThread::currentThread()->objectName();
364 qCDebug(LOG_VariableController())
365 << "VariableController::onDateTimeOnSelection" << QThread::currentThread()->objectName();
366 366 auto selectedRows = impl->m_VariableSelectionModel->selectedRows();
367 367
368 368 // NOTE we only permit the time modification for one variable
@@ -483,9 +483,9 void VariableController::onAbortAcquisitionRequested(QUuid vIdentifier)
483 483
484 484 void VariableController::onAddSynchronizationGroupId(QUuid synchronizationGroupId)
485 485 {
486 qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronizationGroupId"
487 << QThread::currentThread()->objectName()
488 << synchronizationGroupId;
486 qCDebug(LOG_VariableController())
487 << "TORM: VariableController::onAddSynchronizationGroupId"
488 << QThread::currentThread()->objectName() << synchronizationGroupId;
489 489 auto vSynchroGroup = std::make_shared<VariableSynchronizationGroup>();
490 490 impl->m_GroupIdToVariableSynchronizationGroupMap.insert(
491 491 std::make_pair(synchronizationGroupId, vSynchroGroup));
@@ -500,8 +500,8 void VariableController::onAddSynchronized(std::shared_ptr<Variable> variable,
500 500 QUuid synchronizationGroupId)
501 501
502 502 {
503 qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronized"
504 << synchronizationGroupId;
503 qCDebug(LOG_VariableController())
504 << "TORM: VariableController::onAddSynchronized" << synchronizationGroupId;
505 505 auto varToVarIdIt = impl->m_VariableToIdentifierMap.find(variable);
506 506 if (varToVarIdIt != impl->m_VariableToIdentifierMap.cend()) {
507 507 auto groupIdToVSGIt
@@ -565,9 +565,9 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable>
565 565 }
566 566
567 567 auto varRequestId = QUuid::createUuid();
568 qCDebug(LOG_VariableController()) << "VariableController::onRequestDataLoading"
569 << QThread::currentThread()->objectName() << varRequestId
570 << range << synchronise;
568 qCDebug(LOG_VariableController())
569 << "VariableController::onRequestDataLoading" << QThread::currentThread()->objectName()
570 << varRequestId << range << synchronise;
571 571
572 572 if (!synchronise) {
573 573 auto varIds = std::list<QUuid>{};
@@ -577,8 +577,8 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable>
577 577 }
578 578 impl->m_VarGroupIdToVarIds.insert(std::make_pair(varRequestId, varIds));
579 579 for (const auto &var : variables) {
580 qCDebug(LOG_VariableController()) << "processRequest for" << var->name() << varRequestId
581 << varIds.size();
580 qCDebug(LOG_VariableController())
581 << "processRequest for" << var->name() << varRequestId << varIds.size();
582 582 impl->processRequest(var, range, varRequestId);
583 583 }
584 584 }
@@ -603,8 +603,8 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable>
603 603
604 604 // Don't process already processed var
605 605 if (var != nullptr) {
606 qCDebug(LOG_VariableController()) << "processRequest synchro for" << var->name()
607 << varRequestId;
606 qCDebug(LOG_VariableController())
607 << "processRequest synchro for" << var->name() << varRequestId;
608 608 auto vSyncRangeRequested
609 609 = variables.contains(var)
610 610 ? range
@@ -706,26 +706,26 void VariableController::VariableControllerPrivate::processRequest(std::shared_p
706 706
707 707 switch (varHandler->m_State) {
708 708 case VariableRequestHandlerState::OFF: {
709 qCDebug(LOG_VariableController()) << tr("Process Request OFF")
710 << varRequest.m_RangeRequested
711 << varRequest.m_CacheRangeRequested;
709 qCDebug(LOG_VariableController())
710 << tr("Process Request OFF") << varRequest.m_RangeRequested
711 << varRequest.m_CacheRangeRequested;
712 712 varHandler->m_RunningVarRequest = varRequest;
713 713 varHandler->m_State = VariableRequestHandlerState::RUNNING;
714 714 executeVarRequest(var, varRequest);
715 715 break;
716 716 }
717 717 case VariableRequestHandlerState::RUNNING: {
718 qCDebug(LOG_VariableController()) << tr("Process Request RUNNING")
719 << varRequest.m_RangeRequested
720 << varRequest.m_CacheRangeRequested;
718 qCDebug(LOG_VariableController())
719 << tr("Process Request RUNNING") << varRequest.m_RangeRequested
720 << varRequest.m_CacheRangeRequested;
721 721 varHandler->m_State = VariableRequestHandlerState::PENDING;
722 722 varHandler->m_PendingVarRequest = varRequest;
723 723 break;
724 724 }
725 725 case VariableRequestHandlerState::PENDING: {
726 qCDebug(LOG_VariableController()) << tr("Process Request PENDING")
727 << varRequest.m_RangeRequested
728 << varRequest.m_CacheRangeRequested;
726 qCDebug(LOG_VariableController())
727 << tr("Process Request PENDING") << varRequest.m_RangeRequested
728 << varRequest.m_CacheRangeRequested;
729 729 auto variableGroupIdToCancel = varHandler->m_PendingVarRequest.m_VariableGroupId;
730 730 cancelVariableRequest(variableGroupIdToCancel);
731 731 // Cancel variable can make state downgrade
@@ -762,8 +762,8 VariableController::VariableControllerPrivate::findVariable(QUuid vIdentifier)
762 762 std::shared_ptr<IDataSeries> VariableController::VariableControllerPrivate::retrieveDataSeries(
763 763 const QVector<AcquisitionDataPacket> acqDataPacketVector)
764 764 {
765 qCDebug(LOG_VariableController()) << tr("TORM: retrieveDataSeries acqDataPacketVector size")
766 << acqDataPacketVector.size();
765 qCDebug(LOG_VariableController())
766 << tr("TORM: retrieveDataSeries acqDataPacketVector size") << acqDataPacketVector.size();
767 767 std::shared_ptr<IDataSeries> dataSeries;
768 768 if (!acqDataPacketVector.isEmpty()) {
769 769 dataSeries = acqDataPacketVector[0].m_DateSeries;
@@ -780,8 +780,8 void VariableController::VariableControllerPrivate::registerProvider(
780 780 std::shared_ptr<IDataProvider> provider)
781 781 {
782 782 if (m_ProviderSet.find(provider) == m_ProviderSet.end()) {
783 qCDebug(LOG_VariableController()) << tr("Registering of a new provider")
784 << provider->objectName();
783 qCDebug(LOG_VariableController())
784 << tr("Registering of a new provider") << provider->objectName();
785 785 m_ProviderSet.insert(provider);
786 786 connect(provider.get(), &IDataProvider::dataProvided, m_VariableAcquisitionWorker.get(),
787 787 &VariableAcquisitionWorker::onVariableDataAcquired);
@@ -816,8 +816,8 QUuid VariableController::VariableControllerPrivate::acceptVariableRequest(
816 816
817 817 // Element traité, on a déjà toutes les données necessaires
818 818 auto varGroupId = varHandler->m_RunningVarRequest.m_VariableGroupId;
819 qCDebug(LOG_VariableController()) << "Variable::acceptVariableRequest" << varGroupId
820 << m_VarGroupIdToVarIds.size();
819 qCDebug(LOG_VariableController())
820 << "Variable::acceptVariableRequest" << varGroupId << m_VarGroupIdToVarIds.size();
821 821
822 822 return varHandler->m_RunningVarRequest.m_VariableGroupId;
823 823 }
@@ -837,8 +837,8 void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq
837 837 auto &varIds = varGroupIdToVarIdsIt->second;
838 838 auto varIdsEnd = varIds.end();
839 839 bool processVariableUpdate = true;
840 qCDebug(LOG_VariableController()) << "VariableControllerPrivate::updateVariables"
841 << varRequestId << varIds.size();
840 qCDebug(LOG_VariableController())
841 << "VariableControllerPrivate::updateVariables" << varRequestId << varIds.size();
842 842 for (auto varIdsIt = varIds.begin(); (varIdsIt != varIdsEnd) && processVariableUpdate;
843 843 ++varIdsIt) {
844 844 auto itVarHandler = m_VarIdToVarRequestHandler.find(*varIdsIt);
@@ -856,15 +856,15 void VariableController::VariableControllerPrivate::updateVariables(QUuid varReq
856 856 auto &varRequest = itVarHandler->second->m_RunningVarRequest;
857 857 var->setRange(varRequest.m_RangeRequested);
858 858 var->setCacheRange(varRequest.m_CacheRangeRequested);
859 qCDebug(LOG_VariableController()) << tr("1: onDataProvided")
860 << varRequest.m_RangeRequested
861 << varRequest.m_CacheRangeRequested;
862 qCDebug(LOG_VariableController()) << tr("2: onDataProvided var points before")
863 << var->nbPoints()
864 << varRequest.m_DataSeries->nbPoints();
859 qCDebug(LOG_VariableController())
860 << tr("1: onDataProvided") << varRequest.m_RangeRequested
861 << varRequest.m_CacheRangeRequested;
862 qCDebug(LOG_VariableController())
863 << tr("2: onDataProvided var points before") << var->nbPoints()
864 << varRequest.m_DataSeries->nbPoints();
865 865 var->mergeDataSeries(varRequest.m_DataSeries);
866 qCDebug(LOG_VariableController()) << tr("3: onDataProvided var points after")
867 << var->nbPoints();
866 qCDebug(LOG_VariableController())
867 << tr("3: onDataProvided var points after") << var->nbPoints();
868 868
869 869 emit var->updated();
870 870 qCDebug(LOG_VariableController()) << tr("Update OK");
@@ -18,21 +18,21 public:
18 18 VisualizationController::VisualizationController(QObject *parent)
19 19 : impl{spimpl::make_unique_impl<VisualizationControllerPrivate>()}
20 20 {
21 qCDebug(LOG_VisualizationController()) << tr("VisualizationController construction")
22 << QThread::currentThread();
21 qCDebug(LOG_VisualizationController())
22 << tr("VisualizationController construction") << QThread::currentThread();
23 23 }
24 24
25 25 VisualizationController::~VisualizationController()
26 26 {
27 qCDebug(LOG_VisualizationController()) << tr("VisualizationController destruction")
28 << QThread::currentThread();
27 qCDebug(LOG_VisualizationController())
28 << tr("VisualizationController destruction") << QThread::currentThread();
29 29 this->waitForFinish();
30 30 }
31 31
32 32 void VisualizationController::initialize()
33 33 {
34 qCDebug(LOG_VisualizationController()) << tr("VisualizationController init")
35 << QThread::currentThread();
34 qCDebug(LOG_VisualizationController())
35 << tr("VisualizationController init") << QThread::currentThread();
36 36 impl->m_WorkingMutex.lock();
37 37 qCDebug(LOG_VisualizationController()) << tr("VisualizationController init END");
38 38 }
@@ -110,8 +110,8 void TestOptionalAxis::testSize_data()
110 110 QTest::newRow("data1") << axis({}) << 0;
111 111 QTest::newRow("data2") << axis({1, 2, 3}) << 3;
112 112 QTest::newRow("data3") << axis({1, 2, 3, 4}) << 4;
113 QTest::newRow("data4 (axis not defined)") << OptionalAxis{}
114 << 0; // Expects 0 for undefined axis
113 QTest::newRow("data4 (axis not defined)")
114 << OptionalAxis{} << 0; // Expects 0 for undefined axis
115 115 }
116 116
117 117 void TestOptionalAxis::testSize()
@@ -134,8 +134,8 void TestOptionalAxis::testUnit_data()
134 134
135 135 QTest::newRow("data1") << axis(Unit{"Hz"}) << Unit{"Hz"};
136 136 QTest::newRow("data2") << axis(Unit{"t", true}) << Unit{"t", true};
137 QTest::newRow("data3 (axis not defined)") << OptionalAxis{}
138 << Unit{}; // Expects default unit for undefined axis
137 QTest::newRow("data3 (axis not defined)")
138 << OptionalAxis{} << Unit{}; // Expects default unit for undefined axis
139 139 }
140 140
141 141 void TestOptionalAxis::testUnit()
@@ -173,18 +173,18 void TestScalarSeries::testMergeWithVector_data()
173 173 {
174 174 testMergeDifferentTypes_struct<VectorSeries, ScalarSeries>();
175 175
176 QTest::newRow("mergeVectorInScalar") << ScalarBuilder{}
177 .setX({1., 2., 3., 4., 5.})
178 .setValues({100., 200., 300., 400., 500.})
179 .build()
180 << VectorBuilder{}
181 .setX({6., 7., 8., 9., 10.})
182 .setXValues({600., 700., 800., 900., 1000.})
183 .setYValues({610., 710., 810., 910., 1010.})
184 .setZValues({620., 720., 820., 920., 1020.})
185 .build()
186 << DataContainer{1., 2., 3., 4., 5.}
187 << DataContainer{100., 200., 300., 400., 500.};
176 QTest::newRow("mergeVectorInScalar")
177 << ScalarBuilder{}
178 .setX({1., 2., 3., 4., 5.})
179 .setValues({100., 200., 300., 400., 500.})
180 .build()
181 << VectorBuilder{}
182 .setX({6., 7., 8., 9., 10.})
183 .setXValues({600., 700., 800., 900., 1000.})
184 .setYValues({610., 710., 810., 910., 1010.})
185 .setZValues({620., 720., 820., 920., 1020.})
186 .build()
187 << DataContainer{1., 2., 3., 4., 5.} << DataContainer{100., 200., 300., 400., 500.};
188 188 }
189 189
190 190 void TestScalarSeries::testMergeWithVector()
@@ -278,12 +278,12 void TestScalarSeries::testPurge_data()
278 278 .build()
279 279 << 2. << 4. << DataContainer{2., 3., 4.}
280 280 << std::vector<DataContainer>{{200., 300., 400.}};
281 QTest::newRow("purgeScalar1 (min/max swap)") << ScalarBuilder{}
282 .setX({1., 2., 3., 4., 5.})
283 .setValues({100., 200., 300., 400., 500.})
284 .build()
285 << 4. << 2. << DataContainer{2., 3., 4.}
286 << std::vector<DataContainer>{{200., 300., 400.}};
281 QTest::newRow("purgeScalar1 (min/max swap)")
282 << ScalarBuilder{}
283 .setX({1., 2., 3., 4., 5.})
284 .setValues({100., 200., 300., 400., 500.})
285 .build()
286 << 4. << 2. << DataContainer{2., 3., 4.} << std::vector<DataContainer>{{200., 300., 400.}};
287 287 QTest::newRow("purgeScalar2") << ScalarBuilder{}
288 288 .setX({1., 2., 3., 4., 5.})
289 289 .setValues({100., 200., 300., 400., 500.})
@@ -324,12 +324,12 void TestScalarSeries::testXAxisRange_data()
324 324 .build()
325 325 << -1. << 3.2 << DataContainer{1., 2., 3.}
326 326 << DataContainer{100., 200., 300.};
327 QTest::newRow("xAxisRange1 (min/max swap)") << ScalarBuilder{}
328 .setX({1., 2., 3., 4., 5.})
329 .setValues({100., 200., 300., 400., 500.})
330 .build()
331 << 3.2 << -1. << DataContainer{1., 2., 3.}
332 << DataContainer{100., 200., 300.};
327 QTest::newRow("xAxisRange1 (min/max swap)")
328 << ScalarBuilder{}
329 .setX({1., 2., 3., 4., 5.})
330 .setValues({100., 200., 300., 400., 500.})
331 .build()
332 << 3.2 << -1. << DataContainer{1., 2., 3.} << DataContainer{100., 200., 300.};
333 333 QTest::newRow("xAxisRange2") << ScalarBuilder{}
334 334 .setX({1., 2., 3., 4., 5.})
335 335 .setValues({100., 200., 300., 400., 500.})
@@ -401,10 +401,10 void TestScalarSeries::testValuesBounds_data()
401 401 .setValues({100., 200., 300., 400., 500.})
402 402 .build()
403 403 << 5.1 << 6. << false << nan << nan;
404 QTest::newRow("scalarBounds5") << ScalarBuilder{}.setX({1.}).setValues({100.}).build() << 0.
405 << 2. << true << 100. << 100.;
406 QTest::newRow("scalarBounds6") << ScalarBuilder{}.setX({}).setValues({}).build() << 0. << 2.
407 << false << nan << nan;
404 QTest::newRow("scalarBounds5")
405 << ScalarBuilder{}.setX({1.}).setValues({100.}).build() << 0. << 2. << true << 100. << 100.;
406 QTest::newRow("scalarBounds6")
407 << ScalarBuilder{}.setX({}).setValues({}).build() << 0. << 2. << false << nan << nan;
408 408
409 409 // Tests with NaN values: NaN values are not included in min/max search
410 410 QTest::newRow("scalarBounds7") << ScalarBuilder{}
@@ -87,8 +87,8 void TestTwoDimArrayData::testCtor_data()
87 87 << true << Container{{1., 2., 3., 4., 5.},
88 88 {6., 7., 8., 9., 10.},
89 89 {11., 12., 13., 14., 15.}};
90 QTest::newRow("invalidInput (invalid data size") << InputData{{1., 2., 3., 4., 5., 6., 7.}, 3}
91 << false << Container{{}, {}, {}};
90 QTest::newRow("invalidInput (invalid data size")
91 << InputData{{1., 2., 3., 4., 5., 6., 7.}, 3} << false << Container{{}, {}, {}};
92 92 QTest::newRow("invalidInput (less than two components")
93 93 << flatten(Container{{1., 2., 3., 4., 5.}}) << false << Container{{}, {}, {}};
94 94 }
@@ -400,8 +400,8 void testSyncOnVarCase1()
400 400 // Go back to initial range
401 401 moveOp(initialRange, initialRange, 300);
402 402
403 QTest::newRow("syncOnVarCase1") << syncId << initialRange << std::move(creations)
404 << std::move(iterations);
403 QTest::newRow("syncOnVarCase1")
404 << syncId << initialRange << std::move(creations) << std::move(iterations);
405 405 }
406 406 }
407 407
@@ -307,9 +307,9 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
307 307
308 308 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange &t2)
309 309 {
310 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: VisualizationGraphWidget::onRangeChanged")
311 << QThread::currentThread()->objectName() << "DoAcqui"
312 << impl->m_DoAcquisition;
310 qCDebug(LOG_VisualizationGraphWidget())
311 << tr("TORM: VisualizationGraphWidget::onRangeChanged")
312 << QThread::currentThread()->objectName() << "DoAcqui" << impl->m_DoAcquisition;
313 313
314 314 auto graphRange = SqpRange{t1.lower, t1.upper};
315 315 auto oldGraphRange = SqpRange{t2.lower, t2.upper};
@@ -185,10 +185,10 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
185 185 graphChildRange.m_TStart += deltaLeft;
186 186 graphChildRange.m_TEnd -= deltaRight;
187 187 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn");
188 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
189 << deltaLeft;
190 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
191 << deltaRight;
188 qCDebug(LOG_VisualizationZoneWidget())
189 << tr("TORM: deltaLeft") << deltaLeft;
190 qCDebug(LOG_VisualizationZoneWidget())
191 << tr("TORM: deltaRight") << deltaRight;
192 192 qCDebug(LOG_VisualizationZoneWidget())
193 193 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
194 194
@@ -199,10 +199,10 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
199 199 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut");
200 200 auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart;
201 201 auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd;
202 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft")
203 << deltaLeft;
204 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight")
205 << deltaRight;
202 qCDebug(LOG_VisualizationZoneWidget())
203 << tr("TORM: deltaLeft") << deltaLeft;
204 qCDebug(LOG_VisualizationZoneWidget())
205 << tr("TORM: deltaRight") << deltaRight;
206 206 qCDebug(LOG_VisualizationZoneWidget())
207 207 << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart;
208 208 graphChildRange.m_TStart -= deltaLeft;
@@ -239,10 +239,10 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V
239 239 break;
240 240 }
241 241 graphChild->enableAcquisition(false);
242 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range before: ")
243 << graphChild->graphRange();
244 qCDebug(LOG_VisualizationZoneWidget()) << tr("TORM: Range after : ")
245 << graphChildRange;
242 qCDebug(LOG_VisualizationZoneWidget())
243 << tr("TORM: Range before: ") << graphChild->graphRange();
244 qCDebug(LOG_VisualizationZoneWidget())
245 << tr("TORM: Range after : ") << graphChildRange;
246 246 qCDebug(LOG_VisualizationZoneWidget())
247 247 << tr("TORM: child dt") << graphChildRange.m_TEnd - graphChildRange.m_TStart;
248 248 graphChild->setGraphRange(graphChildRange);
@@ -1574,10 +1574,7 void QCPLayerable::applyAntialiasingHint(QCPPainter *painter, bool localAntialia
1574 1574
1575 1575 \see initializeParentPlot
1576 1576 */
1577 void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot)
1578 {
1579 Q_UNUSED(parentPlot)
1580 }
1577 void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot){Q_UNUSED(parentPlot)}
1581 1578
1582 1579 /*! \internal
1583 1580
@@ -9394,14 +9391,16 void QCPAxisPainterPrivate::draw(QCPPainter *painter)
9394 9391 painter->setBrush(QBrush(basePen.color()));
9395 9392 QCPVector2D baseLineVector(baseLine.dx(), baseLine.dy());
9396 9393 if (lowerEnding.style() != QCPLineEnding::esNone)
9397 lowerEnding.draw(painter, QCPVector2D(baseLine.p1())
9398 - baseLineVector.normalized() * lowerEnding.realLength()
9399 * (lowerEnding.inverted() ? -1 : 1),
9394 lowerEnding.draw(painter,
9395 QCPVector2D(baseLine.p1())
9396 - baseLineVector.normalized() * lowerEnding.realLength()
9397 * (lowerEnding.inverted() ? -1 : 1),
9400 9398 -baseLineVector);
9401 9399 if (upperEnding.style() != QCPLineEnding::esNone)
9402 upperEnding.draw(painter, QCPVector2D(baseLine.p2())
9403 + baseLineVector.normalized() * upperEnding.realLength()
9404 * (upperEnding.inverted() ? -1 : 1),
9400 upperEnding.draw(painter,
9401 QCPVector2D(baseLine.p2())
9402 + baseLineVector.normalized() * upperEnding.realLength()
9403 * (upperEnding.inverted() ? -1 : 1),
9405 9404 baseLineVector);
9406 9405 painter->setAntialiasing(antialiasingBackup);
9407 9406
@@ -16630,8 +16629,9 void QCPColorGradient::updateColorBuffer()
16630 16629 hue -= 1.0;
16631 16630 if (useAlpha) {
16632 16631 const QRgb rgb
16633 = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF()
16634 + t * highHsv.saturationF(),
16632 = QColor::fromHsvF(hue,
16633 (1 - t) * lowHsv.saturationF()
16634 + t * highHsv.saturationF(),
16635 16635 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16636 16636 .rgb();
16637 16637 const float alpha = (1 - t) * lowHsv.alphaF() + t * highHsv.alphaF();
@@ -16640,8 +16640,9 void QCPColorGradient::updateColorBuffer()
16640 16640 }
16641 16641 else {
16642 16642 mColorBuffer[i]
16643 = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF()
16644 + t * highHsv.saturationF(),
16643 = QColor::fromHsvF(hue,
16644 (1 - t) * lowHsv.saturationF()
16645 + t * highHsv.saturationF(),
16645 16646 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16646 16647 .rgb();
16647 16648 }
@@ -19998,12 +19999,14 void QCPColorScale::update(UpdatePhase phase)
19998 19999 switch (phase) {
19999 20000 case upMargins: {
20000 20001 if (mType == QCPAxis::atBottom || mType == QCPAxis::atTop) {
20001 setMaximumSize(QWIDGETSIZE_MAX, mBarWidth + mAxisRect.data()->margins().top()
20002 + mAxisRect.data()->margins().bottom()
20003 + margins().top() + margins().bottom());
20004 setMinimumSize(0, mBarWidth + mAxisRect.data()->margins().top()
20005 + mAxisRect.data()->margins().bottom() + margins().top()
20006 + margins().bottom());
20002 setMaximumSize(QWIDGETSIZE_MAX,
20003 mBarWidth + mAxisRect.data()->margins().top()
20004 + mAxisRect.data()->margins().bottom() + margins().top()
20005 + margins().bottom());
20006 setMinimumSize(0,
20007 mBarWidth + mAxisRect.data()->margins().top()
20008 + mAxisRect.data()->margins().bottom() + margins().top()
20009 + margins().bottom());
20007 20010 }
20008 20011 else {
20009 20012 setMaximumSize(mBarWidth + mAxisRect.data()->margins().left()
@@ -105,8 +105,8 void AmdaProvider::requestDataLoading(QUuid acqIdentifier, const DataProviderPar
105 105 const auto times = parameters.m_Times;
106 106 const auto data = parameters.m_Data;
107 107 for (const auto &dateTime : qAsConst(times)) {
108 qCDebug(LOG_AmdaProvider()) << tr("TORM AmdaProvider::requestDataLoading ") << acqIdentifier
109 << dateTime;
108 qCDebug(LOG_AmdaProvider())
109 << tr("TORM AmdaProvider::requestDataLoading ") << acqIdentifier << dateTime;
110 110 this->retrieveData(acqIdentifier, dateTime, data);
111 111
112 112
@@ -142,14 +142,14 void TestAmdaParser::testReadJson_data()
142 142 QTest::newRow("Valid file") << QStringLiteral("ValidFile1.json") << validResults1();
143 143
144 144 // Invalid files
145 QTest::newRow("Invalid file (unexisting file)") << QStringLiteral("UnexistingFile.json")
146 << invalidResults();
147 QTest::newRow("Invalid file (two root objects)") << QStringLiteral("TwoRootsFile.json")
148 << invalidResults();
149 QTest::newRow("Invalid file (wrong root key)") << QStringLiteral("WrongRootKey.json")
150 << invalidResults();
151 QTest::newRow("Invalid file (wrong root type)") << QStringLiteral("WrongRootType.json")
152 << invalidResults();
145 QTest::newRow("Invalid file (unexisting file)")
146 << QStringLiteral("UnexistingFile.json") << invalidResults();
147 QTest::newRow("Invalid file (two root objects)")
148 << QStringLiteral("TwoRootsFile.json") << invalidResults();
149 QTest::newRow("Invalid file (wrong root key)")
150 << QStringLiteral("WrongRootKey.json") << invalidResults();
151 QTest::newRow("Invalid file (wrong root type)")
152 << QStringLiteral("WrongRootType.json") << invalidResults();
153 153 }
154 154
155 155 void TestAmdaParser::testReadJson()
@@ -226,9 +226,9 std::shared_ptr<IDataSeries> CosinusProvider::retrieveData(QUuid acqIdentifier,
226 226 progress = currentProgress;
227 227
228 228 emit dataProvidedProgress(acqIdentifier, progress);
229 qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::retrieveData"
230 << QThread::currentThread()->objectName()
231 << progress;
229 qCDebug(LOG_CosinusProvider())
230 << "TORM: CosinusProvider::retrieveData"
231 << QThread::currentThread()->objectName() << progress;
232 232 // NOTE: Try to use multithread if possible
233 233 }
234 234 }
@@ -252,8 +252,8 void CosinusProvider::requestDataLoading(QUuid acqIdentifier,
252 252 {
253 253 // TODO: Add Mutex
254 254 m_VariableToEnableProvider[acqIdentifier] = true;
255 qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::requestDataLoading"
256 << QThread::currentThread()->objectName();
255 qCDebug(LOG_CosinusProvider())
256 << "TORM: CosinusProvider::requestDataLoading" << QThread::currentThread()->objectName();
257 257 // NOTE: Try to use multithread if possible
258 258 const auto times = parameters.m_Times;
259 259
General Comments 0
You need to be logged in to leave comments. Login now