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