##// END OF EJS Templates
added missing GPL headers...
jeandet -
r11:f1a4e3a7ca04 default
parent child
Show More
@@ -14,7 +14,7 DESTDIR =./bin
14 TARGET = QLop
14 TARGET = QLop
15 TEMPLATE = app
15 TEMPLATE = app
16
16
17 LIBS+=-lfftw3
17 LIBS+=-lfftw3_threads -lfftw3
18
18
19 INCLUDEPATH += src/QCustomPlot \
19 INCLUDEPATH += src/QCustomPlot \
20 src src/Cassini \
20 src src/Cassini \
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "cassinidatadownloader.h"
23 #include "cassinidatadownloader.h"
2 #include "ui_cassinidatadownloader.h"
24 #include "ui_cassinidatadownloader.h"
3 #include <filedownloader.h>
25 #include <filedownloader.h>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef CASSINIDATADOWNLOADER_H
23 #ifndef CASSINIDATADOWNLOADER_H
2 #define CASSINIDATADOWNLOADER_H
24 #define CASSINIDATADOWNLOADER_H
3
25
@@ -266,7 +266,7 void CassiniDataFile::readFile()
266 //#pragma omp barrier
266 //#pragma omp barrier
267 free(fileContent);
267 free(fileContent);
268 // }
268 // }
269 qDebug()<< lineCnt <<" Points loade 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 }
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "cassiniindexfile.h"
23 #include "cassiniindexfile.h"
2
24
3 #include <QFile>
25 #include <QFile>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef CASSINIINDEXFILE_H
23 #ifndef CASSINIINDEXFILE_H
2 #define CASSINIINDEXFILE_H
24 #define CASSINIINDEXFILE_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "cassiniindexfileviewer.h"
23 #include "cassiniindexfileviewer.h"
2 #include "ui_cassiniindexfileviewer.h"
24 #include "ui_cassiniindexfileviewer.h"
3 #include <QFileDialog>
25 #include <QFileDialog>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef CASSINIINDEXFILEVIEWER_H
23 #ifndef CASSINIINDEXFILEVIEWER_H
2 #define CASSINIINDEXFILEVIEWER_H
24 #define CASSINIINDEXFILEVIEWER_H
3
25
@@ -1,8 +1,31
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "cassinitools.h"
23 #include "cassinitools.h"
2 #include <qlopplots.h>
24 #include <qlopplots.h>
3 #include <QPen>
25 #include <QPen>
4 #include <QAction>
26 #include <QAction>
5 #include <fftw3.h>
27 #include <fftw3.h>
28 #include <omp.h>
6
29
7 CassiniTools* CassiniTools::_self=NULL;
30 CassiniTools* CassiniTools::_self=NULL;
8 QDockWidget* CassiniTools::m_gui=NULL;
31 QDockWidget* CassiniTools::m_gui=NULL;
@@ -39,6 +62,7 CassiniTools::CassiniTools(bool noGUI,QO
39 connect(m_dataFile,SIGNAL(dataReady(QLopDataList)),this,SLOT(dataReady(QLopDataList)));
62 connect(m_dataFile,SIGNAL(dataReady(QLopDataList)),this,SLOT(dataReady(QLopDataList)));
40 m_serviceName="CassiniTools";
63 m_serviceName="CassiniTools";
41 m_noGui=noGUI;
64 m_noGui=noGUI;
65 fftw_init_threads();
42 }
66 }
43
67
44 CassiniTools::~CassiniTools()
68 CassiniTools::~CassiniTools()
@@ -162,10 +186,13 void CassiniTools::export_view_Predefine
162
186
163 void CassiniTools::compute_fft_on_view(int PID)
187 void CassiniTools::compute_fft_on_view(int PID)
164 {
188 {
189
190 QElapsedTimer timr;
165 SocExplorerPlot* plot = QLopPlots::getPlot(PID);
191 SocExplorerPlot* plot = QLopPlots::getPlot(PID);
166 if(plot==NULL)
192 if(plot==NULL)
167 return;
193 return;
168 {
194 {
195 timr.start();
169 QLopDataList vectors;
196 QLopDataList vectors;
170 for(int i=0;i<plot->graphCount();i++)
197 for(int i=0;i<plot->graphCount();i++)
171 {
198 {
@@ -199,6 +226,7 void CassiniTools::compute_fft_on_view(i
199 {
226 {
200 in[i]=in[i]-av;
227 in[i]=in[i]-av;
201 }
228 }
229 fftw_plan_with_nthreads(4);
202 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);
203 fftw_execute(p); /* repeat as needed */
231 fftw_execute(p); /* repeat as needed */
204 fftw_destroy_plan(p);
232 fftw_destroy_plan(p);
@@ -225,6 +253,7 void CassiniTools::compute_fft_on_view(i
225 plot->rescaleAxis();
253 plot->rescaleAxis();
226 plot->replot();
254 plot->replot();
227
255
256 qDebug()<< ch1V->data->count() <<" Points loaded in "<< timr.elapsed()<<"ms";
228 }
257 }
229 }
258 }
230 }
259 }
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 #ifndef CASSINITOOLS_H
22 #ifndef CASSINITOOLS_H
2 #define CASSINITOOLS_H
23 #define CASSINITOOLS_H
3
24
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "cassinitoolsgui.h"
23 #include "cassinitoolsgui.h"
2 #include "ui_cassinitoolsgui.h"
24 #include "ui_cassinitoolsgui.h"
3 #include <cassinitools.h>
25 #include <cassinitools.h>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef CASSINITOOLSGUI_H
23 #ifndef CASSINITOOLSGUI_H
2 #define CASSINITOOLSGUI_H
24 #define CASSINITOOLSGUI_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "expxmldownloader.h"
23 #include "expxmldownloader.h"
2 #include <QDebug>
24 #include <QDebug>
3 #include <QFile>
25 #include <QFile>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef EXPXMLDOWNLOADER_H
23 #ifndef EXPXMLDOWNLOADER_H
2 #define EXPXMLDOWNLOADER_H
24 #define EXPXMLDOWNLOADER_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "downloadhistory.h"
23 #include "downloadhistory.h"
2 #include "ui_downloadhistory.h"
24 #include "ui_downloadhistory.h"
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef DOWNLOADHISTORY_H
23 #ifndef DOWNLOADHISTORY_H
2 #define DOWNLOADHISTORY_H
24 #define DOWNLOADHISTORY_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "downloadhistoryelement.h"
23 #include "downloadhistoryelement.h"
2 #include "ui_downloadhistoryelement.h"
24 #include "ui_downloadhistoryelement.h"
3
25
@@ -1,3 +1,24
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
1 #ifndef DOWNLOADHISTORYELEMENT_H
22 #ifndef DOWNLOADHISTORYELEMENT_H
2 #define DOWNLOADHISTORYELEMENT_H
23 #define DOWNLOADHISTORYELEMENT_H
3
24
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "filebrowser.h"
23 #include "filebrowser.h"
2 #include "ui_filebrowser.h"
24 #include "ui_filebrowser.h"
3 #include <QListView>
25 #include <QListView>
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef FILEBROWSER_H
23 #ifndef FILEBROWSER_H
2 #define FILEBROWSER_H
24 #define FILEBROWSER_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "filesystemmodel.h"
23 #include "filesystemmodel.h"
2 FileSystemModel::FileSystemModel(QObject *parent):QFileSystemModel(parent)
24 FileSystemModel::FileSystemModel(QObject *parent):QFileSystemModel(parent)
3 {
25 {
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef FILESYSTEMMODEL_H
23 #ifndef FILESYSTEMMODEL_H
2 #define FILESYSTEMMODEL_H
24 #define FILESYSTEMMODEL_H
3
25
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 /*
23 * This code is mainly a copy of QCustomPlot's QCPGraph class
24 */
1 #include "qcustomplotvect.h"
25 #include "qcustomplotvect.h"
2 #include <QVector>
26 #include <QVector>
3 #include <QVectorIterator>
27 #include <QVectorIterator>
@@ -1,3 +1,27
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 /*
23 * This code is mainly a copy of QCustomPlot's QCPGraph class
24 */
1 #ifndef QCUSTOMPLOTVECT_H
25 #ifndef QCUSTOMPLOTVECT_H
2 #define QCUSTOMPLOTVECT_H
26 #define QCUSTOMPLOTVECT_H
3
27
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "qlopplots.h"
23 #include "qlopplots.h"
2 #include <QMainWindow>
24 #include <QMainWindow>
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef QLOPPLOTS_H
23 #ifndef QLOPPLOTS_H
2 #define QLOPPLOTS_H
24 #define QLOPPLOTS_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "abstractfileloader.h"
23 #include "abstractfileloader.h"
2
24
3 AbstractFileLoader::AbstractFileLoader(QObject *parent) : QThread(parent)
25 AbstractFileLoader::AbstractFileLoader(QObject *parent) : QThread(parent)
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef ABSTRACTFILELOADER_H
23 #ifndef ABSTRACTFILELOADER_H
2 #define ABSTRACTFILELOADER_H
24 #define ABSTRACTFILELOADER_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "filedownloader.h"
23 #include "filedownloader.h"
2 #include <QFile>
24 #include <QFile>
3 FileDownloader* FileDownloader::_self=NULL;
25 FileDownloader* FileDownloader::_self=NULL;
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef FILEDOWNLOADER_H
23 #ifndef FILEDOWNLOADER_H
2 #define FILEDOWNLOADER_H
24 #define FILEDOWNLOADER_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "filedownloadertask.h"
23 #include "filedownloadertask.h"
2
24
3 FileDownloaderTask::FileDownloaderTask(QNetworkReply *reply, int ID, const QString &fileName, QObject *parent) : QObject(parent)
25 FileDownloaderTask::FileDownloaderTask(QNetworkReply *reply, int ID, const QString &fileName, QObject *parent) : QObject(parent)
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef FILEDOWNLOADERTASK_H
23 #ifndef FILEDOWNLOADERTASK_H
2 #define FILEDOWNLOADERTASK_H
24 #define FILEDOWNLOADERTASK_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef QLOP
23 #ifndef QLOP
2 #define QLOP
24 #define QLOP
3 #ifdef WIN32
25 #ifdef WIN32
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "qlopdata.h"
23 #include "qlopdata.h"
2
24
3 QLopData::QLopData(QObject *parent) : QObject(parent)
25 QLopData::QLopData(QObject *parent) : QObject(parent)
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef QLOPDATA_H
23 #ifndef QLOPDATA_H
2 #define QLOPDATA_H
24 #define QLOPDATA_H
3
25
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #include "qlopservice.h"
23 #include "qlopservice.h"
2
24
3 QLopService::QLopService(QObject *parent) : QObject(parent)
25 QLopService::QLopService(QObject *parent) : QObject(parent)
@@ -1,3 +1,25
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22
1 #ifndef QLOPSERVICE_H
23 #ifndef QLOPSERVICE_H
2 #define QLOPSERVICE_H
24 #define QLOPSERVICE_H
3
25
This diff has been collapsed as it changes many lines, (566 lines changed) Show them Hide them
@@ -26,35 +26,35
26 #include <QPrinter>
26 #include <QPrinter>
27
27
28 SocExplorerPlot::SocExplorerPlot(QWidget *parent) :
28 SocExplorerPlot::SocExplorerPlot(QWidget *parent) :
29 QWidget(parent), mRubberBand(new QRubberBand(QRubberBand::Rectangle, this))
29 QWidget(parent), mRubberBand(new QRubberBand(QRubberBand::Rectangle, this))
30 {
30 {
31 this->m_plot = new QCustomPlotVect(this);
31 this->m_plot = new QCustomPlotVect(this);
32 this->m_plot->setInteractions(QCP::iRangeDrag | QCP::iSelectAxes |
32 this->m_plot->setInteractions(QCP::iRangeDrag | QCP::iSelectAxes |
33 QCP::iSelectLegend | QCP::iSelectPlottables);
33 QCP::iSelectLegend | QCP::iSelectPlottables);
34 this->m_plot->axisRect()->setRangeDrag(Qt::Horizontal|Qt::Vertical);
34 this->m_plot->axisRect()->setRangeDrag(Qt::Horizontal|Qt::Vertical);
35 this->m_plot->axisRect()->setRangeZoom(Qt::Horizontal|Qt::Vertical);
35 this->m_plot->axisRect()->setRangeZoom(Qt::Horizontal|Qt::Vertical);
36 this->m_mainlayout = new QGridLayout(this);
36 this->m_mainlayout = new QGridLayout(this);
37 this->setLayout(this->m_mainlayout);
37 this->setLayout(this->m_mainlayout);
38 this->m_mainlayout->addWidget(this->m_plot);
38 this->m_mainlayout->addWidget(this->m_plot);
39 this->setMinimumSize(400,300);
39 this->setMinimumSize(400,300);
40 this->setFocusPolicy(Qt::WheelFocus);
40 this->setFocusPolicy(Qt::WheelFocus);
41 this->m_plot->setAttribute(Qt::WA_TransparentForMouseEvents);
41 this->m_plot->setAttribute(Qt::WA_TransparentForMouseEvents);
42 this->ctrl_hold = false;
42 this->ctrl_hold = false;
43 this->shift_hold = false;
43 this->shift_hold = false;
44 this->mouse_hold = false;
44 this->mouse_hold = false;
45 this->m_plot->setNoAntialiasingOnDrag(true);
45 this->m_plot->setNoAntialiasingOnDrag(true);
46 this->show();
46 this->show();
47 this->m_plot->legend->setVisible(true);
47 this->m_plot->legend->setVisible(true);
48 }
48 }
49
49
50 SocExplorerPlot::~SocExplorerPlot()
50 SocExplorerPlot::~SocExplorerPlot()
51 {
51 {
52 delete mRubberBand;
52 delete mRubberBand;
53 }
53 }
54
54
55 void SocExplorerPlot::show()
55 void SocExplorerPlot::show()
56 {
56 {
57 QWidget::show();
57 QWidget::show();
58 }
58 }
59
59
60 void SocExplorerPlot::replot()
60 void SocExplorerPlot::replot()
@@ -99,9 +99,9 QVector<QCPData> *SocExplorerPlot::getVi
99
99
100 void SocExplorerPlot::setTitle(QString title)
100 void SocExplorerPlot::setTitle(QString title)
101 {
101 {
102 Q_UNUSED(title)
102 Q_UNUSED(title)
103 //this->m_plot->setTitle(title);
103 //this->m_plot->setTitle(title);
104 /*!
104 /*!
105 @todo Function borcken fixe this!
105 @todo Function borcken fixe this!
106 */
106 */
107 this->m_Title = title;
107 this->m_Title = title;
@@ -116,7 +116,7 const QString &SocExplorerPlot::title()
116
116
117 void SocExplorerPlot::setXaxisLabel(QString label)
117 void SocExplorerPlot::setXaxisLabel(QString label)
118 {
118 {
119 this->m_plot->xAxis->setLabel(label);
119 this->m_plot->xAxis->setLabel(label);
120 this->repaint();
120 this->repaint();
121 }
121 }
122
122
@@ -127,7 +127,7 void SocExplorerPlot::setXaxisLog()
127
127
128 void SocExplorerPlot::setYaxisLabel(QString label)
128 void SocExplorerPlot::setYaxisLabel(QString label)
129 {
129 {
130 this->m_plot->yAxis->setLabel(label);
130 this->m_plot->yAxis->setLabel(label);
131 this->repaint();
131 this->repaint();
132 }
132 }
133
133
@@ -138,48 +138,48 void SocExplorerPlot::setYaxisLog()
138
138
139 void SocExplorerPlot::setXaxisRange(double lower, double upper)
139 void SocExplorerPlot::setXaxisRange(double lower, double upper)
140 {
140 {
141 this->m_plot->xAxis->setRange(lower,upper);
141 this->m_plot->xAxis->setRange(lower,upper);
142 }
142 }
143
143
144 void SocExplorerPlot::setYaxisRange(double lower, double upper)
144 void SocExplorerPlot::setYaxisRange(double lower, double upper)
145 {
145 {
146 this->m_plot->yAxis->setRange(lower,upper);
146 this->m_plot->yAxis->setRange(lower,upper);
147 }
147 }
148
148
149
149
150 void SocExplorerPlot::rescaleAxis()
150 void SocExplorerPlot::rescaleAxis()
151 {
151 {
152 this->m_plot->rescaleAxes();
152 this->m_plot->rescaleAxes();
153 this->m_plot->replot();
153 this->m_plot->replot();
154 }
154 }
155
155
156 void SocExplorerPlot::setLegendFont(QFont font)
156 void SocExplorerPlot::setLegendFont(QFont font)
157 {
157 {
158 this->m_plot->legend->setFont(font);
158 this->m_plot->legend->setFont(font);
159 this->repaint();
159 this->repaint();
160 }
160 }
161
161
162 void SocExplorerPlot::setLegendSelectedFont(QFont font)
162 void SocExplorerPlot::setLegendSelectedFont(QFont font)
163 {
163 {
164 this->m_plot->legend->setSelectedFont(font);
164 this->m_plot->legend->setSelectedFont(font);
165 this->repaint();
165 this->repaint();
166 }
166 }
167
167
168 void SocExplorerPlot::setAdaptativeSampling(int graphIndex, bool enable)
168 void SocExplorerPlot::setAdaptativeSampling(int graphIndex, bool enable)
169 {
169 {
170 this->m_plot->graph(graphIndex)->setAdaptiveSampling(enable);
170 this->m_plot->graph(graphIndex)->setAdaptiveSampling(enable);
171 }
171 }
172
172
173 void SocExplorerPlot::setUseFastVector(int graphIndex, bool enable)
173 void SocExplorerPlot::setUseFastVector(int graphIndex, bool enable)
174 {
174 {
175 // TODO deprecated
175 // TODO deprecated
176 // this->m_plot->graph(graphIndex)->setUseFastVectors(enable);
176 // this->m_plot->graph(graphIndex)->setUseFastVectors(enable);
177 }
177 }
178
178
179 int SocExplorerPlot::addGraph()
179 int SocExplorerPlot::addGraph()
180 {
180 {
181 this->m_plot->addGraph();
181 this->m_plot->addGraph();
182 return this->m_plot->graphCount() -1;
182 return this->m_plot->graphCount() -1;
183 }
183 }
184
184
185 bool SocExplorerPlot::removeGraph(int graphIndex)
185 bool SocExplorerPlot::removeGraph(int graphIndex)
@@ -194,20 +194,20 int SocExplorerPlot::graphCount()
194
194
195 void SocExplorerPlot::removeAllGraphs()
195 void SocExplorerPlot::removeAllGraphs()
196 {
196 {
197 int graphCount=this->m_plot->graphCount();
197 int graphCount=this->m_plot->graphCount();
198 for(int i=0;i<graphCount;i++)
198 for(int i=0;i<graphCount;i++)
199 {
199 {
200 this->m_plot->removeGraph(0);
200 this->m_plot->removeGraph(0);
201 }
201 }
202 }
202 }
203
203
204
204
205 void SocExplorerPlot::setGraphName(int graphIndex,QString name)
205 void SocExplorerPlot::setGraphName(int graphIndex,QString name)
206 {
206 {
207 if(graphIndex<this->m_plot->graphCount())
207 if(graphIndex<this->m_plot->graphCount())
208 {
208 {
209 this->m_plot->graph(graphIndex)->setName(name);
209 this->m_plot->graph(graphIndex)->setName(name);
210 }
210 }
211 }
211 }
212
212
213 const QString &SocExplorerPlot::graphName(int graphIndex)
213 const QString &SocExplorerPlot::graphName(int graphIndex)
@@ -222,137 +222,137 const QString &SocExplorerPlot::graphNam
222
222
223 void SocExplorerPlot::setGraphData(int graphIndex, QList<QVariant> x, QList<QVariant> y)
223 void SocExplorerPlot::setGraphData(int graphIndex, QList<QVariant> x, QList<QVariant> y)
224 {
224 {
225 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()) && (x.at(0).type()==QVariant::Double))
225 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()) && (x.at(0).type()==QVariant::Double))
226 {
226 {
227 QVector<double> _x(x.count()), _y(y.count());
227 QVector<double> _x(x.count()), _y(y.count());
228 for(int i=0;i<x.count();i++)
228 for(int i=0;i<x.count();i++)
229 {
229 {
230 /*_x[i] = x.at(i).value<double>();
230 /*_x[i] = x.at(i).value<double>();
231 _y[i] = y.at(i).value<double>();*/
231 _y[i] = y.at(i).value<double>();*/
232 _x[i] = x.at(i).toDouble();
232 _x[i] = x.at(i).toDouble();
233 _y[i] = y.at(i).toDouble();
233 _y[i] = y.at(i).toDouble();
234 }
234 }
235 this->m_plot->graph(graphIndex)->setData(_x,_y);
235 this->m_plot->graph(graphIndex)->setData(_x,_y);
236 }
236 }
237 else
237 else
238 {
238 {
239 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()) && (x.at(0).type()==QVariant::DateTime))
239 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()) && (x.at(0).type()==QVariant::DateTime))
240 {
240 {
241 QVector<double> _x(x.count()), _y(y.count());
241 QVector<double> _x(x.count()), _y(y.count());
242 for(int i=0;i<x.count();i++)
242 for(int i=0;i<x.count();i++)
243 {
243 {
244 /*_x[i] = x.at(i).value<double>();
244 /*_x[i] = x.at(i).value<double>();
245 _y[i] = y.at(i).value<double>();*/
245 _y[i] = y.at(i).value<double>();*/
246 _x[i] = x.at(i).toDateTime().toMSecsSinceEpoch();
246 _x[i] = x.at(i).toDateTime().toMSecsSinceEpoch();
247 _y[i] = y.at(i).toDouble();
247 _y[i] = y.at(i).toDouble();
248 }
248 }
249 this->m_plot->graph(graphIndex)->setData(_x,_y);
249 this->m_plot->graph(graphIndex)->setData(_x,_y);
250 this->m_plot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
250 this->m_plot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
251 this->m_plot->xAxis->setDateTimeFormat("hh:mm:ss.zzz");
251 this->m_plot->xAxis->setDateTimeFormat("hh:mm:ss.zzz");
252
252
253 }
253 }
254 }
254 }
255 this->m_plot->replot();
255 this->m_plot->replot();
256 }
256 }
257
257
258 void SocExplorerPlot::setGraphData(int graphIndex, QCPDataMap *data, bool copy, bool replot)
258 void SocExplorerPlot::setGraphData(int graphIndex, QCPDataMap *data, bool copy, bool replot)
259 {
259 {
260 if((graphIndex<this->m_plot->graphCount()))// && (x.at(0).type()==QVariant::Double))
260 if((graphIndex<this->m_plot->graphCount()))// && (x.at(0).type()==QVariant::Double))
261 {
261 {
262 this->m_plot->graph(graphIndex)->setData(data,copy);
262 this->m_plot->graph(graphIndex)->setData(data,copy);
263 }
263 }
264 if(replot)
264 if(replot)
265 this->m_plot->replot();
265 this->m_plot->replot();
266 }
266 }
267
267
268 void SocExplorerPlot::setGraphData(int graphIndex,QVector<QCPData> *data, bool replot)
268 void SocExplorerPlot::setGraphData(int graphIndex,QVector<QCPData> *data, bool replot)
269 {
269 {
270 if((graphIndex<this->m_plot->graphCount()))// && (x.at(0).type()==QVariant::Double))
270 if((graphIndex<this->m_plot->graphCount()))// && (x.at(0).type()==QVariant::Double))
271 {
271 {
272 ((QCPGraphVect*)this->m_plot->graph(graphIndex))->setData(data);
272 ((QCPGraphVect*)this->m_plot->graph(graphIndex))->setData(data);
273 }
273 }
274 if(replot)
274 if(replot)
275 this->m_plot->replot();
275 this->m_plot->replot();
276 }
276 }
277
277
278 void SocExplorerPlot::addGraphData(int graphIndex, QList<QVariant> x, QList<QVariant> y)
278 void SocExplorerPlot::addGraphData(int graphIndex, QList<QVariant> x, QList<QVariant> y)
279 {
279 {
280 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()))// && (x.at(0).type()==QVariant::Double))
280 if((graphIndex<this->m_plot->graphCount()) && (x.count()==y.count()))// && (x.at(0).type()==QVariant::Double))
281 {
281 {
282 QVector<double> _x(x.count()), _y(y.count());
282 QVector<double> _x(x.count()), _y(y.count());
283 for(int i=0;i<x.count();i++)
283 for(int i=0;i<x.count();i++)
284 {
284 {
285 /*_x[i] = x.at(i).value<double>();
285 /*_x[i] = x.at(i).value<double>();
286 _y[i] = y.at(i).value<double>();*/
286 _y[i] = y.at(i).value<double>();*/
287 _x[i] = x.at(i).toDouble();
287 _x[i] = x.at(i).toDouble();
288 _y[i] = y.at(i).toDouble();
288 _y[i] = y.at(i).toDouble();
289 }
289 }
290 this->m_plot->graph(graphIndex)->addData(_x,_y);
290 this->m_plot->graph(graphIndex)->addData(_x,_y);
291 }
291 }
292 this->m_plot->replot();
292 this->m_plot->replot();
293 }
293 }
294
294
295 void SocExplorerPlot::addGraphData(int graphIndex, QVariant x, QVariant y)
295 void SocExplorerPlot::addGraphData(int graphIndex, QVariant x, QVariant y)
296 {
296 {
297 if(graphIndex<this->m_plot->graphCount())// && (x.at(0).type()==QVariant::Double))
297 if(graphIndex<this->m_plot->graphCount())// && (x.at(0).type()==QVariant::Double))
298 {
298 {
299 this->m_plot->graph(graphIndex)->addData(x.toDouble(),y.toDouble());
299 this->m_plot->graph(graphIndex)->addData(x.toDouble(),y.toDouble());
300 }
300 }
301 this->m_plot->replot();
301 this->m_plot->replot();
302 }
302 }
303
303
304 void SocExplorerPlot::setGraphPen(int graphIndex,QPen pen)
304 void SocExplorerPlot::setGraphPen(int graphIndex,QPen pen)
305 {
305 {
306 if(graphIndex<this->m_plot->graphCount())
306 if(graphIndex<this->m_plot->graphCount())
307 {
307 {
308 this->m_plot->graph(graphIndex)->setPen(pen);
308 this->m_plot->graph(graphIndex)->setPen(pen);
309 }
309 }
310 }
310 }
311
311
312 QPen SocExplorerPlot::getGraphPen(int graphIndex)
312 QPen SocExplorerPlot::getGraphPen(int graphIndex)
313 {
313 {
314 if(graphIndex<this->m_plot->graphCount())
314 if(graphIndex<this->m_plot->graphCount())
315 {
315 {
316 return this->m_plot->graph(graphIndex)->pen();
316 return this->m_plot->graph(graphIndex)->pen();
317 }
317 }
318 return this->m_plot->graph()->pen();
318 return this->m_plot->graph()->pen();
319 }
319 }
320
320
321
321
322
322
323 void SocExplorerPlot::setGraphLineStyle(int graphIndex,QString lineStyle)
323 void SocExplorerPlot::setGraphLineStyle(int graphIndex,QString lineStyle)
324 {
324 {
325 if(graphIndex<this->m_plot->graphCount())
325 if(graphIndex<this->m_plot->graphCount())
326 {
326 {
327 if(!lineStyle.compare("none"))
327 if(!lineStyle.compare("none"))
328 {
328 {
329 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsNone);
329 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsNone);
330 return;
330 return;
331 }
331 }
332 if(!lineStyle.compare("line"))
332 if(!lineStyle.compare("line"))
333 {
333 {
334 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsLine);
334 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsLine);
335 return;
335 return;
336 }
336 }
337 if(!lineStyle.compare("stepleft"))
337 if(!lineStyle.compare("stepleft"))
338 {
338 {
339 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepLeft);
339 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepLeft);
340 return;
340 return;
341 }
341 }
342 if(!lineStyle.compare("stepright"))
342 if(!lineStyle.compare("stepright"))
343 {
343 {
344 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepRight);
344 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepRight);
345 return;
345 return;
346 }
346 }
347 if(!lineStyle.compare("stepcenter"))
347 if(!lineStyle.compare("stepcenter"))
348 {
348 {
349 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepCenter);
349 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsStepCenter);
350 return;
350 return;
351 }
351 }
352 if(!lineStyle.compare("impulse"))
352 if(!lineStyle.compare("impulse"))
353 {
353 {
354 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsImpulse);
354 this->m_plot->graph(graphIndex)->setLineStyle(QCPGraph::lsImpulse);
355 return;
355 return;
356 }
356 }
357
357
358
358
@@ -361,87 +361,87 void SocExplorerPlot::setGraphLineStyle(
361
361
362 void SocExplorerPlot::setGraphScatterStyle(int graphIndex,QString scatterStyle)
362 void SocExplorerPlot::setGraphScatterStyle(int graphIndex,QString scatterStyle)
363 {
363 {
364 if(graphIndex<this->m_plot->graphCount())
364 if(graphIndex<this->m_plot->graphCount())
365 {
365 {
366 if(!scatterStyle.compare("none"))
366 if(!scatterStyle.compare("none"))
367 {
367 {
368 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssNone);
368 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssNone);
369 return;
369 return;
370 }
370 }
371 if(!scatterStyle.compare("dot"))
371 if(!scatterStyle.compare("dot"))
372 {
372 {
373 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDot);
373 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDot);
374 return;
374 return;
375 }
375 }
376 if(!scatterStyle.compare("cross"))
376 if(!scatterStyle.compare("cross"))
377 {
377 {
378 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCross);
378 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCross);
379 return;
379 return;
380 }
380 }
381 if(!scatterStyle.compare("plus"))
381 if(!scatterStyle.compare("plus"))
382 {
382 {
383 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlus);
383 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlus);
384 return;
384 return;
385 }
385 }
386 if(!scatterStyle.compare("circle"))
386 if(!scatterStyle.compare("circle"))
387 {
387 {
388 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCircle);
388 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCircle);
389 return;
389 return;
390 }
390 }
391 if(!scatterStyle.compare("disc"))
391 if(!scatterStyle.compare("disc"))
392 {
392 {
393 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDisc);
393 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDisc);
394 return;
394 return;
395 }
395 }
396 if(!scatterStyle.compare("square"))
396 if(!scatterStyle.compare("square"))
397 {
397 {
398 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssSquare);
398 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssSquare);
399 return;
399 return;
400 }
400 }
401 if(!scatterStyle.compare("diamond"))
401 if(!scatterStyle.compare("diamond"))
402 {
402 {
403 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDiamond);
403 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssDiamond);
404 return;
404 return;
405 }
405 }
406 if(!scatterStyle.compare("star"))
406 if(!scatterStyle.compare("star"))
407 {
407 {
408 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssStar);
408 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssStar);
409 return;
409 return;
410 }
410 }
411 if(!scatterStyle.compare("triangle"))
411 if(!scatterStyle.compare("triangle"))
412 {
412 {
413 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssTriangle);
413 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssTriangle);
414 return;
414 return;
415 }
415 }
416 if(!scatterStyle.compare("invertedtriangle"))
416 if(!scatterStyle.compare("invertedtriangle"))
417 {
417 {
418 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssTriangleInverted);
418 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssTriangleInverted);
419 return;
419 return;
420 }
420 }
421 if(!scatterStyle.compare("crosssquare"))
421 if(!scatterStyle.compare("crosssquare"))
422 {
422 {
423 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCrossSquare);
423 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCrossSquare);
424 return;
424 return;
425 }
425 }
426 if(!scatterStyle.compare("plussquare"))
426 if(!scatterStyle.compare("plussquare"))
427 {
427 {
428 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlusSquare);
428 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlusSquare);
429 return;
429 return;
430 }
430 }
431 if(!scatterStyle.compare("crosscircle"))
431 if(!scatterStyle.compare("crosscircle"))
432 {
432 {
433 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCrossCircle);
433 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssCrossCircle);
434 return;
434 return;
435 }
435 }
436 if(!scatterStyle.compare("pluscircle"))
436 if(!scatterStyle.compare("pluscircle"))
437 {
437 {
438 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlusCircle);
438 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPlusCircle);
439 return;
439 return;
440 }
440 }
441 if(!scatterStyle.compare("peace"))
441 if(!scatterStyle.compare("peace"))
442 {
442 {
443 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPeace);
443 this->m_plot->graph(graphIndex)->setScatterStyle(QCPScatterStyle::ssPeace);
444 return;
444 return;
445 }
445 }
446
446
447 }
447 }
@@ -449,12 +449,12 void SocExplorerPlot::setGraphScatterSty
449
449
450 void SocExplorerPlot::setXaxisTickLabelType(QCPAxis::LabelType type)
450 void SocExplorerPlot::setXaxisTickLabelType(QCPAxis::LabelType type)
451 {
451 {
452 this->m_plot->xAxis->setTickLabelType(type);
452 this->m_plot->xAxis->setTickLabelType(type);
453 }
453 }
454
454
455 void SocExplorerPlot::setXaxisDateTimeFormat(const QString &format)
455 void SocExplorerPlot::setXaxisDateTimeFormat(const QString &format)
456 {
456 {
457 this->m_plot->xAxis->setDateTimeFormat(format);
457 this->m_plot->xAxis->setDateTimeFormat(format);
458 }
458 }
459
459
460
460
@@ -463,111 +463,111 void SocExplorerPlot::setXaxisDateTimeFo
463
463
464 void SocExplorerPlot::keyPressEvent(QKeyEvent * event)
464 void SocExplorerPlot::keyPressEvent(QKeyEvent * event)
465 {
465 {
466 switch(event->key())
466 switch(event->key())
467 {
467 {
468 case Qt::Key_Control:
468 case Qt::Key_Control:
469 this->ctrl_hold = true;
469 this->ctrl_hold = true;
470 setCursor(Qt::CrossCursor);
470 setCursor(Qt::CrossCursor);
471 break;
471 break;
472 case Qt::Key_Shift:
472 case Qt::Key_Shift:
473 this->shift_hold = true;
473 this->shift_hold = true;
474 break;
474 break;
475 case Qt::Key_M:
475 case Qt::Key_M:
476 this->rescaleAxis();
476 this->rescaleAxis();
477 break;
477 break;
478 case Qt::Key_Left:
478 case Qt::Key_Left:
479 if(!ctrl_hold)
479 if(!ctrl_hold)
480 {
480 {
481 move(-0.1,Qt::Horizontal);
481 move(-0.1,Qt::Horizontal);
482 }
482 }
483 else
483 else
484 {
484 {
485 zoom(2,this->width()/2,Qt::Horizontal);
485 zoom(2,this->width()/2,Qt::Horizontal);
486 }
486 }
487 break;
487 break;
488 case Qt::Key_Right:
488 case Qt::Key_Right:
489 if(!ctrl_hold)
489 if(!ctrl_hold)
490 {
490 {
491 move(0.1,Qt::Horizontal);
491 move(0.1,Qt::Horizontal);
492 }
492 }
493 else
493 else
494 {
494 {
495 zoom(0.5,this->width()/2,Qt::Horizontal);
495 zoom(0.5,this->width()/2,Qt::Horizontal);
496 }
496 }
497 break;
497 break;
498 case Qt::Key_Up:
498 case Qt::Key_Up:
499 if(!ctrl_hold)
499 if(!ctrl_hold)
500 {
500 {
501 move(0.1,Qt::Vertical);
501 move(0.1,Qt::Vertical);
502 }
502 }
503 else
503 else
504 {
504 {
505 zoom(0.5,this->height()/2,Qt::Vertical);
505 zoom(0.5,this->height()/2,Qt::Vertical);
506 }
506 }
507 break;
507 break;
508 case Qt::Key_Down:
508 case Qt::Key_Down:
509 if(!ctrl_hold)
509 if(!ctrl_hold)
510 {
510 {
511 move(-0.1,Qt::Vertical);
511 move(-0.1,Qt::Vertical);
512 }
512 }
513 else
513 else
514 {
514 {
515 zoom(2,this->height()/2,Qt::Vertical);
515 zoom(2,this->height()/2,Qt::Vertical);
516 }
516 }
517 break;
517 break;
518 default:
518 default:
519 QWidget::keyPressEvent(event);
519 QWidget::keyPressEvent(event);
520 break;
520 break;
521 }
521 }
522 }
522 }
523
523
524 void SocExplorerPlot::keyReleaseEvent(QKeyEvent * event)
524 void SocExplorerPlot::keyReleaseEvent(QKeyEvent * event)
525 {
525 {
526 switch(event->key())
526 switch(event->key())
527 {
527 {
528 case Qt::Key_Control:
528 case Qt::Key_Control:
529 event->accept();
529 event->accept();
530 this->ctrl_hold = false;
530 this->ctrl_hold = false;
531 break;
531 break;
532 case Qt::Key_Shift:
532 case Qt::Key_Shift:
533 event->accept();
533 event->accept();
534 this->shift_hold = false;
534 this->shift_hold = false;
535 break;
535 break;
536 default:
536 default:
537 QWidget::keyReleaseEvent(event);
537 QWidget::keyReleaseEvent(event);
538 break;
538 break;
539 }
539 }
540 setCursor(Qt::ArrowCursor);
540 setCursor(Qt::ArrowCursor);
541 }
541 }
542
542
543 void SocExplorerPlot::wheelEvent(QWheelEvent * event)
543 void SocExplorerPlot::wheelEvent(QWheelEvent * event)
544 {
544 {
545 double factor;
545 double factor;
546 double wheelSteps = event->delta()/120.0; // a single step delta is +/-120 usually
546 double wheelSteps = event->delta()/120.0; // a single step delta is +/-120 usually
547 if(ctrl_hold)
547 if(ctrl_hold)
548 {
548 {
549 if (event->orientation()==Qt::Vertical)//mRangeZoom.testFlag(Qt::Vertical))
549 if (event->orientation()==Qt::Vertical)//mRangeZoom.testFlag(Qt::Vertical))
550 {
550 {
551 setCursor(Qt::SizeVerCursor);
551 setCursor(Qt::SizeVerCursor);
552 factor = pow(this->m_plot->axisRect()->rangeZoomFactor(Qt::Vertical), wheelSteps);
552 factor = pow(this->m_plot->axisRect()->rangeZoomFactor(Qt::Vertical), wheelSteps);
553 zoom(factor,event->pos().y(),Qt::Vertical);
553 zoom(factor,event->pos().y(),Qt::Vertical);
554 }
554 }
555 QWidget::wheelEvent(event);
555 QWidget::wheelEvent(event);
556 return;
556 return;
557 }
557 }
558 if(shift_hold)
558 if(shift_hold)
559 {
559 {
560 if (event->orientation()==Qt::Vertical)//mRangeZoom.testFlag(Qt::Vertical))
560 if (event->orientation()==Qt::Vertical)//mRangeZoom.testFlag(Qt::Vertical))
561 {
561 {
562 setCursor(Qt::SizeHorCursor);
562 setCursor(Qt::SizeHorCursor);
563 factor = pow(this->m_plot->axisRect()->rangeZoomFactor(Qt::Horizontal), wheelSteps);
563 factor = pow(this->m_plot->axisRect()->rangeZoomFactor(Qt::Horizontal), wheelSteps);
564 zoom(factor,event->pos().x(),Qt::Horizontal);
564 zoom(factor,event->pos().x(),Qt::Horizontal);
565 }
565 }
566 QWidget::wheelEvent(event);
566 QWidget::wheelEvent(event);
567 return;
567 return;
568 }
568 }
569 move(wheelSteps/10,Qt::Horizontal);
569 move(wheelSteps,Qt::Horizontal);
570 QWidget::wheelEvent(event);
570 QWidget::wheelEvent(event);
571 }
571 }
572
572
573
573
@@ -575,86 +575,132 void SocExplorerPlot::wheelEvent(QWheelE
575
575
576 void SocExplorerPlot::mousePressEvent(QMouseEvent *event)
576 void SocExplorerPlot::mousePressEvent(QMouseEvent *event)
577 {
577 {
578 if(event->button()==Qt::LeftButton)
578 if(event->button()==Qt::LeftButton)
579 {
579 {
580 if(ctrl_hold)
580 if(ctrl_hold)
581 {
581 {
582 setCursor(Qt::CrossCursor);
582 setCursor(Qt::CrossCursor);
583 mOrigin = event->pos();
583 mOrigin = event->pos();
584 mRubberBand->setGeometry(QRect(mOrigin, QSize()));
584 mRubberBand->setGeometry(QRect(mOrigin, QSize()));
585 mRubberBand->show();
585 mRubberBand->show();
586 }
586 }
587 else
587 else
588 {
588 {
589 setCursor(Qt::ClosedHandCursor);
589 setCursor(Qt::ClosedHandCursor);
590 mDragStart = event->pos();
590 mDragStart = event->pos();
591 this->mouse_hold = true;
591 this->mouse_hold = true;
592 DragStartHorzRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Horizontal)->range();
592 DragStartHorzRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Horizontal)->range();
593 DragStartVertRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Vertical)->range();
593 DragStartVertRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Vertical)->range();
594 }
594 }
595 }
595 }
596 QWidget::mousePressEvent(event);
596 QWidget::mousePressEvent(event);
597 }
597 }
598
598
599 void SocExplorerPlot::mouseReleaseEvent(QMouseEvent *event)
599 void SocExplorerPlot::mouseReleaseEvent(QMouseEvent *event)
600 {
600 {
601 if(event->button()==Qt::LeftButton)
601 if(event->button()==Qt::LeftButton)
602 {
602 {
603 this->mouse_hold = false;
603 this->mouse_hold = false;
604 }
604 }
605 if (mRubberBand->isVisible())
605 if (mRubberBand->isVisible())
606 {
606 {
607 const QRect & zoomRect = mRubberBand->geometry();
607 const QRect & zoomRect = mRubberBand->geometry();
608 int xp1, yp1, xp2, yp2;
608 int xp1, yp1, xp2, yp2;
609 zoomRect.getCoords(&xp1, &yp1, &xp2, &yp2);
609 zoomRect.getCoords(&xp1, &yp1, &xp2, &yp2);
610 double x1 = this->m_plot->xAxis->pixelToCoord(xp1);
610 double x1 = this->m_plot->xAxis->pixelToCoord(xp1);
611 double x2 = this->m_plot->xAxis->pixelToCoord(xp2);
611 double x2 = this->m_plot->xAxis->pixelToCoord(xp2);
612 double y1 = this->m_plot->yAxis->pixelToCoord(yp1);
612 double y1 = this->m_plot->yAxis->pixelToCoord(yp1);
613 double y2 = this->m_plot->yAxis->pixelToCoord(yp2);
613 double y2 = this->m_plot->yAxis->pixelToCoord(yp2);
614
614
615 this->m_plot->xAxis->setRange(x1, x2);
615 this->m_plot->xAxis->setRange(x1, x2);
616 this->m_plot->yAxis->setRange(y1, y2);
616 this->m_plot->yAxis->setRange(y1, y2);
617
617
618 mRubberBand->hide();
618 mRubberBand->hide();
619 this->m_plot->replot();
619 this->m_plot->replot();
620 }
620 }
621 setCursor(Qt::ArrowCursor);
621 setCursor(Qt::ArrowCursor);
622 QWidget::mouseReleaseEvent(event);
622 QWidget::mouseReleaseEvent(event);
623 }
623 }
624
624
625 void SocExplorerPlot::zoom(double factor, int center, Qt::Orientation orientation)
625 void SocExplorerPlot::zoom(double factor, int center, Qt::Orientation orientation)
626 {
626 {
627 QCPAxis* axis = this->m_plot->axisRect()->rangeZoomAxis(orientation);
627 QCPAxis* axis = this->m_plot->axisRect()->rangeZoomAxis(orientation);
628 axis->scaleRange(factor, axis->pixelToCoord(center));
628 axis->scaleRange(factor, axis->pixelToCoord(center));
629 this->m_plot->replot();
629 this->m_plot->replot();
630 }
630 }
631
631
632 void SocExplorerPlot::move(double factor, Qt::Orientation orientation)
632 void SocExplorerPlot::move(double factor, Qt::Orientation orientation)
633 {
633 {
634 QCPAxis* axis = this->m_plot->axisRect()->rangeDragAxis(orientation);
634 QCPAxis* axis = this->m_plot->axisRect()->rangeDragAxis(orientation);
635 double rg = (axis->range().upper - axis->range().lower)*(factor);
635 // double rg = (axis->range().upper - axis->range().lower)*(factor);
636 axis->setRange(axis->range().lower+(rg), axis->range().upper+(rg));
636 // axis->setRange(axis->range().lower+(rg), axis->range().upper+(rg));
637 this->m_plot->replot();
637 double rg =0.0;
638 DragStartHorzRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Horizontal)->range();
639 DragStartVertRange = this->m_plot->axisRect()->rangeDragAxis(Qt::Vertical)->range();
640 if(this->m_plot->xAxis->scaleType() == QCPAxis::stLinear)
641 {
642 rg = (axis->range().upper - axis->range().lower)*(factor/10);
643 axis->setRange(axis->range().lower+(rg), axis->range().upper+(rg));
644 }
645 else if(this->m_plot->xAxis->scaleType() == QCPAxis::stLogarithmic)
646 {
647 // rg = (axis->range().upper / axis->range().lower)*(factor/100);
648 int start,stop;
649 double diff;
650 if(factor>0.0)
651 {
652 stop =this->width()*factor/10;
653 start = 2*this->width()*factor/10;
654 }
655 if(factor<0.0)
656 {
657 factor*=-1.0;
658 start =this->width()*factor/10;
659 stop = 2*this->width()*factor/10;
660 }
661 diff = axis->pixelToCoord(start) / axis->pixelToCoord(stop);
662 axis->setRange(this->m_plot->axisRect()->rangeDragAxis(orientation)->range().lower*diff, this->m_plot->axisRect()->rangeDragAxis(orientation)->range().upper*diff);
663 }
664 this->m_plot->replot();
638 }
665 }
639
666
640
667
641 void SocExplorerPlot::mouseMoveEvent(QMouseEvent *event)
668 void SocExplorerPlot::mouseMoveEvent(QMouseEvent *event)
642 {
669 {
643 if(mouse_hold)
670 if(mouse_hold)
644 {
671 {
645 QCPAxis* Haxis = this->m_plot->axisRect()->rangeDragAxis(Qt::Horizontal);
672 QCPAxis* Haxis = this->m_plot->axisRect()->rangeDragAxis(Qt::Horizontal);
646 QCPAxis* Vaxis = this->m_plot->axisRect()->rangeDragAxis(Qt::Vertical);
673 QCPAxis* Vaxis = this->m_plot->axisRect()->rangeDragAxis(Qt::Vertical);
647 double diff = Haxis->pixelToCoord(mDragStart.x()) - Haxis->pixelToCoord(event->pos().x());
674 // double diff = rangeDragHorzAxis->pixelToCoord(mDragStart.x()) / rangeDragHorzAxis->pixelToCoord(event->pos().x());
648 Haxis->setRange(DragStartHorzRange.lower+diff, DragStartHorzRange.upper+diff);
675 // rangeDragHorzAxis->setRange(mDragStartHorzRange.lower*diff, mDragStartHorzRange.upper*diff);
649 diff = Vaxis->pixelToCoord(mDragStart.y()) - Vaxis->pixelToCoord(event->pos().y());
676 double diff=0;
650 Vaxis->setRange(DragStartVertRange.lower+diff, DragStartVertRange.upper+diff);
677 if(this->m_plot->xAxis->scaleType() == QCPAxis::stLinear)
651 this->m_plot->replot();
678 {
679 diff = Haxis->pixelToCoord(mDragStart.x()) - Haxis->pixelToCoord(event->pos().x());
680 Haxis->setRange(DragStartHorzRange.lower+diff, DragStartHorzRange.upper+diff);
681 }
682 else if(this->m_plot->xAxis->scaleType() == QCPAxis::stLogarithmic)
683 {
684 diff = Haxis->pixelToCoord(mDragStart.x()) / Haxis->pixelToCoord(event->pos().x());
685 Haxis->setRange(DragStartHorzRange.lower*diff, DragStartHorzRange.upper*diff);
686 }
687 if(this->m_plot->yAxis->scaleType() == QCPAxis::stLinear)
688 {
689 diff = Vaxis->pixelToCoord(mDragStart.y()) - Vaxis->pixelToCoord(event->pos().y());
690 Vaxis->setRange(DragStartVertRange.lower+diff, DragStartVertRange.upper+diff);
691 }
692 else if(this->m_plot->yAxis->scaleType() == QCPAxis::stLogarithmic)
693 {
694 diff = Vaxis->pixelToCoord(mDragStart.y()) / Vaxis->pixelToCoord(event->pos().y());
695 Vaxis->setRange(DragStartVertRange.lower*diff, DragStartVertRange.upper*diff);
696 }
697 this->m_plot->replot();
652 }
698 }
653 if (mRubberBand->isVisible())
699 if (mRubberBand->isVisible())
654 {
700 {
655 mRubberBand->setGeometry(QRect(mOrigin, event->pos()).normalized());
701 mRubberBand->setGeometry(QRect(mOrigin, event->pos()).normalized());
656 }
702 }
657 QWidget::mouseMoveEvent(event);
703 QWidget::mouseMoveEvent(event);
658 }
704 }
659
705
660
706
General Comments 0
You need to be logged in to leave comments. Login now