12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include "CCOS.Dev.IODevice.Detail.hpp"
- #include "CCOS.Dev.MSGMould.hpp"
- #include "DeviceErrorInfor.h"
- namespace nDetail = CCOS::Dev::Detail;
- class FPDErrorWarning
- {
- public:
- FPDErrorWarning(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter, std::string DevInstance, std::string strAppPath);
- ~FPDErrorWarning();
- std::unique_ptr <nDetail::MSGUnit> m_MSGUnit;
- //向HW发送错误消息
- void SendError( DeviceError obErr);
- void SendErrorX( std::string strErrorCode);
- //通知UI清除所有错误
- void ClearAllError();
- void SendAllError();
- void SendAllWarn();
- void SyncErrorList();
- //错误恢复后通知HW,strErrCode:恢复的错误ID
- bool OnErrorX( std::string strErrCode);
- //向HW发送警告消息
- void SendWarn( DeviceError obWar);
- void AddWarnMsg(std::string code, std::string info);
- void DelWarnMsg(std::string code);
- void AddErrMsg(std::string code, std::string info);
- void DelErrMsg(std::string code);
- bool IsErrorExist(std::string code);
- int GetExistErrorNum();
- void OnError(std::string strErrCode, std::string strErr = "");
- //响应警告事件 nIndex:探测器ID strWarnCode:警告事件ID,strWarn:警告内容
- void OnWarn(std::string strWarnCode, std::string strWarn = "");
- void OnWarnX(std::string strWarnCode);
- private:
- int GetMessageLevel(const std::string& code);
- protected:
- std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
- private:
- DeviceErrorInfor m_WarnRes; //warn配置文件列表
- DeviceErrorInfor m_ErrRes; //error配置文件列表
- DeviceErrorList m_ErrList; //当前错误列表
- DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR
- DeviceErrorList m_WarnList; //当前错误列表
- };
|