forked from EspoTek/Labrador
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
308 lines (240 loc) · 8.45 KB
/
mainwindow.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
304
305
306
307
308
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QActionGroup>
#include <QAction>
#include <QShortcut>
#include <QFont>
#include <QDateTime>
#include <QDir>
#include <QFile>
#include <QThread>
#include <QPalette>
#include <QDebug>
#include <QBrush>
#include <QGridLayout>
#include <math.h>
#include "qcustomplot.h"
#include "platformspecific.h"
#include "qcustomplot.h"
#include "ui_mainwindow.h"
#include "scoperangeenterdialog.h"
//#include "isobuffer.h"
#include "q_debugstream.h"
#include "pinchcatcher.h"
//The Main Window object. This has a lot of control information too (keyboard shortcuts etc.)!
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void resizeEvent(QResizeEvent *event);
void showFileDialog(QString *fileName);
void openFileDialog(QString *fileName);
private slots:
//Oscilloscope
void on_actionGain0_5_triggered();
void on_actionGain1_triggered();
void on_actionGain2_triggered();
void on_actionGain4_triggered();
void on_actionGain8_triggered();
void on_actionGain16_triggered();
void on_actionGain32_triggered();
void on_actionGain64_triggered();
void on_actionGainAuto_triggered();
void on_actionCursor_Stats_triggered(bool checked);
void on_actionAutomatically_Enable_Cursors_toggled(bool arg1);
void on_action60FPS_toggled(bool enabled);
void on_action30FPS_toggled(bool enabled);
void on_action20FPS_toggled(bool enabled);
void on_action15FPS_toggled(bool enabled);
void on_action10FPS_toggled(bool enabled);
void on_action5FPS_toggled(bool enabled);
void on_actionSnap_to_Cursors_triggered();
void on_actionEnter_Manually_triggered();
void connectDisplaySignals();
void calibrateStage2();
void calibrateStage3();
//Logic Analyzer
void on_action300_toggled(bool arg1);
void on_action600_toggled(bool arg1);
void on_action1200_toggled(bool arg1);
void on_action2400_toggled(bool arg1);
void on_action4800_toggled(bool arg1);
void on_action9600_toggled(bool arg1);
void on_action14400_toggled(bool arg1);
void on_action19200_toggled(bool arg1);
void on_action28800_toggled(bool arg1);
void on_action38400_toggled(bool arg1);
void on_action57600_toggled(bool arg1);
void on_action115200_toggled(bool arg1);
void on_action300_2_toggled(bool arg1);
void on_action600_2_toggled(bool arg1);
void on_action1200_2_toggled(bool arg1);
void on_action2400_2_toggled(bool arg1);
void on_action4800_2_toggled(bool arg1);
void on_action9600_2_toggled(bool arg1);
void on_action14400_2_toggled(bool arg1);
void on_action19200_2_toggled(bool arg1);
void on_action28800_2_toggled(bool arg1);
void on_action38400_2_toggled(bool arg1);
void on_action57600_2_toggled(bool arg1);
void on_action115200_2_toggled(bool arg1);
void cycleBaudRate_CH1();
void cycleBaudRateBackwards_CH1();
void cycleBaudRate_CH2();
void cycleBaudRateBackwards_CH2();
//Deprecated/Unsupported
void timeBaseNeedsChanging(bool positive);
void on_actionForce_Square_triggered(bool checked);
void helloWorld();
//Keyboard Shortcuts
void arrowUpTriggered();
void arrowDownTriggered();
void ctrlArrowUpTriggered();
void ctrlArrowDownTriggered();
void cycleDelayLeft();
void cycleDelayRight();
void cycleDelayLeft_large();
void cycleDelayRight_large();
void enableLabradorDebugging();
//Power Supply
void on_actionAuto_Lock_toggled(bool arg1);
//File/other
void on_actionRecord_triggered(bool checked);
void on_actionTake_Snapshot_triggered();
void reinitUsb(void);
void reinitUsbStage2(void);
void resetUsbState(void);
void rSourceIndexChanged(int newSource);
void multimeterStateChange(bool state);
#ifdef PLATFORM_ANDROID
//Android Special
void on_actionOld_Person_Mode_triggered(bool checked);
void screenRotateEvent(Qt::ScreenOrientation orientation);
bool eventFilter(QObject *obj, QEvent *event);
bool gestureFilter(QGestureEvent *event);
void horiScaleEvent(bool enabled);
void vertScaleEvent(bool enabled);
void dpiAutoScaling();
void on_androidMenuButton_clicked();
#endif
void on_actionCalibrate_triggered();
void on_actionLo_bw_triggered();
void on_actionSingle_ep_msync_triggered();
void on_actionSingle_ep_async_triggered();
void on_actionSnapshot_CH1_triggered();
void on_actionSnapshot_CH2_triggered();
void on_actionRecord_CH1_triggered(bool checked);
void on_actionRecord_CH2_triggered(bool checked);
void serialEmergencyDisable(int channel);
void on_actionFirmware_Recovery_triggered();
void on_actionShow_Debug_Console_triggered();
void on_actionDAQ_Settings_triggered();
void fileLimitReached_CH1(void);
void fileLimitReached_CH2(void);
void daq_updatedAveraging(int newVal);
void daq_updatedMaxFileSize(qulonglong newVal);
void daq_saveButtonPressed();
void on_actionAbout_triggered();
void on_actionOpen_DAQ_File_triggered();
void on_actionQuit_triggered();
void on_kickstartIsoButton_clicked();
void on_actionCalibrate_2_triggered();
void calibrate_psu_stage2();
void calibrate_psu_stage3();
void on_actionSerial_triggered(bool checked);
void on_actionI2C_triggered(bool checked);
void on_actionShow_Range_Dialog_on_Main_Page_triggered(bool checked);
void paused(bool enabled);
void on_actionNone_triggered();
void on_actionNone_2_triggered();
void on_actionEven_triggered();
void on_actionOdd_triggered();
void on_actionEven_2_triggered();
void on_actionOdd_2_triggered();
void on_actionDocumentation_triggered();
void on_actionPinout_triggered();
void cursorGroupEnabled(bool enabled);
void on_actionHide_Widget_Oscilloscope_triggered(bool checked);
void on_actionHide_Widget_SignalGen_triggered(bool checked);
void on_actionHide_Widget_Multimeter_triggered(bool checked);
void on_actionHide_Widget_PowerSupply_triggered(bool checked);
void on_actionHide_Widget_LogicAnalyzer_triggered(bool checked);
private:
//Generic Vars
Ui::MainWindow *ui;
QWheelEvent *wheelEmu;
bool forceSquare = false;
QCPItemText *textLabel;
QFile *output375_CH1, *output375_CH2, *output750;
unsigned char caibrateStage;
QMessageBox *calibrationMessages;
double PSU5, PSU10;
double psu_voltage_calibration_offset;
int reinitdeviceMode;
double reinitScopeGain;
double reinitCurrentPsuVoltage;
int reinitDigitalPinState;
QSettings *settings;
bool calibrationCanceled = false;
//Generic Functions
void initialisePlot();
void labelPsu();
void menuSetup();
void initShortcuts();
void readSettingsFile();
//Shortcut pointers
QActionGroup *gainGroup;
QActionGroup *rangeGroupV;
QActionGroup *rangeGroupI;
QActionGroup *rangeGroupR;
QActionGroup *rangeGroupC;
QActionGroup *uartBaudGroup_CH1;
QActionGroup *uartBaudGroup_CH2;
QActionGroup *uartParityGroup_CH1;
QActionGroup *uartParityGroup_CH2;
QActionGroup *fpsGroup;
QActionGroup *connectionTypeGroup;
QActionGroup *serialProtocolGroup;
QShortcut *shortcut_cycleBaudRate_CH1;
QShortcut *shortcut_cycleBaudRateBackwards_CH1;
QShortcut *shortcut_cycleBaudRate_CH2;
QShortcut *shortcut_cycleBaudRateBackwards_CH2;
QShortcut *shortcut_ArrowUp;
QShortcut *shortcut_ArrowDown;
QShortcut *shortcut_CtrlArrowUp;
QShortcut *shortcut_CtrlArrowDown;
QShortcut *shortcut_w;
QShortcut *shortcut_ctrlW;
QShortcut *shortcut_s;
QShortcut *shortcut_ctrlS;
QShortcut *shortcut_a;
QShortcut *shortcut_d;
QShortcut *shortcut_ArrowLeft;
QShortcut *shortcut_ArrowRight;
QShortcut *shortcut_CtrlArrowLeft;
QShortcut *shortcut_CtrlArrowRight;
QShortcut *shortcut_snapScopeToCursors;\
QShortcut *shortcut_manualRange;
QShortcut *shortcut_snapshot_CH1;
QShortcut *shortcut_snapshot_CH2;
QShortcut *shortcut_Debug;
QShortcut *shortcut_Esc;
//Duct Tape
bool dt_AlreadyAskedAboutCalibration = false;
int dt_userWantsToCalibrate;
int daq_num_to_average;
qulonglong daq_max_file_size;
scopeRangeEnterDialog* scopeRangeSwitch = nullptr;
#ifdef PLATFORM_ANDROID
//Android Special
QScreen *screenPtr;
bool scalingInTimeAxis = false;
#endif
};
#endif // MAINWINDOW_H