##// END OF EJS Templates
comment omp.h to ensure the compilation from the command line
perrinel -
r29:6d9ae743e935
parent child
Show More
@@ -1,39 +1,39
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, 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 <QProcessEnvironment>
23 #include <QProcessEnvironment>
24 #include <QThread>
24 #include <QThread>
25 #include <SqpApplication.h>
25 #include <SqpApplication.h>
26 #include <omp.h>
27 #include <qglobal.h>
26 #include <qglobal.h>
28
27
29 int main(int argc, char *argv[])
28 int main(int argc, char *argv[])
30 {
29 {
30 int ad;
31 SqpApplication a(argc, argv);
31 SqpApplication a(argc, argv);
32 SqpApplication::setOrganizationName("LPP");
32 SqpApplication::setOrganizationName("LPP");
33 SqpApplication::setOrganizationDomain("lpp.fr");
33 SqpApplication::setOrganizationDomain("lpp.fr");
34 SqpApplication::setApplicationName("SciQLop");
34 SqpApplication::setApplicationName("SciQLop");
35 MainWindow w;
35 MainWindow w;
36 w.show();
36 w.show();
37
37
38 return a.exec();
38 return a.exec();
39 }
39 }
@@ -1,104 +1,103
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, 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 #include <QAction>
24 #include <QAction>
25 #include <QDate>
25 #include <QDate>
26 #include <QDateTime>
26 #include <QDateTime>
27 #include <QDir>
27 #include <QDir>
28 #include <QFileDialog>
28 #include <QFileDialog>
29 #include <omp.h>
29 //#include <omp.h>
30 //#include <network/filedownloader.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
39 //#include <qlopplotmanager.h>
40
40
41
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
41 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
43 {
42 {
44 ui->setupUi(this);
43 ui->setupUi(this);
45 /* QLopGUI::registerMenuBar(menuBar());
44 /* QLopGUI::registerMenuBar(menuBar());
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
45 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
47 this->m_progressWidget = new QWidget();
46 this->m_progressWidget = new QWidget();
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
47 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
48 this->m_progressWidget->setLayout(this->m_progressLayout);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
49 this->m_progressWidget->setWindowModality(Qt::WindowModal);
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
50 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
52 for(int i=0;i<OMP_THREADS;i++)
51 for(int i=0;i<OMP_THREADS;i++)
53 {
52 {
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
53 this->m_progress.append(new QProgressBar(this->m_progressWidget));
55 this->m_progress.last()->setMinimum(0);
54 this->m_progress.last()->setMinimum(0);
56 this->m_progress.last()->setMaximum(100);
55 this->m_progress.last()->setMaximum(100);
57 this->m_progressLayout->addWidget(this->m_progress.last());
56 this->m_progressLayout->addWidget(this->m_progress.last());
58 this->m_progressWidget->hide();
57 this->m_progressWidget->hide();
59 this->m_progressThreadIds[i] = -1;
58 this->m_progressThreadIds[i] = -1;
60 }
59 }
61 this->m_progressWidget->setWindowTitle("Loading File");
60 this->m_progressWidget->setWindowTitle("Loading File");
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
61 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
63 << QLopCore::self()
62 << QLopCore::self()
64 << QLopPlotManager::self()
63 << QLopPlotManager::self()
65 << QLopCodecManager::self()
64 << QLopCodecManager::self()
66 << FileDownloader::self()
65 << FileDownloader::self()
67 << QLopDataBase::self()
66 << QLopDataBase::self()
68 << SpaceData::self();
67 << SpaceData::self();
69
68
70 CDFCodec::registerToManager();
69 CDFCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
70 AMDATXTCodec::registerToManager();
72
71
73
72
74 for(int i=0;i<ServicesToLoad.count();i++)
73 for(int i=0;i<ServicesToLoad.count();i++)
75 {
74 {
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
75 qDebug()<<ServicesToLoad.at(i)->serviceName();
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
76 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
77 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
79 if(wdgt)
78 if(wdgt)
80 {
79 {
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
80 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
81 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
83 }
82 }
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
83 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
85 }*/
84 }*/
86 }
85 }
87
86
88 MainWindow::~MainWindow()
87 MainWindow::~MainWindow()
89 {
88 {
90 delete ui;
89 delete ui;
91 }
90 }
92
91
93
92
94 void MainWindow::changeEvent(QEvent *e)
93 void MainWindow::changeEvent(QEvent *e)
95 {
94 {
96 QMainWindow::changeEvent(e);
95 QMainWindow::changeEvent(e);
97 switch (e->type()) {
96 switch (e->type()) {
98 case QEvent::LanguageChange:
97 case QEvent::LanguageChange:
99 ui->retranslateUi(this);
98 ui->retranslateUi(this);
100 break;
99 break;
101 default:
100 default:
102 break;
101 break;
103 }
102 }
104 }
103 }
General Comments 0
You need to be logged in to leave comments. Login now