##// END OF EJS Templates
Merge branch 'feature/DownloadProgressRefactoring' into develop
perrinel -
r427:7dfa9848e171 merge
parent child
Show More
@@ -47,6 +47,12 signals:
47 47 void dataProvided(QUuid identifier, std::shared_ptr<IDataSeries> dateSerie,
48 48 const SqpDateTime &dateTime);
49 49
50 /**
51 * @brief dataProvided send dataSeries under dateTime and that corresponds of the data
52 * identified by identifier
53 */
54 void dataProvidedProgress(QUuid identifier, double progress);
55
50 56
51 57 /**
52 58 * @brief requestConstructed send a request for the data identified by identifier
@@ -32,9 +32,9 NetworkController::NetworkController(QObject *parent)
32 32 void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid identifier,
33 33 std::function<void(QNetworkReply *, QUuid)> callback)
34 34 {
35 auto reply = impl->m_AccessManager->get(request);
36 35 qCDebug(LOG_NetworkController()) << tr("NetworkController registered")
37 << QThread::currentThread() << reply;
36 << QThread::currentThread()->objectName();
37 auto reply = impl->m_AccessManager->get(request);
38 38
39 39 // Store the couple reply id
40 40 impl->lockWrite();
@@ -81,6 +81,8 void NetworkController::onProcessRequested(const QNetworkRequest &request, QUuid
81 81
82 82 connect(reply, &QNetworkReply::finished, this, onReplyFinished);
83 83 connect(reply, &QNetworkReply::downloadProgress, this, onReplyProgress);
84 qCDebug(LOG_NetworkController()) << tr("NetworkController registered END")
85 << QThread::currentThread()->objectName() << reply;
84 86 }
85 87
86 88 void NetworkController::initialize()
@@ -88,6 +90,17 void NetworkController::initialize()
88 90 qCDebug(LOG_NetworkController()) << tr("NetworkController init") << QThread::currentThread();
89 91 impl->m_WorkingMutex.lock();
90 92 impl->m_AccessManager = std::make_unique<QNetworkAccessManager>();
93
94
95 auto onReplyErrors = [this](QNetworkReply *reply, const QList<QSslError> &errors) {
96
97 qCCritical(LOG_NetworkController()) << tr("NetworkAcessManager errors: ") << errors;
98
99 };
100
101
102 connect(impl->m_AccessManager.get(), &QNetworkAccessManager::sslErrors, this, onReplyErrors);
103
91 104 qCDebug(LOG_NetworkController()) << tr("NetworkController init END");
92 105 }
93 106
@@ -144,6 +144,8 void VariableController::createVariable(const QString &name, const QVariantHash
144 144 };
145 145
146 146 connect(provider.get(), &IDataProvider::dataProvided, addDateTimeAcquired);
147 connect(provider.get(), &IDataProvider::dataProvidedProgress, this,
148 &VariableController::onVariableRetrieveDataInProgress);
147 149 this->onRequestDataLoading(newVariable, dateTime);
148 150 }
149 151 }
@@ -106,11 +106,6 SqpApplication::SqpApplication(int &argc, char **argv)
106 106 impl->m_NetworkControllerThread.start();
107 107 impl->m_VariableControllerThread.start();
108 108 impl->m_VisualizationControllerThread.start();
109
110 // Core connections:
111 // NetworkController <-> VariableController
112 connect(&sqpApp->networkController(), &NetworkController::replyDownloadProgress,
113 &sqpApp->variableController(), &VariableController::onVariableRetrieveDataInProgress);
114 109 }
115 110
116 111 SqpApplication::~SqpApplication()
@@ -48,6 +48,10 AmdaProvider::AmdaProvider()
48 48 &networkController,
49 49 SLOT(onProcessRequested(QNetworkRequest, QUuid,
50 50 std::function<void(QNetworkReply *, QUuid)>)));
51
52
53 connect(&sqpApp->networkController(), SIGNAL(replyDownloadProgress(QUuid, double)), this,
54 SIGNAL(dataProvidedProgress(QUuid, double)));
51 55 }
52 56 }
53 57
General Comments 0
You need to be logged in to leave comments. Login now