FaceAccess/Linguist/interface/View.h

175 lines
5.8 KiB
C
Raw Normal View History

2024-07-11 11:27:12 +08:00
/********************************************************************
* Name : View.h
* Param :
* Return :
* Describ :
* Author : Zhang Botong
* Date : 2019-11-13
********************************************************************/
#ifndef VIEW_H
#define VIEW_H
#include "BackStage.h"
#include "mainUi.h"
typedef enum
{
Error1_N = 1000,
Error_INPUT_PARAM,
Error1_1,
ErrorLive,
Error_PERSON_ID_NO_EXIST,
Error_REGISTER_PERSON,
Error_DELETE_PERSON,
Error_CLEAR_PERSON,
Error_QUERY_PERSON_COUNT,
Error_QUERY_MAX_PERSON_ID,
Error_NO_FACE,
Error_NO_FACE_IMAGE,
Error_REGISTER_FACE,
Error_DELETE_FACE,
Error_QUERY_PERSONID,
Error_QUERY
}enErrCode;
class View
{
public:
enum class enRecoUiMaskType
{
enRecoUiMaskNormal,
enRecoUiMaskTempCalibra,
enRecoUiMaskLight,
enRecoUiMaskDark,
enRecoUiMaskMax
};
static View* getInstance();
static int msgShowOvertimeCloseCB(void *data);
int viewInitBackstage(void* pParaMng, void* pObjs, bool needSetupWizard);
int viewCreateUi(int languageType, bool showCursor);
int viewCreateSettingUi();
virtual ~View();
void showRecoMsgReco();
void showUnauthorizedPage();
void showScreenSaverPage();
void showErrorDisplayPage(enErrCode errCode);
void notifyFaceInfo(const bool faceAvailable);
void showRecoMsgRetry();
void showRecoMsgFail(int failType = 0);
void showRecoSuccess(const char *name);
void showFaceImg(const unsigned char *imgData, const int imgLen);
void showRecoMsgIDFail();
void startCapture();
void updatePlatformConnectionStatus(UiInterfaceForBackstage::PLATFORM_CONNECTION_STATUS_E state);
void showRecoMsgMoveForehead(); //移动到额头区
void showRecoMsgForeheadNormalTemp(const float temp, const bool isC); //显示正常温度
void showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC); //显示异常温度
void showRecoMsgReadTempFailed(); //体温检测失败
void showRecoMsgNoMaskWarn(); //请戴口罩
void showRecoMsgMaskOk(); //口罩检测成功
void showRecoMsgNoEntry(const bool noEntry); //禁止通行或者清除禁止通行
void showRecoMsgMaskWarn();
void turnOffScanLine(); //关闭扫描线
void updateLogo(int logo);
void showQRCodeResult(int result);
void showQRCodeReco();
void showFaceReco();
void updateRecoUiIp();
void showFeatureUpdateProgress(const unsigned current, const unsigned all);
void closeFeatureUpdateProgress();
void showCalibrationBox();
void closeCalibrationBox();
//color:0-white, 1-red, 2-yellow
void showNotiMsg(const char *msg, int color, double displayTime = 3600 * 8);
void switchLightOrDarkRecoUi(bool isDark);
void updateScreenSaver();
void grabScreen(const char* picName, int rotate = 0);
void showDrawPage();
void switchToRecoUi();
void showCenterMsg(const char* msg, double displayTime = 3.0, int type = 0);
void closeCenterMsgWin();
void showCursorSwitch(bool sw);
void setPwdButton(bool visible);
int setNetWire(const stNetWire& wireCfg);
int setServerAddr(const char *addr, bool byQrcode = false);
void showPwdUiPersonName(const char* name);
void showUserPwd(const char* name);
void showUserPwdError(int type, int color = 0);
void showUserCandidate(const char** opns, int opnsNum);
void showDevTestPage(const char* devCfgMsg);
void setDevTestMesAddrAndProdNoText(const char* text);
void setDevTestPcbSeqText(const char* text);
#if 0
void setDevTestConfigInfo(const char* text);
#endif
void showOrHideFaceFrame(bool show);
void showPassResult(bool pass);
void showRecoUiColorFaceSnapshot(const char* path);
void showRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len);
void recoUiswitchToType(int type);
void qrcodeFastCfgResult(bool isSuccessed);
void icCardResult(const char* icCardNum);
bool isInSettingUi();
void updateAdScreen();
void showHealthMsg(int type, float temp, const char* msg, bool pass, const unsigned char* jpgDate,
int jpgLen, const char* tripCity, const char* failReason, int bgColor, int displayTime = 3);
void showHealthCodeAuthStatus(int status);
void showAntiDismantleDetect(bool upload);
void showSceneResult(int result, const char* resultText, const char* businessInfo, int displayTime);
void updatePersonNumAccessed(int personAccess, int personAll);
bool isScenePassing();
void setSceneUiPersonCountType(int type);
void updateSceneUiPersonCount(int count);
void showCallBtn(bool callButton, bool videoButton);//显示/隐藏通话按键
void showCallDialPage();//显示拨号页面
void showCallReceiverCallIn(const char* callerName, bool videoEnable);//显示接收者通话拨入
void showCallInitiatorConnected(bool videoEnable);//显示发起者通话接通
void exitCall();//退出通话界面
void showCallPlatformCallIn(const char* callerName);//显示平台通话拨入
void showCallVideoPlayer(bool show);//显示/隐藏视频播放
void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time);
void showRecoUiDevIdAndVer(bool show);
void showUserItemChoose(const std::vector<std::string>& items);
protected:
View();
private:
Backstage* m_backstage;
mainUi* m_ui;
static View * m_this;
bool m_needSetupWizard = false;
unsigned long long m_ullNotiMsgShowTmr = 0;
unsigned long long m_ullCenterMsgShowTmr = 0;
};
void rotateRgbImage(const unsigned char* inputImage, int width, int height, unsigned char* outptuImg, double angle);
#endif