Define.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. };
  38. struct DeviceInfo
  39. {
  40. int Id;
  41. std::string Name; // 名称
  42. std::string Type; // 类型
  43. std::string Code; // 标识码
  44. std::string Model; // 型号,通信组件的Code属性
  45. int ServerId; //
  46. ModuleInfo ModuleInfo; //
  47. std::string Description; // 描述
  48. std::list<DataItem> Properties;
  49. };
  50. struct ConsumerInfo{
  51. std::string name;
  52. std::string AssemblyName; // 组件程序(dll、jar)名字,含路径
  53. std::string ClassName; // 组件的 类名
  54. };
  55. struct DataManagerInfo{
  56. int Id;
  57. std::string Name; // 名称
  58. std::string Type; // 类型
  59. std::string Code; // 标识码
  60. std::string Model; // 型号,通信组件的Code属性
  61. int ServerId; //
  62. std::string Description; // 描述
  63. std::list<ModuleInfo> modules;
  64. std::list<ConsumerInfo>consumers;
  65. };
  66. struct Config
  67. {
  68. int serverId;
  69. std::string appName;
  70. };
  71. #include <QMutex>
  72. #include <QSemaphore>
  73. #include <QQueue>
  74. struct PublishData{
  75. };
  76. struct SharedData{
  77. QMutex* mutex;
  78. QSemaphore* sem;
  79. QQueue<PublishData>commandList;
  80. };