DeviceErrorInfor.h 2.4 KB

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