##// END OF EJS Templates
Update worker for SqpRange compatibility
perrinel -
r501:7c5044f34aa3
parent child
Show More
@@ -8,7 +8,7
8 #include <QObject>
8 #include <QObject>
9 #include <QUuid>
9 #include <QUuid>
10
10
11 #include <Data/SqpDateTime.h>
11 #include <Data/SqpRange.h>
12
12
13 #include <QLoggingCategory>
13 #include <QLoggingCategory>
14
14
@@ -8,7 +8,7 Q_LOGGING_CATEGORY(LOG_VariableAcquisitionWorker, "VariableAcquisitionWorker")
8
8
9 struct VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate {
9 struct VariableAcquisitionWorker::VariableAcquisitionWorkerPrivate {
10
10
11 std::unordered_map<std::shared_ptr<Variable>, QVector<SqpDateTime> >
11 std::unordered_map<std::shared_ptr<Variable>, QVector<SqpRange> >
12 m_VariableToSqpDateTimeListMap;
12 m_VariableToSqpDateTimeListMap;
13 };
13 };
14
14
@@ -26,8 +26,8 struct VariableController::VariableControllerPrivate {
26 {
26 {
27 }
27 }
28
28
29 QVector<SqpDateTime> provideNotInCacheDateTimeList(std::shared_ptr<Variable> variable,
29 QVector<SqpRange> provideNotInCacheDateTimeList(std::shared_ptr<Variable> variable,
30 const SqpDateTime &dateTime);
30 const SqpRange &dateTime);
31
31
32 QMutex m_WorkingMutex;
32 QMutex m_WorkingMutex;
33 /// Variable model. The VariableController has the ownership
33 /// Variable model. The VariableController has the ownership
@@ -246,10 +246,10 void VariableController::waitForFinish()
246 }
246 }
247
247
248
248
249 QVector<SqpDateTime> VariableController::VariableControllerPrivate::provideNotInCacheDateTimeList(
249 QVector<SqpRange> VariableController::VariableControllerPrivate::provideNotInCacheDateTimeList(
250 std::shared_ptr<Variable> variable, const SqpDateTime &dateTime)
250 std::shared_ptr<Variable> variable, const SqpRange &dateTime)
251 {
251 {
252 auto notInCache = QVector<SqpDateTime>{};
252 auto notInCache = QVector<SqpRange>{};
253
253
254 if (!variable->contains(dateTime)) {
254 if (!variable->contains(dateTime)) {
255 auto vDateTime = variable->dateTime();
255 auto vDateTime = variable->dateTime();
@@ -257,14 +257,14 QVector<SqpDateTime> VariableController::VariableControllerPrivate::provideNotIn
257 notInCache << dateTime;
257 notInCache << dateTime;
258 }
258 }
259 else if (dateTime.m_TStart < vDateTime.m_TStart && dateTime.m_TEnd <= vDateTime.m_TEnd) {
259 else if (dateTime.m_TStart < vDateTime.m_TStart && dateTime.m_TEnd <= vDateTime.m_TEnd) {
260 notInCache << SqpDateTime{dateTime.m_TStart, vDateTime.m_TStart};
260 notInCache << SqpRange{dateTime.m_TStart, vDateTime.m_TStart};
261 }
261 }
262 else if (dateTime.m_TStart < vDateTime.m_TStart && dateTime.m_TEnd > vDateTime.m_TEnd) {
262 else if (dateTime.m_TStart < vDateTime.m_TStart && dateTime.m_TEnd > vDateTime.m_TEnd) {
263 notInCache << SqpDateTime{dateTime.m_TStart, vDateTime.m_TStart}
263 notInCache << SqpRange{dateTime.m_TStart, vDateTime.m_TStart}
264 << SqpDateTime{vDateTime.m_TEnd, dateTime.m_TStart};
264 << SqpRange{vDateTime.m_TEnd, dateTime.m_TStart};
265 }
265 }
266 else if (dateTime.m_TStart < vDateTime.m_TEnd) {
266 else if (dateTime.m_TStart < vDateTime.m_TEnd) {
267 notInCache << SqpDateTime{vDateTime.m_TEnd, dateTime.m_TStart};
267 notInCache << SqpRange{vDateTime.m_TEnd, dateTime.m_TStart};
268 }
268 }
269 else {
269 else {
270 qCCritical(LOG_VariableController()) << tr("Detection of unknown case.")
270 qCCritical(LOG_VariableController()) << tr("Detection of unknown case.")
General Comments 1
Under Review
author

Auto status change to "Under Review"

You need to be logged in to leave comments. Login now