DeviceErrorInfor.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #pragma once
  2. #ifndef LIB_DEVICEERRORINFOR_EXPORTS
  3. #ifdef WIN_64BIT
  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 "DeviceErrorCode.h"
  19. using namespace std;
  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. string getCode();
  31. string getName();
  32. string getDescription();
  33. string getSolution();
  34. string getNotifyType();
  35. string getInterlock();
  36. string getBackCommand();
  37. void setCode(string code);
  38. void setName(string name);
  39. void setDescription(string desc);
  40. void setSolution(string solu);
  41. void setNotifyType(string notifytype);
  42. void setInterlock(string interlock);
  43. void setBackCommand(string backCommand);
  44. private:
  45. string m_strCode;
  46. string m_strName;
  47. string m_strDescription;
  48. string m_strSolution;
  49. string m_strNotifyType;
  50. string m_strInterlock;
  51. string m_strBackCommand;
  52. //string m_str;
  53. };
  54. class DeviceErrorInfor
  55. {
  56. public:
  57. DeviceErrorInfor(void);
  58. ~DeviceErrorInfor(void);
  59. bool getDeviceError(const string strFileName , const string strCode, DeviceError &error);
  60. bool getDeviceWarn(const string strFileName, const string strCode, DeviceError &warn);
  61. bool getDeviceError(const string strCode, DeviceError &error);
  62. bool getDeviceWarn(const string strCode, DeviceError &warn);
  63. void setFileName(DEVICE_ERROR_INFO_TYPE type, const string strLang ,const string strInfoFileName );
  64. private:
  65. string m_strFileName;
  66. bool getInfor(const string strFileName ,const string strType , const string strCode, DeviceError &error);
  67. };
  68. class DeviceErrorList
  69. {
  70. public:
  71. DeviceErrorList(void);
  72. ~DeviceErrorList(void);
  73. bool isError();
  74. bool isExist(const string strCode);
  75. bool add(DeviceError &error);
  76. bool remove(const string strCode);
  77. void clear();
  78. int size();
  79. DeviceError &item(int index);
  80. private:
  81. vector<DeviceError> m_list;
  82. };