#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; //通知UI清除所有错误 void ClearAllError(); //通知UI警告信息 void AddWarnMsg(std::string code, std::string info); //通知UI删除警告信息 void DelWarnMsg(std::string code); //通知UI添加错误信息 void AddErrMsg(std::string code, std::string info); //通知UI删除错误信息 void DelErrMsg(std::string code); bool IsErrorExist(std::string code); int GetExistErrorNum(); void OnError(std::string strErrCode, std::string strErr = ""); //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配置文件列表 DeviceErrorList m_WarnList; //当前错误列表 DeviceErrorList m_ErrList; //当前错误列表 };