##// END OF EJS Templates
Ajout du code source minimal
perrinel -
r1:d9a9f7fae6d2
parent child
Show More
@@ -0,0 +1,39
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 #include "mainwindow.h"
23 #include <QApplication>
24 #include <QProcessEnvironment>
25 #include <QThread>
26 #include <omp.h>
27 #include <qglobal.h>
28
29 int main(int argc, char *argv[])
30 {
31 QApplication a(argc, argv);
32 QApplication::setOrganizationName("LPP");
33 QApplication::setOrganizationDomain("lpp.fr");
34 QApplication::setApplicationName("SciQLop");
35 MainWindow w;
36 w.show();
37
38 return a.exec();
39 }
@@ -0,0 +1,104
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 #include "mainwindow.h"
23 #include "ui_mainwindow.h"
24 #include <QAction>
25 #include <QDate>
26 #include <QDateTime>
27 #include <QDir>
28 #include <QFileDialog>
29 #include <omp.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
40
41
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
43 {
44 ui->setupUi(this);
45 /* QLopGUI::registerMenuBar(menuBar());
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
47 this->m_progressWidget = new QWidget();
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
52 for(int i=0;i<OMP_THREADS;i++)
53 {
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
55 this->m_progress.last()->setMinimum(0);
56 this->m_progress.last()->setMaximum(100);
57 this->m_progressLayout->addWidget(this->m_progress.last());
58 this->m_progressWidget->hide();
59 this->m_progressThreadIds[i] = -1;
60 }
61 this->m_progressWidget->setWindowTitle("Loading File");
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
63 << QLopCore::self()
64 << QLopPlotManager::self()
65 << QLopCodecManager::self()
66 << FileDownloader::self()
67 << QLopDataBase::self()
68 << SpaceData::self();
69
70 CDFCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
72
73
74 for(int i=0;i<ServicesToLoad.count();i++)
75 {
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
79 if(wdgt)
80 {
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
83 }
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
85 }*/
86 }
87
88 MainWindow::~MainWindow()
89 {
90 delete ui;
91 }
92
93
94 void MainWindow::changeEvent(QEvent *e)
95 {
96 QMainWindow::changeEvent(e);
97 switch (e->type()) {
98 case QEvent::LanguageChange:
99 ui->retranslateUi(this);
100 break;
101 default:
102 break;
103 }
104 }
@@ -0,0 +1,60
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
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
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
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
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 #ifndef MAINWINDOW_H
23 #define MAINWINDOW_H
24
25 #include <QListWidgetItem>
26 #include <QMainWindow>
27 #include <QProgressBar>
28 #include <QProgressDialog>
29 #include <QThread>
30 #include <QVBoxLayout>
31 #include <QWidget>
32 //#include "../Core/qlopservice.h"
33 //#include "../Core/qlopgui.h"
34
35
36 namespace Ui {
37 class MainWindow;
38 }
39
40 class MainWindow : public QMainWindow {
41 Q_OBJECT
42
43 public:
44 explicit MainWindow(QWidget *parent = 0);
45 ~MainWindow();
46 public slots:
47
48 protected:
49 void changeEvent(QEvent *e);
50
51 private:
52 Ui::MainWindow *ui;
53 QList<QProgressBar *> m_progress;
54 int *m_progressThreadIds;
55 QWidget *m_progressWidget;
56 QVBoxLayout *m_progressLayout;
57 // QList<QLopService*> m_qlopServices;
58 };
59
60 #endif // MAINWINDOW_H
@@ -0,0 +1,56
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>MainWindow</class>
4 <widget class="QMainWindow" name="MainWindow">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>800</width>
10 <height>600</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>QLop</string>
15 </property>
16 <property name="dockNestingEnabled">
17 <bool>true</bool>
18 </property>
19 <widget class="QWidget" name="centralWidget">
20 <property name="enabled">
21 <bool>true</bool>
22 </property>
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
25 <horstretch>0</horstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
28 </property>
29 <property name="maximumSize">
30 <size>
31 <width>16777215</width>
32 <height>16777215</height>
33 </size>
34 </property>
35 </widget>
36 <widget class="QMenuBar" name="menuBar">
37 <property name="geometry">
38 <rect>
39 <x>0</x>
40 <y>0</y>
41 <width>800</width>
42 <height>45</height>
43 </rect>
44 </property>
45 </widget>
46 <widget class="QStatusBar" name="statusBar"/>
47 <action name="actionIndex_Viewer">
48 <property name="text">
49 <string>Index Viewer</string>
50 </property>
51 </action>
52 </widget>
53 <layoutdefault spacing="6" margin="11"/>
54 <resources/>
55 <connections/>
56 </ui>
General Comments 0
You need to be logged in to leave comments. Login now