##// END OF EJS Templates
@@ -1,128 +1,128
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SciQLop Software
2 -- This file is a part of the SciQLop Software
3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "MainWindow.h"
22 #include "MainWindow.h"
23 #include "ui_MainWindow.h"
23 #include "ui_MainWindow.h"
24
24
25 #include <DataSource/DataSourceController.h>
25 #include <DataSource/DataSourceController.h>
26 #include <DataSource/DataSourceWidget.h>
26 #include <DataSource/DataSourceWidget.h>
27 #include <SqpApplication.h>
27 #include <SqpApplication.h>
28
28
29 #include <QAction>
29 #include <QAction>
30 #include <QDate>
30 #include <QDate>
31 #include <QDateTime>
31 #include <QDateTime>
32 #include <QDir>
32 #include <QDir>
33 #include <QFileDialog>
33 #include <QFileDialog>
34 //#include <omp.h>
34 //#include <omp.h>
35 //#include <network/filedownloader.h>
35 //#include <network/filedownloader.h>
36 //#include <qlopdatabase.h>
36 //#include <qlopdatabase.h>
37 //#include <qlopsettings.h>
37 //#include <qlopsettings.h>
38 //#include <qlopgui.h>
38 //#include <qlopgui.h>
39 //#include <spacedata.h>
39 //#include <spacedata.h>
40 //#include "qlopcore.h"
40 //#include "qlopcore.h"
41 //#include "qlopcodecmanager.h"
41 //#include "qlopcodecmanager.h"
42 //#include "cdfcodec.h"
42 //#include "cdfcodec.h"
43 //#include "amdatxtcodec.h"
43 //#include "amdatxtcodec.h"
44 //#include <qlopplotmanager.h>
44 //#include <qlopplotmanager.h>
45 #include <QAction>
45 #include <QAction>
46 #include <QToolBar>
46 #include <QToolBar>
47 #include <memory.h>
47 #include <memory.h>
48 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow)
48 MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent}, m_Ui{new Ui::MainWindow}
49 {
49 {
50 m_Ui->setupUi(this);
50 m_Ui->setupUi(this);
51
51
52 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
52 auto leftSidePane = m_Ui->leftInspectorSidePane->sidePane();
53 leftSidePane->addAction("ACTION L1");
53 leftSidePane->addAction("ACTION L1");
54 leftSidePane->addAction("ACTION L2");
54 leftSidePane->addAction("ACTION L2");
55 leftSidePane->addAction("ACTION L3");
55 leftSidePane->addAction("ACTION L3");
56
56
57 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
57 auto rightSidePane = m_Ui->rightInspectorSidePane->sidePane();
58 rightSidePane->addAction("ACTION R1");
58 rightSidePane->addAction("ACTION R1");
59 rightSidePane->addAction("ACTION R2");
59 rightSidePane->addAction("ACTION R2");
60 rightSidePane->addAction("ACTION R3");
60 rightSidePane->addAction("ACTION R3");
61
61
62 this->menuBar()->addAction("File");
62 this->menuBar()->addAction("File");
63 auto mainToolBar = this->addToolBar("MainToolBar");
63 auto mainToolBar = this->addToolBar("MainToolBar");
64 mainToolBar->addAction("A1");
64 mainToolBar->addAction("A1");
65
65
66 // Widgets / controllers connections
66 // Widgets / controllers connections
67 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
67 connect(&sqpApp->dataSourceController(), SIGNAL(dataSourceItemSet(DataSourceItem *)),
68 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
68 m_Ui->dataSourceWidget, SLOT(addDataSource(DataSourceItem *)));
69
69
70 /* QLopGUI::registerMenuBar(menuBar());
70 /* QLopGUI::registerMenuBar(menuBar());
71 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
71 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
72 this->m_progressWidget = new QWidget();
72 this->m_progressWidget = new QWidget();
73 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
73 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
74 this->m_progressWidget->setLayout(this->m_progressLayout);
74 this->m_progressWidget->setLayout(this->m_progressLayout);
75 this->m_progressWidget->setWindowModality(Qt::WindowModal);
75 this->m_progressWidget->setWindowModality(Qt::WindowModal);
76 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
76 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
77 for(int i=0;i<OMP_THREADS;i++)
77 for(int i=0;i<OMP_THREADS;i++)
78 {
78 {
79 this->m_progress.append(new QProgressBar(this->m_progressWidget));
79 this->m_progress.append(new QProgressBar(this->m_progressWidget));
80 this->m_progress.last()->setMinimum(0);
80 this->m_progress.last()->setMinimum(0);
81 this->m_progress.last()->setMaximum(100);
81 this->m_progress.last()->setMaximum(100);
82 this->m_progressLayout->addWidget(this->m_progress.last());
82 this->m_progressLayout->addWidget(this->m_progress.last());
83 this->m_progressWidget->hide();
83 this->m_progressWidget->hide();
84 this->m_progressThreadIds[i] = -1;
84 this->m_progressThreadIds[i] = -1;
85 }
85 }
86 this->m_progressWidget->setWindowTitle("Loading File");
86 this->m_progressWidget->setWindowTitle("Loading File");
87 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
87 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
88 << QLopCore::self()
88 << QLopCore::self()
89 << QLopPlotManager::self()
89 << QLopPlotManager::self()
90 << QLopCodecManager::self()
90 << QLopCodecManager::self()
91 << FileDownloader::self()
91 << FileDownloader::self()
92 << QLopDataBase::self()
92 << QLopDataBase::self()
93 << SpaceData::self();
93 << SpaceData::self();
94
94
95 CDFCodec::registerToManager();
95 CDFCodec::registerToManager();
96 AMDATXTCodec::registerToManager();
96 AMDATXTCodec::registerToManager();
97
97
98
98
99 for(int i=0;i<ServicesToLoad.count();i++)
99 for(int i=0;i<ServicesToLoad.count();i++)
100 {
100 {
101 qDebug()<<ServicesToLoad.at(i)->serviceName();
101 qDebug()<<ServicesToLoad.at(i)->serviceName();
102 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
102 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
103 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
103 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
104 if(wdgt)
104 if(wdgt)
105 {
105 {
106 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
106 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
107 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
107 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
108 }
108 }
109 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
109 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
110 }*/
110 }*/
111 }
111 }
112
112
113 MainWindow::~MainWindow()
113 MainWindow::~MainWindow()
114 {
114 {
115 }
115 }
116
116
117
117
118 void MainWindow::changeEvent(QEvent *e)
118 void MainWindow::changeEvent(QEvent *e)
119 {
119 {
120 QMainWindow::changeEvent(e);
120 QMainWindow::changeEvent(e);
121 switch (e->type()) {
121 switch (e->type()) {
122 case QEvent::LanguageChange:
122 case QEvent::LanguageChange:
123 m_Ui->retranslateUi(this);
123 m_Ui->retranslateUi(this);
124 break;
124 break;
125 default:
125 default:
126 break;
126 break;
127 }
127 }
128 }
128 }
@@ -1,47 +1,47
1 #include "sidepane/SqpSidePane.h"
1 #include "sidepane/SqpSidePane.h"
2 #include "ui_SqpSidePane.h"
2 #include "ui_SqpSidePane.h"
3
3
4 #include <QAction>
4 #include <QAction>
5 #include <QLayout>
5 #include <QLayout>
6 #include <QToolBar>
6 #include <QToolBar>
7
7
8 namespace {
8 namespace {
9 static const QString SQPSIDEPANESTYLESHEET
9 static const QString SQPSIDEPANESTYLESHEET
10 = "QToolBar {"
10 = "QToolBar {"
11 " background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
11 " background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
12 " stop: 0.0 #5a5a5a,"
12 " stop: 0.0 #5a5a5a,"
13 " stop: 1.0 #414141);"
13 " stop: 1.0 #414141);"
14 " border: none;"
14 " border: none;"
15 " border-left: 1px solid #424242;"
15 " border-left: 1px solid #424242;"
16 "border-right: 1px solid #393939;"
16 "border-right: 1px solid #393939;"
17 " }"
17 " }"
18
18
19 " QToolButton {"
19 " QToolButton {"
20 "background: none;"
20 "background: none;"
21 "border: none;"
21 "border: none;"
22 " }";
22 " }";
23 }
23 }
24
24
25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget(parent), ui(new Ui::SqpSidePane)
25 SqpSidePane::SqpSidePane(QWidget *parent) : QWidget{parent}, ui{new Ui::SqpSidePane}
26 {
26 {
27 QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
27 QVBoxLayout *sidePaneLayout = new QVBoxLayout(this);
28 sidePaneLayout->setContentsMargins(0, 0, 0, 0);
28 sidePaneLayout->setContentsMargins(0, 0, 0, 0);
29 this->setLayout(sidePaneLayout);
29 this->setLayout(sidePaneLayout);
30
30
31 ui->setupUi(this);
31 ui->setupUi(this);
32 m_SidePaneToolbar = new QToolBar(this);
32 m_SidePaneToolbar = new QToolBar(this);
33 m_SidePaneToolbar->setOrientation(Qt::Vertical);
33 m_SidePaneToolbar->setOrientation(Qt::Vertical);
34 sidePaneLayout->addWidget(m_SidePaneToolbar);
34 sidePaneLayout->addWidget(m_SidePaneToolbar);
35
35
36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
36 m_SidePaneToolbar->setStyleSheet(SQPSIDEPANESTYLESHEET);
37 }
37 }
38
38
39 SqpSidePane::~SqpSidePane()
39 SqpSidePane::~SqpSidePane()
40 {
40 {
41 delete ui;
41 delete ui;
42 }
42 }
43
43
44 QToolBar *SqpSidePane::sidePane()
44 QToolBar *SqpSidePane::sidePane()
45 {
45 {
46 return m_SidePaneToolbar;
46 return m_SidePaneToolbar;
47 }
47 }
@@ -1,13 +1,13
1 #include "visualization/VisualizationTabWidget.h"
1 #include "visualization/VisualizationTabWidget.h"
2 #include "ui_VisualizationTabWidget.h"
2 #include "ui_VisualizationTabWidget.h"
3
3
4 VisualizationTabWidget::VisualizationTabWidget(QWidget *parent)
4 VisualizationTabWidget::VisualizationTabWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::VisualizationTabWidget)
5 : QWidget{parent}, ui{new Ui::VisualizationTabWidget}
6 {
6 {
7 ui->setupUi(this);
7 ui->setupUi(this);
8 }
8 }
9
9
10 VisualizationTabWidget::~VisualizationTabWidget()
10 VisualizationTabWidget::~VisualizationTabWidget()
11 {
11 {
12 delete ui;
12 delete ui;
13 }
13 }
@@ -1,43 +1,43
1 #include "visualization/VisualizationWidget.h"
1 #include "visualization/VisualizationWidget.h"
2 #include "ui_VisualizationWidget.h"
2 #include "ui_VisualizationWidget.h"
3 #include "visualization/VisualizationTabWidget.h"
3 #include "visualization/VisualizationTabWidget.h"
4
4
5 #include <QDebug>
5 #include <QDebug>
6 #include <QToolButton>
6 #include <QToolButton>
7
7
8 #include "iostream"
8 #include "iostream"
9
9
10 Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
10 Q_LOGGING_CATEGORY(LOG_VisualizationWidget, "VisualizationWidget")
11
11
12 VisualizationWidget::VisualizationWidget(QWidget *parent)
12 VisualizationWidget::VisualizationWidget(QWidget *parent)
13 : QWidget(parent), ui(new Ui::VisualizationWidget)
13 : QWidget{parent}, ui{new Ui::VisualizationWidget}
14 {
14 {
15 ui->setupUi(this);
15 ui->setupUi(this);
16
16
17 auto *addTabViewButton = new QToolButton(ui->tabWidget);
17 auto addTabViewButton = new QToolButton{ui->tabWidget};
18 addTabViewButton->setText("Add View");
18 addTabViewButton->setText(tr("Add View"));
19 addTabViewButton->setCursor(Qt::ArrowCursor);
19 addTabViewButton->setCursor(Qt::ArrowCursor);
20 addTabViewButton->setAutoRaise(true);
20 addTabViewButton->setAutoRaise(true);
21 ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
21 ui->tabWidget->setCornerWidget(addTabViewButton, Qt::TopRightCorner);
22
22
23 auto addTabView = [&](bool checked) {
23 auto addTabView = [&](bool checked) {
24 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
24 auto index = ui->tabWidget->addTab(new VisualizationTabWidget(ui->tabWidget),
25 QString("View %1").arg(ui->tabWidget->count() + 1));
25 QString("View %1").arg(ui->tabWidget->count() + 1));
26 qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
26 qCInfo(LOG_VisualizationWidget()) << tr("add the tab of index %1").arg(index);
27 };
27 };
28
28
29 auto removeTabView = [&](int index) {
29 auto removeTabView = [&](int index) {
30 ui->tabWidget->removeTab(index);
30 ui->tabWidget->removeTab(index);
31 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
31 qCInfo(LOG_VisualizationWidget()) << tr("remove the tab of index %1").arg(index);
32 };
32 };
33
33
34 ui->tabWidget->setTabsClosable(true);
34 ui->tabWidget->setTabsClosable(true);
35
35
36 connect(addTabViewButton, &QToolButton::clicked, addTabView);
36 connect(addTabViewButton, &QToolButton::clicked, addTabView);
37 connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
37 connect(ui->tabWidget, &QTabWidget::tabCloseRequested, removeTabView);
38 }
38 }
39
39
40 VisualizationWidget::~VisualizationWidget()
40 VisualizationWidget::~VisualizationWidget()
41 {
41 {
42 delete ui;
42 delete ui;
43 }
43 }
@@ -1,13 +1,13
1 #include "visualization/VisualizationZoneWidget.h"
1 #include "visualization/VisualizationZoneWidget.h"
2 #include "ui_VisualizationZoneWidget.h"
2 #include "ui_VisualizationZoneWidget.h"
3
3
4 VisualizationZoneWidget::VisualizationZoneWidget(QWidget *parent)
4 VisualizationZoneWidget::VisualizationZoneWidget(QWidget *parent)
5 : QWidget(parent), ui(new Ui::VisualizationZoneWidget)
5 : QWidget{parent}, ui{new Ui::VisualizationZoneWidget}
6 {
6 {
7 ui->setupUi(this);
7 ui->setupUi(this);
8 }
8 }
9
9
10 VisualizationZoneWidget::~VisualizationZoneWidget()
10 VisualizationZoneWidget::~VisualizationZoneWidget()
11 {
11 {
12 delete ui;
12 delete ui;
13 }
13 }
General Comments 3
Under Review
author

Pull request updated. Auto status change to "Under Review"

Changed commits:
  * 6 added
  * 3 removed

Changed files:
  * A gui/src/Visualization/VisualizationWidget.cpp
  * A gui/include/SidePane/SqpSidePane.h
  * A gui/include/Visualization/VisualizationGraphWidget.h
  * A gui/include/Visualization/VisualizationTabWidget.h
  * A gui/include/Visualization/VisualizationWidget.h
  * A gui/include/Visualization/VisualizationZoneWidget.h
  * A gui/include/Visualization/qcustomplot.h
  * A gui/src/SidePane/SqpSidePane.cpp
  * A gui/src/Visualization/VisualizationGraphWidget.cpp
  * A gui/src/Visualization/VisualizationTabWidget.cpp
  * A gui/src/Visualization/VisualizationZoneWidget.cpp
  * A gui/src/Visualization/qcustomplot.cpp
  * M gui/include/DataSource/DataSourceWidget.h
  * M gui/src/DataSource/DataSourceTreeWidgetItem.cpp
  * M gui/src/DataSource/DataSourceWidget.cpp
  * M app/src/Main.cpp
  * M app/src/MainWindow.cpp
  * M app/ui/MainWindow.ui
  * M core/include/DataSource/DataSourceController.h
  * M core/src/DataSource/DataSourceController.cpp
  * M core/tests/DataSource/TestDataSourceController.cpp
  * M gui/ui/visualization/VisualizationWidget.ui
  * M gui/vera-exclusions/exclusions.txt
  * M gui/src/visualization/VisualizationWidget.cpp
  * R cmake/sciqlop_package_qt.cmake
  * R core/include/Plugin/PluginManager.h
  * R core/include/Visualization/VisualizationController.h
  * R core/src/Plugin/PluginManager.cpp
  * R core/src/Visualization/VisualizationController.cpp
  * R gui/include/sidepane/SqpSidePane.h
  * R gui/include/visualization/VisualizationGraphWidget.h
  * R gui/include/visualization/VisualizationTabWidget.h
  * R gui/include/visualization/VisualizationWidget.h
  * R gui/include/visualization/VisualizationZoneWidget.h
  * R gui/include/visualization/qcustomplot.h
  * R gui/src/sidepane/SqpSidePane.cpp
  * R gui/src/visualization/VisualizationGraphWidget.cpp
  * R gui/src/visualization/VisualizationTabWidget.cpp
  * R gui/src/visualization/VisualizationZoneWidget.cpp
  * R gui/src/visualization/qcustomplot.cpp
  * R gui/ui/sidepane/SqpSidePane.ui
  * R gui/ui/visualization/VisualizationGraphWidget.ui
  * R gui/ui/visualization/VisualizationTabWidget.ui
  * R gui/ui/visualization/VisualizationZoneWidget.ui
  * R plugin/CMakeLists.txt
  * R plugin/cmake/Findsciqlop-plugin.cmake
  * R plugin/include/Plugin/IPlugin.h
  * R app/CMakeLists.txt
  * R app/include/MainWindow.h
  * R app/vera-exclusions/exclusions.txt
  * R cmake/sciqlop_applications.cmake
  * R core/CMakeLists.txt
  * R core/include/Common/spimpl.h
  * R gui/CMakeLists.txt
  * R gui/include/SqpApplication.h
  * R gui/src/SqpApplication.cpp
  * R app/src/mainwindow.ui
Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now