#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; void OnError(std::string strErrCode, std::string strErr = ""); //响应警告事件 nIndex:探测器ID strWarnCode:警告事件ID,strWarn:警告内容 void OnWarn(std::string strWarnCode, std::string strWarn = ""); //通知UI清除所有错误 void ClearAllError(); 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(); protected: std::shared_ptr m_EventCenter; private: DeviceErrorInfor m_WarnRes; //warn配置文件列表 DeviceErrorInfor m_ErrRes; //error配置文件列表 DeviceErrorList m_ErrList; //当前错误列表 DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR DeviceErrorList m_WarnList; //当前错误列表 };