-
Notifications
You must be signed in to change notification settings - Fork 1
/
DigitalOscilloscope.h
92 lines (78 loc) · 2 KB
/
DigitalOscilloscope.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
#ifndef DIGITALOSCILLOSCOPE_H
#define DIGITALOSCILLOSCOPE_H
#include <QMainWindow>
#include "SerialSamplingThread.h"
#include "qwt_system_clock.h"
#include "RecvDatabBase.h"
#include "QFile"
////////////////////////////////
//
class QTimer;
class QextSerialPort;
class QextSerialEnumerator;
///////////////////////////////
//
class WheelBox;
namespace Ui {
class DigitalOscilloscope;
}
class DigitalOscilloscope : public QMainWindow
{
Q_OBJECT
public:
explicit DigitalOscilloscope(QWidget *parent = 0);
~DigitalOscilloscope();
/////////////////////////////////////////////////////////
//
private:
void initCOMList();
void initBaudRateList();
void initDataBitList();
void initParityList();
void initStopBitList();
void initQueryModel();
//////////////////////////////////////////////////////////
//
private Q_SLOTS:
void onPortNameChanged(const QString &name);
void onBaudRateChanged(int idx);
void onParityChanged(int idx);
void onDataBitsChanged(int idx);
void onStopBitsChanged(int idx);
void onTimeoutChanged(int val);
void onQueryModeChanged(int idx);
void onOpenCloseButtonClicked();
void onReadyRead();
void onPortAddedOrRemoved();
void start();
void setInterval(double val);
void on_action_Quit_triggered();
void on_action_Qt_triggered();
void on_action_About_triggered();
Q_SIGNALS:
void signalIntervalChanged(double);
public:
double signalInterval() const;
/////////////////////////////////////////////
//
private:
Ui::DigitalOscilloscope *ui;
///////////////////////////////////
//
QTimer *timer;
QextSerialPort *port;
QextSerialEnumerator *enumerator;
// RecvDatabBase *recvDatabase;
QFile *file;
QTextStream out;
///////////////////////////////////
//
WheelBox *d_timerWheel;
// WheelBox *d_intervalWheel;
// SerialSamplingThread *samplingThread;
QwtSystemClock clock;
double interval;
double time;
int line;
};
#endif // DIGITALOSCILLOSCOPE_H