FPDErrorWarningProcess.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include "DIOS.Dev.IODevice.Detail.hpp"
  3. #include "DIOS.Dev.MSGMould.hpp"
  4. #include "DeviceErrorInfor.h"
  5. namespace nDetail = DIOS::Dev::Detail;
  6. class FPDErrorWarning
  7. {
  8. public:
  9. FPDErrorWarning(std::shared_ptr <DIOS::Dev::IOEventCenter> EventCenter, std::string DevInstance, std::string strInfoPath);
  10. ~FPDErrorWarning();
  11. //发送错误消息给消息中心 strErrCode:错误事件code, strErr:错误内容
  12. void SendError(std::string strErrCode, std::string strErr = "");
  13. //清除错误消息
  14. void ClearError(std::string strErrCode);
  15. //发送错误消息给消息中心 strWarnCode:警告事件code, strWarn:警告内容
  16. void SendWarn(std::string strWarnCode, std::string strWarn = "");
  17. //清除警告消息
  18. void ClearWarn(std::string strWarnCode);
  19. //发送所有错误列表信息
  20. void SendAllError();
  21. //发送所有警告列表信息
  22. void SendAllWarn();
  23. //清除所有错误
  24. void ClearAllError();
  25. //清除所有警告
  26. void ClearAllWarn();
  27. //错误列表是否存在错误: true:存在错误(禁止Ready); false:不存在错误(可Ready)
  28. bool IsErrorExist();
  29. RET_STATUS JSGetErrorList(std::string& out);
  30. protected:
  31. std::shared_ptr <DIOS::Dev::IOEventCenter> m_EventCenter;
  32. private:
  33. std::unique_ptr <nDetail::MSGUnit> m_MSGUnit;
  34. DeviceErrorInfor m_ErrRes; //error配置文件列表
  35. DeviceErrorInfor m_WarnRes; //warn配置文件列表
  36. DeviceErrorList m_ErrList; //当前错误列表
  37. DeviceErrorList m_WarnList; //当前警告列表
  38. };