From 09d21ab895206a68fb1b578675ba316b035da86c 2017-07-27 14:39:40 From: Alexandre Leroux Date: 2017-07-27 14:39:40 Subject: [PATCH] Minor refactoring - Replaces wrong loggers - Removes obsolete code commented --- diff --git a/app/src/Main.cpp b/app/src/Main.cpp index 9c2f426..9cde88d 100644 --- a/app/src/Main.cpp +++ b/app/src/Main.cpp @@ -28,6 +28,10 @@ #include #include +#include + +Q_LOGGING_CATEGORY(LOG_Main, "Main") + namespace { /// Name of the directory containing the plugins @@ -66,8 +70,7 @@ int main(int argc, char *argv[]) } #endif #endif - qCDebug(LOG_PluginManager()) - << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath()); + qCDebug(LOG_Main()) << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath()); PluginManager pluginManager{}; pluginManager.loadPlugins(pluginDir); diff --git a/app/src/MainWindow.cpp b/app/src/MainWindow.cpp index 9b306a3..b2f2078 100644 --- a/app/src/MainWindow.cpp +++ b/app/src/MainWindow.cpp @@ -41,18 +41,6 @@ #include #include -//#include -//#include -//#include -//#include -//#include -//#include -//#include "qlopcore.h" -//#include "qlopcodecmanager.h" -//#include "cdfcodec.h" -//#include "amdatxtcodec.h" -//#include - #include "iostream" Q_LOGGING_CATEGORY(LOG_MainWindow, "MainWindow") @@ -207,55 +195,12 @@ MainWindow::MainWindow(QWidget *parent) SIGNAL(tableMenuAboutToBeDisplayed(QMenu *, const QVector > &)), m_Ui->view, SLOT(attachVariableMenu(QMenu *, const QVector > &)), Qt::DirectConnection); - - /* QLopGUI::registerMenuBar(menuBar()); - this->setWindowIcon(QIcon(":/sciqlopLOGO.svg")); - this->m_progressWidget = new QWidget(); - this->m_progressLayout = new QVBoxLayout(this->m_progressWidget); - this->m_progressWidget->setLayout(this->m_progressLayout); - this->m_progressWidget->setWindowModality(Qt::WindowModal); - m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int)); - for(int i=0;im_progress.append(new QProgressBar(this->m_progressWidget)); - this->m_progress.last()->setMinimum(0); - this->m_progress.last()->setMaximum(100); - this->m_progressLayout->addWidget(this->m_progress.last()); - this->m_progressWidget->hide(); - this->m_progressThreadIds[i] = -1; - } - this->m_progressWidget->setWindowTitle("Loading File"); - const QListServicesToLoad=QList() - << QLopCore::self() - << QLopPlotManager::self() - << QLopCodecManager::self() - << FileDownloader::self() - << QLopDataBase::self() - << SpaceData::self(); - - CDFCodec::registerToManager(); - AMDATXTCodec::registerToManager(); - - - for(int i=0;iserviceName(); - ServicesToLoad.at(i)->initialize(); //must be called before getGUI - QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI(); - if(wdgt) - { - wdgt->setAllowedAreas(Qt::AllDockWidgetAreas); - this->addDockWidget(Qt::TopDockWidgetArea,wdgt); - } - PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i)); - }*/ } MainWindow::~MainWindow() { } - void MainWindow::changeEvent(QEvent *e) { QMainWindow::changeEvent(e); diff --git a/core/include/Variable/VariableCacheController.h b/core/include/Variable/VariableCacheController.h index 7830d0a..3ddf33e 100644 --- a/core/include/Variable/VariableCacheController.h +++ b/core/include/Variable/VariableCacheController.h @@ -14,9 +14,6 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController) class Variable; -Q_DECLARE_LOGGING_CATEGORY(LOG_VariableCacheController) - - /// This class aims to store in the cache all of the dateTime already requested to the variable. class VariableCacheController : public QObject { Q_OBJECT diff --git a/gui/src/Visualization/VisualizationGraphWidget.cpp b/gui/src/Visualization/VisualizationGraphWidget.cpp index bf903ae..1cf0265 100644 --- a/gui/src/Visualization/VisualizationGraphWidget.cpp +++ b/gui/src/Visualization/VisualizationGraphWidget.cpp @@ -251,7 +251,7 @@ void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange if (variable->contains(variableDateTimeWithTolerance)) { qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection zoom in that need request:"); - // add 10% tolerance for each side + // add tolerance for each side tolerance = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart); variableDateTimeWithTolerance.m_TStart -= tolerance; @@ -286,7 +286,7 @@ void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1, const QCPRange } else { qCDebug(LOG_VisualizationGraphWidget()) << tr("TORM: Detection zoom out: "); - // add 10% tolerance for each side + // add tolerance for each side tolerance = toleranceFactor * (currentDateTime.m_TEnd - currentDateTime.m_TStart); variableDateTimeWithTolerance.m_TStart -= tolerance; variableDateTimeWithTolerance.m_TEnd += tolerance; diff --git a/plugins/amda/src/AmdaProvider.cpp b/plugins/amda/src/AmdaProvider.cpp index 6191106..196ccc9 100644 --- a/plugins/amda/src/AmdaProvider.cpp +++ b/plugins/amda/src/AmdaProvider.cpp @@ -39,8 +39,7 @@ QString dateFormat(double sqpDateTime) noexcept AmdaProvider::AmdaProvider() { - qCDebug(LOG_NetworkController()) << tr("AmdaProvider::AmdaProvider") - << QThread::currentThread(); + qCDebug(LOG_AmdaProvider()) << tr("AmdaProvider::AmdaProvider") << QThread::currentThread(); if (auto app = sqpApp) { auto &networkController = app->networkController(); connect(this, SIGNAL(requestConstructed(QNetworkRequest, QUuid,