-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathqserialframe.h
69 lines (49 loc) · 1.23 KB
/
qserialframe.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
#ifndef QSERIALFRAME_H
#define QSERIALFRAME_H
#include <QFrame>
#include <QCloseEvent>
#include <QTimerEvent>
#include "qanalogthread.h"
namespace Ui {
class QSerialFrame;
}
class QSerialFrame : public QFrame
{
Q_OBJECT
public:
explicit QSerialFrame(QWidget *parent = 0);
~QSerialFrame();
private:
typedef enum __ECmd {
CmdCarLeave = 0,
CmdCarEnter,
CmdCarGateLeave,
CmdCarGateEnter,
CmdCarCard
} ECmd;
void GetCmd( ECmd eType, QByteArray& byCmd, char cCan, int nCardId = 0 );
void GetCardId( QByteArray& byCardId, int nCardId );
void SendCmd( QObject* pObj );
protected:
void closeEvent( QCloseEvent* e );
void timerEvent( QTimerEvent* e );
private slots:
void HandleCommand( QByteArray byCmd );
void on_btnTimer_clicked();
void on_btn1_clicked();
void on_btn0_clicked();
void on_btn2_clicked();
void on_btn4_clicked();
void on_btn3_clicked();
void on_btn5_clicked();
void on_btn6_clicked();
void on_btn7_clicked();
void on_btn8_clicked();
void on_btn9_clicked();
private:
Ui::QSerialFrame *ui;
bool bTimerStart;
int nTimerId;
QAnalogThread* pAnalogThread;
};
#endif // QSERIALFRAME_H