Collimator.BasicMoulds.hpp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #pragma once
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5. #include "DIOS.Dev.MouldDefine.hpp"
  6. #include "Collimator.BasicMoulds.hpp"
  7. #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
  8. namespace DIOS::Dev::Detail
  9. {
  10. namespace Collimator
  11. {
  12. static const char* DeviceDriverType = "{A1B2C3D4-5678-9101-1121-314159265358}";//"{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}";
  13. static const char* CollimatorUnitType = "{566EC9F1-CE5A-4B31-9D2A-E9E80B4CA0CC}"; //"{DD98BBEB-0850-4BE7-997B-8DDECA6BD654}";
  14. namespace AttrKey
  15. {
  16. static const char* MODE = "Mode"; //模式
  17. static const char* XSIZE = "XSize"; //单边大小
  18. static const char* YSIZE = "YSize";
  19. static const char* FILTER = "Filter"; //滤过
  20. static const char* SID = "SID"; //源板距离
  21. static const char* ANGLE = "Angle"; //角度
  22. static const char* LIGHT = "Light"; //定位灯状态
  23. static const char* ThresholdValue = "ThresholdValue"; //遮光器单边阈值
  24. static const char* MaxWidth = "MaxWidth"; //单边最大值
  25. static const char* MaxHigh = "MaxHigh";
  26. static const char* XRatio = "XRatio"; //单边比例
  27. static const char* YRatio = "YRatio";
  28. static const char* Reversal = "Reversal";
  29. static const char* ConnectionStatus = "ConnectionStatus";
  30. }
  31. namespace ActionKey
  32. {
  33. static const char* SetCollimatorSize = "SetCollimatorSize";
  34. static const char* SetCollimatorSID = "SetCollimatorSID";
  35. static const char* SetCollimatorFilter = "SetCollimatorFilter";
  36. static const char* SetCollimatorAngle = "SetCollimatorAngle";
  37. static const char* SetCollimatorMode = "SetCollimatorMode";
  38. static const char* SetTechParamsInfo = "SetTechParamsInfo";
  39. static const char* SetCollimatorLight = "SetCollimatorLight";
  40. static const char* SetHCollimatorOpen = "SetHCollimatorOpen";
  41. static const char* SetHCollimatorClose = "SetHCollimatorClose";
  42. static const char* SetVCollimatorOpen = "SetVCollimatorOpen";
  43. static const char* SetVCollimatorClose = "SetVCollimatorClose";
  44. static const char* Reset = "Reset";
  45. static const char* SetCollimatorRatio = "SetCollimatorRatio";
  46. }
  47. //##################################################################################################
  48. //定义具体设备属性
  49. #define UNIT_DATA_INT(NAME, KEY) \
  50. class NAME :public IntMould\
  51. {\
  52. using super = IntMould;\
  53. public:\
  54. NAME(int initialvalue, int lower, int upper, int accuracy)\
  55. :super(KEY, initialvalue, lower, upper, accuracy)\
  56. {}\
  57. ~NAME() {}\
  58. };\
  59. #define UNIT_DATA_INT_withLimit(NAME, KEY, INIT, MIN, MAX, ACC) \
  60. class NAME :public IntMould\
  61. {\
  62. using super = IntMould;\
  63. public:\
  64. NAME(int initialvalue = INIT, int lower = MIN, int upper = MAX, int accuracy = ACC)\
  65. :super(KEY, initialvalue, lower, upper, accuracy)\
  66. {}\
  67. ~NAME() {}\
  68. };\
  69. #define UNIT_DATA_FLOAT(NAME, KEY) \
  70. class NAME :public FloatMould\
  71. {\
  72. using super = FloatMould;\
  73. public:\
  74. NAME(float initialvalue, float lower, float upper, float accuracy)\
  75. :super(KEY, initialvalue, lower, upper, accuracy)\
  76. {}\
  77. ~NAME() {}\
  78. };\
  79. #define UNIT_DATA_STR(NAME, KEY) \
  80. class NAME :public StringMould\
  81. {\
  82. using super = StringMould;\
  83. public:\
  84. NAME(std::string initialvalue)\
  85. :super(KEY, initialvalue)\
  86. {}\
  87. ~NAME() {}\
  88. };\
  89. UNIT_DATA_INT(XSIZEMould, AttrKey::XSIZE);
  90. UNIT_DATA_INT(YSIZEMould, AttrKey::YSIZE);
  91. UNIT_DATA_INT(XRATIOMould, AttrKey::XRatio);
  92. UNIT_DATA_INT(YRATIOMould, AttrKey::YRatio);
  93. UNIT_DATA_INT(FILTERMould, AttrKey::FILTER);
  94. UNIT_DATA_INT(SIDMould, AttrKey::SID);
  95. UNIT_DATA_FLOAT(ANGLEMould, AttrKey::ANGLE);
  96. UNIT_DATA_INT(MODEMould, AttrKey::MODE);
  97. UNIT_DATA_INT(LIGHTMould, AttrKey::LIGHT);
  98. UNIT_DATA_INT(ReversalMould, AttrKey::Reversal);
  99. UNIT_DATA_INT(ConnectionStatusMould, AttrKey::ConnectionStatus);
  100. //-----------------------------------------------------------------------------
  101. // ConfigInfo
  102. //-----------------------------------------------------------------------------
  103. namespace ConfKey
  104. {
  105. static const char* DiosVender = "Vender";
  106. static const char* DiosModel = "Model";
  107. static const char* DiosConfig = "DeviceConfig";
  108. static const char* DiosAttribute = "Attribute";
  109. static const char* DiosDescription = "Description";
  110. static const char* DiosSCFType = "SCFType";
  111. static const char* DiosSCFTCPIP = "TCPIP";
  112. static const char* DiosSCFCOM = "COM";
  113. static const char* DiosSCFIP = "ip";
  114. static const char* DiosSCFPort = "port";
  115. static const char* DiosSCFBaudrate = "baudrate";
  116. static const char* DiosSCFBytesize = "bytesize";
  117. static const char* DiosSCFParity = "parity";
  118. static const char* DiosSCFStopbits = "stopbits";
  119. static const char* DiosIsConnect = "IsConnect";
  120. //20220412 新增 <ConfigToolInfo> 以及其内部属性,主要用于webconfig
  121. static const char* DiosConfigToolInfo = "ConfigToolInfo";
  122. static const char* DiosAttributeInfo = "AttributeInfo";
  123. static const char* DiosAttributeKey = "AttributeKey";
  124. static const char* DiosAttributeDescripition = "AttributeDescripition";
  125. static const char* DiosAccess = "Access";
  126. static const char* DiosType = "Type";
  127. static const char* DiosRangeMin = "RangeMin";
  128. static const char* DiosRangeMax = "RangeMax";
  129. static const char* DiosListNum = "ListNum";
  130. static const char* DiosListInfo = "ListInfo";
  131. static const char* DiosList = "List";
  132. static const char* DiosRequired = "Required";
  133. static const char* DiosDefaultValue = "DefaultValue";
  134. static const char* DiosInnerKey = "InnerKey";
  135. static const char* DiosPathID = "PathID";
  136. }
  137. }
  138. }