FPDErrorWarningProcess.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. //通知UI清除所有错误
  13. void ClearAllError();
  14. //通知UI警告信息
  15. void AddWarnMsg(std::string code, std::string info);
  16. //通知UI删除警告信息
  17. void DelWarnMsg(std::string code);
  18. //通知UI添加错误信息
  19. void AddErrMsg(std::string code, std::string info);
  20. //通知UI删除错误信息
  21. void DelErrMsg(std::string code);
  22. bool IsErrorExist(std::string code);
  23. int GetExistErrorNum();
  24. void OnError(std::string strErrCode, std::string strErr = "");
  25. //strWarnCode:警告事件ID,strWarn:警告内容
  26. void OnWarn(std::string strWarnCode, std::string strWarn = "");
  27. protected:
  28. std::shared_ptr <CCOS::Dev::IOEventCenter> m_EventCenter;
  29. private:
  30. DeviceErrorInfor m_WarnRes; //warn配置文件列表
  31. DeviceErrorInfor m_ErrRes; //error配置文件列表
  32. DeviceErrorList m_WarnList; //当前错误列表
  33. DeviceErrorList m_ErrList; //当前错误列表
  34. };