DeviceErrorInfor.h 2.4 KB

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