SYNBOX.BasicMoulds.hpp 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. #pragma once
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5. //
  6. //#include "TmplMould.tlh"
  7. //#include "TmplMould.tli"
  8. #include "DIOS.Dev.MouldDefine.hpp"
  9. #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
  10. namespace DIOS::Dev::Detail
  11. {
  12. namespace SYNBOX
  13. {
  14. static const char* DeviceDriverType = "{93A0633D-0BF0-4c45-9973-BFF841D5E2DC}";
  15. static const char* SyncConsoleUnitType = "{D1AF818B-72D0-400E-B780-DF58E2EF23D4}";
  16. namespace AttrKey
  17. {
  18. static const char* WORKSTATION = "WORKSTATION";
  19. static const char* EXPMODE = "EXPMODE";
  20. static const char* DiosGeneratorSync = "GENERATORSYNCSTATE";
  21. static const char* DiosExpectGeneratorSync = "GENERATOREXPECTSYNCSTATE";
  22. typedef enum _Dios_Generator_Sync
  23. {
  24. GENERATOR_SYNC_ERR = -1,
  25. GENERATOR_RAD_OFF,
  26. GENERATOR_RAD_PREPARE,
  27. GENERATOR_RAD_READY,
  28. GENERATOR_RAD_XRAYON,
  29. GENERATOR_RAD_XRAYOFF,
  30. GENERATOR_FLU_OFF,
  31. GENERATOR_FLU_READY,
  32. GENERATOR_FLU_XRAYON,
  33. GENERATOR_FLU_XRAYOFF,
  34. GENERATOR_SYNC_MAX
  35. }GENERATOR_SYNC;
  36. static const char* DiosHandSwitch = "HANDSWITCHSTATE";
  37. typedef enum _HAND_SWITCH {
  38. HAND_OFF,
  39. HAND_DWON1,
  40. HAND_DWON2,
  41. HAND_MAX
  42. }HAND_SWITCH;
  43. static const char* TOTALEXPSURENUMBER = "TotalExposureNumber";
  44. static const char* CURRENTEXPOSUREBNUMBER = "CurrentExposureNumber";
  45. static const char* DiosDetectorStatus = "DETECTORSTATUS";
  46. typedef enum _Dios_Detector_Status
  47. {
  48. DETECTOR_STATUS_SHUTDOWN,
  49. DETECTOR_STATUS_INIT,
  50. DETECTOR_STATUS_SLEEP,
  51. DETECTOR_STATUS_WAKEUP,//低能耗,能工作
  52. DETECTOR_STATUS_STANDBY,//高能耗,能采集
  53. //DETECTOR_STATUS_ACQ_WAIT,//在STANDBY状态,执行ACQ Action且没到ACQ状态
  54. DETECTOR_STATUS_ACQ,
  55. //DETECTOR_STATUS_STANDBY_WAIT,//在ACQ状态,执行StopAcq Action且没到STANDBY状态
  56. DETECTOR_STATUS_ERROR,
  57. DETECTOR_STATUS_MAX
  58. }DETECTOR_STATUS;
  59. static const char* DiosXwindowStatus = "XWINDOWSTATUS";
  60. typedef enum _Xwindow_Status {
  61. XWINDOW_OFF,
  62. XWINDOW_ON,
  63. XWINDOW_MAX
  64. }XWINDOW_STATUS;
  65. }
  66. namespace ActionKey
  67. {
  68. static const char* SetValue_WORKSTATION = "SetValue_WORKSTATION";
  69. static const char* SetExpMode = "SetExpMode";
  70. static const char* SetGeneratortoSyncStatus = "SetGeneratortoSyncStatus";
  71. static const char* SetExpEnable = "SetExpEnable";
  72. static const char* SetExpDisable = "SetExpDisable";
  73. static const char* PrepareAcquisition = "PrepareAcquisition";
  74. static const char* StartWindowRequest = "StartWindowRequest";
  75. static const char* SetExposureTimes = "SetExposureTimes";
  76. static const char* StopWindowRequest = "StopWindowRequest";
  77. static const char* SetFrameRate = "SetFrameRate";
  78. }
  79. //-----------------------------------------------------------------------------
  80. // HANDSWITCHMould
  81. //-----------------------------------------------------------------------------
  82. class HANDSWITCHMould :public IntMould
  83. {
  84. using super = IntMould;
  85. public:
  86. HANDSWITCHMould( int initialvalue, int lower, int upper, int accuracy)
  87. :super(AttrKey::DiosHandSwitch, initialvalue, lower, upper, accuracy)
  88. {
  89. }
  90. ~HANDSWITCHMould()
  91. {
  92. }
  93. };
  94. //-----------------------------------------------------------------------------
  95. // GENSYNSTATEMould
  96. //-----------------------------------------------------------------------------
  97. class GENSYNSTATEMould :public IntMould
  98. {
  99. using super =IntMould;
  100. public:
  101. GENSYNSTATEMould( int initialvalue, int lower, int upper, int accuracy)
  102. :super( AttrKey::DiosGeneratorSync, initialvalue, lower, upper, accuracy)
  103. {
  104. }
  105. ~GENSYNSTATEMould()
  106. {
  107. }
  108. };
  109. //-----------------------------------------------------------------------------
  110. // GENEXPECTSYNSTATEMould
  111. //-----------------------------------------------------------------------------
  112. class GENEXPECTSYNSTATEMould :public IntMould
  113. {
  114. using super = IntMould;
  115. public:
  116. GENEXPECTSYNSTATEMould(int initialvalue, int lower, int upper, int accuracy)
  117. :super(AttrKey::DiosExpectGeneratorSync, initialvalue, lower, upper, accuracy)
  118. {
  119. }
  120. ~GENEXPECTSYNSTATEMould()
  121. {
  122. }
  123. };
  124. //-----------------------------------------------------------------------------
  125. // TotalExposureNumberMould
  126. //-----------------------------------------------------------------------------
  127. class TOTALEXPNUMMould :public IntMould
  128. {
  129. using super = IntMould;
  130. public:
  131. TOTALEXPNUMMould(int initialvalue, int lower, int upper, int accuracy)
  132. :super(AttrKey::TOTALEXPSURENUMBER, initialvalue, lower, upper, accuracy)
  133. {
  134. }
  135. ~TOTALEXPNUMMould()
  136. {
  137. }
  138. };
  139. //-----------------------------------------------------------------------------
  140. // CurrentExposureNumber
  141. //-----------------------------------------------------------------------------
  142. class CUREXPNUMMould :public IntMould
  143. {
  144. using super = IntMould;
  145. public:
  146. CUREXPNUMMould(int initialvalue, int lower, int upper, int accuracy)
  147. :super( AttrKey::CURRENTEXPOSUREBNUMBER, initialvalue, lower, upper, accuracy)
  148. {
  149. }
  150. ~CUREXPNUMMould()
  151. {
  152. }
  153. };
  154. //-----------------------------------------------------------------------------
  155. // DETECTORSTATUSMould
  156. //-----------------------------------------------------------------------------
  157. class DETECTORSTATUSMould :public IntMould
  158. {
  159. using super = IntMould;
  160. public:
  161. DETECTORSTATUSMould(int initialvalue, int lower, int upper, int accuracy)
  162. :super( AttrKey::DiosDetectorStatus, initialvalue, lower, upper, accuracy)
  163. {
  164. }
  165. ~DETECTORSTATUSMould()
  166. {
  167. }
  168. };
  169. //-----------------------------------------------------------------------------
  170. // XWINDOWSTATUSMould
  171. //-----------------------------------------------------------------------------
  172. class XWINDOWSTATUSMould :public IntMould
  173. {
  174. using super = IntMould;
  175. public:
  176. XWINDOWSTATUSMould(int initialvalue, int lower, int upper, int accuracy)
  177. :super(AttrKey::DiosXwindowStatus, initialvalue, lower, upper, accuracy)
  178. {
  179. }
  180. ~XWINDOWSTATUSMould()
  181. {
  182. }
  183. };
  184. //-----------------------------------------------------------------------------
  185. // WORKSTATIONMould
  186. //-----------------------------------------------------------------------------
  187. class WORKSTATIONMould :public StringMould
  188. {
  189. using super = StringMould;
  190. public:
  191. WORKSTATIONMould(std::string initialvalue)
  192. :super(AttrKey::WORKSTATION, initialvalue)
  193. {
  194. }
  195. ~WORKSTATIONMould()
  196. {
  197. }
  198. };
  199. //-----------------------------------------------------------------------------
  200. // EXPMODEMould
  201. //-----------------------------------------------------------------------------
  202. class EXPMODEMould :public StringMould
  203. {
  204. using super = StringMould;
  205. public:
  206. EXPMODEMould(std::string initialvalue)
  207. :super(AttrKey::EXPMODE, initialvalue)
  208. {
  209. }
  210. ~EXPMODEMould()
  211. {
  212. }
  213. };
  214. //-----------------------------------------------------------------------------
  215. // ConfigInfo
  216. //-----------------------------------------------------------------------------
  217. namespace ConfKey
  218. {
  219. static const char* DiosType = "Vender";
  220. static const char* DiosModel = "Model";
  221. static const char* DiosConfig = "DeviceConfig";
  222. static const char* DiosAttribute = "Attribute";
  223. static const char* DiosDescription = "Description";
  224. static const char* DiosSCFType = "SCFType";
  225. static const char* DiosSCFTCPIP = "TCPIP";
  226. static const char* DiosSCFCOM = "COM";
  227. static const char* DiosSCFIP = "ip";
  228. static const char* DiosSCFPort = "port";
  229. static const char* DiosSCFBaudrate = "baudrate";
  230. static const char* DiosSCFBytesize = "bytesize";
  231. static const char* DiosSCFParity = "parity";
  232. static const char* DiosSCFStopbits = "stopbits";
  233. static const char* DiosIsConnect = "IsConnect";
  234. }
  235. }
  236. }