1 Star 0 Fork 0

qinxude/rk3568ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
toolbar.h 3.56 KB
一键复制 编辑 原始数据 按行查看 历史
qinxude 提交于 2024-09-03 09:38 . 3568ui base
#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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qinxude/rk3568ui.git
[email protected]:qinxude/rk3568ui.git
qinxude
rk3568ui
rk3568ui
master

搜索帮助