-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfpthread.h
More file actions
47 lines (36 loc) · 998 Bytes
/
fpthread.h
File metadata and controls
47 lines (36 loc) · 998 Bytes
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
#ifndef FPTHREAD_H
#define FPTHREAD_H
#include <QThread>
#include <QSet>
#include <QDateTime>
#include "fingerprint.h"
class FpThread : public QThread
{
Q_OBJECT
public:
explicit FpThread(QObject *parent = nullptr);
~FpThread();
enum Mode {NORMAL = 0, ENROLL = 1, DELETE = 2};
public slots:
void enroll(bool run);
void del(int id);
signals:
void match(int id, int score, bool button);
void enrollFinished(int id, bool success);
private:
volatile Mode mode;
volatile uint16_t tempID;
QSet<int>* fingerIds;
QDateTime enrollStartTime;
void run();
void normalMode(Fingerprint* fp);
void enrollMode(Fingerprint* fp);
void deleteMode(Fingerprint* fp);
// configuration
uint16_t MAX_FINGERS; // capacitiy of fingerprint library
uint32_t ENROLL_TIMEOUT; // (seconds) timeout for enroll mode
QString DATABASE_NAME; // name of database
QString DATABASE_USER; // user name for database
QString DATABASE_PASSWD; // password for database user
};
#endif // FPTHREAD_H