-
Notifications
You must be signed in to change notification settings - Fork 1
/
sagemmorpho.h
75 lines (60 loc) · 1.59 KB
/
sagemmorpho.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
#ifndef SAGEMMORPHO_H
#define SAGEMMORPHO_H
#include <QWidget>
#include "Morpho/morpho_definitions.h"
namespace Ui {
class SagemMorpho;
}
class SagemMorpho : public QWidget
{
Q_OBJECT
public:
explicit SagemMorpho(QWidget *parent = nullptr);
~SagemMorpho();
void putData(const QByteArray &data);
void setLocalEchoEnabled(bool set);
void sendBreak();
enum ReceiveState
{
ReceiveState_ReceiveSOP = 0,
ReceiveState_ReceiveData = 1
};
signals:
void getData(const QByteArray &data);
public slots:
void clear();
void sendSag0();
void sendSag1();
void sendBdr0();
void sendBdr1();
void sendTrace();
void sendIdentify0();
void sendCancel0();
void sendIdentify1();
void sendCancel1();
void setAck(bool disabled) {m_ackDisable = disabled;}
private slots:
void on_desciptorButton_clicked();
void on_configUartButton_clicked();
void on_addRecordButton_clicked();
void on_eraseBaseButton_clicked();
void on_destroyBaseButton_clicked();
void on_createBaseButton_clicked();
void on_getBaseConfigButton_clicked();
void on_identifyButton_clicked();
void on_cancelButton_clicked();
private:
void addRecord(int userId);
void ack();
void receiveSOP();
void receiveData();
private:
Ui::SagemMorpho* ui;
enum MorphoRequest m_request;
QByteArray m_response;
int m_userId;
int m_repeat;
ReceiveState m_receiveState;
bool m_ackDisable;
};
#endif // SAGEMMORPHO_H