@@ -0,0 +1,83 | |||||
|
1 | #include "qlopdatabase.h" | |||
|
2 | ||||
|
3 | QList<QLopData*>* QLopDataBase::m_dataBase=NULL; | |||
|
4 | QLopDataBase* QLopDataBase::_self=NULL; | |||
|
5 | ||||
|
6 | #define INIT() \ | |||
|
7 | if(Q_UNLIKELY(_self==NULL))\ | |||
|
8 | {\ | |||
|
9 | init();\ | |||
|
10 | } | |||
|
11 | ||||
|
12 | QLopDataBase::QLopDataBase(QObject *parent) : QObject(parent) | |||
|
13 | { | |||
|
14 | this->m_dataBase = new QList<QLopData*>(); | |||
|
15 | } | |||
|
16 | ||||
|
17 | QLopDataBase::~QLopDataBase() | |||
|
18 | { | |||
|
19 | ||||
|
20 | } | |||
|
21 | ||||
|
22 | void QLopDataBase::init() | |||
|
23 | { | |||
|
24 | _self=new QLopDataBase(); | |||
|
25 | } | |||
|
26 | ||||
|
27 | int QLopDataBase::addData(QLopData *data) | |||
|
28 | { | |||
|
29 | INIT(); | |||
|
30 | if(!m_dataBase->contains(data)) | |||
|
31 | { | |||
|
32 | m_dataBase->append(data); | |||
|
33 | return 1; | |||
|
34 | } | |||
|
35 | return 0; | |||
|
36 | } | |||
|
37 | ||||
|
38 | int QLopDataBase::addData(const QLopDataList& data) | |||
|
39 | { | |||
|
40 | INIT(); | |||
|
41 | int addedData=0; | |||
|
42 | for (int i = 0; i < data.count(); i++) | |||
|
43 | { | |||
|
44 | addedData += addData(data.at(i)); | |||
|
45 | } | |||
|
46 | return addedData; | |||
|
47 | } | |||
|
48 | ||||
|
49 | QLopDataBase *QLopDataBase::self() | |||
|
50 | { | |||
|
51 | INIT(); | |||
|
52 | return _self; | |||
|
53 | } | |||
|
54 | ||||
|
55 | int QLopDataBase::count() | |||
|
56 | { | |||
|
57 | return m_dataBase->count(); | |||
|
58 | } | |||
|
59 | ||||
|
60 | QLopData *QLopDataBase::getData(const QString &name) | |||
|
61 | { | |||
|
62 | for (int i = 0; i < m_dataBase->count(); i++) | |||
|
63 | { | |||
|
64 | if(Q_UNLIKELY(m_dataBase->at(i)->name==name)) | |||
|
65 | { | |||
|
66 | return m_dataBase->at(i); | |||
|
67 | } | |||
|
68 | } | |||
|
69 | return NULL; | |||
|
70 | } | |||
|
71 | ||||
|
72 | QLopData *QLopDataBase::getData(int ID) | |||
|
73 | { | |||
|
74 | for (int i = 0; i < m_dataBase->count(); i++) | |||
|
75 | { | |||
|
76 | if(Q_UNLIKELY(m_dataBase->at(i)->ID==ID)) | |||
|
77 | { | |||
|
78 | return m_dataBase->at(i); | |||
|
79 | } | |||
|
80 | } | |||
|
81 | return NULL; | |||
|
82 | } | |||
|
83 |
@@ -0,0 +1,29 | |||||
|
1 | #ifndef QLOPDATABASE_H | |||
|
2 | #define QLOPDATABASE_H | |||
|
3 | ||||
|
4 | #include <QObject> | |||
|
5 | #include <qlopdata.h> | |||
|
6 | #include <QList> | |||
|
7 | ||||
|
8 | class QLopDataBase : public QObject | |||
|
9 | { | |||
|
10 | Q_OBJECT | |||
|
11 | explicit QLopDataBase(QObject *parent = 0); | |||
|
12 | ~QLopDataBase(); | |||
|
13 | static QLopDataBase* _self; | |||
|
14 | public: | |||
|
15 | static void init(); | |||
|
16 | static int addData(QLopData* data); | |||
|
17 | static int addData(const QLopDataList &data); | |||
|
18 | static QLopDataBase* self(); | |||
|
19 | static int count(); | |||
|
20 | static QLopData* getData(const QString& name); | |||
|
21 | static QLopData* getData(int ID); | |||
|
22 | signals: | |||
|
23 | ||||
|
24 | public slots: | |||
|
25 | private: | |||
|
26 | static QList<QLopData*>* m_dataBase; | |||
|
27 | }; | |||
|
28 | ||||
|
29 | #endif // QLOPDATABASE_H |
@@ -1,110 +1,112 | |||||
1 | #------------------------------------------------- |
|
1 | #------------------------------------------------- | |
2 | # |
|
2 | # | |
3 | # Project created by QtCreator 2015-01-07T02:41:29 |
|
3 | # Project created by QtCreator 2015-01-07T02:41:29 | |
4 | # |
|
4 | # | |
5 | #------------------------------------------------- |
|
5 | #------------------------------------------------- | |
6 |
|
6 | |||
7 | QT += core gui network xml svg |
|
7 | QT += core gui network xml svg | |
8 | CONFIG += pythonqt |
|
8 | CONFIG += pythonqt | |
9 |
|
9 | |||
10 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport |
|
10 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport | |
11 |
|
11 | |||
12 | DESTDIR =./bin |
|
12 | DESTDIR =./bin | |
13 |
|
13 | |||
14 | TARGET = QLop |
|
14 | TARGET = QLop | |
15 | TEMPLATE = app |
|
15 | TEMPLATE = app | |
16 |
|
16 | |||
17 | LIBS+=-lfftw3_threads -lfftw3 |
|
17 | LIBS+=-lfftw3_threads -lfftw3 | |
18 |
|
18 | |||
19 | INCLUDEPATH += src/QCustomPlot \ |
|
19 | INCLUDEPATH += src/QCustomPlot \ | |
20 | src src/Cassini \ |
|
20 | src src/Cassini \ | |
21 | src/Core src/Core/Widgets \ |
|
21 | src/Core src/Core/Widgets \ | |
22 | src/Core/Widgets/PyWdgt |
|
22 | src/Core/Widgets/PyWdgt | |
23 |
|
23 | |||
24 | QMAKE_CXXFLAGS_RELEASE += -O5 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx |
|
24 | QMAKE_CXXFLAGS_RELEASE += -O5 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx | |
25 | QMAKE_LFLAGS_RELEASE += -O5 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx |
|
25 | QMAKE_LFLAGS_RELEASE += -O5 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx | |
26 |
|
26 | |||
27 | QMAKE_CXXFLAGS_DEBUG += -O0 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx |
|
27 | QMAKE_CXXFLAGS_DEBUG += -O0 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx | |
28 | QMAKE_LFLAGS_DEBUG += -O0 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx |
|
28 | QMAKE_LFLAGS_DEBUG += -O0 -fopenmp -march=corei7-avx -mtune=corei7-avx -mavx | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | SOURCES += src/main.cpp\ |
|
31 | SOURCES += src/main.cpp\ | |
32 | src/mainwindow.cpp \ |
|
32 | src/mainwindow.cpp \ | |
33 | src/SocExplorerPlot.cpp \ |
|
33 | src/SocExplorerPlot.cpp \ | |
34 | src/QCustomPlot/qcustomplot.cpp \ |
|
34 | src/QCustomPlot/qcustomplot.cpp \ | |
35 | src/toolbarcontainer.cpp \ |
|
35 | src/toolbarcontainer.cpp \ | |
36 | src/Core/abstractfileloader.cpp \ |
|
36 | src/Core/abstractfileloader.cpp \ | |
37 | src/Core/filedownloader.cpp \ |
|
37 | src/Core/filedownloader.cpp \ | |
38 | src/Core/filedownloadertask.cpp \ |
|
38 | src/Core/filedownloadertask.cpp \ | |
39 | src/Core/Widgets/downloadhistory.cpp \ |
|
39 | src/Core/Widgets/downloadhistory.cpp \ | |
40 | src/Core/Widgets/downloadhistoryelement.cpp \ |
|
40 | src/Core/Widgets/downloadhistoryelement.cpp \ | |
41 | src/Core/qlopservice.cpp \ |
|
41 | src/Core/qlopservice.cpp \ | |
42 | src/Cassini/expxmldownloader.cpp \ |
|
42 | src/Cassini/expxmldownloader.cpp \ | |
43 | src/Cassini/cassinidatadownloader.cpp \ |
|
43 | src/Cassini/cassinidatadownloader.cpp \ | |
44 | src/Cassini/cassinidatafile.cpp \ |
|
44 | src/Cassini/cassinidatafile.cpp \ | |
45 | src/Cassini/cassiniindexfile.cpp \ |
|
45 | src/Cassini/cassiniindexfile.cpp \ | |
46 | src/Cassini/cassiniindexfileviewer.cpp \ |
|
46 | src/Cassini/cassiniindexfileviewer.cpp \ | |
47 | src/Cassini/cassinitools.cpp \ |
|
47 | src/Cassini/cassinitools.cpp \ | |
48 | src/Cassini/cassinitoolsgui.cpp \ |
|
48 | src/Cassini/cassinitoolsgui.cpp \ | |
49 | src/Core/Widgets/qlopplots.cpp \ |
|
49 | src/Core/Widgets/qlopplots.cpp \ | |
50 | src/Core/qlopdata.cpp \ |
|
50 | src/Core/qlopdata.cpp \ | |
51 | src/Core/Widgets/PyWdgt/pythonconsole.cpp \ |
|
51 | src/Core/Widgets/PyWdgt/pythonconsole.cpp \ | |
52 | src/Core/Widgets/PyWdgt/pythonqtscriptingconsoledandd.cpp \ |
|
52 | src/Core/Widgets/PyWdgt/pythonqtscriptingconsoledandd.cpp \ | |
53 | src/QCustomPlot/qcpdocumentobject.cpp \ |
|
53 | src/QCustomPlot/qcpdocumentobject.cpp \ | |
54 | src/Core/Widgets/filebrowser.cpp \ |
|
54 | src/Core/Widgets/filebrowser.cpp \ | |
55 | src/Core/Widgets/filesystemmodel.cpp \ |
|
55 | src/Core/Widgets/filesystemmodel.cpp \ | |
56 | src/Core/Widgets/qcustomplotvect.cpp |
|
56 | src/Core/Widgets/qcustomplotvect.cpp \ | |
|
57 | src/Core/qlopdatabase.cpp | |||
57 |
|
58 | |||
58 | HEADERS += src/mainwindow.h \ |
|
59 | HEADERS += src/mainwindow.h \ | |
59 | src/SocExplorerPlot.h \ |
|
60 | src/SocExplorerPlot.h \ | |
60 | src/QCustomPlot/qcustomplot.h \ |
|
61 | src/QCustomPlot/qcustomplot.h \ | |
61 | src/toolbarcontainer.h \ |
|
62 | src/toolbarcontainer.h \ | |
62 | src/Core/abstractfileloader.h \ |
|
63 | src/Core/abstractfileloader.h \ | |
63 | src/Core/filedownloader.h \ |
|
64 | src/Core/filedownloader.h \ | |
64 | src/Core/filedownloadertask.h \ |
|
65 | src/Core/filedownloadertask.h \ | |
65 | src/Core/Widgets/downloadhistory.h \ |
|
66 | src/Core/Widgets/downloadhistory.h \ | |
66 | src/Core/Widgets/downloadhistoryelement.h \ |
|
67 | src/Core/Widgets/downloadhistoryelement.h \ | |
67 | src/Core/qlopservice.h \ |
|
68 | src/Core/qlopservice.h \ | |
68 | src/Cassini/expxmldownloader.h \ |
|
69 | src/Cassini/expxmldownloader.h \ | |
69 | src/Cassini/cassinidatadownloader.h \ |
|
70 | src/Cassini/cassinidatadownloader.h \ | |
70 | src/Cassini/cassinidatafile.h \ |
|
71 | src/Cassini/cassinidatafile.h \ | |
71 | src/Cassini/cassiniindexfile.h \ |
|
72 | src/Cassini/cassiniindexfile.h \ | |
72 | src/Cassini/cassiniindexfileviewer.h \ |
|
73 | src/Cassini/cassiniindexfileviewer.h \ | |
73 | src/Cassini/cassinitools.h \ |
|
74 | src/Cassini/cassinitools.h \ | |
74 | src/Cassini/cassinitoolsgui.h \ |
|
75 | src/Cassini/cassinitoolsgui.h \ | |
75 | src/Core/Widgets/qlopplots.h \ |
|
76 | src/Core/Widgets/qlopplots.h \ | |
76 | src/Core/qlopdata.h \ |
|
77 | src/Core/qlopdata.h \ | |
77 | src/Core/Widgets/PyWdgt/pythonconsole.h \ |
|
78 | src/Core/Widgets/PyWdgt/pythonconsole.h \ | |
78 | src/Core/Widgets/PyWdgt/pythonqtscriptingconsoledandd.h \ |
|
79 | src/Core/Widgets/PyWdgt/pythonqtscriptingconsoledandd.h \ | |
79 | src/Core/qlop.h \ |
|
80 | src/Core/qlop.h \ | |
80 | src/Core/pyqlop.h \ |
|
81 | src/Core/pyqlop.h \ | |
81 | src/QCustomPlot/qcpdocumentobject.h \ |
|
82 | src/QCustomPlot/qcpdocumentobject.h \ | |
82 | src/Core/Widgets/filebrowser.h \ |
|
83 | src/Core/Widgets/filebrowser.h \ | |
83 | src/Core/Widgets/filesystemmodel.h \ |
|
84 | src/Core/Widgets/filesystemmodel.h \ | |
84 | src/Core/Widgets/qcustomplotvect.h |
|
85 | src/Core/Widgets/qcustomplotvect.h \ | |
|
86 | src/Core/qlopdatabase.h | |||
85 |
|
87 | |||
86 | FORMS += src/mainwindow.ui \ |
|
88 | FORMS += src/mainwindow.ui \ | |
87 | src/Core/Widgets/downloadhistory.ui \ |
|
89 | src/Core/Widgets/downloadhistory.ui \ | |
88 | src/Core/Widgets/downloadhistoryelement.ui \ |
|
90 | src/Core/Widgets/downloadhistoryelement.ui \ | |
89 | src/Cassini/cassinidatadownloader.ui \ |
|
91 | src/Cassini/cassinidatadownloader.ui \ | |
90 | src/Cassini/cassiniindexfileviewer.ui \ |
|
92 | src/Cassini/cassiniindexfileviewer.ui \ | |
91 | src/Cassini/cassinitoolsgui.ui \ |
|
93 | src/Cassini/cassinitoolsgui.ui \ | |
92 | src/Core/Widgets/filebrowser.ui |
|
94 | src/Core/Widgets/filebrowser.ui | |
93 |
|
95 | |||
94 | RESOURCES += \ |
|
96 | RESOURCES += \ | |
95 | resources/qlop.qrc |
|
97 | resources/qlop.qrc | |
96 |
|
98 | |||
97 | include(src/Core/Widgets/NicePyConsole/NicePyConsole.pri) |
|
99 | include(src/Core/Widgets/NicePyConsole/NicePyConsole.pri) | |
98 | include(src/Core/pythonQtOut/generated_cpp/PyQLop/PyQLop.pri) |
|
100 | include(src/Core/pythonQtOut/generated_cpp/PyQLop/PyQLop.pri) | |
99 |
|
101 | |||
100 | win32 { |
|
102 | win32 { | |
101 | DEFINES += WIN32 |
|
103 | DEFINES += WIN32 | |
102 | } |
|
104 | } | |
103 |
|
105 | |||
104 | unix { |
|
106 | unix { | |
105 | DEFINES += UNIX |
|
107 | DEFINES += UNIX | |
106 | } |
|
108 | } | |
107 |
|
109 | |||
108 | DISTFILES += \ |
|
110 | DISTFILES += \ | |
109 | src/Core/pythongenerator.sh \ |
|
111 | src/Core/pythongenerator.sh \ | |
110 | src/Core/pythonQtgeneratorCfg.txt |
|
112 | src/Core/pythonQtgeneratorCfg.txt |
@@ -1,306 +1,306 | |||||
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 "cassinidatafile.h" |
|
22 | #include "cassinidatafile.h" | |
23 | #include <QFile> |
|
23 | #include <QFile> | |
24 | #include <stdio.h> |
|
24 | #include <stdio.h> | |
25 | #include <QDateTime> |
|
25 | #include <QDateTime> | |
26 | #include <QVector> |
|
26 | #include <QVector> | |
27 | #include <QProgressDialog> |
|
27 | #include <QProgressDialog> | |
28 | #include <omp.h> |
|
28 | #include <omp.h> | |
29 | #include <QTimer> |
|
29 | #include <QTimer> | |
30 | #include <QElapsedTimer> |
|
30 | #include <QElapsedTimer> | |
31 | #include <sys/time.h> |
|
31 | #include <sys/time.h> | |
32 |
|
32 | |||
33 | CassiniDataFile::CassiniDataFile(QObject *parent) : AbstractFileLoader(parent) |
|
33 | CassiniDataFile::CassiniDataFile(QObject *parent) : AbstractFileLoader(parent) | |
34 | { |
|
34 | { | |
35 |
|
35 | |||
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 | CassiniDataFile::~CassiniDataFile() |
|
38 | CassiniDataFile::~CassiniDataFile() | |
39 | { |
|
39 | { | |
40 |
|
40 | |||
41 | } |
|
41 | } | |
42 |
|
42 | |||
43 | void CassiniDataFile::parseFile(const QString &fileName) |
|
43 | void CassiniDataFile::parseFile(const QString &fileName) | |
44 | { |
|
44 | { | |
45 | this->fileName = fileName; |
|
45 | this->fileName = fileName; | |
46 | m_Write = false; |
|
46 | m_Write = false; | |
47 | this->start(); |
|
47 | this->start(); | |
48 | } |
|
48 | } | |
49 |
|
49 | |||
50 | void CassiniDataFile::saveFile(const QString &fileName, QLopDataList data) |
|
50 | void CassiniDataFile::saveFile(const QString &fileName, QLopDataList data) | |
51 | { |
|
51 | { | |
52 | this->fileName = fileName; |
|
52 | this->fileName = fileName; | |
53 | m_Write = true; |
|
53 | m_Write = true; | |
54 | m_data = data; |
|
54 | m_data = data; | |
55 | this->start(); |
|
55 | this->start(); | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | inline double __decodeVal(int ofset,unsigned char* data) |
|
58 | inline double __decodeVal(int ofset,unsigned char* data) | |
59 | { |
|
59 | { | |
60 | if(data[ofset]=='-') |
|
60 | if(data[ofset]=='-') | |
61 | return -0.001 * (double)( |
|
61 | return -0.001 * (double)( | |
62 | (10000 * (int)(data[ofset+1] & 0x0F)) |
|
62 | (10000 * (int)(data[ofset+1] & 0x0F)) | |
63 | + (1000 * (int)(data[ofset+2] & 0x0F)) |
|
63 | + (1000 * (int)(data[ofset+2] & 0x0F)) | |
64 | + (100 * (int)(data[ofset+4] & 0x0F)) |
|
64 | + (100 * (int)(data[ofset+4] & 0x0F)) | |
65 | + (10 * (int)(data[ofset+5] & 0x0F)) |
|
65 | + (10 * (int)(data[ofset+5] & 0x0F)) | |
66 | + ( (int)(data[ofset+6] & 0x0F)) |
|
66 | + ( (int)(data[ofset+6] & 0x0F)) | |
67 | ); |
|
67 | ); | |
68 | else |
|
68 | else | |
69 | { |
|
69 | { | |
70 | if(data[ofset+1]=='-') |
|
70 | if(data[ofset+1]=='-') | |
71 | { |
|
71 | { | |
72 | return -0.001 * (double)( |
|
72 | return -0.001 * (double)( | |
73 | (1000 * (int)(data[ofset+2] & 0x0F)) |
|
73 | (1000 * (int)(data[ofset+2] & 0x0F)) | |
74 | + (100 * (int)(data[ofset+4] & 0x0F)) |
|
74 | + (100 * (int)(data[ofset+4] & 0x0F)) | |
75 | + (10 * (int)(data[ofset+5] & 0x0F)) |
|
75 | + (10 * (int)(data[ofset+5] & 0x0F)) | |
76 | + ( (int)(data[ofset+6] & 0x0F)) |
|
76 | + ( (int)(data[ofset+6] & 0x0F)) | |
77 | ); |
|
77 | ); | |
78 | } |
|
78 | } | |
79 | else |
|
79 | else | |
80 | { |
|
80 | { | |
81 | return 0.001 * (double)( |
|
81 | return 0.001 * (double)( | |
82 | (10000 * (int)(data[ofset+1] & 0x0F)) |
|
82 | (10000 * (int)(data[ofset+1] & 0x0F)) | |
83 | + (1000 * (int)(data[ofset+2] & 0x0F)) |
|
83 | + (1000 * (int)(data[ofset+2] & 0x0F)) | |
84 | + (100 * (int)(data[ofset+4] & 0x0F)) |
|
84 | + (100 * (int)(data[ofset+4] & 0x0F)) | |
85 | + (10 * (int)(data[ofset+5] & 0x0F)) |
|
85 | + (10 * (int)(data[ofset+5] & 0x0F)) | |
86 | + ( (int)(data[ofset+6] & 0x0F)) |
|
86 | + ( (int)(data[ofset+6] & 0x0F)) | |
87 | ); |
|
87 | ); | |
88 | } |
|
88 | } | |
89 | } |
|
89 | } | |
90 | } |
|
90 | } | |
91 |
|
91 | |||
92 | inline QDate __decodeDate(int ofset,unsigned char* data) |
|
92 | inline QDate __decodeDate(int ofset,unsigned char* data) | |
93 | { |
|
93 | { | |
94 | int y=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + (1*(data[ofset+3] & 0x0F)); |
|
94 | int y=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + (1*(data[ofset+3] & 0x0F)); | |
95 | int m=(10*(data[ofset+5] & 0x0F)) + (1*(data[ofset+6] & 0x0F)); |
|
95 | int m=(10*(data[ofset+5] & 0x0F)) + (1*(data[ofset+6] & 0x0F)); | |
96 | int d=(10*(data[ofset+8] & 0x0F)) + (1*(data[ofset+9] & 0x0F)); |
|
96 | int d=(10*(data[ofset+8] & 0x0F)) + (1*(data[ofset+9] & 0x0F)); | |
97 | return QDate(y,m,d); |
|
97 | return QDate(y,m,d); | |
98 | } |
|
98 | } | |
99 |
|
99 | |||
100 | inline QTime __decodeTime(int ofset,unsigned char* data) |
|
100 | inline QTime __decodeTime(int ofset,unsigned char* data) | |
101 | { |
|
101 | { | |
102 | int h=(10*(data[ofset] & 0x0F)) + (1*(data[ofset+1] & 0x0F)); |
|
102 | int h=(10*(data[ofset] & 0x0F)) + (1*(data[ofset+1] & 0x0F)); | |
103 | int m=(10*(data[ofset+3] & 0x0F)) + (1*(data[ofset+4] & 0x0F)); |
|
103 | int m=(10*(data[ofset+3] & 0x0F)) + (1*(data[ofset+4] & 0x0F)); | |
104 | int s=(10*(data[ofset+6] & 0x0F)) + (1*(data[ofset+7] & 0x0F)); |
|
104 | int s=(10*(data[ofset+6] & 0x0F)) + (1*(data[ofset+7] & 0x0F)); | |
105 | int ms=(100*(data[ofset+9] & 0x0F)) + (10*(data[ofset+10] & 0x0F)) + (1*(data[ofset+11] & 0x0F)); |
|
105 | int ms=(100*(data[ofset+9] & 0x0F)) + (10*(data[ofset+10] & 0x0F)) + (1*(data[ofset+11] & 0x0F)); | |
106 | return QTime(h,m,s,ms); |
|
106 | return QTime(h,m,s,ms); | |
107 | } |
|
107 | } | |
108 |
|
108 | |||
109 | double __decodeTimeFromEpochMs(int ofset,unsigned char* data) |
|
109 | double __decodeTimeFromEpochMs(int ofset,unsigned char* data) | |
110 | { |
|
110 | { | |
111 | struct tm t; |
|
111 | struct tm t; | |
112 | time_t t_of_day; |
|
112 | time_t t_of_day; | |
113 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; |
|
113 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; | |
114 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); |
|
114 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); | |
115 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); |
|
115 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); | |
116 | t.tm_hour=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); |
|
116 | t.tm_hour=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); | |
117 | t.tm_min=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); |
|
117 | t.tm_min=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); | |
118 | t.tm_sec=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); |
|
118 | t.tm_sec=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); | |
119 | int ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); |
|
119 | int ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); | |
120 | t_of_day = mktime(&t); |
|
120 | t_of_day = mktime(&t); | |
121 | return (t_of_day*1000.0)+ms; |
|
121 | return (t_of_day*1000.0)+ms; | |
122 | } |
|
122 | } | |
123 |
|
123 | |||
124 | double __decodeTimeFromEpoch(int ofset,unsigned char* data) |
|
124 | double __decodeTimeFromEpoch(int ofset,unsigned char* data) | |
125 | { |
|
125 | { | |
126 | struct tm t; |
|
126 | struct tm t; | |
127 | time_t t_of_day; |
|
127 | time_t t_of_day; | |
128 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; |
|
128 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; | |
129 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); |
|
129 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); | |
130 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); |
|
130 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); | |
131 | t.tm_hour=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); |
|
131 | t.tm_hour=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); | |
132 | t.tm_min=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); |
|
132 | t.tm_min=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); | |
133 | t.tm_sec=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); |
|
133 | t.tm_sec=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); | |
134 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); |
|
134 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); | |
135 | t_of_day = mktime(&t); |
|
135 | t_of_day = mktime(&t); | |
136 | return (double)t_of_day+((double)ms*(double)0.001); |
|
136 | return (double)t_of_day+((double)ms*(double)0.001); | |
137 | } |
|
137 | } | |
138 |
|
138 | |||
139 | double __decodeTimeHMSmS(int ofset,unsigned char* data) |
|
139 | double __decodeTimeHMSmS(int ofset,unsigned char* data) | |
140 | { |
|
140 | { | |
141 | int h,m,s; |
|
141 | int h,m,s; | |
142 | h=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); |
|
142 | h=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); | |
143 | m=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); |
|
143 | m=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); | |
144 | s=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); |
|
144 | s=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); | |
145 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); |
|
145 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); | |
146 | return (double)((h*3600)+(m*60)+s) + (ms*0.001); |
|
146 | return (double)((h*3600)+(m*60)+s) + (ms*0.001); | |
147 | } |
|
147 | } | |
148 |
|
148 | |||
149 | double __decodeTimeDHMSmS(int ofset,unsigned char* data) |
|
149 | double __decodeTimeDHMSmS(int ofset,unsigned char* data) | |
150 | { |
|
150 | { | |
151 | int d,h,m,s; |
|
151 | int d,h,m,s; | |
152 | d=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); |
|
152 | d=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); | |
153 | h=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); |
|
153 | h=(10*(data[ofset+11] & 0x0F)) + ((data[ofset+12] & 0x0F)); | |
154 | m=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); |
|
154 | m=(10*(data[ofset+14] & 0x0F)) + ((data[ofset+15] & 0x0F)); | |
155 | s=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); |
|
155 | s=(10*(data[ofset+17] & 0x0F)) + ((data[ofset+18] & 0x0F)); | |
156 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); |
|
156 | double ms=(100*(data[ofset+20] & 0x0F)) + (10*(data[ofset+21] & 0x0F)) + ((data[ofset+22] & 0x0F)); | |
157 | return (double)((d*3600*24)+(h*3600)+(m*60)+s) + (ms*0.001); |
|
157 | return (double)((d*3600*24)+(h*3600)+(m*60)+s) + (ms*0.001); | |
158 | } |
|
158 | } | |
159 |
|
159 | |||
160 | double __decodeTimeFromEpochDayOnly(int ofset,unsigned char* data) |
|
160 | double __decodeTimeFromEpochDayOnly(int ofset,unsigned char* data) | |
161 | { |
|
161 | { | |
162 | struct tm t; |
|
162 | struct tm t; | |
163 | time_t t_of_day; |
|
163 | time_t t_of_day; | |
164 | // t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; |
|
164 | // t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)) -1900; | |
165 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)); |
|
165 | t.tm_year=(1000*(data[ofset] & 0x0F)) + (100*(data[ofset+1] & 0x0F)) + (10*(data[ofset+2] & 0x0F)) + ((data[ofset+3] & 0x0F)); | |
166 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); |
|
166 | t.tm_mon=(10*(data[ofset+5] & 0x0F)) + ((data[ofset+6] & 0x0F)); | |
167 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); |
|
167 | t.tm_mday=(10*(data[ofset+8] & 0x0F)) + ((data[ofset+9] & 0x0F)); | |
168 | t.tm_hour=0; |
|
168 | t.tm_hour=0; | |
169 | t.tm_min=0; |
|
169 | t.tm_min=0; | |
170 | t.tm_sec=0; |
|
170 | t.tm_sec=0; | |
171 | // t_of_day = mktime(&t); |
|
171 | // t_of_day = mktime(&t); | |
172 | // return (double)t_of_day; |
|
172 | // return (double)t_of_day; | |
173 | QDateTime date(QDate(t.tm_year,t.tm_mon,1),QTime(0,0)); |
|
173 | QDateTime date(QDate(t.tm_year,t.tm_mon,1),QTime(0,0)); | |
174 | // date.setDate(); |
|
174 | // date.setDate(); | |
175 | return (double)((date.toMSecsSinceEpoch()/1000.0)-(24*3600)); |
|
175 | return (double)((date.toMSecsSinceEpoch()/1000.0)-(24*3600)); | |
176 | } |
|
176 | } | |
177 |
|
177 | |||
178 | void CassiniDataFile::run() |
|
178 | void CassiniDataFile::run() | |
179 | { |
|
179 | { | |
180 | if(!m_Write) |
|
180 | if(!m_Write) | |
181 | { |
|
181 | { | |
182 | readFile(); |
|
182 | readFile(); | |
183 | } |
|
183 | } | |
184 | else |
|
184 | else | |
185 | { |
|
185 | { | |
186 | writeFile(); |
|
186 | writeFile(); | |
187 | } |
|
187 | } | |
188 | } |
|
188 | } | |
189 |
|
189 | |||
190 | void CassiniDataFile::readFile() |
|
190 | void CassiniDataFile::readFile() | |
191 | { |
|
191 | { | |
192 | FILE* dataFile; |
|
192 | FILE* dataFile; | |
193 | dataFile = fopen(fileName.toStdString().c_str(),"r"); |
|
193 | dataFile = fopen(fileName.toStdString().c_str(),"r"); | |
194 |
|
194 | |||
195 | if(dataFile != NULL) |
|
195 | if(dataFile != NULL) | |
196 | { |
|
196 | { | |
197 | fseek(dataFile, 0L, SEEK_END); |
|
197 | fseek(dataFile, 0L, SEEK_END); | |
198 | int FileSize=ftell(dataFile); |
|
198 | int FileSize=ftell(dataFile); | |
199 | int lineCnt = FileSize/58; |
|
199 | int lineCnt = FileSize/58; | |
200 | int curLine=0; |
|
200 | int curLine=0; | |
201 | int lastLineUpdate=0; |
|
201 | int lastLineUpdate=0; | |
202 | QVector<QCPData> *ch1=new QVector<QCPData>(lineCnt); |
|
202 | QVector<QCPData> *ch1=new QVector<QCPData>(lineCnt); | |
203 | QVector<QCPData> *ch2=new QVector<QCPData>(lineCnt); |
|
203 | QVector<QCPData> *ch2=new QVector<QCPData>(lineCnt); | |
204 | QVector<QCPData> *ch3=new QVector<QCPData>(lineCnt); |
|
204 | QVector<QCPData> *ch3=new QVector<QCPData>(lineCnt); | |
205 | QLopDataList data; |
|
205 | QLopDataList data; | |
206 | QLopData* ch1V=new QLopData(); |
|
206 | QLopDataVector* ch1V=new QLopDataVector(); | |
207 | QLopData* ch2V=new QLopData(); |
|
207 | QLopDataVector* ch2V=new QLopDataVector(); | |
208 | QLopData* ch3V=new QLopData(); |
|
208 | QLopDataVector* ch3V=new QLopDataVector(); | |
209 | ch1V->data=ch1; |
|
209 | ch1V->data=ch1; | |
210 | ch2V->data=ch2; |
|
210 | ch2V->data=ch2; | |
211 | ch3V->data=ch3; |
|
211 | ch3V->data=ch3; | |
212 | ch1V->name="r"; |
|
212 | ch1V->name="r"; | |
213 | ch2V->name="theta"; |
|
213 | ch2V->name="theta"; | |
214 | ch3V->name="phi"; |
|
214 | ch3V->name="phi"; | |
215 | ch1V->unit="nT"; |
|
215 | ch1V->unit="nT"; | |
216 | ch2V->unit="nT"; |
|
216 | ch2V->unit="nT"; | |
217 | ch3V->unit="nT"; |
|
217 | ch3V->unit="nT"; | |
218 | data.append(ch1V); |
|
218 | data.append(ch1V); | |
219 | data.append(ch2V); |
|
219 | data.append(ch2V); | |
220 | data.append(ch3V); |
|
220 | data.append(ch3V); | |
221 | QElapsedTimer timr; |
|
221 | QElapsedTimer timr; | |
222 |
|
222 | |||
223 | double _x=0.0,day=0.0; |
|
223 | double _x=0.0,day=0.0; | |
224 | char* line; |
|
224 | char* line; | |
225 | QCPData data1,data2,data3; |
|
225 | QCPData data1,data2,data3; | |
226 | char* fileContent=(char*)malloc(FileSize); |
|
226 | char* fileContent=(char*)malloc(FileSize); | |
227 | if(Q_UNLIKELY(fileContent==NULL))return; |
|
227 | if(Q_UNLIKELY(fileContent==NULL))return; | |
228 | int threadIndex,numThreads=omp_get_num_threads(); |
|
228 | int threadIndex,numThreads=omp_get_num_threads(); | |
229 | int updateTriger=(lineCnt/100)/numThreads; |
|
229 | int updateTriger=(lineCnt/100)/numThreads; | |
230 | fseek(dataFile, 0L, SEEK_SET); |
|
230 | fseek(dataFile, 0L, SEEK_SET); | |
231 | char* svglocale=NULL; |
|
231 | char* svglocale=NULL; | |
232 | setlocale(LC_NUMERIC,svglocale); |
|
232 | setlocale(LC_NUMERIC,svglocale); | |
233 | setlocale(LC_NUMERIC, "en_US"); |
|
233 | setlocale(LC_NUMERIC, "en_US"); | |
234 | if(fread(fileContent,1,FileSize,dataFile)) |
|
234 | if(fread(fileContent,1,FileSize,dataFile)) | |
235 | { |
|
235 | { | |
236 | line = fileContent; |
|
236 | line = fileContent; | |
237 | QDateTime date; |
|
237 | QDateTime date; | |
238 | timr.start(); |
|
238 | timr.start(); | |
239 | day=__decodeTimeFromEpochDayOnly(0,(unsigned char*)line); |
|
239 | day=__decodeTimeFromEpochDayOnly(0,(unsigned char*)line); | |
240 | //#pragma omp parallel if ((FileSize > 10000000)) private(date,data1,data2,data3,_x,threadIndex,lastLineUpdate) shared(ch1,ch2,ch3,lineCnt) |
|
240 | //#pragma omp parallel if ((FileSize > 10000000)) private(date,data1,data2,data3,_x,threadIndex,lastLineUpdate) shared(ch1,ch2,ch3,lineCnt) | |
241 | // { |
|
241 | // { | |
242 | #pragma omp parallel for if ((FileSize > 1024*1024*10)) private(date,data1,data2,data3,_x,threadIndex,lastLineUpdate,curLine) shared(ch1,ch2,ch3,lineCnt,updateTriger) |
|
242 | #pragma omp parallel for if ((FileSize > 1024*1024*10)) private(date,data1,data2,data3,_x,threadIndex,lastLineUpdate,curLine) shared(ch1,ch2,ch3,lineCnt,updateTriger) | |
243 | for(int i=0;i<lineCnt;i++) |
|
243 | for(int i=0;i<lineCnt;i++) | |
244 | { |
|
244 | { | |
245 | // _x= i; |
|
245 | // _x= i; | |
246 | _x= day + __decodeTimeDHMSmS((i*58),(unsigned char*)line); |
|
246 | _x= day + __decodeTimeDHMSmS((i*58),(unsigned char*)line); | |
247 | // _x=__decodeTimeFromEpoch((i*58),(unsigned char*)line); |
|
247 | // _x=__decodeTimeFromEpoch((i*58),(unsigned char*)line); | |
248 | data1.key=_x; |
|
248 | data1.key=_x; | |
249 | data2.key=_x; |
|
249 | data2.key=_x; | |
250 | data3.key=_x; |
|
250 | data3.key=_x; | |
251 | data1.value=__decodeVal(((i*58)+27),(unsigned char*)line); |
|
251 | data1.value=__decodeVal(((i*58)+27),(unsigned char*)line); | |
252 | data2.value=__decodeVal(((i*58)+38),(unsigned char*)line); |
|
252 | data2.value=__decodeVal(((i*58)+38),(unsigned char*)line); | |
253 | data3.value=__decodeVal(((i*58)+49),(unsigned char*)line); |
|
253 | data3.value=__decodeVal(((i*58)+49),(unsigned char*)line); | |
254 | (*ch1)[i]=data1; |
|
254 | (*ch1)[i]=data1; | |
255 | (*ch2)[i]=data2; |
|
255 | (*ch2)[i]=data2; | |
256 | (*ch3)[i]=data3; |
|
256 | (*ch3)[i]=data3; | |
257 | curLine++; |
|
257 | curLine++; | |
258 | if(Q_UNLIKELY(lastLineUpdate++>updateTriger)) |
|
258 | if(Q_UNLIKELY(lastLineUpdate++>updateTriger)) | |
259 | { |
|
259 | { | |
260 | lastLineUpdate=0; |
|
260 | lastLineUpdate=0; | |
261 | int test=((curLine*numThreads *100)/ (lineCnt)); |
|
261 | int test=((curLine*numThreads *100)/ (lineCnt)); | |
262 | emit updateProgress(omp_get_thread_num(),test); |
|
262 | emit updateProgress(omp_get_thread_num(),test); | |
263 | } |
|
263 | } | |
264 | } |
|
264 | } | |
265 | } |
|
265 | } | |
266 | //#pragma omp barrier |
|
266 | //#pragma omp barrier | |
267 | free(fileContent); |
|
267 | free(fileContent); | |
268 | // } |
|
268 | // } | |
269 | qDebug()<< lineCnt <<" Points loaded in "<< timr.elapsed()<<"ms"; |
|
269 | qDebug()<< lineCnt <<" Points loaded in "<< timr.elapsed()<<"ms"; | |
270 | setlocale(LC_NUMERIC,svglocale); |
|
270 | setlocale(LC_NUMERIC,svglocale); | |
271 | emit dataReady(data); |
|
271 | emit dataReady(data); | |
272 | } |
|
272 | } | |
273 | } |
|
273 | } | |
274 |
|
274 | |||
275 | void CassiniDataFile::writeFile() |
|
275 | void CassiniDataFile::writeFile() | |
276 | { |
|
276 | { | |
277 | QFile dataFile(fileName); |
|
277 | QFile dataFile(fileName); | |
278 | dataFile.open(QIODevice::WriteOnly); |
|
278 | dataFile.open(QIODevice::WriteOnly); | |
279 | QTextStream out(&dataFile); |
|
279 | QTextStream out(&dataFile); | |
280 | if(dataFile.isOpen()) |
|
280 | if(dataFile.isOpen()) | |
281 | { |
|
281 | { | |
282 | if(m_data.count()==3) |
|
282 | if(m_data.count()==3) | |
283 | { |
|
283 | { | |
284 | QLopData* ch1V=m_data.at(0); |
|
284 | QLopDataVector* ch1V=(QLopDataVector*)m_data.at(0); | |
285 | QLopData* ch2V=m_data.at(1); |
|
285 | QLopDataVector* ch2V=(QLopDataVector*)m_data.at(1); | |
286 | QLopData* ch3V=m_data.at(2); |
|
286 | QLopDataVector* ch3V=(QLopDataVector*)m_data.at(2); | |
287 | if(ch1V->data->count()==ch2V->data->count() && ch1V->data->count()==ch3V->data->count()) |
|
287 | if(ch1V->data->count()==ch2V->data->count() && ch1V->data->count()==ch3V->data->count()) | |
288 | { |
|
288 | { | |
289 | for(int i=0;i<ch1V->data->count();i++) |
|
289 | for(int i=0;i<ch1V->data->count();i++) | |
290 | { |
|
290 | { | |
291 | double key = ch1V->data->at(i).key; |
|
291 | double key = ch1V->data->at(i).key; | |
292 | QDateTime date = QDateTime::fromMSecsSinceEpoch(key*1000); |
|
292 | QDateTime date = QDateTime::fromMSecsSinceEpoch(key*1000); | |
293 | out << date.toString(Qt::ISODate)+QString(".%1").arg(date.time().msec(),3); |
|
293 | out << date.toString(Qt::ISODate)+QString(".%1").arg(date.time().msec(),3); | |
294 | out << QString("%1%2%3").arg(ch1V->data->at(i).value, 11, 'f', 3).arg(ch2V->data->at(i).value, 11, 'f', 3).arg(ch3V->data->at(i).value, 11, 'f', 3); |
|
294 | out << QString("%1%2%3").arg(ch1V->data->at(i).value, 11, 'f', 3).arg(ch2V->data->at(i).value, 11, 'f', 3).arg(ch3V->data->at(i).value, 11, 'f', 3); | |
295 | out << "\r\n"; |
|
295 | out << "\r\n"; | |
296 | } |
|
296 | } | |
297 | } |
|
297 | } | |
298 | dataFile.flush(); |
|
298 | dataFile.flush(); | |
299 | m_data.clear(); |
|
299 | m_data.clear(); | |
300 | delete ch1V; |
|
300 | delete ch1V; | |
301 | delete ch2V; |
|
301 | delete ch2V; | |
302 | delete ch3V; |
|
302 | delete ch3V; | |
303 | } |
|
303 | } | |
304 | } |
|
304 | } | |
305 | } |
|
305 | } | |
306 |
|
306 |
@@ -1,306 +1,306 | |||||
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 |
|
22 | |||
23 | #include "cassinitools.h" |
|
23 | #include "cassinitools.h" | |
24 | #include <qlopplots.h> |
|
24 | #include <qlopplots.h> | |
25 | #include <QPen> |
|
25 | #include <QPen> | |
26 | #include <QAction> |
|
26 | #include <QAction> | |
27 | #include <fftw3.h> |
|
27 | #include <fftw3.h> | |
28 | #include <omp.h> |
|
28 | #include <omp.h> | |
29 |
|
29 | |||
30 | CassiniTools* CassiniTools::_self=NULL; |
|
30 | CassiniTools* CassiniTools::_self=NULL; | |
31 | QDockWidget* CassiniTools::m_gui=NULL; |
|
31 | QDockWidget* CassiniTools::m_gui=NULL; | |
32 | CassiniToolsGUI* CassiniTools::m_CassiniToolsGUI=NULL; |
|
32 | CassiniToolsGUI* CassiniTools::m_CassiniToolsGUI=NULL; | |
33 | CassiniDataFile* CassiniTools::m_dataFile=NULL; |
|
33 | CassiniDataFile* CassiniTools::m_dataFile=NULL; | |
34 | int CassiniTools::m_defaultPlot=-1; |
|
34 | int CassiniTools::m_defaultPlot=-1; | |
35 | int CassiniTools::m_fftPlot=-1; |
|
35 | int CassiniTools::m_fftPlot=-1; | |
36 | SocExplorerPlotActions* CassiniTools::ExportAction=NULL; |
|
36 | SocExplorerPlotActions* CassiniTools::ExportAction=NULL; | |
37 |
|
37 | |||
38 | Qt::GlobalColor QLopColours[]= {Qt::black, |
|
38 | Qt::GlobalColor QLopColours[]= {Qt::black, | |
39 | Qt::red, |
|
39 | Qt::red, | |
40 | Qt::blue, |
|
40 | Qt::blue, | |
41 | Qt::green, |
|
41 | Qt::green, | |
42 | Qt::darkGreen, |
|
42 | Qt::darkGreen, | |
43 | Qt::cyan, |
|
43 | Qt::cyan, | |
44 | Qt::darkRed, |
|
44 | Qt::darkRed, | |
45 | Qt::gray, |
|
45 | Qt::gray, | |
46 | Qt::yellow, |
|
46 | Qt::yellow, | |
47 | Qt::darkBlue, |
|
47 | Qt::darkBlue, | |
48 | Qt::darkCyan, |
|
48 | Qt::darkCyan, | |
49 | Qt::magenta, |
|
49 | Qt::magenta, | |
50 | Qt::darkMagenta, |
|
50 | Qt::darkMagenta, | |
51 | Qt::darkYellow, |
|
51 | Qt::darkYellow, | |
52 | Qt::darkGray, |
|
52 | Qt::darkGray, | |
53 | Qt::lightGray}; |
|
53 | Qt::lightGray}; | |
54 |
|
54 | |||
55 | int QLopColoursCount=16; |
|
55 | int QLopColoursCount=16; | |
56 |
|
56 | |||
57 | #define _INIT() if(Q_UNLIKELY(_self==NULL)){init();} |
|
57 | #define _INIT() if(Q_UNLIKELY(_self==NULL)){init();} | |
58 |
|
58 | |||
59 | CassiniTools::CassiniTools(bool noGUI,QObject *parent) : QLopService(parent) |
|
59 | CassiniTools::CassiniTools(bool noGUI,QObject *parent) : QLopService(parent) | |
60 | { |
|
60 | { | |
61 | m_dataFile = new CassiniDataFile(); |
|
61 | m_dataFile = new CassiniDataFile(); | |
62 | connect(m_dataFile,SIGNAL(dataReady(QLopDataList)),this,SLOT(dataReady(QLopDataList))); |
|
62 | connect(m_dataFile,SIGNAL(dataReady(QLopDataList)),this,SLOT(dataReady(QLopDataList))); | |
63 | m_serviceName="CassiniTools"; |
|
63 | m_serviceName="CassiniTools"; | |
64 | m_noGui=noGUI; |
|
64 | m_noGui=noGUI; | |
65 | fftw_init_threads(); |
|
65 | fftw_init_threads(); | |
66 | } |
|
66 | } | |
67 |
|
67 | |||
68 | CassiniTools::~CassiniTools() |
|
68 | CassiniTools::~CassiniTools() | |
69 | { |
|
69 | { | |
70 | delete m_dataFile; |
|
70 | delete m_dataFile; | |
71 | delete m_CassiniToolsGUI; |
|
71 | delete m_CassiniToolsGUI; | |
72 | delete m_gui; |
|
72 | delete m_gui; | |
73 | } |
|
73 | } | |
74 |
|
74 | |||
75 | void CassiniTools::makePlot() |
|
75 | void CassiniTools::makePlot() | |
76 | { |
|
76 | { | |
77 | m_defaultPlot = QLopPlots::addPlot(); |
|
77 | m_defaultPlot = QLopPlots::addPlot(); | |
78 | m_fftPlot = QLopPlots::addPlot(); |
|
78 | m_fftPlot = QLopPlots::addPlot(); | |
79 | SocExplorerPlot* plot=QLopPlots::getPlot(m_defaultPlot); |
|
79 | SocExplorerPlot* plot=QLopPlots::getPlot(m_defaultPlot); | |
80 | if(plot) |
|
80 | if(plot) | |
81 | { |
|
81 | { | |
82 | plot->setTitle(_self->m_serviceName + " plot"); |
|
82 | plot->setTitle(_self->m_serviceName + " plot"); | |
83 | plot->setXaxisTickLabelType(QCPAxis::ltDateTime); |
|
83 | plot->setXaxisTickLabelType(QCPAxis::ltDateTime); | |
84 | plot->setXaxisDateTimeFormat("hh:mm:ss.zzz"); |
|
84 | plot->setXaxisDateTimeFormat("hh:mm:ss.zzz"); | |
85 | plot->setContextMenuPolicy(Qt::ActionsContextMenu); |
|
85 | plot->setContextMenuPolicy(Qt::ActionsContextMenu); | |
86 | SocExplorerPlotActions* action=new SocExplorerPlotActions("export view",plot->PID(),_self); |
|
86 | SocExplorerPlotActions* action=new SocExplorerPlotActions("export view",plot->PID(),_self); | |
87 | plot->addAction(action); |
|
87 | plot->addAction(action); | |
88 | QObject::connect(action,SIGNAL(triggered(int)),_self,SLOT(export_view(int))); |
|
88 | QObject::connect(action,SIGNAL(triggered(int)),_self,SLOT(export_view(int))); | |
89 | ExportAction=new SocExplorerPlotActions("export view to "+QString(plot->title()).replace(".TAB","-part.TAB"),plot->PID(),_self); |
|
89 | ExportAction=new SocExplorerPlotActions("export view to "+QString(plot->title()).replace(".TAB","-part.TAB"),plot->PID(),_self); | |
90 | plot->addAction(ExportAction); |
|
90 | plot->addAction(ExportAction); | |
91 | QObject::connect(ExportAction,SIGNAL(triggered(int)),_self,SLOT(export_view_Predefined_FileName(int))); |
|
91 | QObject::connect(ExportAction,SIGNAL(triggered(int)),_self,SLOT(export_view_Predefined_FileName(int))); | |
92 | action=new SocExplorerPlotActions("FFT of the current view",plot->PID(),_self); |
|
92 | action=new SocExplorerPlotActions("FFT of the current view",plot->PID(),_self); | |
93 | plot->addAction(action); |
|
93 | plot->addAction(action); | |
94 | QObject::connect(action,SIGNAL(triggered(int)),_self,SLOT(compute_fft_on_view(int))); |
|
94 | QObject::connect(action,SIGNAL(triggered(int)),_self,SLOT(compute_fft_on_view(int))); | |
95 | } |
|
95 | } | |
96 | } |
|
96 | } | |
97 |
|
97 | |||
98 | void CassiniTools::init(bool noGUI, QObject *parent) |
|
98 | void CassiniTools::init(bool noGUI, QObject *parent) | |
99 | { |
|
99 | { | |
100 | if(Q_UNLIKELY(_self==NULL)) |
|
100 | if(Q_UNLIKELY(_self==NULL)) | |
101 | { |
|
101 | { | |
102 | _self=new CassiniTools(noGUI,parent); |
|
102 | _self=new CassiniTools(noGUI,parent); | |
103 | } |
|
103 | } | |
104 | } |
|
104 | } | |
105 |
|
105 | |||
106 | CassiniTools *CassiniTools::self() |
|
106 | CassiniTools *CassiniTools::self() | |
107 | { |
|
107 | { | |
108 | _INIT(); |
|
108 | _INIT(); | |
109 | return _self; |
|
109 | return _self; | |
110 | } |
|
110 | } | |
111 |
|
111 | |||
112 | void CassiniTools::decodeFGMData(const QString &file) |
|
112 | void CassiniTools::decodeFGMData(const QString &file) | |
113 | { |
|
113 | { | |
114 | _INIT(); |
|
114 | _INIT(); | |
115 | m_dataFile->parseFile(file); |
|
115 | m_dataFile->parseFile(file); | |
116 | } |
|
116 | } | |
117 |
|
117 | |||
118 | void CassiniTools::plotFile(const QString &File) |
|
118 | void CassiniTools::plotFile(const QString &File) | |
119 | { |
|
119 | { | |
120 | if(!m_dataFile->isRunning()) |
|
120 | if(!m_dataFile->isRunning()) | |
121 | { |
|
121 | { | |
122 | m_dataFile->parseFile(File); |
|
122 | m_dataFile->parseFile(File); | |
123 | // TODO fixme |
|
123 | // TODO fixme | |
124 | SocExplorerPlot* plot = QLopPlots::getPlot(m_defaultPlot); |
|
124 | SocExplorerPlot* plot = QLopPlots::getPlot(m_defaultPlot); | |
125 | if(plot==NULL) |
|
125 | if(plot==NULL) | |
126 | { |
|
126 | { | |
127 | makePlot(); |
|
127 | makePlot(); | |
128 | plot = QLopPlots::getPlot(m_defaultPlot); |
|
128 | plot = QLopPlots::getPlot(m_defaultPlot); | |
129 | } |
|
129 | } | |
130 | if(plot) |
|
130 | if(plot) | |
131 | { |
|
131 | { | |
132 | plot->setTitle(File); |
|
132 | plot->setTitle(File); | |
133 | ExportAction->setText("export view to "+QString(File).replace(".TAB","-part.TAB")); |
|
133 | ExportAction->setText("export view to "+QString(File).replace(".TAB","-part.TAB")); | |
134 | } |
|
134 | } | |
135 | } |
|
135 | } | |
136 | } |
|
136 | } | |
137 |
|
137 | |||
138 | void CassiniTools::plot_TAB_File(const QString &fileName) |
|
138 | void CassiniTools::plot_TAB_File(const QString &fileName) | |
139 | { |
|
139 | { | |
140 | //TODO fix: accent not accepted |
|
140 | //TODO fix: accent not accepted | |
141 | plotFile(fileName); |
|
141 | plotFile(fileName); | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | void CassiniTools::export_view(int PID) |
|
144 | void CassiniTools::export_view(int PID) | |
145 | { |
|
145 | { | |
146 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); |
|
146 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); | |
147 | if(plot==NULL) |
|
147 | if(plot==NULL) | |
148 | return; |
|
148 | return; | |
149 | { |
|
149 | { | |
150 | QString fileName = plot->title(); |
|
150 | QString fileName = plot->title(); | |
151 | fileName = QFileDialog::getSaveFileName(0,tr("Set filename"),fileName.replace(".TAB","-part.TAB")); |
|
151 | fileName = QFileDialog::getSaveFileName(0,tr("Set filename"),fileName.replace(".TAB","-part.TAB")); | |
152 | if(fileName!="") |
|
152 | if(fileName!="") | |
153 | { |
|
153 | { | |
154 | QLopDataList vectors; |
|
154 | QLopDataList vectors; | |
155 | for(int i=0;i<plot->graphCount();i++) |
|
155 | for(int i=0;i<plot->graphCount();i++) | |
156 | { |
|
156 | { | |
157 | QLopData* vect = new QLopData(); |
|
157 | QLopDataVector* vect = new QLopDataVector(); | |
158 | vect->data = plot->getVisibleData(i); |
|
158 | vect->data = plot->getVisibleData(i); | |
159 | vectors.append(vect); |
|
159 | vectors.append(vect); | |
160 | } |
|
160 | } | |
161 | m_dataFile->saveFile(fileName,vectors); |
|
161 | m_dataFile->saveFile(fileName,vectors); | |
162 | } |
|
162 | } | |
163 | } |
|
163 | } | |
164 | } |
|
164 | } | |
165 |
|
165 | |||
166 | void CassiniTools::export_view_Predefined_FileName(int PID) |
|
166 | void CassiniTools::export_view_Predefined_FileName(int PID) | |
167 | { |
|
167 | { | |
168 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); |
|
168 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); | |
169 | if(plot==NULL) |
|
169 | if(plot==NULL) | |
170 | return; |
|
170 | return; | |
171 | { |
|
171 | { | |
172 | QString fileName = QString(plot->title()).replace(".TAB","-part.TAB"); |
|
172 | QString fileName = QString(plot->title()).replace(".TAB","-part.TAB"); | |
173 | if(fileName!="") |
|
173 | if(fileName!="") | |
174 | { |
|
174 | { | |
175 | QLopDataList vectors; |
|
175 | QLopDataList vectors; | |
176 | for(int i=0;i<plot->graphCount();i++) |
|
176 | for(int i=0;i<plot->graphCount();i++) | |
177 | { |
|
177 | { | |
178 | QLopData* vect = new QLopData(); |
|
178 | QLopDataVector* vect = new QLopDataVector(); | |
179 | vect->data = plot->getVisibleData(i); |
|
179 | vect->data = plot->getVisibleData(i); | |
180 | vectors.append(vect); |
|
180 | vectors.append(vect); | |
181 | } |
|
181 | } | |
182 | m_dataFile->saveFile(fileName,vectors); |
|
182 | m_dataFile->saveFile(fileName,vectors); | |
183 | } |
|
183 | } | |
184 | } |
|
184 | } | |
185 | } |
|
185 | } | |
186 |
|
186 | |||
187 | void CassiniTools::compute_fft_on_view(int PID) |
|
187 | void CassiniTools::compute_fft_on_view(int PID) | |
188 | { |
|
188 | { | |
189 |
|
189 | |||
190 | QElapsedTimer timr; |
|
190 | QElapsedTimer timr; | |
191 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); |
|
191 | SocExplorerPlot* plot = QLopPlots::getPlot(PID); | |
192 | if(plot==NULL) |
|
192 | if(plot==NULL) | |
193 | return; |
|
193 | return; | |
194 | { |
|
194 | { | |
195 | timr.start(); |
|
195 | timr.start(); | |
196 | QLopDataList vectors; |
|
196 | QLopDataList vectors; | |
197 | for(int i=0;i<plot->graphCount();i++) |
|
197 | for(int i=0;i<plot->graphCount();i++) | |
198 | { |
|
198 | { | |
199 | QLopData* vect = new QLopData(); |
|
199 | QLopDataVector* vect = new QLopDataVector(); | |
200 | vect->data = plot->getVisibleData(i); |
|
200 | vect->data = plot->getVisibleData(i); | |
201 | vectors.append(vect); |
|
201 | vectors.append(vect); | |
202 | } |
|
202 | } | |
203 | if(vectors.count()==3) |
|
203 | if(vectors.count()==3) | |
204 | { |
|
204 | { | |
205 | QLopData* ch1V=vectors.at(0); |
|
205 | QLopDataVector* ch1V=(QLopDataVector*)vectors.at(0); | |
206 | QLopData* ch2V=vectors.at(1); |
|
206 | QLopDataVector* ch2V=(QLopDataVector*)vectors.at(1); | |
207 | QLopData* ch3V=vectors.at(2); |
|
207 | QLopDataVector* ch3V=(QLopDataVector*)vectors.at(2); | |
208 | QLopData* FFTout=new QLopData(); |
|
208 | QLopDataVector* FFTout=new QLopDataVector(); | |
209 | if(ch1V->data->count()==ch2V->data->count() && ch1V->data->count()==ch3V->data->count()) |
|
209 | if(ch1V->data->count()==ch2V->data->count() && ch1V->data->count()==ch3V->data->count()) | |
210 | { |
|
210 | { | |
211 |
|
211 | |||
212 | double* in; |
|
212 | double* in; | |
213 | fftw_complex *out; |
|
213 | fftw_complex *out; | |
214 | fftw_plan p; |
|
214 | fftw_plan p; | |
215 | FFTout->data = new QVector<QCPData>(ch1V->data->count()/2); |
|
215 | FFTout->data = new QVector<QCPData>(ch1V->data->count()/2); | |
216 | in = (double*) fftw_malloc(sizeof(double) * ch1V->data->count()); |
|
216 | in = (double*) fftw_malloc(sizeof(double) * ch1V->data->count()); | |
217 | out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * ch1V->data->count()); |
|
217 | out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * ch1V->data->count()); | |
218 | double av=0; |
|
218 | double av=0; | |
219 | for(int i=0;i<ch1V->data->count();i++) |
|
219 | for(int i=0;i<ch1V->data->count();i++) | |
220 | { |
|
220 | { | |
221 | in[i]=sqrt((ch1V->data->at(i).value*ch1V->data->at(i).value) + (ch2V->data->at(i).value*ch2V->data->at(i).value) + (ch3V->data->at(i).value*ch3V->data->at(i).value)); |
|
221 | in[i]=sqrt((ch1V->data->at(i).value*ch1V->data->at(i).value) + (ch2V->data->at(i).value*ch2V->data->at(i).value) + (ch3V->data->at(i).value*ch3V->data->at(i).value)); | |
222 | av = av+in[i]; |
|
222 | av = av+in[i]; | |
223 | } |
|
223 | } | |
224 | av/=ch1V->data->count(); |
|
224 | av/=ch1V->data->count(); | |
225 | for(int i=0;i<ch1V->data->count();i++) |
|
225 | for(int i=0;i<ch1V->data->count();i++) | |
226 | { |
|
226 | { | |
227 | in[i]=in[i]-av; |
|
227 | in[i]=in[i]-av; | |
228 | } |
|
228 | } | |
229 | fftw_plan_with_nthreads(4); |
|
229 | fftw_plan_with_nthreads(4); | |
230 | p = fftw_plan_dft_r2c_1d(ch1V->data->count(),in, out,FFTW_ESTIMATE); |
|
230 | p = fftw_plan_dft_r2c_1d(ch1V->data->count(),in, out,FFTW_ESTIMATE); | |
231 | fftw_execute(p); /* repeat as needed */ |
|
231 | fftw_execute(p); /* repeat as needed */ | |
232 | fftw_destroy_plan(p); |
|
232 | fftw_destroy_plan(p); | |
233 | fftw_free(in); |
|
233 | fftw_free(in); | |
234 | for(int i=0;i<ch1V->data->count()/2;i++) |
|
234 | for(int i=0;i<ch1V->data->count()/2;i++) | |
235 | { |
|
235 | { | |
236 | // (*FFTout->data)[i].value=sqrt((out[i][0] * out[i][0]) + (out[i][1] * out[i][1]))/ch1V->data->count(); |
|
236 | // (*FFTout->data)[i].value=sqrt((out[i][0] * out[i][0]) + (out[i][1] * out[i][1]))/ch1V->data->count(); | |
237 | (*FFTout->data)[i].value=((out[i][0] * out[i][0]) + (out[i][1] * out[i][1]))/(ch1V->data->count()); |
|
237 | (*FFTout->data)[i].value=((out[i][0] * out[i][0]) + (out[i][1] * out[i][1]))/(ch1V->data->count()); | |
238 | (*FFTout->data)[i].key = i; |
|
238 | (*FFTout->data)[i].key = i; | |
239 | } |
|
239 | } | |
240 | fftw_free(out); |
|
240 | fftw_free(out); | |
241 | SocExplorerPlot* plot = QLopPlots::getPlot(m_fftPlot); |
|
241 | SocExplorerPlot* plot = QLopPlots::getPlot(m_fftPlot); | |
242 | if(plot==NULL) |
|
242 | if(plot==NULL) | |
243 | return; |
|
243 | return; | |
244 | plot->removeAllGraphs(); |
|
244 | plot->removeAllGraphs(); | |
245 | plot->addGraph(); |
|
245 | plot->addGraph(); | |
246 | plot->setXaxisLog(); |
|
246 | plot->setXaxisLog(); | |
247 | plot->setYaxisLog(); |
|
247 | plot->setYaxisLog(); | |
248 | plot->setAdaptativeSampling(0,true); |
|
248 | plot->setAdaptativeSampling(0,true); | |
249 | QPen pen = plot->getGraphPen(0); |
|
249 | QPen pen = plot->getGraphPen(0); | |
250 | pen.setColor(QLopColours[0%QLopColoursCount]); |
|
250 | pen.setColor(QLopColours[0%QLopColoursCount]); | |
251 | plot->setGraphPen(0,pen); |
|
251 | plot->setGraphPen(0,pen); | |
252 | plot->setGraphData(0,FFTout->data,false); |
|
252 | plot->setGraphData(0,FFTout->data,false); | |
253 | plot->rescaleAxis(); |
|
253 | plot->rescaleAxis(); | |
254 | plot->replot(); |
|
254 | plot->replot(); | |
255 |
|
255 | |||
256 | qDebug()<< ch1V->data->count() <<" Points loaded in "<< timr.elapsed()<<"ms"; |
|
256 | qDebug()<< ch1V->data->count() <<" Points loaded in "<< timr.elapsed()<<"ms"; | |
257 | } |
|
257 | } | |
258 | } |
|
258 | } | |
259 | } |
|
259 | } | |
260 | } |
|
260 | } | |
261 |
|
261 | |||
262 | QDockWidget *CassiniTools::getGUI() |
|
262 | QDockWidget *CassiniTools::getGUI() | |
263 | { |
|
263 | { | |
264 | if(!m_noGui && (m_gui==NULL)) |
|
264 | if(!m_noGui && (m_gui==NULL)) | |
265 | { |
|
265 | { | |
266 | m_gui=new QDockWidget("Cassini Tools"); |
|
266 | m_gui=new QDockWidget("Cassini Tools"); | |
267 | m_CassiniToolsGUI = new CassiniToolsGUI(); |
|
267 | m_CassiniToolsGUI = new CassiniToolsGUI(); | |
268 | m_gui->setWidget(m_CassiniToolsGUI); |
|
268 | m_gui->setWidget(m_CassiniToolsGUI); | |
269 | m_gui->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable); |
|
269 | m_gui->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable); | |
270 | } |
|
270 | } | |
271 | return m_gui; |
|
271 | return m_gui; | |
272 | } |
|
272 | } | |
273 |
|
273 | |||
274 | const QString &CassiniTools::serviceName() |
|
274 | const QString &CassiniTools::serviceName() | |
275 | { |
|
275 | { | |
276 | _INIT(); |
|
276 | _INIT(); | |
277 | return m_serviceName; |
|
277 | return m_serviceName; | |
278 | } |
|
278 | } | |
279 |
|
279 | |||
280 | void CassiniTools::dataReady(QLopDataList data) |
|
280 | void CassiniTools::dataReady(QLopDataList data) | |
281 | { |
|
281 | { | |
282 | SocExplorerPlot* plot = QLopPlots::getPlot(m_defaultPlot); |
|
282 | SocExplorerPlot* plot = QLopPlots::getPlot(m_defaultPlot); | |
283 | if(plot==NULL) |
|
283 | if(plot==NULL) | |
284 | { |
|
284 | { | |
285 | makePlot(); |
|
285 | makePlot(); | |
286 | plot = QLopPlots::getPlot(m_defaultPlot); |
|
286 | plot = QLopPlots::getPlot(m_defaultPlot); | |
287 | } |
|
287 | } | |
288 | if(plot) |
|
288 | if(plot) | |
289 | { |
|
289 | { | |
290 | plot->removeAllGraphs(); |
|
290 | plot->removeAllGraphs(); | |
291 | for(int i=0;i<data.count();i++) |
|
291 | for(int i=0;i<data.count();i++) | |
292 | { |
|
292 | { | |
293 | plot->addGraph(); |
|
293 | plot->addGraph(); | |
294 | plot->setAdaptativeSampling(i,true); |
|
294 | plot->setAdaptativeSampling(i,true); | |
295 | plot->setUseFastVector(i,true); |
|
295 | plot->setUseFastVector(i,true); | |
296 | QPen pen = plot->getGraphPen(i); |
|
296 | QPen pen = plot->getGraphPen(i); | |
297 | pen.setColor(QLopColours[i%QLopColoursCount]); |
|
297 | pen.setColor(QLopColours[i%QLopColoursCount]); | |
298 | plot->setGraphPen(i,pen); |
|
298 | plot->setGraphPen(i,pen); | |
299 | plot->setGraphName(i,data.at(i)->name+"("+data.at(i)->unit+")"); |
|
299 | plot->setGraphName(i,data.at(i)->name+"("+data.at(i)->unit+")"); | |
300 | plot->setGraphData(i,data.at(i)->data,false); |
|
300 | plot->setGraphData(i,((QLopDataVector*)data.at(i))->data,false); | |
301 | } |
|
301 | } | |
302 | plot->rescaleAxis(); |
|
302 | plot->rescaleAxis(); | |
303 | plot->replot(); |
|
303 | plot->replot(); | |
304 | } |
|
304 | } | |
305 | } |
|
305 | } | |
306 |
|
306 |
@@ -1,107 +1,118 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <ui version="4.0"> |
|
2 | <ui version="4.0"> | |
3 | <class>CassiniToolsGUI</class> |
|
3 | <class>CassiniToolsGUI</class> | |
4 | <widget class="QWidget" name="CassiniToolsGUI"> |
|
4 | <widget class="QWidget" name="CassiniToolsGUI"> | |
5 | <property name="geometry"> |
|
5 | <property name="geometry"> | |
6 | <rect> |
|
6 | <rect> | |
7 | <x>0</x> |
|
7 | <x>0</x> | |
8 | <y>0</y> |
|
8 | <y>0</y> | |
9 | <width>400</width> |
|
9 | <width>400</width> | |
10 | <height>300</height> |
|
10 | <height>300</height> | |
11 | </rect> |
|
11 | </rect> | |
12 | </property> |
|
12 | </property> | |
13 | <property name="windowTitle"> |
|
13 | <property name="windowTitle"> | |
14 | <string>Form</string> |
|
14 | <string>Form</string> | |
15 | </property> |
|
15 | </property> | |
16 | <layout class="QGridLayout" name="gridLayout"> |
|
16 | <layout class="QGridLayout" name="gridLayout"> | |
17 | <item row="0" column="0"> |
|
17 | <item row="0" column="0"> | |
18 | <widget class="QTabWidget" name="tabWidget"> |
|
18 | <widget class="QTabWidget" name="tabWidget"> | |
19 | <property name="currentIndex"> |
|
19 | <property name="currentIndex"> | |
20 | <number>2</number> |
|
20 | <number>2</number> | |
21 | </property> |
|
21 | </property> | |
22 | <widget class="QWidget" name="tab"> |
|
22 | <widget class="QWidget" name="tab"> | |
23 | <attribute name="title"> |
|
23 | <attribute name="title"> | |
24 | <string>Data downloader</string> |
|
24 | <string>Data downloader</string> | |
25 | </attribute> |
|
25 | </attribute> | |
26 | <layout class="QGridLayout" name="gridLayout_2"> |
|
26 | <layout class="QGridLayout" name="gridLayout_2"> | |
27 | <item row="0" column="0"> |
|
27 | <item row="0" column="0"> | |
28 | <widget class="CassiniDataDownloader" name="widget" native="true"/> |
|
28 | <widget class="CassiniDataDownloader" name="widget" native="true"/> | |
29 | </item> |
|
29 | </item> | |
30 | </layout> |
|
30 | </layout> | |
31 | </widget> |
|
31 | </widget> | |
32 | <widget class="QWidget" name="tab_2"> |
|
32 | <widget class="QWidget" name="tab_2"> | |
33 | <attribute name="title"> |
|
33 | <attribute name="title"> | |
34 | <string>Index file viewer</string> |
|
34 | <string>Index file viewer</string> | |
35 | </attribute> |
|
35 | </attribute> | |
36 | <layout class="QGridLayout" name="gridLayout_3"> |
|
36 | <layout class="QGridLayout" name="gridLayout_3"> | |
37 | <item row="0" column="0"> |
|
37 | <item row="0" column="0"> | |
38 | <widget class="CassiniIndexFileViewer" name="widget_2" native="true"/> |
|
38 | <widget class="CassiniIndexFileViewer" name="widget_2" native="true"/> | |
39 | </item> |
|
39 | </item> | |
40 | </layout> |
|
40 | </layout> | |
41 | </widget> |
|
41 | </widget> | |
42 | <widget class="QWidget" name="tab_3"> |
|
42 | <widget class="QWidget" name="tab_3"> | |
43 | <attribute name="title"> |
|
43 | <attribute name="title"> | |
44 | <string>Folder browser</string> |
|
44 | <string>Folder browser</string> | |
45 | </attribute> |
|
45 | </attribute> | |
46 | <layout class="QGridLayout" name="gridLayout_4"> |
|
46 | <layout class="QGridLayout" name="gridLayout_4"> | |
47 | <item row="0" column="1"> |
|
47 | <item row="0" column="1"> | |
48 | <widget class="QPushButton" name="addFolderViewQpb"> |
|
48 | <widget class="QPushButton" name="addFolderViewQpb"> | |
|
49 | <property name="font"> | |||
|
50 | <font> | |||
|
51 | <pointsize>7</pointsize> | |||
|
52 | </font> | |||
|
53 | </property> | |||
49 | <property name="text"> |
|
54 | <property name="text"> | |
50 | <string/> |
|
55 | <string/> | |
51 | </property> |
|
56 | </property> | |
52 | <property name="icon"> |
|
57 | <property name="icon"> | |
53 | <iconset resource="../../resources/qlop.qrc"> |
|
58 | <iconset resource="../../resources/qlop.qrc"> | |
54 | <normaloff>:/img/Gnome-list-add.svg</normaloff>:/img/Gnome-list-add.svg</iconset> |
|
59 | <normaloff>:/img/Gnome-list-add.svg</normaloff>:/img/Gnome-list-add.svg</iconset> | |
55 | </property> |
|
60 | </property> | |
|
61 | <property name="iconSize"> | |||
|
62 | <size> | |||
|
63 | <width>16</width> | |||
|
64 | <height>16</height> | |||
|
65 | </size> | |||
|
66 | </property> | |||
56 | <property name="flat"> |
|
67 | <property name="flat"> | |
57 | <bool>false</bool> |
|
68 | <bool>false</bool> | |
58 | </property> |
|
69 | </property> | |
59 | </widget> |
|
70 | </widget> | |
60 | </item> |
|
71 | </item> | |
61 | <item row="0" column="0"> |
|
72 | <item row="0" column="0"> | |
62 | <spacer name="horizontalSpacer"> |
|
73 | <spacer name="horizontalSpacer"> | |
63 | <property name="orientation"> |
|
74 | <property name="orientation"> | |
64 | <enum>Qt::Horizontal</enum> |
|
75 | <enum>Qt::Horizontal</enum> | |
65 | </property> |
|
76 | </property> | |
66 | <property name="sizeHint" stdset="0"> |
|
77 | <property name="sizeHint" stdset="0"> | |
67 | <size> |
|
78 | <size> | |
68 | <width>40</width> |
|
79 | <width>40</width> | |
69 |
<height> |
|
80 | <height>8</height> | |
70 | </size> |
|
81 | </size> | |
71 | </property> |
|
82 | </property> | |
72 | </spacer> |
|
83 | </spacer> | |
73 | </item> |
|
84 | </item> | |
74 | <item row="1" column="0" colspan="2"> |
|
85 | <item row="1" column="0" colspan="2"> | |
75 | <widget class="toolBarContainer" name="folderViews" native="true"/> |
|
86 | <widget class="toolBarContainer" name="folderViews" native="true"/> | |
76 | </item> |
|
87 | </item> | |
77 | </layout> |
|
88 | </layout> | |
78 | </widget> |
|
89 | </widget> | |
79 | </widget> |
|
90 | </widget> | |
80 | </item> |
|
91 | </item> | |
81 | </layout> |
|
92 | </layout> | |
82 | </widget> |
|
93 | </widget> | |
83 | <customwidgets> |
|
94 | <customwidgets> | |
84 | <customwidget> |
|
95 | <customwidget> | |
85 | <class>toolBarContainer</class> |
|
96 | <class>toolBarContainer</class> | |
86 | <extends>QWidget</extends> |
|
97 | <extends>QWidget</extends> | |
87 | <header location="global">toolbarcontainer.h</header> |
|
98 | <header location="global">toolbarcontainer.h</header> | |
88 | <container>1</container> |
|
99 | <container>1</container> | |
89 | </customwidget> |
|
100 | </customwidget> | |
90 | <customwidget> |
|
101 | <customwidget> | |
91 | <class>CassiniDataDownloader</class> |
|
102 | <class>CassiniDataDownloader</class> | |
92 | <extends>QWidget</extends> |
|
103 | <extends>QWidget</extends> | |
93 | <header location="global">cassinidatadownloader.h</header> |
|
104 | <header location="global">cassinidatadownloader.h</header> | |
94 | <container>1</container> |
|
105 | <container>1</container> | |
95 | </customwidget> |
|
106 | </customwidget> | |
96 | <customwidget> |
|
107 | <customwidget> | |
97 | <class>CassiniIndexFileViewer</class> |
|
108 | <class>CassiniIndexFileViewer</class> | |
98 | <extends>QWidget</extends> |
|
109 | <extends>QWidget</extends> | |
99 | <header location="global">cassiniindexfileviewer.h</header> |
|
110 | <header location="global">cassiniindexfileviewer.h</header> | |
100 | <container>1</container> |
|
111 | <container>1</container> | |
101 | </customwidget> |
|
112 | </customwidget> | |
102 | </customwidgets> |
|
113 | </customwidgets> | |
103 | <resources> |
|
114 | <resources> | |
104 | <include location="../../resources/qlop.qrc"/> |
|
115 | <include location="../../resources/qlop.qrc"/> | |
105 | </resources> |
|
116 | </resources> | |
106 | <connections/> |
|
117 | <connections/> | |
107 | </ui> |
|
118 | </ui> |
@@ -1,175 +1,214 | |||||
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 |
|
22 | |||
23 | #include "filebrowser.h" |
|
23 | #include "filebrowser.h" | |
24 | #include "ui_filebrowser.h" |
|
24 | #include "ui_filebrowser.h" | |
25 | #include <QListView> |
|
25 | #include <QListView> | |
26 | #include <QTreeView> |
|
26 | #include <QTreeView> | |
27 |
|
27 | |||
28 | FileBrowser::FileBrowser(QWidget *parent) : |
|
28 | FileBrowser::FileBrowser(QWidget *parent) : | |
29 | QDockWidget(parent), |
|
29 | QDockWidget(parent), | |
30 | ui(new Ui::FileBrowser) |
|
30 | ui(new Ui::FileBrowser) | |
31 | { |
|
31 | { | |
|
32 | this->doubleClickEater = new DoubleClickEater(); | |||
32 | ui->setupUi(this); |
|
33 | ui->setupUi(this); | |
33 | this->model = new FileSystemModel(this); |
|
34 | this->model = new FileSystemModel(this); | |
34 | this->model->setRootPath(QDir::currentPath()); |
|
35 | this->model->setRootPath(QDir::currentPath()); | |
35 | this->view = new QTreeView(); |
|
36 | this->view = new QTreeView(); | |
36 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); |
|
37 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); | |
37 | this->view->setModel(this->model); |
|
38 | this->view->setModel(this->model); | |
38 | this->cd(model->rootPath()); |
|
39 | this->cd(model->rootPath()); | |
39 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); |
|
40 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); | |
40 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); |
|
41 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); | |
|
42 | connect(this->view,SIGNAL(activated(QModelIndex)),this,SLOT(activated(QModelIndex))); | |||
41 | connect(this->ui->ListViewQpb,SIGNAL(clicked()),this,SLOT(changeToListView())); |
|
43 | connect(this->ui->ListViewQpb,SIGNAL(clicked()),this,SLOT(changeToListView())); | |
42 | connect(this->ui->TreeViewQpb,SIGNAL(clicked()),this,SLOT(changeToTreeView())); |
|
44 | connect(this->ui->TreeViewQpb,SIGNAL(clicked()),this,SLOT(changeToTreeView())); | |
43 | connect(this->ui->parentDirQpb,SIGNAL(clicked()),this,SLOT(parentDir())); |
|
45 | connect(this->ui->parentDirQpb,SIGNAL(clicked()),this,SLOT(parentDir())); | |
44 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); |
|
46 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); | |
45 | view->setDragEnabled(true); |
|
47 | view->setDragEnabled(true); | |
46 | view->setAcceptDrops(true); |
|
48 | view->setAcceptDrops(true); | |
47 | view->setDropIndicatorShown(true); |
|
49 | view->setDropIndicatorShown(true); | |
48 | view->setDragDropMode(QAbstractItemView::DragDrop); |
|
50 | view->setDragDropMode(QAbstractItemView::DragDrop); | |
49 | this->pathCompleter = new QCompleter(this->model,this); |
|
51 | this->pathCompleter = new QCompleter(this->model,this); | |
50 | this->ui->pathLineEdit->setCompleter(pathCompleter); |
|
52 | this->ui->pathLineEdit->setCompleter(pathCompleter); | |
51 | this->pathLineEditEnterEditMode(false); |
|
53 | this->pathLineEditEnterEditMode(false); | |
|
54 | this->setFocusPolicy(Qt::StrongFocus); | |||
|
55 | this->ui->pathLineEdit->installEventFilter(this->doubleClickEater); | |||
|
56 | connect(this->doubleClickEater,SIGNAL(doubleClicked()),this,SLOT(pathLineEditDblClicked())); | |||
52 | } |
|
57 | } | |
53 |
|
58 | |||
54 | FileBrowser::~FileBrowser() |
|
59 | FileBrowser::~FileBrowser() | |
55 | { |
|
60 | { | |
56 | delete ui; |
|
61 | delete ui; | |
57 | } |
|
62 | } | |
58 |
|
63 | |||
59 | void FileBrowser::setNameFilters(const QStringList &filters,bool disables) |
|
64 | void FileBrowser::setNameFilters(const QStringList &filters,bool disables) | |
60 | { |
|
65 | { | |
61 | this->model->setNameFilters(filters); |
|
66 | this->model->setNameFilters(filters); | |
62 | this->model->setNameFilterDisables(disables); |
|
67 | this->model->setNameFilterDisables(disables); | |
63 | } |
|
68 | } | |
64 |
|
69 | |||
65 | void FileBrowser::changeToTreeView() |
|
70 | void FileBrowser::changeToTreeView() | |
66 | { |
|
71 | { | |
67 | this->ui->gridLayout->removeWidget(this->view); |
|
72 | this->ui->gridLayout->removeWidget(this->view); | |
68 | delete this->view; |
|
73 | delete this->view; | |
69 | this->view = new QTreeView(); |
|
74 | this->view = new QTreeView(); | |
70 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); |
|
75 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); | |
71 | this->view->setModel(this->model); |
|
76 | this->view->setModel(this->model); | |
72 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); |
|
77 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); | |
73 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); |
|
78 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); | |
74 | this->cd(model->rootPath()); |
|
79 | this->cd(model->rootPath()); | |
75 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); |
|
80 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); | |
76 | view->setDragEnabled(true); |
|
81 | view->setDragEnabled(true); | |
77 | view->setAcceptDrops(true); |
|
82 | view->setAcceptDrops(true); | |
78 | view->setDropIndicatorShown(true); |
|
83 | view->setDropIndicatorShown(true); | |
79 | } |
|
84 | } | |
80 |
|
85 | |||
81 | void FileBrowser::changeToListView() |
|
86 | void FileBrowser::changeToListView() | |
82 | { |
|
87 | { | |
83 | this->ui->gridLayout->removeWidget(this->view); |
|
88 | this->ui->gridLayout->removeWidget(this->view); | |
84 | delete this->view; |
|
89 | delete this->view; | |
85 | this->view = new QListView(); |
|
90 | this->view = new QListView(); | |
86 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); |
|
91 | this->ui->gridLayout->addWidget(this->view,1,0,1,-1); | |
87 | this->view->setModel(this->model); |
|
92 | this->view->setModel(this->model); | |
88 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); |
|
93 | connect(this->view,SIGNAL(clicked(QModelIndex)),this,SLOT(clicked(QModelIndex))); | |
89 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); |
|
94 | connect(this->view,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClicked(QModelIndex))); | |
90 | this->cd(model->rootPath()); |
|
95 | this->cd(model->rootPath()); | |
91 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); |
|
96 | view->setSelectionMode(QAbstractItemView::ExtendedSelection); | |
92 | view->setDragEnabled(true); |
|
97 | view->setDragEnabled(true); | |
93 | view->setAcceptDrops(true); |
|
98 | view->setAcceptDrops(true); | |
94 | view->setDropIndicatorShown(true); |
|
99 | view->setDropIndicatorShown(true); | |
95 | } |
|
100 | } | |
96 |
|
101 | |||
97 | void FileBrowser::clicked(QModelIndex index) |
|
102 | void FileBrowser::clicked(QModelIndex index) | |
98 | { |
|
103 | { | |
99 | QString file=model->filePath(index); |
|
104 | QString file=model->filePath(index); | |
100 | if(QFile::exists(file)) |
|
105 | if(QFile::exists(file)) | |
101 | emit fileClicked(file); |
|
106 | emit fileClicked(file); | |
102 | } |
|
107 | } | |
103 |
|
108 | |||
104 | void FileBrowser::doubleClicked(QModelIndex index) |
|
109 | void FileBrowser::doubleClicked(QModelIndex index) | |
105 | { |
|
110 | { | |
106 | if(model->isDir(index)) |
|
111 | if(model->isDir(index)) | |
107 | { |
|
112 | { | |
108 | this->cd(model->filePath(index)); |
|
113 | this->cd(model->filePath(index)); | |
109 | } |
|
114 | } | |
110 | else |
|
115 | else | |
111 | { |
|
116 | { | |
112 | QString file=model->filePath(index); |
|
117 | QString file=model->filePath(index); | |
113 | if(QFile::exists(file)) |
|
118 | if(QFile::exists(file)) | |
114 | emit fileDoubleClicked(file); |
|
119 | emit fileDoubleClicked(file); | |
115 | } |
|
120 | } | |
116 | } |
|
121 | } | |
117 |
|
122 | |||
|
123 | void FileBrowser::activated(const QModelIndex &index) | |||
|
124 | { | |||
|
125 | doubleClicked(index); | |||
|
126 | } | |||
|
127 | ||||
118 | void FileBrowser::parentDir() |
|
128 | void FileBrowser::parentDir() | |
119 | { |
|
129 | { | |
120 | this->cd(model->rootPath()+"/.."); |
|
130 | this->cd(model->rootPath()+"/.."); | |
121 | } |
|
131 | } | |
122 |
|
132 | |||
123 | void FileBrowser::cd(const QString &newPath) |
|
133 | void FileBrowser::cd(const QString &newPath) | |
124 | { |
|
134 | { | |
125 | model->setRootPath(newPath); |
|
135 | model->setRootPath(newPath); | |
126 | this->view->setRootIndex(model->index(model->rootPath())); |
|
136 | this->view->setRootIndex(model->index(model->rootPath())); | |
127 | this->ui->pathLineEdit->setText(model->rootPath()); |
|
137 | this->ui->pathLineEdit->setText(model->rootPath()); | |
128 | } |
|
138 | } | |
129 |
|
139 | |||
|
140 | void FileBrowser::pathLineEditDblClicked() | |||
|
141 | { | |||
|
142 | if(this->ui->pathLineEdit->isReadOnly()) | |||
|
143 | pathLineEditEnterEditMode(true); | |||
|
144 | } | |||
|
145 | ||||
130 |
|
146 | |||
131 | void FileBrowser::changeEvent(QEvent *e) |
|
147 | void FileBrowser::changeEvent(QEvent *e) | |
132 | { |
|
148 | { | |
133 | QDockWidget::changeEvent(e); |
|
149 | QDockWidget::changeEvent(e); | |
134 | switch (e->type()) { |
|
150 | switch (e->type()) { | |
135 | case QEvent::LanguageChange: |
|
151 | case QEvent::LanguageChange: | |
136 | ui->retranslateUi(this); |
|
152 | ui->retranslateUi(this); | |
137 | break; |
|
153 | break; | |
138 | default: |
|
154 | default: | |
139 | break; |
|
155 | break; | |
140 | } |
|
156 | } | |
141 | } |
|
157 | } | |
142 |
|
158 | |||
143 | void FileBrowser::keyPressEvent(QKeyEvent *e) |
|
159 | void FileBrowser::keyPressEvent(QKeyEvent *e) | |
144 | { |
|
160 | { | |
145 | switch (e->key()) |
|
161 | switch (e->key()) | |
146 | { |
|
162 | { | |
147 | case Qt::Key_L: |
|
163 | case Qt::Key_L: | |
148 | if(e->modifiers()==Qt::ControlModifier) |
|
164 | if(e->modifiers()==Qt::ControlModifier) | |
149 | { |
|
165 | { | |
150 | pathLineEditEnterEditMode(true); |
|
166 | pathLineEditEnterEditMode(true); | |
151 | e->accept(); |
|
167 | e->accept(); | |
152 | } |
|
168 | } | |
153 | break; |
|
169 | break; | |
154 | case Qt::Key_Return: |
|
170 | case Qt::Key_Return: | |
155 | pathLineEditEnterEditMode(false); |
|
171 | if(!this->view->hasFocus()) | |
|
172 | { | |||
156 | if(QFile::exists(this->ui->pathLineEdit->text())) |
|
173 | if(QFile::exists(this->ui->pathLineEdit->text())) | |
157 | { |
|
174 | { | |
158 | this->cd(this->ui->pathLineEdit->text()); |
|
175 | this->cd(this->ui->pathLineEdit->text()); | |
159 | e->accept(); |
|
176 | e->accept(); | |
160 | } |
|
177 | } | |
|
178 | pathLineEditEnterEditMode(false); | |||
|
179 | } | |||
|
180 | break; | |||
|
181 | case Qt::Key_Backspace: | |||
|
182 | if(this->view->hasFocus()) | |||
|
183 | { | |||
|
184 | parentDir(); | |||
|
185 | } | |||
161 | break; |
|
186 | break; | |
162 | default: |
|
187 | default: | |
163 | break; |
|
188 | break; | |
164 | } |
|
189 | } | |
165 | if(!e->isAccepted()) |
|
190 | if(!e->isAccepted()) | |
166 | QDockWidget::keyPressEvent(e); |
|
191 | QDockWidget::keyPressEvent(e); | |
167 | } |
|
192 | } | |
168 |
|
193 | |||
169 | void FileBrowser::pathLineEditEnterEditMode(bool enter) |
|
194 | void FileBrowser::pathLineEditEnterEditMode(bool enter) | |
170 | { |
|
195 | { | |
171 | this->ui->pathLineEdit->setReadOnly(!enter); |
|
196 | this->ui->pathLineEdit->setReadOnly(!enter); | |
172 | this->ui->pathLineEdit->setDisabled(!enter); |
|
197 | this->ui->pathLineEdit->setDisabled(!enter); | |
173 | if(enter) |
|
198 | if(enter) | |
174 | this->ui->pathLineEdit->setFocus(); |
|
199 | this->ui->pathLineEdit->setFocus(); | |
175 | } |
|
200 | } | |
|
201 | ||||
|
202 | ||||
|
203 | bool DoubleClickEater::eventFilter(QObject *obj, QEvent *event) | |||
|
204 | { | |||
|
205 | if (event->type() == QEvent::MouseButtonDblClick) | |||
|
206 | { | |||
|
207 | emit doubleClicked(); | |||
|
208 | return true; | |||
|
209 | } else | |||
|
210 | { | |||
|
211 | // standard event processing | |||
|
212 | return QObject::eventFilter(obj, event); | |||
|
213 | } | |||
|
214 | } |
@@ -1,66 +1,84 | |||||
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 |
|
22 | |||
23 | #ifndef FILEBROWSER_H |
|
23 | #ifndef FILEBROWSER_H | |
24 | #define FILEBROWSER_H |
|
24 | #define FILEBROWSER_H | |
25 |
|
25 | |||
26 | #include <QDockWidget> |
|
26 | #include <QDockWidget> | |
27 | #include <QFileSystemModel> |
|
27 | #include <QFileSystemModel> | |
28 | #include <QAbstractItemView> |
|
28 | #include <QAbstractItemView> | |
29 | #include <filesystemmodel.h> |
|
29 | #include <filesystemmodel.h> | |
30 | #include <QKeyEvent> |
|
30 | #include <QKeyEvent> | |
31 | #include <QCompleter> |
|
31 | #include <QCompleter> | |
32 |
|
32 | |||
33 | namespace Ui { |
|
33 | namespace Ui { | |
34 | class FileBrowser; |
|
34 | class FileBrowser; | |
35 | } |
|
35 | } | |
36 |
|
36 | |||
|
37 | class DoubleClickEater : public QObject | |||
|
38 | { | |||
|
39 | Q_OBJECT | |||
|
40 | public: | |||
|
41 | DoubleClickEater(){} | |||
|
42 | ~DoubleClickEater(){} | |||
|
43 | signals: | |||
|
44 | void doubleClicked(); | |||
|
45 | protected: | |||
|
46 | bool eventFilter(QObject *obj, QEvent *event); | |||
|
47 | }; | |||
|
48 | ||||
|
49 | ||||
|
50 | ||||
|
51 | ||||
37 | class FileBrowser : public QDockWidget |
|
52 | class FileBrowser : public QDockWidget | |
38 | { |
|
53 | { | |
39 | Q_OBJECT |
|
54 | Q_OBJECT | |
40 |
|
55 | |||
41 | public: |
|
56 | public: | |
42 | explicit FileBrowser(QWidget *parent = 0); |
|
57 | explicit FileBrowser(QWidget *parent = 0); | |
43 | ~FileBrowser(); |
|
58 | ~FileBrowser(); | |
44 | void setNameFilters(const QStringList & filters, bool disables=false); |
|
59 | void setNameFilters(const QStringList & filters, bool disables=false); | |
45 | signals: |
|
60 | signals: | |
46 | void fileClicked(const QString& file); |
|
61 | void fileClicked(const QString& file); | |
47 | void fileDoubleClicked(const QString& file); |
|
62 | void fileDoubleClicked(const QString& file); | |
48 | private slots: |
|
63 | private slots: | |
49 | void changeToTreeView(); |
|
64 | void changeToTreeView(); | |
50 | void changeToListView(); |
|
65 | void changeToListView(); | |
51 | void clicked(QModelIndex index); |
|
66 | void clicked(QModelIndex index); | |
52 | void doubleClicked(QModelIndex index); |
|
67 | void doubleClicked(QModelIndex index); | |
|
68 | void activated(const QModelIndex & index); | |||
53 | void parentDir(); |
|
69 | void parentDir(); | |
54 | void cd(const QString& newPath); |
|
70 | void cd(const QString& newPath); | |
|
71 | void pathLineEditDblClicked(); | |||
55 | protected: |
|
72 | protected: | |
56 | void changeEvent(QEvent *e); |
|
73 | void changeEvent(QEvent *e); | |
57 | void keyPressEvent(QKeyEvent *e); |
|
74 | void keyPressEvent(QKeyEvent *e); | |
58 | private: |
|
75 | private: | |
59 | void pathLineEditEnterEditMode(bool enter=true); |
|
76 | void pathLineEditEnterEditMode(bool enter=true); | |
60 | Ui::FileBrowser *ui; |
|
77 | Ui::FileBrowser *ui; | |
61 | FileSystemModel* model; |
|
78 | FileSystemModel* model; | |
62 | QAbstractItemView* view; |
|
79 | QAbstractItemView* view; | |
63 | QCompleter* pathCompleter; |
|
80 | QCompleter* pathCompleter; | |
|
81 | DoubleClickEater* doubleClickEater; | |||
64 | }; |
|
82 | }; | |
65 |
|
83 | |||
66 | #endif // FILEBROWSER_H |
|
84 | #endif // FILEBROWSER_H |
@@ -1,34 +1,47 | |||||
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 |
|
22 | |||
23 | #include "qlopdata.h" |
|
23 | #include "qlopdata.h" | |
24 |
|
24 | |||
25 | QLopData::QLopData(QObject *parent) : QObject(parent) |
|
25 | QLopData::QLopData(QObject *parent) : QObject(parent) | |
26 | { |
|
26 | { | |
27 |
|
27 | this->unit = ""; | ||
|
28 | this->source = "Not set"; | |||
|
29 | this->type = QLopData::None; | |||
28 | } |
|
30 | } | |
29 |
|
31 | |||
30 | QLopData::~QLopData() |
|
32 | QLopData::~QLopData() | |
31 | { |
|
33 | { | |
|
34 | // delete data; | |||
|
35 | } | |||
|
36 | ||||
|
37 | ||||
|
38 | ||||
|
39 | QLopDataVector::QLopDataVector(QObject *parent) | |||
|
40 | { | |||
|
41 | this->type = QLopData::Vector; | |||
|
42 | } | |||
|
43 | ||||
|
44 | QLopDataVector::~QLopDataVector() | |||
|
45 | { | |||
32 | delete data; |
|
46 | delete data; | |
33 | } |
|
47 | } | |
34 |
|
@@ -1,56 +1,78 | |||||
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 |
|
22 | |||
23 | #ifndef QLOPDATA_H |
|
23 | #ifndef QLOPDATA_H | |
24 | #define QLOPDATA_H |
|
24 | #define QLOPDATA_H | |
25 |
|
25 | |||
26 | #include <QObject> |
|
26 | #include <QObject> | |
27 | #include <qcustomplot.h> |
|
27 | #include <qcustomplot.h> | |
28 |
|
28 | |||
29 | typedef struct dataVector |
|
29 | typedef struct dataVector | |
30 | { |
|
30 | { | |
31 | QString name; |
|
31 | QString name; | |
32 | QString unit; |
|
32 | QString unit; | |
33 | QVector<QCPData>* data; |
|
33 | QVector<QCPData>* data; | |
34 | }dataVector; |
|
34 | }dataVector; | |
35 |
|
35 | |||
36 | typedef QList<dataVector> QListOfDataVector; |
|
36 | typedef QList<dataVector> QListOfDataVector; | |
37 |
|
37 | |||
38 |
|
38 | |||
39 |
|
39 | |||
40 | class QLopData : public QObject |
|
40 | class QLopData : public QObject | |
41 | { |
|
41 | { | |
42 | Q_OBJECT |
|
42 | Q_OBJECT | |
43 | public: |
|
43 | public: | |
|
44 | typedef enum QLopDataType | |||
|
45 | { | |||
|
46 | Scalar=0, | |||
|
47 | Vector=1, | |||
|
48 | Matrix=2, | |||
|
49 | None=-1, | |||
|
50 | } | |||
|
51 | QLopDataType; | |||
44 | explicit QLopData(QObject *parent = 0); |
|
52 | explicit QLopData(QObject *parent = 0); | |
45 | ~QLopData(); |
|
53 | ~QLopData(); | |
46 | QString name; |
|
54 | QString name; | |
|
55 | QString source; | |||
47 | QString unit; |
|
56 | QString unit; | |
|
57 | QLopDataType type; | |||
|
58 | int ID; | |||
|
59 | signals: | |||
|
60 | void dataChanged(); | |||
|
61 | public slots: | |||
|
62 | private: | |||
|
63 | }; | |||
|
64 | ||||
|
65 | class QLopDataVector : public QLopData | |||
|
66 | { | |||
|
67 | Q_OBJECT | |||
|
68 | public: | |||
|
69 | explicit QLopDataVector(QObject *parent = 0); | |||
|
70 | ~QLopDataVector(); | |||
48 | QVector<QCPData>* data; |
|
71 | QVector<QCPData>* data; | |
49 | signals: |
|
72 | signals: | |
50 | void dataChanged(); |
|
|||
51 | public slots: |
|
73 | public slots: | |
52 | private: |
|
74 | private: | |
53 | }; |
|
75 | }; | |
54 | typedef QList<QLopData*> QLopDataList; |
|
76 | typedef QList<QLopData*> QLopDataList; | |
55 |
|
77 | |||
56 | #endif // QLOPDATA_H |
|
78 | #endif // QLOPDATA_H |
General Comments 0
You need to be logged in to leave comments.
Login now