##// END OF EJS Templates
Minor refactoring...
Alexandre Leroux -
r424:09d21ab89520
parent child
Show More
@@ -28,6 +28,10
28 28 #include <Plugin/PluginManager.h>
29 29 #include <QDir>
30 30
31 #include <QLoggingCategory>
32
33 Q_LOGGING_CATEGORY(LOG_Main, "Main")
34
31 35 namespace {
32 36
33 37 /// Name of the directory containing the plugins
@@ -66,8 +70,7 int main(int argc, char *argv[])
66 70 }
67 71 #endif
68 72 #endif
69 qCDebug(LOG_PluginManager())
70 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
73 qCDebug(LOG_Main()) << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
71 74
72 75 PluginManager pluginManager{};
73 76 pluginManager.loadPlugins(pluginDir);
@@ -41,18 +41,6
41 41 #include <QToolButton>
42 42 #include <memory.h>
43 43
44 //#include <omp.h>
45 //#include <network/filedownloader.h>
46 //#include <qlopdatabase.h>
47 //#include <qlopsettings.h>
48 //#include <qlopgui.h>
49 //#include <spacedata.h>
50 //#include "qlopcore.h"
51 //#include "qlopcodecmanager.h"
52 //#include "cdfcodec.h"
53 //#include "amdatxtcodec.h"
54 //#include <qlopplotmanager.h>
55
56 44 #include "iostream"
57 45
58 46 Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow")
@@ -207,55 +195,12 MainWindow::MainWindow(QWidget *parent)
207 195 SIGNAL(tableMenuAboutToBeDisplayed(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
208 196 m_Ui->view, SLOT(attachVariableMenu(QMenu *, const QVector<std::shared_ptr<Variable> > &)),
209 197 Qt::DirectConnection);
210
211 /* QLopGUI::registerMenuBar(menuBar());
212 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
213 this->m_progressWidget = new QWidget();
214 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
215 this->m_progressWidget->setLayout(this->m_progressLayout);
216 this->m_progressWidget->setWindowModality(Qt::WindowModal);
217 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
218 for(int i=0;i<OMP_THREADS;i++)
219 {
220 this->m_progress.append(new QProgressBar(this->m_progressWidget));
221 this->m_progress.last()->setMinimum(0);
222 this->m_progress.last()->setMaximum(100);
223 this->m_progressLayout->addWidget(this->m_progress.last());
224 this->m_progressWidget->hide();
225 this->m_progressThreadIds[i] = -1;
226 }
227 this->m_progressWidget->setWindowTitle("Loading File");
228 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
229 << QLopCore::self()
230 << QLopPlotManager::self()
231 << QLopCodecManager::self()
232 << FileDownloader::self()
233 << QLopDataBase::self()
234 << SpaceData::self();
235
236 CDFCodec::registerToManager();
237 AMDATXTCodec::registerToManager();
238
239
240 for(int i=0;i<ServicesToLoad.count();i++)
241 {
242 qDebug()<<ServicesToLoad.at(i)->serviceName();
243 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
244 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
245 if(wdgt)
246 {
247 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
248 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
249 }
250 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
251 }*/
252 198 }
253 199
254 200 MainWindow::~MainWindow()
255 201 {
256 202 }
257 203
258
259 204 void MainWindow::changeEvent(QEvent *e)
260 205 {
261 206 QMainWindow::changeEvent(e);
@@ -14,9 +14,6 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController)
14 14
15 15 class Variable;
16 16
17 Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController)
18
19
20 17 /// This class aims to store in the cache all of the dateTime already requested to the variable.
21 18 class VariableCacheController : public QObject {
22 19 Q_OBJECT
@@ -251,7 +251,7 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange
251 251 if (variable->contains(variableDateTimeWithTolerance)) {
252 252 qCDebug(LOG_VisualizationGraphWidget())
253 253 << tr("TORM: Detection zoom in that need request:");
254 // add 10% tolerance for each side
254 // add tolerance for each side
255 255 tolerance
256 256 = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
257 257 variableDateTimeWithTolerance.m_TStart -= tolerance;
@@ -286,7 +286,7 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange
286 286 }
287 287 else {
288 288 qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection zoom out: ");
289 // add 10% tolerance for each side
289 // add tolerance for each side
290 290 tolerance = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart);
291 291 variableDateTimeWithTolerance.m_TStart -= tolerance;
292 292 variableDateTimeWithTolerance.m_TEnd += tolerance;
@@ -39,8 +39,7 QString dateFormat(double sqpDateTime) noexcept
39 39
40 40 AmdaProvider::AmdaProvider()
41 41 {
42 qCDebug(LOG_NetworkController()) << tr("AmdaProvider::AmdaProvider")
43 << QThread::currentThread();
42 qCDebug(LOG_AmdaProvider()) << tr("AmdaProvider::AmdaProvider") << QThread::currentThread();
44 43 if (auto app = sqpApp) {
45 44 auto &networkController = app->networkController();
46 45 connect(this, SIGNAL(requestConstructed(QNetworkRequest, QUuid,
General Comments 0
You need to be logged in to leave comments. Login now