-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathattys-scope.h
303 lines (235 loc) · 5.12 KB
/
attys-scope.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
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
class Attys_scope;
#ifndef ATTYS_SCOPE_H
#define ATTYS_SCOPE_H
#include <QWidget>
#include <QPainter>
#include <QApplication>
#include <QPushButton>
#include <QCheckBox>
#include <QLayout>
#include <QLineEdit>
#include <QGroupBox>
#include <QLabel>
#include <QScrollArea>
#include <QSettings>
#include <qsplashscreen.h>
#include <qpointer.h>
#include <qfont.h>
#include "scopewindow.h"
#include "gain.h"
#include "channel.h"
#include "special.h"
#include "current.h"
#include "highpass.h"
#include "lowpass.h"
#include "bandstop.h"
#include "recbutton.h"
#include "samplingrate.h"
#include "AttysComm.h"
#include "AttysScan.h"
#include "audiobeep.h"
#include "pythonpipe.h"
#include "acceleration.h"
// version number
#define VERSION "2.6.2"
#define ATTYS_STRING "ATTYS"
#define PROGRAM_NAME "attys-scope"
#define EXECUTABLE_NAME "attys-scope"
struct AttysScanMsg : public AttysScanListener {
QSplashScreen* splash = NULL;
QApplication* app = NULL;
virtual void message(const int, const char * msg) {
fprintf(stderr,"%s\n",msg);
if (splash) {
splash->showMessage(msg);
if (app) {
app->processEvents();
}
}
}
};
class Attys_scope : public QWidget
{
Q_OBJECT
public:
/**
* Constructor
**/
Attys_scope( QWidget *parent,
int ignoreSettings = 0
);
/**
* Destructor
**/
~Attys_scope();
public:
/**
* Sets the filename for the data-file
**/
void setFilename(QString fn,int csv);
public:
void enableControls();
void disableControls();
/**
* Button which controls recording
**/
QPointer<RecButton> recCheckBox;
/**
* Array for the special settings
**/
QPointer<Special>** special;
/**
* Array for the current setting
**/
QPointer<Current>* current;
/**
* Array for the acceleration
**/
QPointer<Acceleration>* acceleration;
/**
* Global sampling rate setting
**/
QPointer<SamplingRate> samplingRate;
/**
* channel label
**/
QPointer<QLabel>** channelLabel;
public:
/**
* Array for the channel settings
**/
QPointer<Channel>** channel;
/**
* Array for the gain settings
**/
QPointer<Gain>** gain;
/**
* highpass filter
**/
QPointer<Highpass>** highpass;
/**
* lowpass filter
**/
QPointer<Lowpass>** lowpass;
/**
* lowpass filter
**/
QPointer<Bandstop>** bandstop;
/**
* The widget which contains the graphical plots of the AD-data
**/
QPointer<ScopeWindow> attysScopeWindow;
/**
* Text-field: elapsed time
**/
QPointer<QLineEdit> timeInfoLineEdit;
/**
* Text-field for the file-name
**/
QPointer<QPushButton> filePushButton;
/**
* switches on a tone when starting/stopping recording
**/
QPointer<QCheckBox> toneCheckBox;
private:
/**
* Button: Increase the time between samples
**/
QPointer<QPushButton> tbIncPushButton;
/**
* Button: Decrease the time between samples
**/
QPointer<QPushButton> tbDecPushButton;
/**
* Text-field: time between samples
**/
QPointer<QLineEdit> tbInfoLineEdit;
/**
* Button: clears the screen
**/
QPointer<QPushButton> clearScreenPushButton;
public:
void slotSaveSettings();
void slotLoadSettings();
void slotRunPython();
void slotStopPython();
void slotLogPython() {logWindow->show();};
private:
/**
* Button to increase the time-base has been pressed
**/
void incTbEvent();
/**
* Reset screen
**/
void resetTbEvent();
/**
* Button to decrease the time-base has been pressed
**/
void decTbEvent();
/**
* Enter a new filename
**/
void enterFileName();
/**
* Pressing or releasing the record button
**/
void recstartstop(int);
public:
/**
* Called when the UDP transmission is on/off
**/
void slotStartUDP();
void slotStopUDP();
private:
int udpPort = 65000;
void specialChanged();
/**
* Called if a change in the time-base has occurred
**/
void changeTB();
/**
* returns the timebase
**/
public:
int getTB() {return tb_us;};
private:
/**
* Time between two samples in ms
**/
int tb_us;
/**
* Layout which keeps one channel together
**/
QPointer<QHBoxLayout>** hbox;
QPointer<QHBoxLayout>* specialLayout;
QPointer<QLabel> statusLabel;
QPointer<QLabel> filenameLabel;
QPointer<QVBoxLayout> controlLayout;
QPointer<QVBoxLayout> scopeLayout;
QPointer<QScrollArea> allChScrollArea;
QPointer<QVBoxLayout> allChScrollLayout;
QPointer<QGridLayout> allChLayout;
QPointer<QGroupBox> allChGroup;
QPointer<QHBoxLayout> mainLayout;
QPointer<QVBoxLayout> restLayout;
QPointer<QGroupBox> restGroup;
QPointer<QHBoxLayout> tbLayout;
QPointer<QHBoxLayout> statusLayout;
QPointer<QHBoxLayout> recLayout;
QPointer<QLabel> recLabel;
QPointer<QLabel> tbLabel;
QFont* voltageFont;
QFont* tbFont;
private:
void readSettings(QSettings &settings);
void writeSettings(QSettings &settings);
public:
void setInfo(const char* txt);
private:
int restartInfo = 1;
char status[256];
AudioBeep* audiobeep;
LogWindow* logWindow;
};
#endif