@@ -22,7 +22,7 public: | |||
|
22 | 22 | void requestDataLoading(QUuid token, const DataProviderParameters ¶meters) override; |
|
23 | 23 | |
|
24 | 24 | private: |
|
25 | void retrieveData(QUuid token, const SqpDateTime &dateTime); | |
|
25 | void retrieveData(QUuid token, const SqpDateTime &dateTime, const QVariantHash &data); | |
|
26 | 26 | }; |
|
27 | 27 | |
|
28 | 28 | #endif // SCIQLOP_AMDAPROVIDER_H |
@@ -1,4 +1,5 | |||
|
1 | 1 | #include "AmdaProvider.h" |
|
2 | #include "AmdaDefs.h" | |
|
2 | 3 | #include "AmdaResultParser.h" |
|
3 | 4 | |
|
4 | 5 | #include <Data/DataProviderParameters.h> |
@@ -51,20 +52,27 void AmdaProvider::requestDataLoading(QUuid token, const DataProviderParameters | |||
|
51 | 52 | { |
|
52 | 53 | // NOTE: Try to use multithread if possible |
|
53 | 54 | const auto times = parameters.m_Times; |
|
55 | const auto data = parameters.m_Data; | |
|
54 | 56 | for (const auto &dateTime : qAsConst(times)) { |
|
55 | retrieveData(token, dateTime); | |
|
57 | retrieveData(token, dateTime, data); | |
|
56 | 58 | } |
|
57 | 59 | } |
|
58 | 60 | |
|
59 | void AmdaProvider::retrieveData(QUuid token, const SqpDateTime &dateTime) | |
|
61 | void AmdaProvider::retrieveData(QUuid token, const SqpDateTime &dateTime, const QVariantHash &data) | |
|
60 | 62 | { |
|
63 | // Retrieves product ID from data: if the value is invalid, no request is made | |
|
64 | auto productId = data.value(AMDA_XML_ID_KEY).toString(); | |
|
65 | if (productId.isNull()) { | |
|
66 | qCCritical(LOG_AmdaProvider()) << tr("Can't retrieve data: unknown product id"); | |
|
67 | return; | |
|
68 | } | |
|
69 | ||
|
61 | 70 | // /////////// // |
|
62 | 71 | // Creates URL // |
|
63 | 72 | // /////////// // |
|
64 | 73 | |
|
65 | 74 | auto startDate = dateFormat(dateTime.m_TStart); |
|
66 | 75 | auto endDate = dateFormat(dateTime.m_TEnd); |
|
67 | auto productId = QStringLiteral("imf(0)"); | |
|
68 | 76 | |
|
69 | 77 | auto url = QUrl{QString{AMDA_URL_FORMAT}.arg(startDate, endDate, productId)}; |
|
70 | 78 |
General Comments 0
You need to be logged in to leave comments.
Login now