-
Notifications
You must be signed in to change notification settings - Fork 1
/
serial.h
152 lines (123 loc) · 2.51 KB
/
serial.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
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QTime>
#include <QTimer>
#include <QDebug>
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QGridLayout>
#include <QtDebug>
#include <QComboBox>
#include <QMessageBox>
#include <QtGui>
#include <QTableView>
#include <QHeaderView>
#include <QTextEdit>
#include <QTextBrowser>
#include <QtSerialPort/QSerialPort>
class MySerialPort : public QWidget
{
Q_OBJECT
public:
MySerialPort(QWidget *parent = 0);
~MySerialPort();
QHBoxLayout * hl0;
QHBoxLayout * hl1;
QHBoxLayout * hl2;
QHBoxLayout * hl3;
QHBoxLayout * hl4;
QHBoxLayout * hl5;
QHBoxLayout * hl6;
QHBoxLayout * hl7;
QHBoxLayout * hl8;
QVBoxLayout * vl0;
QVBoxLayout * vl1;
QGridLayout * gl0;
QLabel * lb0;
QLabel * lb1;
QLabel * lb2;
QLabel * lb3;
QLabel * lb4;
QLabel * lb5;
QLabel * lb6;
QComboBox * cb0;
QComboBox * cb1;
QComboBox * cb2;
QComboBox * cb3;
QComboBox * cb4;
QPushButton * pb0;
QPushButton * pb1;
QPushButton * pb2;
QPushButton * pb3;
QPushButton * pb4;
QTextEdit* te0;
QLineEdit* le0;
public slots:
bool readFromSerial(void);
bool sendToSerial(void);
bool send(QByteArray data);
void openSerial(void);
void clearSendArea(void);
void clearGetArea(void);
void saveData(void);
public:
void TranTest(void);
public:
QSerialPort serial;
QByteArray readBuf;
QTimer timer;
int msg;
int tem;
int tem_node;
int tem_shi;
int tem_ge;
int lightIntensity;
int light_node;
int light_shi;
int light_ge;
int flux;
int flux_shi;
int flux_ge;
int flux_node;
void UIload(void);
void UIlayout(void);
void setBaudRate(void);
void setDataBit(void);
void setParity(void);
void setStopBits(void);
void setComponemtAttribute(void);
};
class Widget : public QWidget
{
Q_OBJECT
public:
Widget(QWidget *parent = 0);
~Widget();
QGridLayout * gl_tab;
QTabWidget * QTab_UI;
MySerialPort * QTab_SerP;
QWidget * help;
QTextBrowser * tw0;
QVBoxLayout * v0_for_help;
QTimer *timer;
public slots:
void showEmptyPosi(void);
public:
int tem;
int tem_node;
int tem_shi;
int tem_ge;
int lightIntensity;
int light_node;
int light_shi;
int light_ge;
int flux;
int flux_shi;
int flux_ge;
int flux_node;
void loadDocument(void);
};
#endif // WIDGET_H