ImageD  v2_7_5 (24.06.22)
ImageD is an image processing software designed for rapid prototyping and implementing algorithms and solutions for science, research and teaching.
d_popup_plot.h
Go to the documentation of this file.
1 /************************************
2  * added: 08.11.2019 *
3  * author: David Eilenstein *
4  * contact: D.Eilenstein@gsi.de *
5  * project: ImageD *
6  * facility: GSI Darmstadt, Ger *
7  ************************************/
8 
9 #ifndef D_POPUP_PLOT_H
10 #define D_POPUP_PLOT_H
11 
12 //own
13 #include <d_enum.h>
14 #include <d_plot.h>
15 
16 //general
17 #include <vector>
18 
19 //Qt
20 #include <QDialog>
21 #include <QString>
22 #include <QStringList>
23 #include <QDebug>
24 #include <QMessageBox>
25 #include <QtCharts/QChartView>
26 #include <QtCharts/QChart>
27 #include <QGridLayout>
28 #include <QComboBox>
29 
30 //namespaces
31 using namespace std;
32 
33 namespace Ui {
34 class D_Popup_Plot;
35 }
36 
41 class D_Popup_Plot : public QDialog
42 {
43  Q_OBJECT
44 
45 public:
46  explicit D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QString nameSeries, vector<double> vX, vector<double> vY, int plot_mode = c_PLOT_SIMPLE_POINT, bool as_exec = true, QWidget *parent = nullptr);
47  explicit D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QString nameSeries, vector<double> vY, int plot_mode = c_PLOT_SIMPLE_POINT, bool as_exec = true, QWidget *parent = nullptr);
48  explicit D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QStringList namesSeries, vector<vector<double>> vvX, vector<vector<double>> vvY, int plot_mode = c_PLOT_SIMPLE_POINT, bool as_exec = true, QWidget *parent = nullptr);
49  explicit D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QStringList namesSeries, vector<vector<double>> vvY, int plot_mode = c_PLOT_SIMPLE_POINT, bool as_exec = true, QWidget *parent = nullptr);
50  ~D_Popup_Plot();
51 
52 private slots:
53  void Plot();
54 
55 private:
56  Ui::D_Popup_Plot *ui;
57 
58  void Init_Ui(QString QS_Titel, int init_PlotMode, bool as_exec);
59  void Populate_CB_Single(QComboBox *CB, QStringList QSL, int index_init);
60 
61 
62 
63  QChartView *pChartView;
64 
65  //data
66  vector<vector<double>> vvData_X;
67  vector<vector<double>> vvData_Y;
68  QString QS_NamePlot;
69  QString QS_Name_X;
70  QString QS_Name_Y;
71  QStringList QSL_NamesSeries;
72 
73  //error handling
74  D_Error_Handler ER;
75  void ERR(int err, QString func = "not specified", QString detail = "not specified");
76 };
77 
78 #endif // D_POPUP_PLOT_H
D_Popup_Plot::D_Popup_Plot
D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QStringList namesSeries, vector< vector< double >> vvX, vector< vector< double >> vvY, int plot_mode=c_PLOT_SIMPLE_POINT, bool as_exec=true, QWidget *parent=nullptr)
d_plot.h
D_Popup_Plot
The D_Popup_Plot class WIP.
Definition: d_popup_plot.h:42
QSL_PLOT_SIMPLE
const QStringList QSL_PLOT_SIMPLE
Definition: d_enum.h:392
c_VIS_TRAFO_LINEAR
@ c_VIS_TRAFO_LINEAR
Definition: d_enum.h:697
D_Popup_Plot::D_Popup_Plot
D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QStringList namesSeries, vector< vector< double >> vvY, int plot_mode=c_PLOT_SIMPLE_POINT, bool as_exec=true, QWidget *parent=nullptr)
D_Error_Handler::ERR
void ERR(int err, QString sender, QString func, QString detail)
D_Error_Handler::ERR pops an error message if an error occured and/or streams it to a csv file.
Definition: d_error_handler.cpp:23
c_PLOT_SIMPLE_POINT
@ c_PLOT_SIMPLE_POINT
Definition: d_enum.h:385
QSL_VisTrafo_Crop
const QStringList QSL_VisTrafo_Crop
Definition: d_enum.h:691
d_popup_plot.h
D_Error_Handler
The D_Error_Handler class takes error codes from D_ERROR_ENUM and shows a popup if an error occures.
Definition: d_error_handler.h:38
QSL_VisTrafo
const QStringList QSL_VisTrafo
Definition: d_enum.h:702
Ui
Definition: d_analysiswindow.h:58
D_Popup_Plot::~D_Popup_Plot
~D_Popup_Plot()
Definition: d_popup_plot.cpp:80
c_VIS_TRAFO_CROP_FIXED
@ c_VIS_TRAFO_CROP_FIXED
Definition: d_enum.h:688
D_Popup_Plot::D_Popup_Plot
D_Popup_Plot(QString Title, QString nameX, QString nameY, QString namePlot, QString nameSeries, vector< double > vX, vector< double > vY, int plot_mode=c_PLOT_SIMPLE_POINT, bool as_exec=true, QWidget *parent=nullptr)
Definition: d_popup_plot.cpp:12
d_enum.h
D_Plot::Plot_AnyReal
static int Plot_AnyReal(QChartView *pChartView, vector< vector< double >> *vvX, vector< vector< double >> *vvY, QString name_title, QStringList qsl_name_series, QString name_x, QString name_y, int plot_mode=c_PLOT_SIMPLE_LINE, int mode_crop_y=c_VIS_TRAFO_CROP_DYNAMIC, double in_min_y=0, double in_max_y=255, int mode_trafo_y=c_VIS_TRAFO_LINEAR, double gamma_y=1, double center_y=0, double divisor_y=1, int mode_crop_x=c_VIS_TRAFO_CROP_DYNAMIC, double in_min_x=0, double in_max_x=255, int mode_trafo_x=c_VIS_TRAFO_LINEAR, double gamma_x=1, double center_x=0, double divisor_x=1)
Definition: d_plot.cpp:69