forked from machinekoder/PhyxCalc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotwindow.h
185 lines (143 loc) · 4.74 KB
/
plotwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**************************************************************************
**
** This file is part of PhyxCalc.
**
** PhyxCalc is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** PhyxCalc is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with PhyxCalc. If not, see <http://www.gnu.org/licenses/>.
**
***************************************************************************/
#ifndef PLOTWINDOW_H
#define PLOTWINDOW_H
#include <QMainWindow>
#include <QFileDialog>
#include <QListWidgetItem>
#include <QPrinter>
#include <QPrintDialog>
#include <QColorDialog>
#include <QImageWriter>
#include <QApplication>
#include <QDesktopWidget>
#include <QClipboard>
#include <QCloseEvent>
#include <QShowEvent>
#include <QRadioButton>
#include <QToolButton>
#include <QCheckBox>
#include <QSignalMapper>
#include <QDebug>
#include <qwt_plot.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_picker.h>
#include <qwt_picker_machine.h>
#include <qwt_symbol.h>
#include <qwt_legend.h>
#include <qwt_scale_widget.h>
#include <qwt_scale_div.h>
#include <qwt_scale_engine.h>
#if QWT_VERSION >= 0x060000
#include <qwt_plot_renderer.h>
#endif
#ifdef QT_SVG_LIB
#include <QSvgGenerator>
#endif
#include "phyxvariablemanager.h"
#include "global.h"
namespace Ui {
class PlotWindow;
}
class PlotWindow : public QMainWindow
{
Q_OBJECT
Q_PROPERTY(PhyxVariableManager::PhyxDatasetList *datasets READ datasets WRITE setDatasets)
protected:
void closeEvent(QCloseEvent *event);
void showEvent (QShowEvent * event);
public:
explicit PlotWindow(QWidget *parent = 0);
~PlotWindow();
PhyxVariableManager::PhyxDatasetList * datasets() const
{
return m_datasets;
}
public slots:
void setDatasets(PhyxVariableManager::PhyxDatasetList * arg)
{
m_datasets = arg;
updateDatasetTable();
}
private slots:
void updatePlots();
void updateMarkers();
void updateSettings();
void updatePixels();
void updateMMs();
void deleteDataset(int index);
void renameDataSet(int row, int column);
void copyToClipboard();
void saveDocument();
void printPlot();
void on_colorBackgroundButton_clicked();
void on_colorBackgroundDeleteButton_clicked();
void on_colorGridButton_clicked();
void on_colorGridDeleteButton_clicked();
void on_colorAxisTicksButton_clicked();
void on_colorAxisTicksDeleteButton_clicked();
void on_colorAxisFontButton_clicked();
void on_colorAxisFontDeleteButton_clicked();
void on_colorGridMinButton_clicked();
void on_colorGridMinDeleteButton_clicked();
void on_lineColorButton_clicked();
void on_colorPlotBackgroundButton_clicked();
void on_colorPlotBackgroundDeleteButton_clicked();
void on_settingsYLAutoscaleCheck_toggled(bool checked);
void on_settingsYRAutoscaleCheck_toggled(bool checked);
void on_settingsXBAutoscaleCheck_toggled(bool checked);
void on_settingsXTAutoscaleCheck_toggled(bool checked);
void on_exportCurrentButton_clicked();
void on_mobileSettingsButton_clicked(bool checked);
void on_colorMarkerLineButton_clicked();
void on_colorMarkerLineDeleteButton_clicked();
void on_colorMarkerSymbolButton_clicked();
void on_colorMarkerSymbolDeleteButton_clicked();
private:
Ui::PlotWindow *ui;
PhyxVariableManager::PhyxDatasetList * m_datasets;
QList<QwtPlotCurve*> plotCurves;
QList<QwtPlotMarker*> plotMarkers;
QwtPlotGrid *plotGrid;
QwtPlotZoomer *plotZoomer;
QwtPlotPicker *plotPicker;
QwtLegend *legend;
QList<QCheckBox*> visibiltyCheckList;
QList<QRadioButton*> xBRadioList;
QList<QRadioButton*> xTRadioList;
QList<QRadioButton*> yLRadioList;
QList<QRadioButton*> yRRadioList;
QList<QButtonGroup*> xGroupList;
QList<QButtonGroup*> yGroupList;
QList<QToolButton*> deleteButtonList;
QSignalMapper *deleteSignalMapper;
void initializeGUI();
void updateDatasetTable();
void plotDataset(int index, int xAxis, int yAxis);
void deletePlots();
void deleteDatasetTableItems();
void setButtonColor(QPushButton *button, QColor color);
signals:
void visibilityChanged(bool);
};
#endif // PLOTWINDOW_H