-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainview.h
184 lines (132 loc) · 4.31 KB
/
mainview.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
#ifndef MAINVIEW_H
#define MAINVIEW_H
// Qt
#include <QMainWindow>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QCheckBox>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QGraphicsView>
#include <QLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QFont>
#include <QComboBox>
// Qwt
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_text.h>
#include <qwt_scale_engine.h>
#include <qwt_interval.h>
#include <qwt_plot_panner.h>
#include <qwt_plot_magnifier.h>
#include <qwt_series_data.h>
/////////////////////////////////////////////////////
// NOTES
/////////////////////////////////////////////////////
/// Document on fast QImage display:
/// http://www.qtcentre.org/threads/6929-Any-fast-way(-lt-10ms)-to-display-640*480-QImage-on-QGraphicsScene
///
/// Need to change way the UI is updated. Should create QTimer object for each UI element that is updated
/// and call a function update() when the timer is ready (through signal and slot connections). Then,
/// the UI needs to have a reference/pointer to the source of the data that it is responsible for displaying.
/// This reference/pointer should point to data allocated on the heap. Allocation occurs in the relevant ____model.
/// This significantly reduces the complexity of the UI calls.
namespace Ui {
class MainView;
}
class MainView : public QMainWindow
{
Q_OBJECT
public:
explicit MainView(QWidget *parent = 0);
~MainView();
// UI Elements
///////////////////////////////////////////
// Fonts
///////////////////////////////////////////
QFont* major_label_font_;
QFont* minor_label_font_;
QFont* button_font_;
QFont* checkbox_font_;
///////////////////////////////////////////
// Syringe
///////////////////////////////////////////
// Main label
QLabel* syringe_label_;
// Buttons
QPushButton* syringe_local_button_;
QPushButton* syringe_remote_button_;
QPushButton* syringe_forward_button_;
QPushButton* syringe_stop_button_;
QPushButton* syringe_reverse_button_;
QPushButton* syringe_switch_button_;
QPushButton* syringe_get_rate_button_;
QPushButton* syringe_set_rate_button_;
// Labels and fields
QLabel* syringe_current_rate_label_;
QLineEdit* syringe_current_rate_field_;
QLabel* syringe_set_rate_label_;
QLineEdit* syringe_set_rate_field_;
///////////////////////////////////////////
// RP
///////////////////////////////////////////
// Label
QLabel* rp_control_label_;
// Plot and plot items
QwtPlot* rp_plot_;
QwtPlotCurve* rp_plot_curve_;
QwtPlotCurve* rp_baseline_mean_plot_curve_;
QwtPlotCurve* rp_baseline_lower_thresh_plot_curve_;
QwtPlotCurve* rp_baseline_upper_thresh_plot_curve_;
QwtPlotPanner* rp_plot_panner_;
QwtPlotMagnifier* rp_plot_magnifier_;
// Fields
QLineEdit* rp_threshold_multiplier_field_;
// Buttons
QPushButton* rp_start_button_;
QPushButton* rp_stop_button_;
QPushButton* rp_set_control_mode_button_;
QPushButton* rp_set_threshold_multiplier_button_;
///////////////////////////////////////////
// Camera
///////////////////////////////////////////
// Label
QLabel* camera_control_label_;
QLabel* camera_resolution_label_;
QLabel* camera_frame_rate_label_;
QLabel* camera_exposure_time_label_;
// ComboBox
QComboBox* camera_resolution_combo_box_;
// Fields
QLineEdit* camera_frame_rate_field_;
QLineEdit* camera_exposure_time_field_;
// Buttons
QPushButton* camera_record_button_;
QPushButton* camera_start_button_;
QPushButton* camera_stop_button_;
QPushButton* camera_set_frame_rate_button_;
QPushButton* camera_set_exposure_time_button_;
QPushButton* camera_set_parameters_button_;
QPushButton* camera_get_cine_info_button_;
// Plot
QGraphicsScene* camera_scene_;
QGraphicsPixmapItem* camera_pixmapitem_;
QGraphicsView* camera_view_;
// Miscellaneous
QPushButton* dual_record_button_;
private:
Ui::MainView *ui;
// Private objects
// Private methods
void setup();
void setup_main_view();
void setup_rp_view();
void setup_camera_view();
void setup_syringe_view();
void setup_miscellaneous_view();
void setup_layout();
};
#endif // MAINVIEW_H