#pragma once #include "DIOS.Dev.IODevice.Detail.hpp" #include "DIOS.Dev.MSGMould.hpp" #include "DeviceErrorInfor.h" namespace nDetail = DIOS::Dev::Detail; class FPDErrorWarning { public: FPDErrorWarning(std::shared_ptr EventCenter, std::string DevInstance, std::string strInfoPath); ~FPDErrorWarning(); //发送错误消息给消息中心 strErrCode:错误事件code, strErr:错误内容 void SendError(std::string strErrCode, std::string strErr = ""); //清除错误消息 void ClearError(std::string strErrCode); //发送错误消息给消息中心 strWarnCode:警告事件code, strWarn:警告内容 void SendWarn(std::string strWarnCode, std::string strWarn = ""); //清除警告消息 void ClearWarn(std::string strWarnCode); //发送所有错误列表信息 void SendAllError(); //发送所有警告列表信息 void SendAllWarn(); //清除所有错误 void ClearAllError(); //清除所有警告 void ClearAllWarn(); //错误列表是否存在错误: true:存在错误(禁止Ready); false:不存在错误(可Ready) bool IsErrorExist(); RET_STATUS JSGetErrorList(std::string& out); protected: std::shared_ptr m_EventCenter; private: std::unique_ptr m_MSGUnit; DeviceErrorInfor m_ErrRes; //error配置文件列表 DeviceErrorInfor m_WarnRes; //warn配置文件列表 DeviceErrorList m_ErrList; //当前错误列表 DeviceErrorList m_WarnList; //当前警告列表 };