FPDErrorWarningProcess.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "CCOS.Dev.IODevice.Detail.hpp"
  3. #include "CCOS.Dev.MSGMould.hpp"
  4. #include "DeviceErrorInfor.h"
  5. namespace nDetail = CCOS::Dev::Detail;
  6. class FPDErrorWarning
  7. {
  8. public:
  9. FPDErrorWarning(std::shared_ptr <CCOS::Dev::IOEventCenter> EventCenter, std::string DevInstance, std::string strAppPath);
  10. ~FPDErrorWarning();
  11. std::unique_ptr <nDetail::MSGUnit> m_MSGUnit;
  12. //向HW发送错误消息
  13. void SendError( DeviceError obErr);
  14. void SendErrorX( std::string strErrorCode);
  15. //通知UI清除所有错误
  16. void ClearAllError();
  17. void SendAllError();
  18. void SendAllWarn();
  19. void SyncErrorList();
  20. //错误恢复后通知HW,strErrCode:恢复的错误ID
  21. bool OnErrorX( std::string strErrCode);
  22. //向HW发送警告消息
  23. void SendWarn( DeviceError obWar);
  24. void AddWarnMsg(std::string code, std::string info);
  25. void DelWarnMsg(std::string code);
  26. void AddErrMsg(std::string code, std::string info);
  27. void DelErrMsg(std::string code);
  28. bool IsErrorExist(std::string code);
  29. int GetExistErrorNum();
  30. void OnError(std::string strErrCode, std::string strErr = "");
  31. //响应警告事件 nIndex:探测器ID strWarnCode:警告事件ID,strWarn:警告内容
  32. void OnWarn(std::string strWarnCode, std::string strWarn = "");
  33. void OnWarnX(std::string strWarnCode);
  34. private:
  35. int GetMessageLevel(const std::string& code);
  36. protected:
  37. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  38. private:
  39. DeviceErrorInfor m_WarnRes; //warn配置文件列表
  40. DeviceErrorInfor m_ErrRes; //error配置文件列表
  41. DeviceErrorList m_ErrList; //当前错误列表
  42. DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR
  43. DeviceErrorList m_WarnList; //当前错误列表
  44. };