blob: 2b17ff346ce197d5bb0807b4f521913b040d2f2d (
plain)
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
#ifndef GUI_CLASS__H
#define GUI_CLASS__H
#include <cmath>
#include <vector>
#include <valarray>
#include <QApplication>
#include <QTextEdit>
#include <QtGui>
#include <QLabel>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <QDoubleSpinBox>
#include <QGroupBox>
#include <QGridLayout>
#include <QPushButton>
class myWindow; // forward reference
class indicator;
////////////////////////////////////////
class myPlot : public QwtPlot {
public:
std::vector<QwtPlotCurve*> curve;
QwtPlotGrid grid;
int divsPerUnit;
int need_replot;
myPlot(const QString);
// the following could be a slot, but doesn't need to be
void setReading(const int, const double, const double,
const double, const double);
int assign_curve();
void flush();
};
////////////////////////////////////////
class scaleBoxer : public QDoubleSpinBox {
public:
indicator* parent;
virtual void stepBy(int);
scaleBoxer(indicator* parent);
};
////////////////////////////////////////
class indicator : public QWidget {
Q_OBJECT;
// Note: Q_SLOTS is #defined to be nothing.
// Slots are handlers for inbound signals.
public Q_SLOTS:
void setIndication(const double, const double, const double, const double);
public:
QGroupBox* group;
QGridLayout* layout;
QLabel* rpLabel;
QDoubleSpinBox* rpBox;
QLabel* ipLabel;
QDoubleSpinBox* ipBox;
QLabel* magLabel;
QDoubleSpinBox* magBox;
QLabel* phaseLabel;
QDoubleSpinBox* phaseBox;
QLabel* scaleLabel;
scaleBoxer* scaleBox;
myPlot* plot;
int plotcur; // which "curve" to use within the plot
int locker;
indicator(myPlot* plot, int locker = 0);
void setDecim(const double newval);
};
////////////////////////////////////////
class blockOfIndicators : public QWidget {
public:
QGroupBox* group;
QVBoxLayout* layout;
blockOfIndicators(myWindow*, myPlot*);
};
////////////////////////////////////////
class rslt_panel : public QWidget {
public:
myWindow* topWin;
QGroupBox* group;
QHBoxLayout* layout;
blockOfIndicators* block;
myPlot* plot;
rslt_panel(myWindow*);
};
////////////////////////////////////////
class entrails_grouper : public QWidget {
Q_OBJECT
public Q_SLOTS:
void VoChanged(double);
void ViChanged(double);
void rateChanged(double);
void timeShiftChanged(double);
void phaseShiftChanged(double);
void tweakButtonClicked();
public:
myWindow* topwin;
QGroupBox* group;
QVBoxLayout* layout;
QLabel* VoCalLabel;
QDoubleSpinBox* VoCalBox;
QLabel* ViCalLabel;
QDoubleSpinBox* ViCalBox;
QLabel* rateLabel;
QDoubleSpinBox* rateBox; // goal rate
QLabel* actRateLabel;
QDoubleSpinBox* actRateBox; // actual rate
QLabel* pcmLabel;
QDoubleSpinBox* pcmBox;
QLabel* timeShiftLabel;
QDoubleSpinBox* timeShiftBox; // loopback time delay
QLabel* phaseShiftLabel;
QDoubleSpinBox* phaseShiftBox; // loopback phase lag
QPushButton* tweakButton;
static const int tweakSize = 10;
std::valarray<double> tweakFreq;
std::valarray<double> tweakPhase;
unsigned int tweakPtr;
unsigned int howmany;
entrails_grouper(myWindow*);
};
////////////////////////////////////////
class refOut_grouper : public QWidget {
Q_OBJECT
public Q_SLOTS:
void freqChanged(double);
void ampChanged(double);
public:
myWindow* topwin;
QGroupBox* group;
QVBoxLayout* layout;
QLabel* freqLabel;
QDoubleSpinBox* freqBox; // goal frequency
QLabel* actFreqLabel;
QDoubleSpinBox* actFreqBox; // actual frequency
QLabel* dBLabel;
QDoubleSpinBox* dBBox; // amplitude in dB
QLabel* VLabel;
QDoubleSpinBox* VBox; // amplitude in V
refOut_grouper(myWindow*);
};
////////////////////////////////////////
class ctrl_column : public QWidget {
Q_OBJECT;
public:
QGroupBox* group;
QVBoxLayout* layout;
refOut_grouper* refOutGroup;
entrails_grouper* entrailsGroup;
ctrl_column(myWindow* _parent);
// hack
// something trivial we can instantiate, to persuade the compiler to
// instantiate (emit) "vtables" for everything in this file:
ctrl_column(int){};
};
//////////////////////////////////////
class timer : public QWidget{
public:
timer(QWidget *parent = 0);
void timerEvent(QTimerEvent *event);
};
////////////////////////////////////////
class myWindow : public QWidget {
Q_OBJECT
public:
myWindow();
QHBoxLayout* topLayout;
QDoubleSpinBox* updRateBox;
QLabel* updRateLabel;
static const int numRsltPanels = 1;
ctrl_column* ctrlCol;
rslt_panel* rsltPanel[numRsltPanels];
std::vector<indicator*> ndc8r;
timer* frameTimer;
void actualFreqs();
public slots:
void flush();
};
#endif /* GUI_CLASS__H */
|