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