1 Star 0 Fork 0

qinxude/rk3568ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
syncfaceid.h 3.83 KB
一键复制 编辑 原始数据 按行查看 历史
qinxude 提交于 2024-09-03 09:38 . 3568ui base
#ifndef SYNCFACEID_H
#define SYNCFACEID_H
#include <QObject>
#include <QCryptographicHash>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonObject>
#include <QJsonDocument>
#include <QJsonArray>
#include <QTimer>
#include <QUuid>
#include <QBuffer>
#include <QPixmap>
#include "datadictionary.h"
#include "common.h"
//#define FACEID_HOST "http://faceapi.dltengyi.cn:3000"
//#define QUERY_STATE_PATH "/faceapi/v1/stat"
//#define GET_PERSON_INFO_PATH "/faceapi/v1/person/info"
//#define GET_PERSON_FACE_PATH "/faceapi/v1/person/face"
//#define UPLOAD_INFO_PATH "/faceapi/v1/person/upload/face"
//#define CMD_CALLBACK_PATH "/faceapi/v1/callback/cmd"
#define KEY "000000"
#define QUERY_TIME_INTERVAL 1000*60*1 /** 单位ms */
typedef enum {
HTTP_QUERY = 0x0,
HTTP_GET_PERSON_INFO,
HTTP_GET_PERSON_FACE,
HTTP_UPLOAD_PERSON_INFO,
HTTP_CMD_CALLBACK,
}HttpCmd_t;
#define SUCCESS_STR "0"
#define SYNC_CMD_STR "1"
#define SYNC_UNABLE_STR "2"
#define SYNC_ENABLE_STR "3"
#define RESET_CMD_STR "4"
class SyncFaceIdThread : public QObject
{
Q_OBJECT
public:
SyncFaceIdThread();
~SyncFaceIdThread();
void SetDeviceId(QString);
void SetBlackBoxId(QString Id);
// void RegisterInfoUpload(QString &Name,QPixmap &Pic);
// int RecgnizeCallback(QString PersonId,QString PersonName,QString Image);
int RecgnizeCallback(QString PersonId,QString PersonName,QString Image);
int RecgnizeCallback(PersonInfo_t Per);
signals:
void PersonInfoSyncFinish(QJsonArray &);
void RegisterFinish(bool);
void SyncFaceIdReset(void);
public slots:
void Start();
void Stop();
void DevParamDataChange(DevParamDataIndex_t Index);
void SystemDataChange(SystemDataIndex_t Index);
void MisDataChange(MisDataIndex_t Index);
void PersonInfoDeleteProcess(QString Id);
void PersonInfoDeleteAll();
private slots:
void ReplyFinish(QNetworkReply *);
void StartQuery();
void RegisterInfoUpload(PersonInfo_t Per);
void RegisterInfoUpload(QString Uuid, QString Name, QString B64Pic);
private:
QNetworkAccessManager *m_HttpManager;
QTimer *m_QueryTimer;
HttpCmd_t m_CurrentCmd;
QJsonArray m_PersonInfoLocal;
QJsonArray m_PersonNotUpload;
qint32 m_PersonFaceIndex;
qint64 m_LastSyncTimeStamp;
qint64 m_LastRegisterTimeStamp;
QString m_HttpCmd;
QString m_HttpResult;
QString m_HttpResultMsg;
QString FACEID_HOST;
QString QUERY_STATE_PATH;
QString GET_PERSON_INFO_PATH;
QString GET_PERSON_FACE_PATH;
QString UPLOAD_INFO_PATH;
QString CMD_CALLBACK_PATH;
QString RECGNIZE_CALLBACK_PATH;
DataDictionary *m_DataDictionary;
QString DeviceId;
QString BlackBoxId;
void QueryState();
void GetPersonInfo();
int GetPersonFace();
int HttpUploadPersonInfo();
int HttpCmdCallback();
QByteArray GetSign(QString TimeStamp);
void AnalysisHttpResult(QJsonObject JsonObject);
void DataAnalysis(QJsonObject JsonObject);
void ResultAnalysis(QJsonObject JsonObject);
int QueryResultDataAnalysis(QJsonObject JsonObject);
int GetPersonInfoResultAnalysis(QJsonObject JsonObject);
int GetPersonFaceResultAnalysis(QJsonObject JsonObject);
int UploadAnalysis(QJsonObject JsonObject);
int PersonInfoAnalysis(int num,QJsonArray JsonArray);
int SavePersonInfo(QJsonObject JsonObject,QJsonArray &);
int m_ServerSyncPersonNum;
bool ImgCheck(QString pic);
QStringList m_PersonInfoTab1 = {
"person_name",
"person_id",
"person_code",
"person_timestamp"
};
QStringList m_PersonInfoTab2 = {
"face_id",
"face_timestamp"
};
};
#endif // SYNCFACEID_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qinxude/rk3568ui.git
[email protected]:qinxude/rk3568ui.git
qinxude
rk3568ui
rk3568ui
master

搜索帮助