DeviceErrorInfor.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. #include "DeviceErrorCode.h"
  5. enum DEVICE_ERROR_INFO_TYPE
  6. {
  7. INFO_TYPE_ERROR,
  8. INFO_TYPE_WARN
  9. };
  10. class DeviceError
  11. {
  12. public:
  13. DeviceError(void);
  14. ~DeviceError(void);
  15. std::string getCode();
  16. std::string getName();
  17. std::string getDescription();
  18. std::string getSolution();
  19. std::string getNotifyType();
  20. std::string getInterlock();
  21. std::string getBackCommand();
  22. void setCode(std::string code);
  23. void setName(std::string name);
  24. void setDescription(std::string desc);
  25. void setSolution(std::string solu);
  26. void setNotifyType(std::string notifytype);
  27. void setInterlock(std::string interlock);
  28. void setBackCommand(std::string backCommand);
  29. private:
  30. std::string m_strCode;
  31. std::string m_strName;
  32. std::string m_strDescription;
  33. std::string m_strSolution;
  34. std::string m_strNotifyType;
  35. std::string m_strInterlock;
  36. std::string m_strBackCommand;
  37. //std::string m_str;
  38. };
  39. class DeviceErrorInfor
  40. {
  41. public:
  42. DeviceErrorInfor(void);
  43. ~DeviceErrorInfor(void);
  44. bool getDeviceError(const std::string strFileName , const std::string strCode, DeviceError &error);
  45. bool getDeviceWarn(const std::string strFileName, const std::string strCode, DeviceError &warn);
  46. bool getDeviceError(const std::string strCode, DeviceError &error);
  47. bool getDeviceWarn(const std::string strCode, DeviceError &warn);
  48. void setFileName(const std::string strPath);
  49. void setFileName(DEVICE_ERROR_INFO_TYPE type, const std::string strLang ,const std::string strInfoFileName ,std::string strAppPath);
  50. private:
  51. std::string m_strFileName;
  52. bool getInfor(const std::string strFileName ,const std::string strType , const std::string strCode, DeviceError &error);
  53. };
  54. class DeviceErrorList
  55. {
  56. public:
  57. DeviceErrorList(void);
  58. ~DeviceErrorList(void);
  59. bool isError();
  60. bool isExist(const std::string strCode);
  61. bool add(DeviceError &error);
  62. bool remove(const std::string strCode);
  63. void clear();
  64. int size();
  65. DeviceError &item(int index);
  66. private:
  67. std::vector<DeviceError> m_list;
  68. };