-
Notifications
You must be signed in to change notification settings - Fork 9
/
retriver.h
86 lines (70 loc) · 1.42 KB
/
retriver.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
/////////////////////////////////////////////
///
/// \author jacky lea
/// \date 2020-12-26
/// \note 串口处理函数
///
////////////////////////////////////////////
#ifndef RETRIVER_H
#define RETRIVER_H
#include <QDebug>
#include <QString>
#include <QThread>
#include <QFile>
#include <QDir>
#include <QTextStream>
#include <QSerialPort>
#include <QMainWindow>
#include <QMessageBox>
#include <QFileDialog>
#include <QDesktopServices>
#include <QSerialPortInfo>
namespace Ui {
class Retriver;
}
class Retriver : public QWidget
{
Q_OBJECT
public:
/// 构造函数
/// \brief Retriver
/// \param parent
///
explicit Retriver(QWidget *parent = nullptr);
///
/// 释放资源
~Retriver();
/// 显示本类界面
/// \brief showWgt
///
void showWgt();
/// 关闭通道
/// \brief stopCOM
///
void stopCOM();
signals:
/// 通知解析器有新包
/// \brief sigNewPkg
/// \param ba
///
void sigNewPkg(QByteArray ba);
private slots:
/// 处理从COM口过来的数据
/// \brief receiveData
///
void receiveData();
/// 打开关闭串口
/// \brief on_btnOpenClose_clicked
///
void on_btnOpenClose_clicked();
/// 取消操作
/// \brief on_btnCance_clicked
///
void on_btnCance_clicked();
private:
Ui::Retriver *ui;
//串口操作
QSerialPort *m_pCOM;
bool m_bOpen;
};
#endif // RETRIVER_H