FPDErrorWarningProcess.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. void OnError(std::string strErrCode, std::string strErr = "");
  13. //响应警告事件 nIndex:探测器ID strWarnCode:警告事件ID,strWarn:警告内容
  14. void OnWarn(std::string strWarnCode, std::string strWarn = "");
  15. //通知UI清除所有错误
  16. void ClearAllError();
  17. void AddWarnMsg(std::string code, std::string info);
  18. void DelWarnMsg(std::string code);
  19. void AddErrMsg(std::string code, std::string info);
  20. void DelErrMsg(std::string code);
  21. bool IsErrorExist(std::string code);
  22. int GetExistErrorNum();
  23. protected:
  24. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  25. private:
  26. DeviceErrorInfor m_WarnRes; //warn配置文件列表
  27. DeviceErrorInfor m_ErrRes; //error配置文件列表
  28. DeviceErrorList m_ErrList; //当前错误列表
  29. DeviceErrorList m_ErrListTemp; //初始化时未发送到UI的ERROR
  30. DeviceErrorList m_WarnList; //当前错误列表
  31. };