FPDErrorWarningProcess.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. //错误恢复后通知HW,strErrCode:恢复的错误ID
  19. bool OnErrorX( std::string strErrCode);
  20. //向HW发送警告消息
  21. void SendWarn( DeviceError obWar);
  22. void AddWarnMsg(std::string code, std::string info);
  23. void DelWarnMsg(std::string code);
  24. void AddErrMsg(std::string code, std::string info);
  25. void DelErrMsg(std::string code);
  26. bool IsErrorExist(std::string code);
  27. int GetExistErrorNum();
  28. void OnError(std::string strErrCode, std::string strErr = "");
  29. //响应警告事件 nIndex:探测器ID strWarnCode:警告事件ID,strWarn:警告内容
  30. void OnWarn(std::string strWarnCode, std::string strWarn = "");
  31. protected:
  32. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  33. private:
  34. DeviceErrorInfor m_WarnRes; //warn配置文件列表
  35. DeviceErrorInfor m_ErrRes; //error配置文件列表
  36. DeviceErrorInfor m_XCUWarnRes; //XCUwarn配置文件列表
  37. DeviceErrorInfor m_XCUErrRes; //XCUerror配置文件列表
  38. DeviceErrorList m_ErrList; //当前错误列表
  39. DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR
  40. DeviceErrorList m_WarnList; //当前错误列表
  41. };