#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 EventCenter, std::string DevInstance, std::string strAppPath); ~FPDErrorWarning(); std::unique_ptr m_MSGUnit; //向HW发送错误消息 void SendError( DeviceError obErr); void SendErrorX( std::string strErrorCode); //通知UI清除所有错误 void ClearAllError(); void SendAllError(); //错误恢复后通知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 = ""); protected: std::shared_ptr m_EventCenter; private: DeviceErrorInfor m_WarnRes; //warn配置文件列表 DeviceErrorInfor m_ErrRes; //error配置文件列表 DeviceErrorInfor m_XCUWarnRes; //XCUwarn配置文件列表 DeviceErrorInfor m_XCUErrRes; //XCUerror配置文件列表 DeviceErrorList m_ErrList; //当前错误列表 DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR DeviceErrorList m_WarnList; //当前错误列表 };