代码拉取完成,页面将自动刷新
#ifndef TOOLBAR_H
#define TOOLBAR_H
#include <QWidget>
#include <QList>
#include <QLabel>
#include <QTimer>
#include <QTime>
#include "datadictionary.h"
#include <QProcess>
namespace Ui {
class ToolBar;
}
class StatusPic
{
public:
typedef enum {
PIC_OK_SHOW,
PIC_FAILED_SHOW,
PIC_FAULT_SHOW,
PIC_HIDE,
}PicStatus_t;
explicit StatusPic(PicStatus_t S,
QString Ok,
QString Failed,
QString Fault)
{
m_Status = S;
m_OkPic = Ok;
m_FailedPic = Failed;
m_FaultPic = Fault;
}
void SetStatus(PicStatus_t S)
{
m_Status = S;
}
void SetId(uint32_t Id)
{
m_Id = Id;
}
PicStatus_t GetStatus(void)
{
return m_Status;
}
QString GetOkPic(void)
{
return m_OkPic;
}
QString GetFailedPic(void)
{
return m_FailedPic;
}
QString GetFaultPic(void)
{
return m_FaultPic;
}
uint32_t GetId(void)
{
return m_Id;
}
private:
PicStatus_t m_Status;
QString m_OkPic;
QString m_FailedPic;
QString m_FaultPic;
uint32_t m_Id;
};
class StatusLabel
{
public:
StatusLabel(bool Enable,QLabel *Label)
{
m_Enable = Enable;
m_Label = Label;
}
void SetEnable(bool Enable)
{
m_Enable = Enable;
}
void SetPic(QString Pic)
{
m_Pic = Pic;
}
void Show()
{
if(m_Enable == true && m_Label != nullptr)
{
QString Sheet = "QLabel{border-image: url(:" + m_Pic + ");}";
m_Label->setStyleSheet(Sheet);
m_Label->show();
}
else if(m_Enable == false && m_Label != nullptr)
{
m_Label->hide();
}
}
private:
bool m_Enable;
QLabel *m_Label;
QString m_Pic;
};
#define TIME_UPDATE_TIMER (500) /** ms */
class ToolBar : public QWidget
{
Q_OBJECT
public:
static ToolBar* GetInstance();
~ToolBar();
void Show(QWidget *parent);
void SetFaceIdSuccess(QString Name,QImage Img);
typedef enum {
SCREEN_LOCK = 0,
SCREEN_UNLOCK,
}SCREEN_STA;
SCREEN_STA GetLockScreenSta();
signals:
void SettingClicked();
void VolumeClicked();
void QuiteFaceId();
void StartFaceId();
void LockScreen(bool);
public slots:
void SetVolumeMute(bool S);
private slots:
void SysTimeDisplay();
void MonitorRtDataChange(MonitorRtDataIndex_t);
void DevParamDataChange(DevParamDataIndex_t);
void SystemDataChange(SystemDataIndex_t);
void MisDataChange(MisDataIndex_t);
void SettingButtonclicked();
void SettingButtonPress5s();
void NetStaCheck();
void on_FaceIdButton_clicked();
void on_VolumeButton_clicked();
void CheckNetWork();
private:
explicit ToolBar(QWidget *parent = nullptr);
void ShowStatusPic(void);
void SetFaceIdButton(bool En);
void FaceIdEnable(bool S);
void AllButtonLock(bool S);
private:
Ui::ToolBar *ui;
static ToolBar* m_ToolBar;
QList<StatusPic*> m_StaList;
QList<StatusLabel*> m_LabelList;
QTimer *m_TimeUpdateTimer;
QTimer *m_NetCheckTimer;
StatusPic *m_BBNetworkSta;
StatusPic *m_LocalNetworkSta;
StatusPic *m_BlackBoxSta;
StatusPic *m_SatellitePSta;
StatusPic *m_MultiComSta;
StatusPic *m_CtlBoardSta;
StatusPic *m_SmartBoardSta;
bool m_FaceIdSucess;
DataDictionary *m_DataDictionary;
SCREEN_STA m_ScreenSta;
QProcess m_Process;
QString m_NetTxBytesTmp;
};
#endif // TOOLBAR_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。