Define.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma once
  2. #include <string>
  3. #include <list>
  4. enum ModuleType
  5. {
  6. Sensor=1,
  7. Actor=2,
  8. Purifier=3,
  9. Calculator=4,
  10. Storage=5,
  11. Transfer=6,
  12. };
  13. struct DataItem
  14. {
  15. int Id;
  16. std::string DataName;
  17. std::string Code;
  18. std::string DataType;
  19. bool Displayed;
  20. std::string Description;
  21. std::string ToString()
  22. {
  23. return Code + DataName;
  24. }
  25. };
  26. struct ModuleInfo
  27. {
  28. int Id;
  29. ModuleType Type; // 类型
  30. std::string Name; // 名称
  31. std::string Code; // 标识码
  32. std::string Model; // 型号
  33. std::string AssemblyName; // 组件程序(dll、jar)名字,含路径
  34. std::string ClassName; // 组件的 类名
  35. std::string Description; // 描述
  36. std::string Version; // 版本
  37. std::string Topic;
  38. };
  39. struct DeviceInfo
  40. {
  41. int Id;
  42. std::string Name; // 名称
  43. std::string Type; // 类型
  44. std::string Code; // 标识码
  45. std::string Model; // 型号,通信组件的Code属性
  46. int ServerId; //
  47. ModuleInfo ModuleInfo; //
  48. std::string Description; // 描述
  49. std::list<DataItem> Properties;
  50. };
  51. struct ConsumerInfo{
  52. std::string Name;
  53. std::string AssemblyName; // 组件程序(dll、jar)名字,含路径
  54. std::string ClassName; // 组件的 类名
  55. std::string SubscribeName;
  56. std::string Settings;
  57. };
  58. struct DataManagerInfo{
  59. int Id;
  60. std::string Name; // 名称
  61. std::string Type; // 类型
  62. std::string Code; // 标识码
  63. std::string Model; // 型号,通信组件的Code属性
  64. int ServerId; //
  65. std::string Description; // 描述
  66. std::list<ModuleInfo> modules;
  67. std::list<ConsumerInfo>consumers;
  68. };
  69. /*struct Config
  70. {
  71. int serverId;
  72. std::string appName;
  73. };*/