FaceAccess/Linguist/interface/BackStage.h
2024-07-11 11:27:12 +08:00

345 lines
14 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef BACKSTAGEI_H
#define BACKSTAGEI_H
#include "BackstageInterfaceForUi.h"
#include "param_manage.h"
#include "golib/golib.h"
class Backstage : public BackstageInterfaceForUi
{
public:
Backstage(void* pParaMng, void* pObjs);
virtual ~Backstage();
int registerPerson(char *name, char *term, int nDataOrigin = 1);
int startIdentyState(bool setfaceReco = true, bool setPeInput = true);
int stopIdentyState(bool setfaceReco = true, bool setPeInput = true);
//工程设置
int verifyFactorySettingPwd(const char *pwd);//验证密码
int recoveryFactorySetting();//恢复出厂设置
//设备设置
int getDeviceId(char *devId, int len);//获取设备id
int getHardwareConfig(char *hardVer, int len);
int getStorSpace(int &total, float &free);//获取存储空间
int getAppVersion(char *appVer, int len);//获取应用版本号
int getRegisterNum();//获取注册人员数
int getAccessRecordNotUpload();//获取未上传通行记录
int getAccessRecordQty();//获取通行记录条数
int getVolume();//获取音量大小
int setVolume(int vol);//设置音量大小
int getLcdBrightness();//获取屏幕亮度
int setLcdBrightness(int brightness);//设置屏幕亮度
bool getFillLightSw();//获取智能补光开关
int setFillLightSw(bool isOpen);//获取智能补光开关
int getStandbyTime();//获取待机时间
int setStandbyTime(int time);//设置待机时间
int getCloseScreenTime();//获取关屏等待时间
int setCloseScreenTime(int time);//获取关屏等待时间
int getLanguage();//获取语言
int setLanguage(int lang);//设置语言
//网络设置
int getIP(char *ip, int len, int& type);//获取IP
int setIP(char *ip);//设置IP
enIpMethod getIpMethod();//获取IP方法
int setIpMethod(enIpMethod ipMethod);//设置IP方法
int getSubnetMask(char *mask, int len);//获取子网掩码
int setSubnetMask(char *mask);//设置子网掩码
int getGateway(char *gateway, int len);//获取默认网关
int setGateway(char *gateway);//设置默认网关
int getDNS(char *dns, int len);//获取DNS
int setDNS(char *dns);//设置DNS
int getEthMac(char *mac, int len);//获取mac
int getWifiMac(char *mac, int len);//获取wifi mac
int getServerAddr(char *addr, int len);//获取服务器ip
int setServerAddr(char *addr, bool byQrcode = false);//设置服务器ip
int testServerIP(char *addr, float &time);//测试服务器ip,成功返回0失败-1
int getIotServerIP(char *ip, int len);//获取服务器ip
int setIotServerIP(char *ip);//设置服务器ip
int getIotPort();//获取端口号, 成功返回端口号,失败返回-1
int setIotPort(int port);//设置端口号
bool getIpShowSw();
int setIpShowSw(bool sw);
//蓝牙设置
//if success, return 0, else return err num;
int getBtSwitch(bool &isOpen);
int getBtName(string &devName);
int getBtPairedDev(list<BluetoothDev_t> &devList);
int getBtAvailDev(list<BluetoothDev_t> &devList);
int getBtAllInfo(BluetoothStat_t &bluetoothStat);
int btScan(list<BluetoothDev_t> &devList);//这个接口不需要吧?现在是定时的去搜索?所以点击“可用设备"条目时直接调用getBtAvailDev就可以了
int btSetSwitch(bool isOpen);
int btSetName(const string &devName);
int btPaire(const string &devId);
int btDisPaire(const string &devId);
int btConnect(const string &devId);
int btDisConnect(const string &devId);
int btRenameDev(const string &devId, const string &devName);
bool getParamBluetoothEnable();//获取蓝牙的开关
int setParamBluetoothEnable(bool sw);//设置蓝牙的开关
std::string getParamBluetoothName();//获取蓝牙设备名称
int setParamBluetoothName(std::string name);//设置蓝牙设备名称
//门禁设置
int getUnlockTime();//获取开锁时间
int setUnlockTime(int time);//设置开锁时间
int getUnlockDelay();//获取开锁延时
int setUnlockDelay(int time);//设置开锁延时
enUnlockSignal getUnlockSig();//获取开锁信号
int setUnlockSig(enUnlockSignal value);//设置开锁信号
enAssist getAssistIn();//获取辅助输入
int setAssistIn(enAssist assist);//设置辅助输入
enAssist getAssistOut();//获取辅助输出
int setAssistOut(enAssist assist);//设置辅助输出
enWiegand getWiegandIn();//获取韦根输入
int setWiegandIn(enWiegand wiegand);//设置韦根输入
enWiegand getWiegandOut();//获取韦根输出
int setWiegandOut(enWiegand wiegand);//设置韦根输出
enBaudRate getBaudRate();//获取波特率
int setBaudRate(enBaudRate baudRate);//设置波特率
int getWarningSig();//获取报警信号
int setWarningSig(int signal);//设置报警信号
//交互提示
enLogo getLogo();//获取logo
int setLogo(enLogo logo);//设置logo
int getCustomLogo(char *logo, int len);
enLogo getLogoTime();//获取logo+time
int setLogoTime(enLogo logo);//设置logo+time
enLogo getBackground();//获取背景图
int setBackground(enLogo logo);//设置背景图
enRecogResult getSuccessResult(char *data, int len);//获取成功结果
int setSuccessResult(enRecogResult result, char *data);//设置成功结果
enRecogResult getFailResult(char *data, int len);//获取失败结果
int setFailResult(enRecogResult result, char *data);//设置失败结果
bool getPlayAudioSw();//获取语音播报开关
int setPlayAudioSw(bool isOpen);//设置语音播报开关
//人脸识别
bool getIdentificationSw();//获取身份核验开关
int setIdentificationSw(bool sw);//设置身份核验开关
enSimilarityTh getSimilarityTh();//获取相似度阈值
int setSimilarityTh(enSimilarityTh th);//设置相似度阈值
int setCustomSimilarity(int sim);//设置自定义识别相似度
int getCustomSimilarity();//获取自定义识别相似度
bool getLivingBodySw();//获取活体开关
int setLivingBodySw(bool isOpen);//设置活体开关
enLivingBodyTh getLivingBodyTh();//获取活体检测阈值
int setLivingBodyTh(enLivingBodyTh th);//设置活体检测阈值
bool getLivingBodyFailSw();//获取活体失败图片留存开关
int setLivingBodyFailSw(bool isOpen);//设置失败图片留存开关
int getVerifyInterval();//获取验证间隔时间
int setVerifyInterval(int time);//设置验证间隔时间
enRecogDistance getRecogDistance();//获取识别距离
int setRecogDistance(enRecogDistance distance);//设置识别距离
enRecogAngle getRecogAngle();//获取识别角度
int setRecogAngle(enRecogAngle angle);//设置识别角度
int getMaxTraceNum();//获取人脸最大跟踪数
int setMaxTraceNum(int num);//设置人脸最大跟踪数
enFaceQuality getFaceQuality();//获取人脸质量阈值
int setFaceQuality(enFaceQuality quality);//设置人脸质量阈值
virtual bool getDynamicFeatureSw();//获取动态底库的开关
virtual int setDynamicFeatureSw(bool sw);//设置动态底库的开关
//系统设置
bool getNtpServerSw();//获取NTP服务开关
int setNtpServerSw(bool isOpen);//设置NTP服务开关
int getNtpServerAddr(char *addr, int len);//获取NTP服务地址
int setNtpServerAddr(char *addr);//设置NTP服务地址
int testNtpServer(char *addr, float &time);//测试NTP服务, 成功返回0失败-1
int getNtpServerPort();//获取NTP端口成功返回端口号失败返回-1
int setNtpServerPort(int port);//设置NTP服务端口
int getNtpCheckInterval();
int setNtpCheckInterval(int interval);
int getNtpTimeZone(char *timeZone, int len);
int setNtpTimeZone(char *timeZone);
int setVerifyFactorySettingPwd(char *pwd);//设置工程密码
int testHardware();//硬件检测
int cleanData();//清除数据
int devReboot();//重启设备
int startCapture();//start capture on register
int deletePerson(long long personID);
int queryPersonList(long long* pPersonIDBuff, int nBuffCount, long long startID, int& nRealPerson);
unsigned queryPerson(const char* searchText);
unsigned queryPerson(const char* searchText, int pageIndex, stQueryPersonInfo personRet[], int personRetSize);
unsigned queryAccessRecord(const char* name, const char* time);
unsigned queryAccessRecord(const char* name, const char* time, int pageIndex, stQueryAccRedInfo recordRet[], int recordRetSize);
int clearPeople();
int getPersonListState(int &sum, unsigned long long &maxPersonID);
int wakeUpFromScreenSaverOrScreenOff();
virtual int delPerson(long long personId);
virtual int modifyPerson(stQueryPersonInfo &personInfo);
virtual int addPerson(stQueryPersonInfo &personInfo);
virtual int snapFace(std::string &feature, std::string &savePath);
bool getMaskCheckSwitch();
int setMaskCheckSwitch(const bool sw);
bool getNoMaskNoPassSwitch();
int setNoMaskNoPassSwitch(const bool sw);
bool getTemperatureCheckSwitch();
int setTemperatureCheckSwitch(const bool sw);
bool getNoTemperatureNoPassSwitch();
int setNoTemperatureNoPassSwitch(const bool sw);
float getLowTemperature();
int setLowTemperature(const float temp);
float getHighTemperature();
int setHighTemperature(const float temp);
bool getQRCodeSwitch();
int setQRCodeSwitch(const bool sw);
bool getDataEncryptSw();
int setDataEncryptSw(bool sw);
int setDateTime(const char *dateTime);
bool getAutoRebootSw();
int setAutoRebootSw(bool sw);
int getAutoRebootTime(char* time, int len);
int setAutoRebootTime(const char *time);
int getAutoRebootInterval();
int setAutoRebootInterval(int interval);
int ntpTimeCorrect();
int ntpTimeCorrectForDevTest(const std::string& ntpServerIp);
int getNetWireCfg(stNetWire& wireCfg);
int setNetWireCfg(const stNetWire& wireCfg);
int setNetWireEnable(bool enable);
int getNetWifiCfg(stNetWifi& wifiCfg);
int setNetWifiCfg(const stNetWifi& wifiCfg);
int setNetWifiEnable(bool enable);
int getSsidList(stAccPoint accPointList[], int accPointListSize);
int claerNetWifiCfg();
int getNet4GCfg(stNet4G& n4gCfg);
int setNet4GEnable(bool enable);
int reboot4G();
int getScreenSaverConfig(stScreensaverCfg& cfg);
int sendPassword(const char *password);
void resetDecisionCenterTimer();
int pauseDataFlow();
int resumeDataFlow();
int candidateChoosedInPopupWindow(int index);
bool isWiegandIoTestOk();
bool isRelayAndGpioTestOk();
bool isRs485TestOk();
bool isReaderUnderScreenTestOk();
bool isWifiTestOk();
bool isRtcTestOk();
bool isWireEthTestOk();
bool is4gTestOk();
bool isSerial1TestOk();
void screenTest();
void speakerTest();
void microphoneTest(bool record) final;
void audioSwitchTest() final;
void tpTest();
void irCamTest();
void irLedTest();
void ageingTest(unsigned hours);
int getMacFromMes(const char* mesAddrAndProdNo, const char* pcbSeq, std::string& mac);
bool isAgeing(std::string& hours);
int getKeyDataMac(std::string& mac);
int getRecoUiAdConfig(stScreensaverCfg& cfg);
int recoUiTypeSwitch(unsigned x, unsigned y, unsigned w, unsigned h);
int getDevPwd(int& type, std::string& pwd);
int setLocalDevPwd(const std::string& pwd);
int getKeyDataHardware(std::string& hardware);
int setKeyDataHardwareAndUpdataFunction(const std::string& hardware);
int setSetupAlreadyFlag();
int getParkInfo(std::string& info);
int setParkInfo(const std::string& info);
int getDevPosi(std::string& posi);
int setDevPosi(const std::string& posi);
int getRs485Cfg();
int setRs485Cfg(int cfg);
int getRs485Prot1Addr();
int setRs485Prot1Addr(int addr);
int getRs485Prot3Cfg(int& handCfg, int& feetCfg);
int setRs485Prot3Cfg(int handCfg, int feetCfg);
int getGPIOCfg();
int setGPIOCfg(int cfg);
int setReverseAccessSw(bool enabled) final;
bool getReverseAccessSw() const final;
int getIDFaceVerifySw();
int setIDFaceVerifySw(bool sw);
int getBtLockCfg(BtDoorLock& cfg);
int setBtLockCfg(const BtDoorLock& cfg);
int getBtLockRemainingBatPwr(const std::string& mac);
bool getHealthCodeSw();
int setHealthCodeSw(bool sw);
bool getHealthCodeNoFaceRequired();
int setHealthCodeNoFaceRequired(bool sw);
bool getHealthCodeAllowStranger();
int setHealthCodeAllowStranger(bool sw);
int getHealthCodePassCfg(int& codeColorCfg, int& c19tCfg, int& tripCfg, int& abtCfg);
int setHealthCodePassCfg(int codeColorCfg, int c19tCfg, int tripCfg, int abtCfg);
std::string utfRawStrToEncodeStr(const std::string &str);
std::string getUnderScreenNfcModuleId();
std::string getExtendNfcModuleId();
bool isIdModuleInfoUploaded();
bool isDevSettingDisable();
void setAntiDemolitionAvail(bool avail, bool upload);
bool getAntiDemolitionSw();
void setAntiDemolitionSw(bool sw);
int getAntiDemolitionOutput();
void setAntiDemolitionOutput(int output);
int getGpio4Cfg();
void setGpio4Cfg(int cfg);
int getGpio5Cfg();
void setGpio5Cfg(int cfg);
int getDoorCloseOvertime();
void setDoorCloseOvertime(int overtime);
bool getDisableDevSettingSw();
void setDisableDevSettingSw(bool sw);
int getTicketCheckCountToday();
int getTicketModePeopleCountType();
int getCallDevList();//获取通话设备列表
int queryCallDevList(const std::string& text, std::vector<stCallDev>& devList);//查询指定的通话设备
int callDev(const std::string& devTag, int devType);//发起通话请求
int callAbort();//放弃通话(拨通之前)
int callHangUp();//挂断
int callReject();//拒接
int callAccept();//接听
int callSetVideoStream(bool enable);//允许/禁用视频
int openCallRemoteDoor() final; // 被打入电话过程中,打开对面面板机控制的闸机
void verifyAbort();
bool getShowIdAndVerSw();
int setShowIdAndVerSw(bool sw);
int playAudio(enAudioIndex index);
int userItemChoose(int index);
private:
int udpSend(const string &sendData, string &recvData);
int resetNetworkCfg();
int udpLoopToSvr(const std::string &sendData);
private:
ParamManage *m_paramMng = nullptr;
GOBJ m_objs = nullptr;
};
#endif