256 lines
9.1 KiB
C++
256 lines
9.1 KiB
C++
#ifndef MAINUI_H
|
||
#define MAINUI_H
|
||
|
||
#include <QWidget>
|
||
#include <QStackedWidget>
|
||
#include <QSplashScreen>
|
||
#include <QTime>
|
||
#include <QTranslator>
|
||
|
||
#include "UiInterfaceForBackstage.h"
|
||
#include "settingUi.h"
|
||
#include "recoUi.h"
|
||
#include "BackstageInterfaceForUi.h"
|
||
#include "UiCommon.h"
|
||
#include "UiConfig.h"
|
||
#include "SetupUi.h"
|
||
|
||
|
||
|
||
class SplashScreenWithMsg : public QSplashScreen
|
||
{
|
||
Q_OBJECT //多语言
|
||
|
||
public:
|
||
explicit SplashScreenWithMsg(const int languageType);
|
||
~SplashScreenWithMsg();
|
||
|
||
private:
|
||
QLabel* m_label_msg;
|
||
|
||
};
|
||
|
||
class mainUi : public UiInterfaceForBackstage
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
static const int START_SCREEN_TIMEOUT = UiConfig::START_SCREEN_TIMEOUT;
|
||
static const int PWD_ACCEPT_DELAY_TIME = UiConfig::PWD_ACCEPT_DELAY_TIME * 60 * 1000; //min to ms
|
||
static const int RETRY_TIMES_MAX_PER_GROUP = UiConfig::RETRY_TIMES_MAX_PER_GROUP;
|
||
|
||
explicit mainUi(const int languageType, bool needSetupWizard);
|
||
~mainUi();
|
||
|
||
void createSettingUi();
|
||
virtual void setBackstageUiinterface(BackstageInterfaceForUi* interface);
|
||
|
||
//UI提供给后台的接口
|
||
virtual long long getUiVersion();
|
||
virtual void showUnauthorizedPage();
|
||
virtual void showScreenSaverPage();
|
||
|
||
virtual void showRecoMsgReco();
|
||
virtual void showRecoMsgRetry();
|
||
virtual void showRecoMsgFail(int failType);
|
||
virtual void notifyFaceInfo(const bool faceAvailable);
|
||
virtual void showRecoSuccess(const char* name);
|
||
virtual void showRecoMsgIDFail();
|
||
|
||
virtual int showFaceImg(const unsigned char *imgData, const int imgLen);
|
||
virtual void updatePlatformConnectionStatus(const PLATFORM_CONNECTION_STATUS_E);
|
||
|
||
virtual void showRecoMsgMoveForehead(); //移动到额头区
|
||
virtual void showRecoMsgForeheadNormalTemp(const float temp, const bool isC); //显示正常温度
|
||
virtual void showRecoMsgForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC); //显示异常温度
|
||
|
||
virtual void showRecoMsgReadTempFailed(); //体温检测失败
|
||
virtual void showRecoMsgNoMaskWarn(); //请戴口罩
|
||
virtual void showRecoMsgMaskOk(); //口罩检测通过
|
||
virtual void showRecoMsgMaskWarn();
|
||
|
||
virtual void showRecoMsgNoEntry(const bool); //显示禁止通行
|
||
|
||
virtual void turnOffScanLine();
|
||
virtual void clearLocalFacePage();
|
||
virtual void updateLogo(const enLogo);
|
||
virtual void showQRCodeMsg(const QRCode_Msg_E);
|
||
virtual void showQRCodeReco();
|
||
virtual void showFaceReco();
|
||
virtual void updateRecoUiIp();
|
||
|
||
virtual void showFeatureUpdateProgress(const unsigned current, const unsigned all);
|
||
virtual void closeFeatureUpdateProgress();
|
||
|
||
virtual void showRecoUiMask(int maskType);
|
||
virtual void showNotiMsg(const char *msg, int color);
|
||
|
||
virtual void updateScreenSaver();
|
||
virtual int grabScreen(const QString& picName, int rotate = 0);
|
||
virtual int switchToRecoUi();
|
||
|
||
virtual int showCenterMsg(const char* msg, int type);
|
||
virtual int showUserPwd(const char* name);
|
||
|
||
void showDrawPage();
|
||
|
||
void showCursorSwitch(bool sw);
|
||
void setPwdButton(bool visible);
|
||
void showPwdUiPersonName(const char* name);
|
||
void showUserPwdError(int type, int color);
|
||
void showUserCandidate(const char* title, const char** opns, int opnsNum);
|
||
void showDevTestPage(const char* devCfgMsg);
|
||
void setDevTestMesAddrAndProdNoText(const char* text);
|
||
void setDevTestPcbSeqText(const char* text);
|
||
void setDevTestConfigInfo(const char* text);
|
||
|
||
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);
|
||
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 showCallDialPage();
|
||
void setCallConsoleStatus(int status, const char* tip);
|
||
void setDndMode(bool enabled, const std::chrono::system_clock::time_point &time) final;
|
||
void showRecoUiDevIdAndVer(bool show);
|
||
void showUserItemChoose(const std::vector<std::string>& items);
|
||
|
||
signals:
|
||
void signalShowRecoUiPage(const int);
|
||
void signalShowRecoState(const int);
|
||
void signalNoSuccessPage(const int);
|
||
void signalSuccessPage(const int nPage, const QString& name);
|
||
void signalDrawScanner(const int nPage, const bool faceAvailable);
|
||
void signalShowAddFaceImg(const unsigned char* imgData, int len);
|
||
void signalUpdatePlatformConnectionStatus(const int);
|
||
|
||
void signalInteraction(const INTERACION_OPTION& interaction, int nSelectRes); //后面去掉
|
||
|
||
void signalShowForeheadNormalTemp(const float temp, const bool isC);
|
||
void signalShowForeheadAbnormalTemp(const float temp, const bool isHigh, const bool isC);
|
||
|
||
void signalClearLocalFacePage();
|
||
|
||
void signalShowLogoChooseDialogBySpecialPwd();
|
||
void signalUpdateLogo(const int);
|
||
void signalShowQRCodeMsg(const int);
|
||
|
||
void signalResetRecoUi(); //在识别界面进入设置界面时复位识别界面,否则可能导致扫描线定时器一直在被调用
|
||
|
||
void signalShowFeatureUpdateProgress(const unsigned current, const unsigned all);
|
||
void signalCloseFeatureUpdateProgress();
|
||
|
||
void signalShowRecoUiMask(int maskType);
|
||
|
||
void signalNotiMsg(const int nPage, const QString& msg, int color);
|
||
|
||
void signalUpdateScreenSaver();
|
||
|
||
void signalCenterMsg(const int nPage, const QString& msg);
|
||
|
||
void signalShowUserPwd(const QString& name);
|
||
void signalShowUserPwdButton();
|
||
void signalSetUserPwdButton(bool visible);
|
||
void signalShowPwdUiPersonName(const QString& name);
|
||
void signalShowUserPwdError(int type, int color);
|
||
|
||
void signalShowUserCandidate(const QString& title, const QStringList& opns);
|
||
|
||
void signalCreateAndShowDevTestPage(const QString& devCfgMsg);
|
||
void signalDevTestMesAddrAndProdNoText(const QString& text);
|
||
void signalDevTestPcbSeqText(const QString& text);
|
||
void signalDevTestConfigInfo(const QString& text);
|
||
|
||
void signalShowOrHideFaceFrame(bool show);
|
||
void signalShowFinalResult(bool pass);
|
||
void signalShowDevTestPage();
|
||
|
||
void signalShowRecoUiColorFaceSnapshot(const QString& path);
|
||
void signalShowRecoUiColorFaceSnapshot(const unsigned char* jpgDate, int len);
|
||
void signalRecoUiswitchToType(int type);
|
||
void signalQrcodeFastCfgResult(bool isSuccessed);
|
||
|
||
void signalIcCardResult(const QString& icCard);
|
||
void signalUpdateAdWidget();
|
||
|
||
void signalShowHealthMsg(int type, float temp, const QString& msg, bool pass, const unsigned char* jpgDate,
|
||
int jpgLen, const QString& tripCity, const QString& failReason, int bgColor, int displayTime);
|
||
void signalShowHealthCodeAuthStatus(int status);
|
||
void signalDelayResetRecoUi();
|
||
void signalShowAntiDismantleDetect(bool);
|
||
void signalShowSceneResult(int result, const QString& resultText, const QString& businessInfo, int displayTime);
|
||
void signalUpdatePersonNumAccessed(int personAccess, int personAll);
|
||
void signalSetSceneUiPersonCountType(int type);
|
||
void signalUpdateSceneUiPersonCount(int count);
|
||
void signalShowCallDialPage();
|
||
void signalSetCallConsoleStatus(int status, const QString& text);
|
||
void signalShowCallBtn(bool callButton, bool videoButton);
|
||
void signalShowRecoUiDevIdAndVer(bool);
|
||
void signalShowUserItemChoose(const QStringList& opns);
|
||
|
||
public slots:
|
||
void slotCloseStartPage();
|
||
void slotShowRecoPage();
|
||
void slotShowSettingPage();
|
||
void slotPwdAcceptDelayUpdate();
|
||
|
||
void slotUpdateIp(); //刷新识别界面的IP,设置界面没有IP显示了,后面去掉
|
||
|
||
void slotShowUserCandidate(const QString& title, const QStringList& opns);
|
||
void slotShowSettingUi();
|
||
void slotSetupDone();
|
||
void slotScreenTouch();
|
||
void slotCreateAndShowDevTestPage(const QString& devCfgMsg);
|
||
void slotDelayResetRecoUi();
|
||
void slotShowAntiDismantleDetect(bool);
|
||
void slotShowUserItemChoose(const QStringList& opns);
|
||
|
||
private:
|
||
typedef enum
|
||
{
|
||
MAIN_UI_PAGE_RECOGNIZE,
|
||
MAIN_UI_PAGE_SETTING
|
||
}MAIN_UI_PAGE_E;
|
||
|
||
QStackedWidget* m_stackWidget_mainUi;
|
||
|
||
//QSplashScreen *m_splash_startPage;
|
||
SplashScreenWithMsg *m_splash_startPage;
|
||
QTime* m_time_startupCost;
|
||
|
||
SetupUi* m_setupUi = nullptr;
|
||
settingUi* m_settingUi = nullptr;;
|
||
recoUi* m_recoUi;
|
||
|
||
QTranslator *m_translatorEnglish;
|
||
|
||
//密码多次输错处理
|
||
QTimer *m_timer;
|
||
int m_reTryTimes;
|
||
bool pwdAcceptDelay;
|
||
|
||
bool m_isPasswordDialogShowed;
|
||
|
||
void updateAllOption();
|
||
int settingPageAuthentication(const QString& dialogTitle, const QString& okBtn, const QString& cancelBtn, bool overtimeClose);
|
||
|
||
//void getBackImgPath(QString& imgPath);
|
||
//void getSaverPath(QString &imgPath);
|
||
};
|
||
|
||
#endif // MAINUI_H
|