hlp:荆州版本
This commit is contained in:
+86
-86
@@ -1,87 +1,87 @@
|
||||
#ifndef RFIDMANAGER_H
|
||||
#define RFIDMANAGER_H
|
||||
|
||||
#include "myinclude.h"
|
||||
#include <QSerialPort>
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QMutex>
|
||||
#include "SysPara.h"
|
||||
|
||||
typedef unsigned char UCHAR;
|
||||
class RFIDManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static RFIDManager* instance();
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief 向卡片写入当前日期时间,标识该卡片已被使用
|
||||
*/
|
||||
int RFIDmarkCardUsedAsync(int type, const QString& cardData = QString());
|
||||
|
||||
// InkJetPrinter定时器timerHandler触发,检查刷卡状态
|
||||
// 初始化刷卡模块
|
||||
void initRFIDMoudle(unsigned int addr, SysPara * sysPara);
|
||||
|
||||
// 300ms检查处理
|
||||
void handleCheck(unsigned int addr);
|
||||
|
||||
void bindSysPara(SysPara *sysPara);
|
||||
private:
|
||||
RFIDManager();
|
||||
|
||||
// 工具类函数
|
||||
void CheckSumOut(UCHAR *buf, UCHAR len);
|
||||
bool CheckSumIn(UCHAR *buf, UCHAR len);
|
||||
void MySleep(unsigned int msec, int expSize = 8);
|
||||
void Hex2Str(const UCHAR *sSrc, UCHAR *sDest, int nSrcLen);
|
||||
void HexStrToByte(const UCHAR* source, UCHAR* dest, int sourceLen);
|
||||
|
||||
// 串口
|
||||
QSerialPort *comForRFID = nullptr;
|
||||
void comForRFID_init();
|
||||
int comReadRFID_data();
|
||||
|
||||
QByteArray buildMarkCardCommand(int block, int cardType, const QString& originalCardData = QString());
|
||||
bool verifyWriteResponse(const QByteArray& response, QString notice);
|
||||
|
||||
int setRFIDCarKey(void);
|
||||
int setRFIDReaderKey(int,int);
|
||||
int setRFIDReaderOriginalKey(void);
|
||||
int setRFIDReaderWorkMode(void);
|
||||
int receiveReadRFID_data(void);
|
||||
int queryReadRFID_address(void);
|
||||
|
||||
int superCardDeduct();
|
||||
|
||||
QMutex m_rfidMutex;
|
||||
QByteArray RFIDReadData;
|
||||
QString strRevdata;
|
||||
bool setICReaderModeFlag;
|
||||
uint checkCardIntervalTime;
|
||||
|
||||
QTimer* RFIDTimer = nullptr;
|
||||
void initTimer();
|
||||
|
||||
// bool cardTouchConfirm(QString msgTxt, QString variableMsgTxt);
|
||||
|
||||
// vx5的系统参数没有实现单例
|
||||
SysPara *sysPara = nullptr;
|
||||
signals:
|
||||
void sig_showMsg(QString msg);
|
||||
|
||||
void sig_maintenanceShow();
|
||||
|
||||
private slots:
|
||||
//接收刷卡数据槽函数
|
||||
void slt_readRFIDData();
|
||||
|
||||
//超时处理槽函数
|
||||
void slt_timerHandle();
|
||||
|
||||
};
|
||||
|
||||
#ifndef RFIDMANAGER_H
|
||||
#define RFIDMANAGER_H
|
||||
|
||||
#include "myinclude.h"
|
||||
#include <QSerialPort>
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QMutex>
|
||||
#include "SysPara.h"
|
||||
|
||||
typedef unsigned char UCHAR;
|
||||
class RFIDManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static RFIDManager* instance();
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief 向卡片写入当前日期时间,标识该卡片已被使用
|
||||
*/
|
||||
int RFIDmarkCardUsedAsync(int type, const QString& cardData = QString());
|
||||
|
||||
// InkJetPrinter定时器timerHandler触发,检查刷卡状态
|
||||
// 初始化刷卡模块
|
||||
void initRFIDMoudle(unsigned int addr, SysPara * sysPara);
|
||||
|
||||
// 300ms检查处理
|
||||
void handleCheck(unsigned int addr);
|
||||
|
||||
void bindSysPara(SysPara *sysPara);
|
||||
private:
|
||||
RFIDManager();
|
||||
|
||||
// 工具类函数
|
||||
void CheckSumOut(UCHAR *buf, UCHAR len);
|
||||
bool CheckSumIn(UCHAR *buf, UCHAR len);
|
||||
void MySleep(unsigned int msec, int expSize = 8);
|
||||
void Hex2Str(const UCHAR *sSrc, UCHAR *sDest, int nSrcLen);
|
||||
void HexStrToByte(const UCHAR* source, UCHAR* dest, int sourceLen);
|
||||
|
||||
// 串口
|
||||
QSerialPort *comForRFID = nullptr;
|
||||
void comForRFID_init();
|
||||
int comReadRFID_data();
|
||||
|
||||
QByteArray buildMarkCardCommand(int block, int cardType, const QString& originalCardData = QString());
|
||||
bool verifyWriteResponse(const QByteArray& response, QString notice);
|
||||
|
||||
int setRFIDCarKey(void);
|
||||
int setRFIDReaderKey(int,int);
|
||||
int setRFIDReaderOriginalKey(void);
|
||||
int setRFIDReaderWorkMode(void);
|
||||
int receiveReadRFID_data(void);
|
||||
int queryReadRFID_address(void);
|
||||
|
||||
int superCardDeduct();
|
||||
|
||||
QMutex m_rfidMutex;
|
||||
QByteArray RFIDReadData;
|
||||
QString strRevdata;
|
||||
bool setICReaderModeFlag;
|
||||
uint checkCardIntervalTime;
|
||||
|
||||
QTimer* RFIDTimer = nullptr;
|
||||
void initTimer();
|
||||
|
||||
// bool cardTouchConfirm(QString msgTxt, QString variableMsgTxt);
|
||||
|
||||
// vx5的系统参数没有实现单例
|
||||
SysPara *sysPara = nullptr;
|
||||
signals:
|
||||
void sig_showMsg(QString msg);
|
||||
|
||||
void sig_maintenanceShow();
|
||||
|
||||
private slots:
|
||||
//接收刷卡数据槽函数
|
||||
void slt_readRFIDData();
|
||||
|
||||
//超时处理槽函数
|
||||
void slt_timerHandle();
|
||||
|
||||
};
|
||||
|
||||
#endif // RFIDMANAGER_H
|
||||
Reference in New Issue
Block a user