##// END OF EJS Templates
Inits Amda provider
Alexandre Leroux -
r377:20d934b9b94e
parent child
Show More
@@ -0,0 +1,31
1 #ifndef SCIQLOP_AMDAPROVIDER_H
2 #define SCIQLOP_AMDAPROVIDER_H
3
4 #include "AmdaGlobal.h"
5
6 #include <Common/spimpl.h>
7
8 #include <Data/IDataProvider.h>
9
10 #include <QLoggingCategory>
11
12
13 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaProvider)
14
15 /**
16 * @brief The AmdaProvider class is an example of how a data provider can generate data
17 */
18 class SCIQLOP_AMDA_EXPORT AmdaProvider : public IDataProvider {
19 public:
20 explicit AmdaProvider();
21
22 void requestDataLoading(QUuid token, const QVector<SqpDateTime> &dateTimeList) override;
23
24 private:
25 void retrieveData(QUuid token, const DataProviderParameters &parameters) const;
26
27 class AmdaProviderPrivate;
28 spimpl::unique_impl_ptr<AmdaProviderPrivate> impl;
29 };
30
31 #endif // SCIQLOP_AMDAPROVIDER_H
@@ -0,0 +1,23
1 #include "AmdaProvider.h"
2
3 Q_LOGGING_CATEGORY(LOG_AmdaProvider, "AmdaProvider")
4
5 struct AmdaProvider::AmdaProviderPrivate {
6 };
7
8 AmdaProvider::AmdaProvider() : impl{spimpl::make_unique_impl<AmdaProviderPrivate>()}
9 {
10 }
11
12 void AmdaProvider::requestDataLoading(QUuid token, const QVector<SqpDateTime> &dateTimeList)
13 {
14 // NOTE: Try to use multithread if possible
15 for (const auto &dateTime : dateTimeList) {
16 retrieveData(token, DataProviderParameters{dateTime});
17 }
18 }
19
20 void AmdaProvider::retrieveData(QUuid token, const DataProviderParameters &parameters) const
21 {
22 /// @todo ALX
23 }
@@ -32,6 +32,9 void AmdaPlugin::initialize()
32 32 else {
33 33 qCCritical(LOG_AmdaPlugin()) << tr("No data source item could be generated for AMDA");
34 34 }
35
36 // Sets data provider
37 dataSourceController.setDataProvider(dataSourceUid, std::make_unique<AmdaProvider>());
35 38 }
36 39 else {
37 40 qCWarning(LOG_AmdaPlugin()) << tr("Can't access to SciQlop application");
General Comments 0
You need to be logged in to leave comments. Login now