-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainWindow.h
82 lines (68 loc) · 1.68 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QRadioButton>
class QComboBox;
class QPushButton;
class QLineEdit;
class QLabel;
class QVBoxLayout;
class QHBoxLayout;
class QTextEdit;
class QErrorMessage;
class QCheckBox;
class QGridLayout;
class MainWindow : public QMainWindow
{
Q_OBJECT
static const int ReceiveCycle=20;
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void comSwitch();
void autoSend();
void ReceiveData();
private:
void createUartBoxs();
void updateComBox(const QList<QSerialPortInfo> &now);
QTimer *updateSerialInfo;
QComboBox *ComBox;
QComboBox *BaudBox;
QComboBox *ParityBox;
QComboBox *ByteSizeBox;
QComboBox *StopBitBox;
QPushButton *UartSwitch;
QString getComName(const QString &ComBoxText);
QTextEdit *ReceiveBox;
QPushButton *ReceiveBoxClean;
QCheckBox *DisplayByHex;
QButtonGroup *CodeSet;
QRadioButton *UseGB;
QRadioButton *UseUTF;
void sendData();
QTextEdit *SendBox;
QPushButton *SendData;
QCheckBox *SendInHex;
QLabel *SendTimeMs;
QLineEdit *SendTimeSet;
QCheckBox *SendByTime;
QTimer *SendTimer;
bool fComOpen=false;
void createUartLabels();
QLabel *ComLabel;
QLabel *BaudLabel;
QLabel *ParityLabel;
QLabel *ByteSizeLabel;
QLabel *StopBitLabel;
void createUartLayout();
QGridLayout *mainLayout;
QErrorMessage *ErrorDialog;
QSerialPort ser;
QTimer *ReceiveTimer;
};
bool operator==(const QSerialPortInfo &lhs,const QSerialPortInfo &rhs);
#endif // MAINWINDOW_H