##// END OF EJS Templates
Intialization of network controller
perrinel -
r339:39fcfe63cb2d
parent child
Show More
@@ -0,0 +1,30
1 #ifndef SCIQLOP_NETWORKCONTROLLER_H
2 #define SCIQLOP_NETWORKCONTROLLER_H
3
4 #include <QLoggingCategory>
5 #include <QObject>
6
7 #include <Common/spimpl.h>
8
9 Q_DECLARE_LOGGING_CATEGORY(LOG_NetworkController)
10
11 /**
12 * @brief The NetworkController class aims to handle all network connection of SciQlop.
13 */
14 class NetworkController : public QObject {
15 Q_OBJECT
16 public:
17 explicit NetworkController(QObject *parent = 0);
18
19
20 void initialize();
21 void finalize();
22
23 private:
24 void waitForFinish();
25
26 class NetworkControllerPrivate;
27 spimpl::unique_impl_ptr<NetworkControllerPrivate> impl;
28 };
29
30 #endif // SCIQLOP_NETWORKCONTROLLER_H
@@ -0,0 +1,33
1 #include "Network/NetworkController.h"
2
3 #include <QMutex>
4 #include <QThread>
5
6 Q_LOGGING_CATEGORY(LOG_NetworkController, "NetworkController")
7
8 struct NetworkController::NetworkControllerPrivate {
9 explicit NetworkControllerPrivate(NetworkController *parent) : m_WorkingMutex{} {}
10 QMutex m_WorkingMutex;
11 };
12
13 NetworkController::NetworkController(QObject *parent)
14 : QObject(parent), impl{spimpl::make_unique_impl<NetworkControllerPrivate>(this)}
15 {
16 }
17
18 void NetworkController::initialize()
19 {
20 qCDebug(LOG_NetworkController()) << tr("NetworkController init") << QThread::currentThread();
21 impl->m_WorkingMutex.lock();
22 qCDebug(LOG_NetworkController()) << tr("NetworkController init END");
23 }
24
25 void NetworkController::finalize()
26 {
27 impl->m_WorkingMutex.unlock();
28 }
29
30 void NetworkController::waitForFinish()
31 {
32 QMutexLocker locker{&impl->m_WorkingMutex};
33 }
@@ -1,42 +1,38
1 1 #ifndef SCIQLOP_IDATAPROVIDER_H
2 2 #define SCIQLOP_IDATAPROVIDER_H
3 3
4 4 #include <memory>
5 5
6 6 #include <QObject>
7 7
8 8 #include <Common/MetaTypes.h>
9 9
10 10 #include <Data/SqpDateTime.h>
11 11
12 12 class DataProviderParameters;
13 13 class IDataSeries;
14 14
15 15 /**
16 16 * @brief The IDataProvider interface aims to declare a data provider.
17 17 *
18 18 * A data provider is an entity that generates data and returns it according to various parameters
19 19 * (time interval, product to retrieve the data, etc.)
20 20 *
21 21 * @sa IDataSeries
22 22 */
23 23 class IDataProvider : public QObject {
24 24
25 25 Q_OBJECT
26 26 public:
27 27 virtual ~IDataProvider() noexcept = default;
28 28
29 virtual std::shared_ptr<IDataSeries>
30 retrieveData(const DataProviderParameters &parameters) const = 0;
31
32
33 29 virtual void requestDataLoading(const QVector<SqpDateTime> &dateTimeList) = 0;
34 30
35 31 signals:
36 32 void dataProvided(std::shared_ptr<IDataSeries> dateSerie, const SqpDateTime &dateTime);
37 33 };
38 34
39 35 // Required for using shared_ptr in signals/slots
40 36 SCIQLOP_REGISTER_META_TYPE(IDATAPROVIDER_PTR_REGISTRY, std::shared_ptr<IDataProvider>)
41 37
42 38 #endif // SCIQLOP_IDATAPROVIDER_H
@@ -1,177 +1,163
1 1 #include <Variable/Variable.h>
2 2 #include <Variable/VariableCacheController.h>
3 3 #include <Variable/VariableController.h>
4 4 #include <Variable/VariableModel.h>
5 5
6 6 #include <Data/DataProviderParameters.h>
7 7 #include <Data/IDataProvider.h>
8 8 #include <Data/IDataSeries.h>
9 9 #include <Time/TimeController.h>
10 10
11 11 #include <QDateTime>
12 12 #include <QMutex>
13 13 #include <QThread>
14 14 #include <QtCore/QItemSelectionModel>
15 15
16 16 #include <unordered_map>
17 17
18 18 Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController")
19 19
20 namespace {
21
22 /// @todo Generates default dataseries, according to the provider passed in parameter. This method
23 /// will be deleted when the timerange is recovered from SciQlop
24 std::shared_ptr<IDataSeries> generateDefaultDataSeries(const IDataProvider &provider,
25 const SqpDateTime &dateTime) noexcept
26 {
27 auto parameters = DataProviderParameters{dateTime};
28
29 return provider.retrieveData(parameters);
30 }
31
32 } // namespace
33
34 20 struct VariableController::VariableControllerPrivate {
35 21 explicit VariableControllerPrivate(VariableController *parent)
36 22 : m_WorkingMutex{},
37 23 m_VariableModel{new VariableModel{parent}},
38 24 m_VariableSelectionModel{new QItemSelectionModel{m_VariableModel, parent}},
39 25 m_VariableCacheController{std::make_unique<VariableCacheController>()}
40 26 {
41 27 }
42 28
43 29 QMutex m_WorkingMutex;
44 30 /// Variable model. The VariableController has the ownership
45 31 VariableModel *m_VariableModel;
46 32 QItemSelectionModel *m_VariableSelectionModel;
47 33
48 34
49 35 TimeController *m_TimeController{nullptr};
50 36 std::unique_ptr<VariableCacheController> m_VariableCacheController;
51 37
52 38 std::unordered_map<std::shared_ptr<Variable>, std::shared_ptr<IDataProvider> >
53 39 m_VariableToProviderMap;
54 40 };
55 41
56 42 VariableController::VariableController(QObject *parent)
57 43 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>(this)}
58 44 {
59 45 qCDebug(LOG_VariableController()) << tr("VariableController construction")
60 46 << QThread::currentThread();
61 47 }
62 48
63 49 VariableController::~VariableController()
64 50 {
65 51 qCDebug(LOG_VariableController()) << tr("VariableController destruction")
66 52 << QThread::currentThread();
67 53 this->waitForFinish();
68 54 }
69 55
70 56 VariableModel *VariableController::variableModel() noexcept
71 57 {
72 58 return impl->m_VariableModel;
73 59 }
74 60
75 61 QItemSelectionModel *VariableController::variableSelectionModel() noexcept
76 62 {
77 63 return impl->m_VariableSelectionModel;
78 64 }
79 65
80 66 void VariableController::setTimeController(TimeController *timeController) noexcept
81 67 {
82 68 impl->m_TimeController = timeController;
83 69 }
84 70
85 71 void VariableController::createVariable(const QString &name,
86 72 std::shared_ptr<IDataProvider> provider) noexcept
87 73 {
88 74
89 75 if (!impl->m_TimeController) {
90 76 qCCritical(LOG_VariableController())
91 77 << tr("Impossible to create variable: The time controller is null");
92 78 return;
93 79 }
94 80
95 81
96 82 /// @todo : for the moment :
97 83 /// - the provider is only used to retrieve data from the variable for its initialization, but
98 84 /// it will be retained later
99 85 /// - default data are generated for the variable, without taking into account the timerange set
100 86 /// in sciqlop
101 87 auto dateTime = impl->m_TimeController->dateTime();
102 88 if (auto newVariable = impl->m_VariableModel->createVariable(name, dateTime)) {
103 89
104 90 // store the provider
105 91 impl->m_VariableToProviderMap[newVariable] = provider;
106 92
107 93 auto addDateTimeAcquired
108 94 = [this, newVariable](auto dataSeriesAcquired, auto dateTimeToPutInCache) {
109 95
110 96 impl->m_VariableCacheController->addDateTime(newVariable, dateTimeToPutInCache);
111 97 newVariable->setDataSeries(dataSeriesAcquired);
112 98
113 99 };
114 100
115 101 connect(provider.get(), &IDataProvider::dataProvided, addDateTimeAcquired);
116 102 this->onRequestDataLoading(newVariable, dateTime);
117 103
118 104 // notify the creation
119 105 emit variableCreated(newVariable);
120 106 }
121 107 }
122 108
123 109 void VariableController::onDateTimeOnSelection(const SqpDateTime &dateTime)
124 110 {
125 111 auto selectedRows = impl->m_VariableSelectionModel->selectedRows();
126 112
127 113 for (const auto &selectedRow : qAsConst(selectedRows)) {
128 114 if (auto selectedVariable = impl->m_VariableModel->variable(selectedRow.row())) {
129 115 selectedVariable->setDateTime(dateTime);
130 116 this->onRequestDataLoading(selectedVariable, dateTime);
131 117 }
132 118 }
133 119 }
134 120
135 121
136 122 void VariableController::onRequestDataLoading(std::shared_ptr<Variable> variable,
137 123 const SqpDateTime &dateTime)
138 124 {
139 125 // we want to load data of the variable for the dateTime.
140 126 // First we check if the cache contains some of them.
141 127 // For the other, we ask the provider to give them.
142 128 if (variable) {
143 129
144 130 auto dateTimeListNotInCache
145 131 = impl->m_VariableCacheController->provideNotInCacheDateTimeList(variable, dateTime);
146 132
147 133 if (!dateTimeListNotInCache.empty()) {
148 134 // Ask the provider for each data on the dateTimeListNotInCache
149 135 impl->m_VariableToProviderMap.at(variable)->requestDataLoading(
150 136 std::move(dateTimeListNotInCache));
151 137 }
152 138 else {
153 139 emit variable->updated();
154 140 }
155 141 }
156 142 else {
157 143 qCCritical(LOG_VariableController()) << tr("Impossible to load data of a variable null");
158 144 }
159 145 }
160 146
161 147
162 148 void VariableController::initialize()
163 149 {
164 150 qCDebug(LOG_VariableController()) << tr("VariableController init") << QThread::currentThread();
165 151 impl->m_WorkingMutex.lock();
166 152 qCDebug(LOG_VariableController()) << tr("VariableController init END");
167 153 }
168 154
169 155 void VariableController::finalize()
170 156 {
171 157 impl->m_WorkingMutex.unlock();
172 158 }
173 159
174 160 void VariableController::waitForFinish()
175 161 {
176 162 QMutexLocker locker{&impl->m_WorkingMutex};
177 163 }
@@ -1,50 +1,52
1 1 #ifndef SCIQLOP_SQPAPPLICATION_H
2 2 #define SCIQLOP_SQPAPPLICATION_H
3 3
4 4 #include "SqpApplication.h"
5 5
6 6 #include <QApplication>
7 7 #include <QLoggingCategory>
8 8
9 9 #include <Common/spimpl.h>
10 10
11 11 Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication)
12 12
13 13 #if defined(sqpApp)
14 14 #undef sqpApp
15 15 #endif
16 16 #define sqpApp (static_cast<SqpApplication *>(QCoreApplication::instance()))
17 17
18 18 class DataSourceController;
19 class NetworkController;
19 20 class TimeController;
20 21 class VariableController;
21 22 class VisualizationController;
22 23
23 24 /**
24 25 * @brief The SqpApplication class aims to make the link between SciQlop
25 26 * and its plugins. This is the intermediate class that SciQlop has to use
26 27 * in the way to connect a data source. Please first use load method to initialize
27 28 * a plugin specified by its metadata name (JSON plugin source) then others specifics
28 29 * method will be able to access it.
29 30 * You can load a data source driver plugin then create a data source.
30 31 */
31 32
32 33 class SqpApplication : public QApplication {
33 34 Q_OBJECT
34 35 public:
35 36 explicit SqpApplication(int &argc, char **argv);
36 37 virtual ~SqpApplication();
37 38 void initialize();
38 39
39 40 /// Accessors for the differents sciqlop controllers
40 41 DataSourceController &dataSourceController() noexcept;
42 NetworkController &networkController() noexcept;
41 43 TimeController &timeController() noexcept;
42 44 VariableController &variableController() noexcept;
43 45 VisualizationController &visualizationController() noexcept;
44 46
45 47 private:
46 48 class SqpApplicationPrivate;
47 49 spimpl::unique_impl_ptr<SqpApplicationPrivate> impl;
48 50 };
49 51
50 52 #endif // SCIQLOP_SQPAPPLICATION_H
@@ -1,118 +1,137
1 1 #include "SqpApplication.h"
2 2
3 3 #include <Data/IDataProvider.h>
4 4 #include <DataSource/DataSourceController.h>
5 #include <Network/NetworkController.h>
5 6 #include <QThread>
6 7 #include <Time/TimeController.h>
7 8 #include <Variable/Variable.h>
8 9 #include <Variable/VariableController.h>
9 10 #include <Visualization/VisualizationController.h>
10 11
11 12 Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
12 13
13 14 class SqpApplication::SqpApplicationPrivate {
14 15 public:
15 16 SqpApplicationPrivate()
16 17 : m_DataSourceController{std::make_unique<DataSourceController>()},
18 m_NetworkController{std::make_unique<NetworkController>()},
17 19 m_TimeController{std::make_unique<TimeController>()},
18 20 m_VariableController{std::make_unique<VariableController>()},
19 21 m_VisualizationController{std::make_unique<VisualizationController>()}
20 22 {
21 23 // /////////////////////////////// //
22 24 // Connections between controllers //
23 25 // /////////////////////////////// //
24 26
25 27 // VariableController <-> DataSourceController
26 28 connect(m_DataSourceController.get(),
27 29 SIGNAL(variableCreationRequested(const QString &, std::shared_ptr<IDataProvider>)),
28 30 m_VariableController.get(),
29 31 SLOT(createVariable(const QString &, std::shared_ptr<IDataProvider>)));
30 32
31 33 // VariableController <-> VisualizationController
32 34 connect(m_VariableController.get(), SIGNAL(variableCreated(std::shared_ptr<Variable>)),
33 35 m_VisualizationController.get(),
34 36 SIGNAL(variableCreated(std::shared_ptr<Variable>)));
35 37
36 38 m_DataSourceController->moveToThread(&m_DataSourceControllerThread);
39 m_NetworkController->moveToThread(&m_NetworkControllerThread);
37 40 m_VariableController->moveToThread(&m_VariableControllerThread);
38 41 m_VisualizationController->moveToThread(&m_VisualizationControllerThread);
39 42
40 43 // Additionnal init
41 44 m_VariableController->setTimeController(m_TimeController.get());
42 45 }
43 46
44 47 virtual ~SqpApplicationPrivate()
45 48 {
46 49 qCInfo(LOG_SqpApplication()) << tr("SqpApplicationPrivate destruction");
47 50 m_DataSourceControllerThread.quit();
48 51 m_DataSourceControllerThread.wait();
49 52
53 m_NetworkControllerThread.quit();
54 m_NetworkControllerThread.wait();
55
50 56 m_VariableControllerThread.quit();
51 57 m_VariableControllerThread.wait();
52 58
53 59 m_VisualizationControllerThread.quit();
54 60 m_VisualizationControllerThread.wait();
55 61 }
56 62
57 63 std::unique_ptr<DataSourceController> m_DataSourceController;
58 64 std::unique_ptr<VariableController> m_VariableController;
59 65 std::unique_ptr<TimeController> m_TimeController;
66 std::unique_ptr<NetworkController> m_NetworkController;
60 67 std::unique_ptr<VisualizationController> m_VisualizationController;
61 68 QThread m_DataSourceControllerThread;
69 QThread m_NetworkControllerThread;
62 70 QThread m_VariableControllerThread;
63 71 QThread m_VisualizationControllerThread;
64 72 };
65 73
66 74
67 75 SqpApplication::SqpApplication(int &argc, char **argv)
68 76 : QApplication{argc, argv}, impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
69 77 {
70 78 qCInfo(LOG_SqpApplication()) << tr("SqpApplication construction");
71 79
72 80 connect(&impl->m_DataSourceControllerThread, &QThread::started,
73 81 impl->m_DataSourceController.get(), &DataSourceController::initialize);
74 82 connect(&impl->m_DataSourceControllerThread, &QThread::finished,
75 83 impl->m_DataSourceController.get(), &DataSourceController::finalize);
76 84
85 connect(&impl->m_NetworkControllerThread, &QThread::started, impl->m_NetworkController.get(),
86 &NetworkController::initialize);
87 connect(&impl->m_NetworkControllerThread, &QThread::finished, impl->m_NetworkController.get(),
88 &NetworkController::finalize);
89
77 90 connect(&impl->m_VariableControllerThread, &QThread::started, impl->m_VariableController.get(),
78 91 &VariableController::initialize);
79 92 connect(&impl->m_VariableControllerThread, &QThread::finished, impl->m_VariableController.get(),
80 93 &VariableController::finalize);
81 94
82 95 connect(&impl->m_VisualizationControllerThread, &QThread::started,
83 96 impl->m_VisualizationController.get(), &VisualizationController::initialize);
84 97 connect(&impl->m_VisualizationControllerThread, &QThread::finished,
85 98 impl->m_VisualizationController.get(), &VisualizationController::finalize);
86 99
87 100 impl->m_DataSourceControllerThread.start();
101 impl->m_NetworkControllerThread.start();
88 102 impl->m_VariableControllerThread.start();
89 103 impl->m_VisualizationControllerThread.start();
90 104 }
91 105
92 106 SqpApplication::~SqpApplication()
93 107 {
94 108 }
95 109
96 110 void SqpApplication::initialize()
97 111 {
98 112 }
99 113
100 114 DataSourceController &SqpApplication::dataSourceController() noexcept
101 115 {
102 116 return *impl->m_DataSourceController;
103 117 }
104 118
119 NetworkController &SqpApplication::networkController() noexcept
120 {
121 return *impl->m_NetworkController;
122 }
123
105 124 TimeController &SqpApplication::timeController() noexcept
106 125 {
107 126 return *impl->m_TimeController;
108 127 }
109 128
110 129 VariableController &SqpApplication::variableController() noexcept
111 130 {
112 131 return *impl->m_VariableController;
113 132 }
114 133
115 134 VisualizationController &SqpApplication::visualizationController() noexcept
116 135 {
117 136 return *impl->m_VisualizationController;
118 137 }
@@ -1,155 +1,153
1 1 #include "Visualization/VisualizationGraphHelper.h"
2 2 #include "Visualization/qcustomplot.h"
3 3
4 4 #include <Data/ScalarSeries.h>
5 5
6 6 #include <Variable/Variable.h>
7 7
8 8 #include <QElapsedTimer>
9 9
10 10 Q_LOGGING_CATEGORY(LOG_VisualizationGraphHelper, "VisualizationGraphHelper")
11 11
12 12 namespace {
13 13
14 14 /// Format for datetimes on a axis
15 15 const auto DATETIME_TICKER_FORMAT = QStringLiteral("yyyy/MM/dd \nhh:mm:ss");
16 16
17 17 /// Generates the appropriate ticker for an axis, depending on whether the axis displays time or
18 18 /// non-time data
19 19 QSharedPointer<QCPAxisTicker> axisTicker(bool isTimeAxis)
20 20 {
21 21 if (isTimeAxis) {
22 22 auto dateTicker = QSharedPointer<QCPAxisTickerDateTime>::create();
23 23 dateTicker->setDateTimeFormat(DATETIME_TICKER_FORMAT);
24 24
25 25 return dateTicker;
26 26 }
27 27 else {
28 28 // default ticker
29 29 return QSharedPointer<QCPAxisTicker>::create();
30 30 }
31 31 }
32 32
33 33 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSeries,
34 34 const SqpDateTime &dateTime)
35 35 {
36 QElapsedTimer timer;
37 timer.start();
38 36 if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) {
39 37 // Clean the graph
40 38 // NAIVE approch
41 const auto &xData = scalarSeries.xAxisData()->data();
42 const auto &valuesData = scalarSeries.valuesData()->data();
39 const auto xData = scalarSeries.xAxisData()->data();
40 const auto valuesData = scalarSeries.valuesData()->data();
43 41 const auto count = xData.count();
44 42 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points in cache" << xData.count();
45 43 auto xValue = QVector<double>(count);
46 44 auto vValue = QVector<double>(count);
47 45
48 46 int n = 0;
49 47 for (auto i = 0; i < count; ++i) {
50 48 const auto x = xData[i];
51 49 if (x >= dateTime.m_TStart && x <= dateTime.m_TEnd) {
52 50 xValue[n] = x;
53 51 vValue[n] = valuesData[i];
54 52 ++n;
55 53 }
56 54 }
57 55
58 56 xValue.resize(n);
59 57 vValue.resize(n);
60 58
61 59 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed"
62 60 << xValue.count();
63 61
64 62 qcpGraph->setData(xValue, vValue);
65 63
66 64 // Display all data
67 65 component->rescaleAxes();
68 66 component->parentPlot()->replot();
69 67 }
70 68 else {
71 69 /// @todo DEBUG
72 70 }
73 71 }
74 72
75 73 QCPAbstractPlottable *createScalarSeriesComponent(ScalarSeries &scalarSeries, QCustomPlot &plot,
76 74 const SqpDateTime &dateTime)
77 75 {
78 76 auto component = plot.addGraph();
79 77
80 78 if (component) {
81 79 // // Graph data
82 80 component->setData(scalarSeries.xAxisData()->data(), scalarSeries.valuesData()->data(),
83 81 true);
84 82
85 83 updateScalarData(component, scalarSeries, dateTime);
86 84
87 85 // Axes properties
88 86 /// @todo : for the moment, no control is performed on the axes: the units and the tickers
89 87 /// are fixed for the default x-axis and y-axis of the plot, and according to the new graph
90 88
91 89 auto setAxisProperties = [](auto axis, const auto &unit) {
92 90 // label (unit name)
93 91 axis->setLabel(unit.m_Name);
94 92
95 93 // ticker (depending on the type of unit)
96 94 axis->setTicker(axisTicker(unit.m_TimeUnit));
97 95 };
98 96 setAxisProperties(plot.xAxis, scalarSeries.xAxisUnit());
99 97 setAxisProperties(plot.yAxis, scalarSeries.valuesUnit());
100 98
101 99 // Display all data
102 100 component->rescaleAxes();
103 101 plot.replot();
104 102 }
105 103 else {
106 104 qCDebug(LOG_VisualizationGraphHelper())
107 105 << QObject::tr("Can't create graph for the scalar series");
108 106 }
109 107
110 108 return component;
111 109 }
112 110
113 111 } // namespace
114 112
115 113 QVector<QCPAbstractPlottable *> VisualizationGraphHelper::create(std::shared_ptr<Variable> variable,
116 114 QCustomPlot &plot) noexcept
117 115 {
118 116 auto result = QVector<QCPAbstractPlottable *>{};
119 117
120 118 if (variable) {
121 119 // Gets the data series of the variable to call the creation of the right components
122 120 // according to its type
123 121 if (auto scalarSeries = dynamic_cast<ScalarSeries *>(variable->dataSeries())) {
124 122 result.append(createScalarSeriesComponent(*scalarSeries, plot, variable->dateTime()));
125 123 }
126 124 else {
127 125 qCDebug(LOG_VisualizationGraphHelper())
128 126 << QObject::tr("Can't create graph plottables : unmanaged data series type");
129 127 }
130 128 }
131 129 else {
132 130 qCDebug(LOG_VisualizationGraphHelper())
133 131 << QObject::tr("Can't create graph plottables : the variable is null");
134 132 }
135 133
136 134 return result;
137 135 }
138 136
139 137 void VisualizationGraphHelper::updateData(QVector<QCPAbstractPlottable *> plotableVect,
140 138 IDataSeries *dataSeries, const SqpDateTime &dateTime)
141 139 {
142 140 if (auto scalarSeries = dynamic_cast<ScalarSeries *>(dataSeries)) {
143 141 if (plotableVect.size() == 1) {
144 142 updateScalarData(plotableVect.at(0), *scalarSeries, dateTime);
145 143 }
146 144 else {
147 145 qCCritical(LOG_VisualizationGraphHelper()) << QObject::tr(
148 146 "Can't update Data of a scalarSeries because there is not only one component "
149 147 "associated");
150 148 }
151 149 }
152 150 else {
153 151 /// @todo DEBUG
154 152 }
155 153 }
@@ -1,26 +1,24
1 1 #ifndef SCIQLOP_COSINUSPROVIDER_H
2 2 #define SCIQLOP_COSINUSPROVIDER_H
3 3
4 4 #include <Data/IDataProvider.h>
5 5
6 6 #include <QLoggingCategory>
7 7
8 8 Q_DECLARE_LOGGING_CATEGORY(LOG_CosinusProvider)
9 9
10 10 /**
11 11 * @brief The CosinusProvider class is an example of how a data provider can generate data
12 12 */
13 13 class CosinusProvider : public IDataProvider {
14 14 public:
15 /// @sa IDataProvider::retrieveData()
16 std::shared_ptr<IDataSeries>
17 retrieveData(const DataProviderParameters &parameters) const override;
18
19 15 void requestDataLoading(const QVector<SqpDateTime> &dateTimeList) override;
20 16
21 17
22 18 private:
19 /// @sa IDataProvider::retrieveData()
20 std::shared_ptr<IDataSeries> retrieveData(const DataProviderParameters &parameters) const;
23 21 std::shared_ptr<IDataSeries> retrieveDataSeries(const SqpDateTime &dateTime);
24 22 };
25 23
26 24 #endif // SCIQLOP_COSINUSPROVIDER_H
General Comments 0
You need to be logged in to leave comments. Login now