-
Notifications
You must be signed in to change notification settings - Fork 9
/
simulator.h
67 lines (56 loc) · 1.19 KB
/
simulator.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
/////////////////////////////////////////////
///
/// \author jacky lea
/// \date 2020-12-26
/// \note 用于产生测试数据
///
////////////////////////////////////////////
#ifndef SIMULATOR_H
#define SIMULATOR_H
#include <QObject>
#include <QByteArray>
#include <QDebug>
#include <QtMath>
#include <QTimer>
#include <QVector>
class Simulator : public QObject
{
Q_OBJECT
public:
/// 构造函数
/// \brief Simulator
///
Simulator();
///
/// 释放资源
~Simulator();
/// 生成一个模块包
/// \brief getOne
/// \param mn 模块号
/// \param max 数值上限,下限默认为0
/// \return
///
QByteArray getOne(uchar ucModelIndex, int iMax);
/// 模拟原始数据包
/// \brief getRaw
/// \param bNoise
/// \return
///
QByteArray getRaw(bool bNoise=false);
/// 模拟EEG数据包
/// \brief getEEG
/// \param noise
/// \return
///
QByteArray getEEG(bool bNoise=false);
signals:
/// 通知界面已经成功解析一包
/// \brief sigNewPkg
/// \param ba
///
void sigNewPkg(QByteArray ba);
private:
QTimer *m_pTimer;
uint m_unIterCnt;
};
#endif // SIMULATOR_H