diff --git a/.gitignore b/.gitignore index 2e25f0f..8211dab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ core/include/Version.h 3rdparty/ subprojects/CatalogueAPI/ subprojects/QxOrm/ +documentation/* +.idea/* +**/__pycache__/* diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index d195733..d3a508d 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -319,8 +319,8 @@ MainWindow::MainWindow(QWidget *parent) // /////////// // // Controllers / controllers connections - connect(&sqpApp->timeController(), SIGNAL(timeUpdated(SqpRange)), &sqpApp->variableController(), - SLOT(onDateTimeOnSelection(SqpRange))); + connect(&sqpApp->timeController(), SIGNAL(timeUpdated(DateTimeRange)), &sqpApp->variableController(), + SLOT(onDateTimeOnSelection(DateTimeRange))); // Widgets / controllers connections @@ -329,8 +329,8 @@ MainWindow::MainWindow(QWidget *parent) m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *))); // Time - connect(timeWidget, SIGNAL(timeUpdated(SqpRange)), &sqpApp->timeController(), - SLOT(onTimeToUpdate(SqpRange))); + connect(timeWidget, SIGNAL(timeUpdated(DateTimeRange)), &sqpApp->timeController(), + SLOT(onTimeToUpdate(DateTimeRange))); // Visualization connect(&sqpApp->visualizationController(), @@ -338,8 +338,8 @@ MainWindow::MainWindow(QWidget *parent) SLOT(onVariableAboutToBeDeleted(std::shared_ptr))); connect(&sqpApp->visualizationController(), - SIGNAL(rangeChanged(std::shared_ptr, const SqpRange &)), m_Ui->view, - SLOT(onRangeChanged(std::shared_ptr, const SqpRange &))); + SIGNAL(rangeChanged(std::shared_ptr, const DateTimeRange &)), m_Ui->view, + SLOT(onRangeChanged(std::shared_ptr, const DateTimeRange &))); // Widgets / widgets connections diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 150f8a0..e0ab2a6 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -10,6 +10,7 @@ FILE (GLOB_RECURSE core_SRCS ./include/Common/StringUtils.h ./include/Common/SignalWaiter.h ./include/Common/DateUtils.h + ./include/Common/Numeric.h ./include/Plugin/IPlugin.h ./include/Data/ArrayDataIterator.h ./include/Data/VariableRequest.h @@ -32,6 +33,7 @@ FILE (GLOB_RECURSE core_SRCS ./include/Data/IDataProvider.h ./include/Data/IDataSeries.h ./include/Network/NetworkController.h + ./include/Network/Downloader.h ./include/Version.h ./include/CoreGlobal.h ./include/Catalogue/CatalogueController.h @@ -46,6 +48,7 @@ FILE (GLOB_RECURSE core_SRCS ./include/Variable/Variable.h ./include/Variable/VariableCacheController.h ./include/Variable/VariableController.h + ./include/Variable/VariableController2.h ./include/Time/TimeController.h ./include/Settings/ISqpSettingsBindable.h ./include/Settings/SqpSettingsDefs.h @@ -71,6 +74,7 @@ FILE (GLOB_RECURSE core_SRCS ./src/Visualization/VisualizationController.cpp ./src/PluginManager/PluginManager.cpp ./src/Variable/VariableController.cpp + ./src/Variable/VariableController2.cpp ./src/Variable/VariableModel.cpp ./src/Variable/VariableCacheController.cpp ./src/Variable/VariableSynchronizationGroup.cpp diff --git a/core/include/Common/Numeric.h b/core/include/Common/Numeric.h new file mode 100644 index 0000000..b74e2a2 --- /dev/null +++ b/core/include/Common/Numeric.h @@ -0,0 +1,18 @@ +#include +#include +#include +#include + +/* + taken from here https://en.cppreference.com/w/cpp/types/numeric_limits/epsilon +*/ +template +typename std::enable_if::is_integer, bool>::type + almost_equal(T x, T y, int ulp) +{ + // the machine epsilon has to be scaled to the magnitude of the values used + // and multiplied by the desired precision in ULPs (units in the last place) + return std::abs(x-y) <= std::numeric_limits::epsilon() * std::abs(x+y) * ulp + // unless the result is subnormal + || std::abs(x-y) < std::numeric_limits::min(); +} diff --git a/core/include/Data/AcquisitionDataPacket.h b/core/include/Data/AcquisitionDataPacket.h index 3e02ba6..41ec85b 100644 --- a/core/include/Data/AcquisitionDataPacket.h +++ b/core/include/Data/AcquisitionDataPacket.h @@ -16,7 +16,7 @@ */ struct AcquisitionDataPacket { std::shared_ptr m_DateSeries; - SqpRange m_Range; + DateTimeRange m_Range; }; SCIQLOP_REGISTER_META_TYPE(ACQUISITIONDATAPACKET_REGISTRY, AcquisitionDataPacket) diff --git a/core/include/Data/AcquisitionRequest.h b/core/include/Data/AcquisitionRequest.h index 9e2b0de..d8b4c1e 100644 --- a/core/include/Data/AcquisitionRequest.h +++ b/core/include/Data/AcquisitionRequest.h @@ -28,8 +28,8 @@ struct AcquisitionRequest { QUuid m_AcqIdentifier; QUuid m_vIdentifier; DataProviderParameters m_DataProviderParameters; - SqpRange m_RangeRequested; - SqpRange m_CacheRangeRequested; + DateTimeRange m_RangeRequested; + DateTimeRange m_CacheRangeRequested; int m_Size; int m_Progression; std::shared_ptr m_Provider; diff --git a/core/include/Data/DataProviderParameters.h b/core/include/Data/DataProviderParameters.h index 3a6c0de..b8756ad 100644 --- a/core/include/Data/DataProviderParameters.h +++ b/core/include/Data/DataProviderParameters.h @@ -10,7 +10,7 @@ */ struct DataProviderParameters { /// Times for which retrieve data - QVector m_Times; + QVector m_Times; /// Extra data that can be used by the provider to retrieve data QVariantHash m_Data; }; diff --git a/core/include/Data/IDataProvider.h b/core/include/Data/IDataProvider.h index 6ff3b18..e816712 100644 --- a/core/include/Data/IDataProvider.h +++ b/core/include/Data/IDataProvider.h @@ -52,7 +52,7 @@ signals: * identified by acqIdentifier */ void dataProvided(QUuid acqIdentifier, std::shared_ptr dateSeriesAcquired, - const SqpRange &dataRangeAcquired); + const DateTimeRange &dataRangeAcquired); /** * @brief dataProvidedProgress notify the progression of the data identifier by acqIdentifier diff --git a/core/include/Data/IDataSeries.h b/core/include/Data/IDataSeries.h index c16f6c4..69ecd49 100644 --- a/core/include/Data/IDataSeries.h +++ b/core/include/Data/IDataSeries.h @@ -49,7 +49,7 @@ public: virtual void purge(double min, double max) = 0; /// @todo Review the name and signature of this method - virtual std::shared_ptr subDataSeries(const SqpRange &range) = 0; + virtual std::shared_ptr subDataSeries(const DateTimeRange &range) = 0; virtual std::unique_ptr clone() const = 0; diff --git a/core/include/Data/ScalarSeries.h b/core/include/Data/ScalarSeries.h index 82e4ec7..5034b9f 100644 --- a/core/include/Data/ScalarSeries.h +++ b/core/include/Data/ScalarSeries.h @@ -21,7 +21,7 @@ public: std::unique_ptr clone() const override; - std::shared_ptr subDataSeries(const SqpRange &range) override; + std::shared_ptr subDataSeries(const DateTimeRange &range) override; }; #endif // SCIQLOP_SCALARSERIES_H diff --git a/core/include/Data/SpectrogramSeries.h b/core/include/Data/SpectrogramSeries.h index f13ea1e..7155b3e 100644 --- a/core/include/Data/SpectrogramSeries.h +++ b/core/include/Data/SpectrogramSeries.h @@ -29,7 +29,7 @@ public: std::unique_ptr clone() const override; /// @sa DataSeries::subDataSeries() - std::shared_ptr subDataSeries(const SqpRange &range) override; + std::shared_ptr subDataSeries(const DateTimeRange &range) override; inline double xResolution() const noexcept { return m_XResolution; } diff --git a/core/include/Data/SqpRange.h b/core/include/Data/SqpRange.h index d51fc0f..bb3d75e 100644 --- a/core/include/Data/SqpRange.h +++ b/core/include/Data/SqpRange.h @@ -13,9 +13,9 @@ /** * @brief The SqpRange struct holds the information of time parameters */ -struct SqpRange { +struct DateTimeRange { /// Creates SqpRange from dates and times - static SqpRange fromDateTime(const QDate &startDate, const QTime &startTime, + static DateTimeRange fromDateTime(const QDate &startDate, const QTime &startTime, const QDate &endDate, const QTime &endTime) { return {DateUtils::secondsSinceEpoch(QDateTime{startDate, startTime, Qt::UTC}), @@ -27,17 +27,19 @@ struct SqpRange { /// End time (UTC) double m_TEnd; - bool contains(const SqpRange &dateTime) const noexcept + double delta()const {return this->m_TEnd - this->m_TStart;} + + bool contains(const DateTimeRange &dateTime) const noexcept { return (m_TStart <= dateTime.m_TStart && m_TEnd >= dateTime.m_TEnd); } - bool intersect(const SqpRange &dateTime) const noexcept + bool intersect(const DateTimeRange &dateTime) const noexcept { return (m_TEnd >= dateTime.m_TStart && m_TStart <= dateTime.m_TEnd); } - bool operator==(const SqpRange &other) const + bool operator==(const DateTimeRange &other) const { auto equals = [](const auto &v1, const auto &v2) { return (std::isnan(v1) && std::isnan(v2)) || v1 == v2; @@ -45,13 +47,13 @@ struct SqpRange { return equals(m_TStart, other.m_TStart) && equals(m_TEnd, other.m_TEnd); } - bool operator!=(const SqpRange &other) const { return !(*this == other); } + bool operator!=(const DateTimeRange &other) const { return !(*this == other); } }; const auto INVALID_RANGE - = SqpRange{std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; + = DateTimeRange{std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN()}; -inline QDebug operator<<(QDebug d, SqpRange obj) +inline QDebug operator<<(QDebug d, DateTimeRange obj) { auto tendDateTimeStart = DateUtils::dateTime(obj.m_TStart); auto tendDateTimeEnd = DateUtils::dateTime(obj.m_TEnd); @@ -61,6 +63,6 @@ inline QDebug operator<<(QDebug d, SqpRange obj) } // Required for using shared_ptr in signals/slots -SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, SqpRange) +SCIQLOP_REGISTER_META_TYPE(SQPRANGE_REGISTRY, DateTimeRange) #endif // SCIQLOP_SQPRANGE_H diff --git a/core/include/Data/VariableRequest.h b/core/include/Data/VariableRequest.h index e47261b..ac56c60 100644 --- a/core/include/Data/VariableRequest.h +++ b/core/include/Data/VariableRequest.h @@ -16,8 +16,8 @@ */ struct VariableRequest { QUuid m_VariableGroupId; - SqpRange m_RangeRequested; - SqpRange m_CacheRangeRequested; + DateTimeRange m_RangeRequested; + DateTimeRange m_CacheRangeRequested; std::shared_ptr m_DataSeries; }; diff --git a/core/include/Data/VectorSeries.h b/core/include/Data/VectorSeries.h index c00ed8b..5d39a81 100644 --- a/core/include/Data/VectorSeries.h +++ b/core/include/Data/VectorSeries.h @@ -28,7 +28,7 @@ public: std::unique_ptr clone() const; - std::shared_ptr subDataSeries(const SqpRange &range) override; + std::shared_ptr subDataSeries(const DateTimeRange &range) override; }; #endif // SCIQLOP_VECTORSERIES_H diff --git a/core/include/Network/Downloader.h b/core/include/Network/Downloader.h index 82c256d..b33ba9a 100644 --- a/core/include/Network/Downloader.h +++ b/core/include/Network/Downloader.h @@ -14,11 +14,45 @@ /** * @brief The Downloader handles all data donwloads in SciQLOP. + * + * Simple synchronous GET example: + * @code{.cpp} + * auto response = Downloader::get("http://example.com") + * std::cout << "Status code: " << response.status_code() << std::endl << "Data: " << response.data().toStdString() << std::endl; + * @endcode + * + * @note + * This is a quick and KISS implementation using QNetworkAccessManager isolating from Qt stuff (Signal/slots). + * This could be impemented with a different backend in the future. + * + * @sa Response */ class SCIQLOP_CORE_EXPORT Downloader{ public: + /** + * @brief does a synchronous GET request on the given url + * @param url + * @param user + * @param passwd + * @return Response object containing request data and http status code + * @sa Downloader::getAsync + */ static Response get(const QString& url, const QString& user="", const QString& passwd=""); + /** + * @brief does an asynchronous GET request on the given url + * @param url + * @param callback + * @param user + * @param passwd + * @return QUuid an unique identifier associated to this request + * @sa Downloader::get, Downloader::downloadFinished + */ static QUuid getAsync(const QString& url, std::function callback, const QString& user="", const QString& passwd=""); + /** + * @brief downloadFinished + * @param uuid + * @return true if the request associated to this uuid is complete + */ static bool downloadFinished(QUuid uuid); static Downloader& instance() diff --git a/core/include/Time/TimeController.h b/core/include/Time/TimeController.h index b83739d..5772448 100644 --- a/core/include/Time/TimeController.h +++ b/core/include/Time/TimeController.h @@ -21,21 +21,21 @@ class SCIQLOP_CORE_EXPORT TimeController : public QObject { public: explicit TimeController(QObject *parent = 0); - SqpRange dateTime() const noexcept; + DateTimeRange dateTime() const noexcept; /// Returns the MIME data associated to a time range - static QByteArray mimeDataForTimeRange(const SqpRange &timeRange); + static QByteArray mimeDataForTimeRange(const DateTimeRange &timeRange); /// Returns the time range contained in a MIME data - static SqpRange timeRangeForMimeData(const QByteArray &mimeData); + static DateTimeRange timeRangeForMimeData(const QByteArray &mimeData); signals: /// Signal emitted to notify that time parameters has beed updated - void timeUpdated(SqpRange time); + void timeUpdated(DateTimeRange time); public slots: /// Slot called when a new dateTime has been defined. - void setDateTimeRange(SqpRange dateTime); + void setDateTimeRange(DateTimeRange dateTime); /// Slot called when the dateTime has to be notified. Call timeUpdated signal void onTimeNotify(); diff --git a/core/include/Variable/Variable.h b/core/include/Variable/Variable.h index ea92956..20a9c5e 100644 --- a/core/include/Variable/Variable.h +++ b/core/include/Variable/Variable.h @@ -35,10 +35,10 @@ public: QString name() const noexcept; void setName(const QString &name) noexcept; - SqpRange range() const noexcept; - void setRange(const SqpRange &range) noexcept; - SqpRange cacheRange() const noexcept; - void setCacheRange(const SqpRange &cacheRange) noexcept; + DateTimeRange range() const noexcept; + void setRange(const DateTimeRange &range) noexcept; + DateTimeRange cacheRange() const noexcept; + void setCacheRange(const DateTimeRange &cacheRange) noexcept; /// @return the number of points hold by the variable. The number of points is updated each time /// the data series changes @@ -50,7 +50,7 @@ public: /// @return the real range, invalid range if the data series is null or empty /// @sa setDataSeries() /// @sa setRange() - SqpRange realRange() const noexcept; + DateTimeRange realRange() const noexcept; /// @return the data of the variable, nullptr if there is no data std::shared_ptr dataSeries() const noexcept; @@ -60,23 +60,23 @@ public: QVariantHash metadata() const noexcept; - bool contains(const SqpRange &range) const noexcept; - bool intersect(const SqpRange &range) const noexcept; - bool isInside(const SqpRange &range) const noexcept; + bool contains(const DateTimeRange &range) const noexcept; + bool intersect(const DateTimeRange &range) const noexcept; + bool isInside(const DateTimeRange &range) const noexcept; - bool cacheContains(const SqpRange &range) const noexcept; - bool cacheIntersect(const SqpRange &range) const noexcept; - bool cacheIsInside(const SqpRange &range) const noexcept; + bool cacheContains(const DateTimeRange &range) const noexcept; + bool cacheIntersect(const DateTimeRange &range) const noexcept; + bool cacheIsInside(const DateTimeRange &range) const noexcept; - QVector provideNotInCacheRangeList(const SqpRange &range) const noexcept; - QVector provideInCacheRangeList(const SqpRange &range) const noexcept; + QVector provideNotInCacheRangeList(const DateTimeRange &range) const noexcept; + QVector provideInCacheRangeList(const DateTimeRange &range) const noexcept; void mergeDataSeries(std::shared_ptr dataSeries) noexcept; - static QVector provideNotInCacheRangeList(const SqpRange &oldRange, - const SqpRange &nextRange); + static QVector provideNotInCacheRangeList(const DateTimeRange &oldRange, + const DateTimeRange &nextRange); - static QVector provideInCacheRangeList(const SqpRange &oldRange, - const SqpRange &nextRange); + static QVector provideInCacheRangeList(const DateTimeRange &oldRange, + const DateTimeRange &nextRange); signals: void updated(); diff --git a/core/include/Variable/VariableAcquisitionWorker.h b/core/include/Variable/VariableAcquisitionWorker.h index f5badbc..3705d5f 100644 --- a/core/include/Variable/VariableAcquisitionWorker.h +++ b/core/include/Variable/VariableAcquisitionWorker.h @@ -28,8 +28,8 @@ public: explicit VariableAcquisitionWorker(QObject *parent = 0); virtual ~VariableAcquisitionWorker(); - QUuid pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, SqpRange rangeRequested, - SqpRange cacheRangeRequested, DataProviderParameters parameters, + QUuid pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, DateTimeRange rangeRequested, + DateTimeRange cacheRangeRequested, DataProviderParameters parameters, std::shared_ptr provider); void abortProgressRequested(QUuid vIdentifier); @@ -37,8 +37,8 @@ public: void initialize(); void finalize(); signals: - void dataProvided(QUuid vIdentifier, const SqpRange &rangeRequested, - const SqpRange &cacheRangeRequested, + void dataProvided(QUuid vIdentifier, const DateTimeRange &rangeRequested, + const DateTimeRange &cacheRangeRequested, QVector dataAcquired); void variableRequestInProgress(QUuid vIdentifier, double progress); @@ -49,7 +49,7 @@ signals: public slots: void onVariableDataAcquired(QUuid acqIdentifier, std::shared_ptr dataSeries, - SqpRange dataRangeAcquired); + DateTimeRange dataRangeAcquired); void onVariableRetrieveDataInProgress(QUuid acqIdentifier, double progress); void onVariableAcquisitionFailed(QUuid acqIdentifier); diff --git a/core/include/Variable/VariableCacheController.h b/core/include/Variable/VariableCacheController.h index 061b0f2..6497842 100644 --- a/core/include/Variable/VariableCacheController.h +++ b/core/include/Variable/VariableCacheController.h @@ -23,17 +23,17 @@ public: explicit VariableCacheController(QObject *parent = 0); - void addDateTime(std::shared_ptr variable, const SqpRange &dateTime); + void addDateTime(std::shared_ptr variable, const DateTimeRange &dateTime); /// Clears cache concerning a variable void clear(std::shared_ptr variable) noexcept; /// Return all of the SqpDataTime part of the dateTime whose are not in the cache - QVector provideNotInCacheDateTimeList(std::shared_ptr variable, - const SqpRange &dateTime); + QVector provideNotInCacheDateTimeList(std::shared_ptr variable, + const DateTimeRange &dateTime); - QVector dateCacheList(std::shared_ptr variable) const noexcept; + QVector dateCacheList(std::shared_ptr variable) const noexcept; void displayCache(std::shared_ptr variable) const; diff --git a/core/include/Variable/VariableCacheStrategy.h b/core/include/Variable/VariableCacheStrategy.h index 2487253..b6a75de 100644 --- a/core/include/Variable/VariableCacheStrategy.h +++ b/core/include/Variable/VariableCacheStrategy.h @@ -23,8 +23,8 @@ class SCIQLOP_CORE_EXPORT VariableCacheStrategy { public: virtual ~VariableCacheStrategy() noexcept = default; - virtual std::pair computeRange(const SqpRange &vRange, - const SqpRange &rangeRequested) + virtual std::pair computeRange(const DateTimeRange &vRange, + const DateTimeRange &rangeRequested) = 0; }; diff --git a/core/include/Variable/VariableController.h b/core/include/Variable/VariableController.h index 863b047..c800fb7 100644 --- a/core/include/Variable/VariableController.h +++ b/core/include/Variable/VariableController.h @@ -53,7 +53,7 @@ public: /// Returns the list of variables contained in a MIME data QList > variablesForMimeData(const QByteArray &mimeData) const; - static AcquisitionZoomType getZoomType(const SqpRange &range, const SqpRange &oldRange); + static AcquisitionZoomType getZoomType(const DateTimeRange &range, const DateTimeRange &oldRange); /// Returns True if there are pending downloads bool hasPendingDownloads(); @@ -62,10 +62,10 @@ signals: void variableAboutToBeDeleted(std::shared_ptr variable); /// Signal emitted when a data acquisition is requested on a range for a variable - void rangeChanged(std::shared_ptr variable, const SqpRange &range); + void rangeChanged(std::shared_ptr variable, const DateTimeRange &range); /// Signal emitted when a sub range of the cacheRange of the variable can be displayed - void updateVarDisplaying(std::shared_ptr variable, const SqpRange &range); + void updateVarDisplaying(std::shared_ptr variable, const DateTimeRange &range); /// Signal emitted when all acquisitions related to the variables have been completed (whether /// validated, canceled, or failed) @@ -95,7 +95,7 @@ public slots: void deleteVariables(const QVector > &variables) noexcept; /// Request the data loading of the variable whithin range - void onRequestDataLoading(QVector > variables, const SqpRange &range, + void onRequestDataLoading(QVector > variables, const DateTimeRange &range, bool synchronise); /** * Creates a new variable and adds it to the model @@ -105,17 +105,17 @@ public slots: * @return the pointer to the new variable or nullptr if the creation failed */ std::shared_ptr createVariable(const QString &name, const QVariantHash &metadata, - std::shared_ptr provider, const SqpRange &range) noexcept; + std::shared_ptr provider, const DateTimeRange &range) noexcept; /// Update the temporal parameters of every selected variable to dateTime - void onDateTimeOnSelection(const SqpRange &dateTime); + void onDateTimeOnSelection(const DateTimeRange &dateTime); /// Update the temporal parameters of the specified variable - void onUpdateDateTime(std::shared_ptr variable, const SqpRange &dateTime); + void onUpdateDateTime(std::shared_ptr variable, const DateTimeRange &dateTime); - void onDataProvided(QUuid vIdentifier, const SqpRange &rangeRequested, - const SqpRange &cacheRangeRequested, + void onDataProvided(QUuid vIdentifier, const DateTimeRange &rangeRequested, + const DateTimeRange &cacheRangeRequested, QVector dataAcquired); void onVariableRetrieveDataInProgress(QUuid identifier, double progress); diff --git a/core/include/Variable/VariableController2.h b/core/include/Variable/VariableController2.h new file mode 100644 index 0000000..4c4da01 --- /dev/null +++ b/core/include/Variable/VariableController2.h @@ -0,0 +1,32 @@ +#include +#include +#include +#include +#include +#include "Data/SqpRange.h" +#include +#include + +class VariableController2 +{ + + QHash> _variables; + QMutex _variables_lock; + + std::vector> _groups; + QMutex _variables_groups_lock; +public: + + QUuid addVariable(std::shared_ptr variable) + { + QMutexLocker lock(&_variables_lock); + QMutexLocker glock(&_variables_groups_lock); + + QUuid uuid = QUuid::createUuid(); + this->_variables[uuid] = variable; + this->_groups.push_back(std::make_unique(uuid)); + return uuid; + } + void changeRange(int variable, DateTimeRange r); + void asyncChangeRange(int variable, DateTimeRange r); +}; diff --git a/core/include/Variable/VariableModel.h b/core/include/Variable/VariableModel.h index ea0bdca..c59ade3 100644 --- a/core/include/Variable/VariableModel.h +++ b/core/include/Variable/VariableModel.h @@ -94,7 +94,7 @@ public: signals: void abortProgessRequested(std::shared_ptr variable); void requestVariable(const QVariantHash &productData); - void requestVariableRangeUpdate(std::shared_ptr variable, const SqpRange &range); + void requestVariableRangeUpdate(std::shared_ptr variable, const DateTimeRange &range); private: class VariableModelPrivate; diff --git a/core/include/Variable/VariableSingleThresholdCacheStrategy.h b/core/include/Variable/VariableSingleThresholdCacheStrategy.h index 66be152..f3afacd 100644 --- a/core/include/Variable/VariableSingleThresholdCacheStrategy.h +++ b/core/include/Variable/VariableSingleThresholdCacheStrategy.h @@ -10,11 +10,11 @@ class SCIQLOP_CORE_EXPORT VariableSingleThresholdCacheStrategy : public Variable public: VariableSingleThresholdCacheStrategy() = default; - std::pair computeRange(const SqpRange &vRange, - const SqpRange &rangeRequested) override + std::pair computeRange(const DateTimeRange &vRange, + const DateTimeRange &rangeRequested) override { - auto varRanges = std::pair{}; + auto varRanges = std::pair{}; auto toleranceFactor = SqpSettings::toleranceValue( GENERAL_TOLERANCE_AT_UPDATE_KEY, GENERAL_TOLERANCE_AT_UPDATE_DEFAULT_VALUE); @@ -22,7 +22,7 @@ public: varRanges.first = rangeRequested; varRanges.second - = SqpRange{rangeRequested.m_TStart - tolerance, rangeRequested.m_TEnd + tolerance}; + = DateTimeRange{rangeRequested.m_TStart - tolerance, rangeRequested.m_TEnd + tolerance}; return varRanges; } diff --git a/core/include/Variable/VariableSynchronizationGroup.h b/core/include/Variable/VariableSynchronizationGroup.h index ffb5ce8..e1a6160 100644 --- a/core/include/Variable/VariableSynchronizationGroup.h +++ b/core/include/Variable/VariableSynchronizationGroup.h @@ -23,10 +23,11 @@ class Variable; class SCIQLOP_CORE_EXPORT VariableSynchronizationGroup : public QObject { Q_OBJECT public: - explicit VariableSynchronizationGroup(QObject *parent = 0); + explicit VariableSynchronizationGroup(QObject *parent = Q_NULLPTR); + explicit VariableSynchronizationGroup(QUuid variable, QObject *parent = Q_NULLPTR); - void addVariableId(QUuid vIdentifier); - void removeVariableId(QUuid vIdentifier); + void addVariable(QUuid vIdentifier); + void removeVariable(QUuid vIdentifier); const std::set &getIds() const noexcept; diff --git a/core/include/Visualization/VisualizationController.h b/core/include/Visualization/VisualizationController.h index 3206a78..6de989e 100644 --- a/core/include/Visualization/VisualizationController.h +++ b/core/include/Visualization/VisualizationController.h @@ -34,7 +34,7 @@ signals: void variableAboutToBeDeleted(std::shared_ptr variable); /// Signal emitted when a data acquisition is requested on a range for a variable - void rangeChanged(std::shared_ptr variable, const SqpRange &range); + void rangeChanged(std::shared_ptr variable, const DateTimeRange &range); public slots: /// Manage init/end of the controller diff --git a/core/src/Data/ScalarSeries.cpp b/core/src/Data/ScalarSeries.cpp index 4dd44f5..3b836f4 100644 --- a/core/src/Data/ScalarSeries.cpp +++ b/core/src/Data/ScalarSeries.cpp @@ -12,7 +12,7 @@ std::unique_ptr ScalarSeries::clone() const return std::make_unique(*this); } -std::shared_ptr ScalarSeries::subDataSeries(const SqpRange &range) +std::shared_ptr ScalarSeries::subDataSeries(const DateTimeRange &range) { auto subXAxisData = std::vector(); auto subValuesData = std::vector(); diff --git a/core/src/Data/SpectrogramSeries.cpp b/core/src/Data/SpectrogramSeries.cpp index 2ea57ba..4bfb435 100644 --- a/core/src/Data/SpectrogramSeries.cpp +++ b/core/src/Data/SpectrogramSeries.cpp @@ -29,7 +29,7 @@ std::unique_ptr SpectrogramSeries::clone() const return std::make_unique(*this); } -std::shared_ptr SpectrogramSeries::subDataSeries(const SqpRange &range) +std::shared_ptr SpectrogramSeries::subDataSeries(const DateTimeRange &range) { auto subXAxisData = std::vector(); auto subValuesData = QVector(); // Uses QVector to append easily values to it diff --git a/core/src/Data/VectorSeries.cpp b/core/src/Data/VectorSeries.cpp index de3fd28..bdc9edb 100644 --- a/core/src/Data/VectorSeries.cpp +++ b/core/src/Data/VectorSeries.cpp @@ -61,7 +61,7 @@ std::unique_ptr VectorSeries::clone() const return std::make_unique(*this); } -std::shared_ptr VectorSeries::subDataSeries(const SqpRange &range) +std::shared_ptr VectorSeries::subDataSeries(const DateTimeRange &range) { auto subXAxisData = std::vector(); auto subValuesData = std::vector(); diff --git a/core/src/Time/TimeController.cpp b/core/src/Time/TimeController.cpp index 22b60ec..fbbac58 100644 --- a/core/src/Time/TimeController.cpp +++ b/core/src/Time/TimeController.cpp @@ -6,7 +6,7 @@ Q_LOGGING_CATEGORY(LOG_TimeController, "TimeController") struct TimeController::TimeControllerPrivate { - SqpRange m_DateTime; + DateTimeRange m_DateTime; }; TimeController::TimeController(QObject *parent) @@ -15,12 +15,12 @@ TimeController::TimeController(QObject *parent) qCDebug(LOG_TimeController()) << tr("TimeController construction"); } -SqpRange TimeController::dateTime() const noexcept +DateTimeRange TimeController::dateTime() const noexcept { return impl->m_DateTime; } -QByteArray TimeController::mimeDataForTimeRange(const SqpRange &timeRange) +QByteArray TimeController::mimeDataForTimeRange(const DateTimeRange &timeRange) { QByteArray encodedData; QDataStream stream{&encodedData, QIODevice::WriteOnly}; @@ -30,17 +30,17 @@ QByteArray TimeController::mimeDataForTimeRange(const SqpRange &timeRange) return encodedData; } -SqpRange TimeController::timeRangeForMimeData(const QByteArray &mimeData) +DateTimeRange TimeController::timeRangeForMimeData(const QByteArray &mimeData) { QDataStream stream{mimeData}; - SqpRange timeRange; + DateTimeRange timeRange; stream >> timeRange.m_TStart >> timeRange.m_TEnd; return timeRange; } -void TimeController::setDateTimeRange(SqpRange dateTime) +void TimeController::setDateTimeRange(DateTimeRange dateTime) { impl->m_DateTime = dateTime; } diff --git a/core/src/Variable/Variable.cpp b/core/src/Variable/Variable.cpp index d431fda..e55bee1 100644 --- a/core/src/Variable/Variable.cpp +++ b/core/src/Variable/Variable.cpp @@ -83,7 +83,7 @@ struct Variable::VariablePrivate { m_RealRange = (minXAxisIt != end && maxXAxisIt != end && minXAxisIt->x() <= maxXAxisIt->x()) - ? SqpRange{minXAxisIt->x(), maxXAxisIt->x()} + ? DateTimeRange{minXAxisIt->x(), maxXAxisIt->x()} : INVALID_RANGE; m_DataSeries->unlock(); } @@ -94,11 +94,11 @@ struct Variable::VariablePrivate { QString m_Name; - SqpRange m_Range; - SqpRange m_CacheRange; + DateTimeRange m_Range; + DateTimeRange m_CacheRange; QVariantHash m_Metadata; std::shared_ptr m_DataSeries; - SqpRange m_RealRange; + DateTimeRange m_RealRange; int m_NbPoints; DataSeriesType m_Type; @@ -135,7 +135,7 @@ void Variable::setName(const QString &name) noexcept impl->unlock(); } -SqpRange Variable::range() const noexcept +DateTimeRange Variable::range() const noexcept { impl->lockRead(); auto range = impl->m_Range; @@ -143,7 +143,7 @@ SqpRange Variable::range() const noexcept return range; } -void Variable::setRange(const SqpRange &range) noexcept +void Variable::setRange(const DateTimeRange &range) noexcept { impl->lockWrite(); impl->m_Range = range; @@ -151,7 +151,7 @@ void Variable::setRange(const SqpRange &range) noexcept impl->unlock(); } -SqpRange Variable::cacheRange() const noexcept +DateTimeRange Variable::cacheRange() const noexcept { impl->lockRead(); auto cacheRange = impl->m_CacheRange; @@ -159,7 +159,7 @@ SqpRange Variable::cacheRange() const noexcept return cacheRange; } -void Variable::setCacheRange(const SqpRange &cacheRange) noexcept +void Variable::setCacheRange(const DateTimeRange &cacheRange) noexcept { impl->lockWrite(); if (cacheRange != impl->m_CacheRange) { @@ -173,7 +173,7 @@ int Variable::nbPoints() const noexcept return impl->m_NbPoints; } -SqpRange Variable::realRange() const noexcept +DateTimeRange Variable::realRange() const noexcept { return impl->m_RealRange; } @@ -233,7 +233,7 @@ QVariantHash Variable::metadata() const noexcept return metadata; } -bool Variable::contains(const SqpRange &range) const noexcept +bool Variable::contains(const DateTimeRange &range) const noexcept { impl->lockRead(); auto res = impl->m_Range.contains(range); @@ -241,7 +241,7 @@ bool Variable::contains(const SqpRange &range) const noexcept return res; } -bool Variable::intersect(const SqpRange &range) const noexcept +bool Variable::intersect(const DateTimeRange &range) const noexcept { impl->lockRead(); @@ -250,15 +250,15 @@ bool Variable::intersect(const SqpRange &range) const noexcept return res; } -bool Variable::isInside(const SqpRange &range) const noexcept +bool Variable::isInside(const DateTimeRange &range) const noexcept { impl->lockRead(); - auto res = range.contains(SqpRange{impl->m_Range.m_TStart, impl->m_Range.m_TEnd}); + auto res = range.contains(DateTimeRange{impl->m_Range.m_TStart, impl->m_Range.m_TEnd}); impl->unlock(); return res; } -bool Variable::cacheContains(const SqpRange &range) const noexcept +bool Variable::cacheContains(const DateTimeRange &range) const noexcept { impl->lockRead(); auto res = impl->m_CacheRange.contains(range); @@ -266,7 +266,7 @@ bool Variable::cacheContains(const SqpRange &range) const noexcept return res; } -bool Variable::cacheIntersect(const SqpRange &range) const noexcept +bool Variable::cacheIntersect(const DateTimeRange &range) const noexcept { impl->lockRead(); auto res = impl->m_CacheRange.intersect(range); @@ -274,19 +274,19 @@ bool Variable::cacheIntersect(const SqpRange &range) const noexcept return res; } -bool Variable::cacheIsInside(const SqpRange &range) const noexcept +bool Variable::cacheIsInside(const DateTimeRange &range) const noexcept { impl->lockRead(); - auto res = range.contains(SqpRange{impl->m_CacheRange.m_TStart, impl->m_CacheRange.m_TEnd}); + auto res = range.contains(DateTimeRange{impl->m_CacheRange.m_TStart, impl->m_CacheRange.m_TEnd}); impl->unlock(); return res; } -QVector Variable::provideNotInCacheRangeList(const SqpRange &range) const noexcept +QVector Variable::provideNotInCacheRangeList(const DateTimeRange &range) const noexcept { // This code assume that cach in contigue. Can return 0, 1 or 2 SqpRange - auto notInCache = QVector{}; + auto notInCache = QVector{}; if (impl->m_CacheRange != INVALID_RANGE) { if (!this->cacheContains(range)) { @@ -296,15 +296,15 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &range) co } else if (range.m_TStart < impl->m_CacheRange.m_TStart && range.m_TEnd <= impl->m_CacheRange.m_TEnd) { - notInCache << SqpRange{range.m_TStart, impl->m_CacheRange.m_TStart}; + notInCache << DateTimeRange{range.m_TStart, impl->m_CacheRange.m_TStart}; } else if (range.m_TStart < impl->m_CacheRange.m_TStart && range.m_TEnd > impl->m_CacheRange.m_TEnd) { - notInCache << SqpRange{range.m_TStart, impl->m_CacheRange.m_TStart} - << SqpRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; + notInCache << DateTimeRange{range.m_TStart, impl->m_CacheRange.m_TStart} + << DateTimeRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; } else if (range.m_TStart < impl->m_CacheRange.m_TEnd) { - notInCache << SqpRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; + notInCache << DateTimeRange{impl->m_CacheRange.m_TEnd, range.m_TEnd}; } else { qCCritical(LOG_Variable()) << tr("Detection of unknown case.") @@ -319,11 +319,11 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &range) co return notInCache; } -QVector Variable::provideInCacheRangeList(const SqpRange &range) const noexcept +QVector Variable::provideInCacheRangeList(const DateTimeRange &range) const noexcept { // This code assume that cach in contigue. Can return 0 or 1 SqpRange - auto inCache = QVector{}; + auto inCache = QVector{}; if (impl->m_CacheRange != INVALID_RANGE) { @@ -331,7 +331,7 @@ QVector Variable::provideInCacheRangeList(const SqpRange &range) const if (range.m_TStart <= impl->m_CacheRange.m_TStart && range.m_TEnd >= impl->m_CacheRange.m_TStart && range.m_TEnd < impl->m_CacheRange.m_TEnd) { - inCache << SqpRange{impl->m_CacheRange.m_TStart, range.m_TEnd}; + inCache << DateTimeRange{impl->m_CacheRange.m_TStart, range.m_TEnd}; } else if (range.m_TStart >= impl->m_CacheRange.m_TStart @@ -340,7 +340,7 @@ QVector Variable::provideInCacheRangeList(const SqpRange &range) const } else if (range.m_TStart > impl->m_CacheRange.m_TStart && range.m_TEnd > impl->m_CacheRange.m_TEnd) { - inCache << SqpRange{range.m_TStart, impl->m_CacheRange.m_TEnd}; + inCache << DateTimeRange{range.m_TStart, impl->m_CacheRange.m_TEnd}; } else if (range.m_TStart <= impl->m_CacheRange.m_TStart && range.m_TEnd >= impl->m_CacheRange.m_TEnd) { @@ -357,12 +357,12 @@ QVector Variable::provideInCacheRangeList(const SqpRange &range) const } -QVector Variable::provideNotInCacheRangeList(const SqpRange &oldRange, - const SqpRange &nextRange) +QVector Variable::provideNotInCacheRangeList(const DateTimeRange &oldRange, + const DateTimeRange &nextRange) { // This code assume that cach in contigue. Can return 0, 1 or 2 SqpRange - auto notInCache = QVector{}; + auto notInCache = QVector{}; if (oldRange != INVALID_RANGE) { if (!oldRange.contains(nextRange)) { @@ -371,14 +371,14 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &oldRange, } else if (nextRange.m_TStart < oldRange.m_TStart && nextRange.m_TEnd <= oldRange.m_TEnd) { - notInCache << SqpRange{nextRange.m_TStart, oldRange.m_TStart}; + notInCache << DateTimeRange{nextRange.m_TStart, oldRange.m_TStart}; } else if (nextRange.m_TStart < oldRange.m_TStart && nextRange.m_TEnd > oldRange.m_TEnd) { - notInCache << SqpRange{nextRange.m_TStart, oldRange.m_TStart} - << SqpRange{oldRange.m_TEnd, nextRange.m_TEnd}; + notInCache << DateTimeRange{nextRange.m_TStart, oldRange.m_TStart} + << DateTimeRange{oldRange.m_TEnd, nextRange.m_TEnd}; } else if (nextRange.m_TStart < oldRange.m_TEnd) { - notInCache << SqpRange{oldRange.m_TEnd, nextRange.m_TEnd}; + notInCache << DateTimeRange{oldRange.m_TEnd, nextRange.m_TEnd}; } else { qCCritical(LOG_Variable()) << tr("Detection of unknown case.") @@ -393,19 +393,19 @@ QVector Variable::provideNotInCacheRangeList(const SqpRange &oldRange, return notInCache; } -QVector Variable::provideInCacheRangeList(const SqpRange &oldRange, - const SqpRange &nextRange) +QVector Variable::provideInCacheRangeList(const DateTimeRange &oldRange, + const DateTimeRange &nextRange) { // This code assume that cach is contigue. Can return 0 or 1 SqpRange - auto inCache = QVector{}; + auto inCache = QVector{}; if (oldRange != INVALID_RANGE) { if (oldRange.intersect(nextRange)) { if (nextRange.m_TStart <= oldRange.m_TStart && nextRange.m_TEnd >= oldRange.m_TStart && nextRange.m_TEnd < oldRange.m_TEnd) { - inCache << SqpRange{oldRange.m_TStart, nextRange.m_TEnd}; + inCache << DateTimeRange{oldRange.m_TStart, nextRange.m_TEnd}; } else if (nextRange.m_TStart >= oldRange.m_TStart @@ -413,7 +413,7 @@ QVector Variable::provideInCacheRangeList(const SqpRange &oldRange, inCache << nextRange; } else if (nextRange.m_TStart > oldRange.m_TStart && nextRange.m_TEnd > oldRange.m_TEnd) { - inCache << SqpRange{nextRange.m_TStart, oldRange.m_TEnd}; + inCache << DateTimeRange{nextRange.m_TStart, oldRange.m_TEnd}; } else if (nextRange.m_TStart <= oldRange.m_TStart && nextRange.m_TEnd >= oldRange.m_TEnd) { diff --git a/core/src/Variable/VariableAcquisitionWorker.cpp b/core/src/Variable/VariableAcquisitionWorker.cpp index 479293a..05d4a67 100644 --- a/core/src/Variable/VariableAcquisitionWorker.cpp +++ b/core/src/Variable/VariableAcquisitionWorker.cpp @@ -60,8 +60,8 @@ VariableAcquisitionWorker::~VariableAcquisitionWorker() QUuid VariableAcquisitionWorker::pushVariableRequest(QUuid varRequestId, QUuid vIdentifier, - SqpRange rangeRequested, - SqpRange cacheRangeRequested, + DateTimeRange rangeRequested, + DateTimeRange cacheRangeRequested, DataProviderParameters parameters, std::shared_ptr provider) { @@ -196,7 +196,7 @@ void VariableAcquisitionWorker::onVariableAcquisitionFailed(QUuid acqIdentifier) void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, std::shared_ptr dataSeries, - SqpRange dataRangeAcquired) + DateTimeRange dataRangeAcquired) { qCDebug(LOG_VariableAcquisitionWorker()) << tr("TORM: onVariableDataAcquired on range ") << acqIdentifier << dataRangeAcquired; diff --git a/core/src/Variable/VariableCacheController.cpp b/core/src/Variable/VariableCacheController.cpp index fd1e836..d8a437e 100644 --- a/core/src/Variable/VariableCacheController.cpp +++ b/core/src/Variable/VariableCacheController.cpp @@ -8,16 +8,16 @@ Q_LOGGING_CATEGORY(LOG_VariableCacheController, "VariableCacheController") struct VariableCacheController::VariableCacheControllerPrivate { - std::unordered_map, QVector > m_VariableToSqpRangeListMap; + std::unordered_map, QVector > m_VariableToSqpRangeListMap; - void addInCacheDataByEnd(const SqpRange &dateTime, QVector &dateTimeList, - QVector ¬InCache, int cacheIndex, double currentTStart); + void addInCacheDataByEnd(const DateTimeRange &dateTime, QVector &dateTimeList, + QVector ¬InCache, int cacheIndex, double currentTStart); - void addInCacheDataByStart(const SqpRange &dateTime, QVector &dateTimeList, - QVector ¬InCache, int cacheIndex, double currentTStart); + void addInCacheDataByStart(const DateTimeRange &dateTime, QVector &dateTimeList, + QVector ¬InCache, int cacheIndex, double currentTStart); - void addDateTimeRecurse(const SqpRange &dateTime, QVector &dateTimeList, + void addDateTimeRecurse(const DateTimeRange &dateTime, QVector &dateTimeList, int cacheIndex); }; @@ -28,7 +28,7 @@ VariableCacheController::VariableCacheController(QObject *parent) } void VariableCacheController::addDateTime(std::shared_ptr variable, - const SqpRange &dateTime) + const DateTimeRange &dateTime) { qCDebug(LOG_VariableCacheController()) << "VariableCacheController::addDateTime" << QThread::currentThread()->objectName(); @@ -77,14 +77,14 @@ void VariableCacheController::clear(std::shared_ptr variable) noexcept qCDebug(LOG_VariableCacheController()) << clearCacheMessage; } -QVector +QVector VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr variable, - const SqpRange &dateTime) + const DateTimeRange &dateTime) { qCDebug(LOG_VariableCacheController()) << "VariableCacheController::provideNotInCacheDateTimeList" << QThread::currentThread()->objectName(); - auto notInCache = QVector{}; + auto notInCache = QVector{}; // This algorithm is recursif. The idea is to localise the start time then the end time in the // list of date time request associated to the variable @@ -101,7 +101,7 @@ VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr return notInCache; } -QVector +QVector VariableCacheController::dateCacheList(std::shared_ptr variable) const noexcept { qCDebug(LOG_VariableCacheController()) << "VariableCacheController::dateCacheList" @@ -111,12 +111,12 @@ VariableCacheController::dateCacheList(std::shared_ptr variable) const } catch (const std::out_of_range &e) { qCWarning(LOG_VariableCacheController()) << e.what(); - return QVector{}; + return QVector{}; } } void VariableCacheController::VariableCacheControllerPrivate::addDateTimeRecurse( - const SqpRange &dateTime, QVector &dateTimeList, int cacheIndex) + const DateTimeRange &dateTime, QVector &dateTimeList, int cacheIndex) { const auto dateTimeListSize = dateTimeList.count(); if (cacheIndex >= dateTimeListSize) { @@ -140,7 +140,7 @@ void VariableCacheController::VariableCacheControllerPrivate::addDateTimeRecurse // rerun the algo from this index with the merged interval auto mTStart = std::min(dateTime.m_TStart, currentDateTime.m_TStart); auto mTEnd = std::max(dateTime.m_TEnd, currentDateTime.m_TEnd); - auto mergeDateTime = SqpRange{mTStart, mTEnd}; + auto mergeDateTime = DateTimeRange{mTStart, mTEnd}; dateTimeList.remove(cacheIndex); addDateTimeRecurse(mergeDateTime, dateTimeList, cacheIndex); @@ -149,7 +149,7 @@ void VariableCacheController::VariableCacheControllerPrivate::addDateTimeRecurse void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataByEnd( - const SqpRange &dateTime, QVector &dateTimeList, QVector ¬InCache, + const DateTimeRange &dateTime, QVector &dateTimeList, QVector ¬InCache, int cacheIndex, double currentTStart) { const auto dateTimeListSize = dateTimeList.count(); @@ -157,7 +157,7 @@ void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataByEn if (currentTStart < dateTime.m_TEnd) { // te localised after all other interval: The last interval is [currentTsart, te] - notInCache.push_back(SqpRange{currentTStart, dateTime.m_TEnd}); + notInCache.push_back(DateTimeRange{currentTStart, dateTime.m_TEnd}); } return; } @@ -165,10 +165,10 @@ void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataByEn auto currentDateTimeJ = dateTimeList[cacheIndex]; if (dateTime.m_TEnd <= currentDateTimeJ.m_TStart) { // te localised between to interval: The last interval is [currentTsart, te] - notInCache.push_back(SqpRange{currentTStart, dateTime.m_TEnd}); + notInCache.push_back(DateTimeRange{currentTStart, dateTime.m_TEnd}); } else { - notInCache.push_back(SqpRange{currentTStart, currentDateTimeJ.m_TStart}); + notInCache.push_back(DateTimeRange{currentTStart, currentDateTimeJ.m_TStart}); if (dateTime.m_TEnd > currentDateTimeJ.m_TEnd) { // te not localised before the current interval: we need to look at the next interval addInCacheDataByEnd(dateTime, dateTimeList, notInCache, ++cacheIndex, @@ -178,13 +178,13 @@ void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataByEn } void VariableCacheController::VariableCacheControllerPrivate::addInCacheDataByStart( - const SqpRange &dateTime, QVector &dateTimeList, QVector ¬InCache, + const DateTimeRange &dateTime, QVector &dateTimeList, QVector ¬InCache, int cacheIndex, double currentTStart) { const auto dateTimeListSize = dateTimeList.count(); if (cacheIndex >= dateTimeListSize) { // ts localised after all other interval: The last interval is [ts, te] - notInCache.push_back(SqpRange{currentTStart, dateTime.m_TEnd}); + notInCache.push_back(DateTimeRange{currentTStart, dateTime.m_TEnd}); return; } diff --git a/core/src/Variable/VariableController.cpp b/core/src/Variable/VariableController.cpp index 541e50d..0e10c69 100644 --- a/core/src/Variable/VariableController.cpp +++ b/core/src/Variable/VariableController.cpp @@ -12,6 +12,8 @@ #include #include