-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProgramGuiWindow.h
130 lines (102 loc) · 3.1 KB
/
ProgramGuiWindow.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
#ifndef PROGRAMGUIWINDOW_H
#define PROGRAMGUIWINDOW_H
#include <QWidget>
#include <QPushButton>
#include <QCheckBox>
#include <QLabel>
#include <QTextEdit>
#include <QComboBox>
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
#include <QTabWidget>
#include <QDoubleSpinBox>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
class QextSerialPort;
class QextSerialEnumerator;
// A window with a basic text area for entering and editing a program.
class ProgramGuiWindow : public QWidget
{
Q_OBJECT
// Program editor
QTextEdit* m_texteditProgram;
// Plot from simulation
QwtPlot *m_plot;
QVector<QwtPlotCurve *> m_curves;
QVector<QVector<QPointF> > m_points;
// status display
QTextEdit* m_texteditStatus;
// bottom buttons
QPushButton* m_buttonHelp;
QPushButton* m_buttonNew;
QPushButton* m_buttonOpen;
QPushButton* m_buttonSave;
QPushButton* m_buttonSimulate;
QLabel* m_labelPort;
QComboBox* m_comboPort;
QCheckBox* m_checkboxLock;
QPushButton* m_buttonRun;
// the serial port
QextSerialPort* m_port;
QextSerialEnumerator* m_portEnumerator;
// the tab container
QTabWidget* m_tabsOutput;
QTabWidget* m_tabsProgram;
// the traditional controls
QWidget* m_widgetTraditional;
QLabel* m_labelChannel;
QSlider* m_sliderChannel;
QSpinBox* m_spinChannel;
QLabel* m_labelPulseWidth;
QSlider* m_sliderPulseWidth;
QDoubleSpinBox* m_spinPulseWidth;
QComboBox* m_comboPulseWidth;
QLabel* m_labelPulseTrain;
QCheckBox* m_checkboxPulseTrain;
QLabel* m_labelPulseFrequency;
QSlider* m_sliderPulseFrequency;
QDoubleSpinBox* m_spinPulseFrequency;
QComboBox* m_comboPulseFrequency;
QLabel* m_labelTrainDuration;
QSlider* m_sliderTrainDuration;
QDoubleSpinBox* m_spinTrainDuration;
QComboBox* m_comboTrainDuration;
QLabel* m_labelNumTrains;
QSlider* m_sliderNumTrains;
QSpinBox* m_spinNumTrains;
QLabel* m_labelTrainDelay;
QSlider* m_sliderTrainDelay;
QDoubleSpinBox* m_spinTrainDelay;
QComboBox* m_comboTrainDelay;
QLabel* m_labelTraditionalProgram;
QTextEdit* m_texteditTraditionalProgram;
// lines buffered to send to the device
QStringList m_sendBuffer;
private Q_SLOTS:
void help();
void newDocument();
void open();
void save();
void simulate();
void run();
void changePulseWidth(int newVal);
void changePulseWidth(double newVal);
void changePulseFrequency(int newVal);
void changePulseFrequency(double newVal);
void changeTrainDuration(int newVal);
void changeTrainDuration(double newVal);
void changeTrainDelay(int newVal);
void changeTrainDelay(double newVal);
void onNewSerialData();
void onLockStateChanged(int state);
void updateTraditionalDisabledControls();
void updateFrequencyControlsRange();
void repopulatePortComboBox();
void updateEquivalentProgram();
public:
ProgramGuiWindow(QWidget* parent = NULL);
virtual QSize sizeHint() const;
void updateProgramName(const QString& name);
};
#endif /* PROGRAMGUIWINDOW_H */