MECH.BasicMoulds.hpp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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 MECH
  13. {
  14. static const char* DeviceDriverType = "{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}";
  15. static const char* MechUnitType = "{0C99B70A-F788-48E1-9728-403BFF6DF982}";
  16. static const char* MamoMechUnitType = "{620AE3B7-74A2-45B8-AE91-B3574CDD5391}";
  17. namespace AttrKey
  18. {
  19. static const char* GRIDSTATE = "GridState";
  20. static const char* GRIDTYPE = "GridType";
  21. static const char* GRIDORIENTATION = "GridOrientation";
  22. static const char* VIEWID = "ViewID";
  23. static const char* TID = "DetectorToTableDistance";//TID
  24. static const char* SID = "DistanceSourcetoDetector";//SID
  25. static const char* ENTRANCE = "DistanceSourcetoEntrance";//ENTRANCE
  26. static const char* SOD = "DistanceSourcetoPatient";//SOD
  27. static const char* PATIENTSIZE = "PatientSize";
  28. static const char* POSITIONNUMBER = "PositionNumber";
  29. static const char* MAMMO_GRID = "GRID";
  30. static const char* MAMMO_AE = "AE";
  31. static const char* MAMMO_TUBEFILTER = "Filter";
  32. static const char* MAMMO_THICKNESS = "Thickness";
  33. static const char* MAMMO_CompPressureDEC = "CompPressureDEC";
  34. static const char* MAMMO_DEPRESS = "Depress";
  35. static const char* MAMMO_ANGLE = "MechanicalAngle";
  36. static const char* MAMMO_HEIGHT = "MechanicalHeight";
  37. static const char* MAMMO_PRESSVAL = "CompPressure";
  38. static const char* MAMMO_AGD = "AGD";
  39. static const char* MAMMO_MAG = "MAG";
  40. typedef enum _Dios_Mech_GridType
  41. {
  42. Grid_No,
  43. Grid_1150,
  44. Universal,
  45. Grid_1800,
  46. Grid_1000,
  47. Grid_3000,
  48. Grid_1500
  49. }MECH_GRIDTYPE;
  50. typedef enum _Dios_Mech_GridState
  51. {
  52. Grid_Noinformation,
  53. Grid_IN,
  54. Grid_IN_CHANGE,
  55. Grid_OUT,
  56. Grid_OUT_CHANGE
  57. }MECH_GRIDSTATE;
  58. typedef enum _Dios_Mech_GridOrientation
  59. {
  60. Grid_Vertical,
  61. Grid_Horizontal
  62. }MECH_GRIDORIENTATION;
  63. }
  64. namespace ActionKey
  65. {
  66. //病人信息相关
  67. static const char* SetStudyInfo = "SetStudyInfo";
  68. static const char* SetViewList = "SetViewList";
  69. static const char* SelectViewInfo = "SelectViewInfo";
  70. //技术参数主要是位置码,遮光器尺寸等信息
  71. static const char* SetTechParamsInfo = "SetTechParamsInfo";
  72. static const char* SetPositonNumber = "SetPositonNumber";
  73. //机架机械控制
  74. static const char* SetGridType = "SetGridType";
  75. static const char* SetSID = "SetSID";
  76. static const char* SetSOD = "SetSOD";
  77. static const char* SetAutoTracking = "SetAutoTracking";
  78. //获取tomo曝光中的位置信息
  79. static const char* GetTomoResults = "GetTomoResults";
  80. }
  81. class GRIDSTATEMould :public IntMould
  82. {
  83. using super = IntMould;
  84. public:
  85. GRIDSTATEMould( int initialvalue, int lower, int upper, int accuracy)
  86. :super( AttrKey::GRIDSTATE, initialvalue, lower, upper, accuracy)
  87. {}
  88. ~GRIDSTATEMould() {}
  89. };
  90. class GRIDTYPEMould :public IntMould
  91. {
  92. using super = IntMould;
  93. public:
  94. GRIDTYPEMould( int initialvalue, int lower, int upper, int accuracy)
  95. :super( AttrKey::GRIDTYPE, initialvalue, lower, upper, accuracy)
  96. {}
  97. ~GRIDTYPEMould() {}
  98. };
  99. class GRIDORIENTATIONMould :public IntMould
  100. {
  101. using super = IntMould;
  102. public:
  103. GRIDORIENTATIONMould( int initialvalue, int lower, int upper, int accuracy)
  104. :super( AttrKey::GRIDORIENTATION, initialvalue, lower, upper, accuracy)
  105. {}
  106. ~GRIDORIENTATIONMould() {}
  107. };
  108. class VIEWIDMould :public IntMould
  109. {
  110. using super = IntMould;
  111. public:
  112. VIEWIDMould( int initialvalue, int lower, int upper, int accuracy)
  113. :super( AttrKey::VIEWID, initialvalue, lower, upper, accuracy)
  114. {}
  115. ~VIEWIDMould() {}
  116. };
  117. class TIDMould :public IntMould
  118. {
  119. using super = IntMould;
  120. public:
  121. TIDMould( int initialvalue, int lower, int upper, int accuracy)
  122. :super( AttrKey::TID, initialvalue, lower, upper, accuracy)
  123. {}
  124. ~TIDMould() {}
  125. static constexpr const char* Unit{ "mm" };
  126. std::string GetDescription()
  127. {
  128. ResDataObject temp, result;
  129. temp.add(ValKey::UPPERLIMIT, m_LimitMax);
  130. temp.add(ValKey::LOWERLIMIT, m_LimitMin);
  131. temp.add(ValKey::ACCURACY, m_Accuracy);
  132. temp.add(ValKey::UNIT, Unit);
  133. result.add(Key.c_str(), temp);
  134. return result.encode();
  135. }
  136. };
  137. class SIDMould :public IntMould
  138. {
  139. using super = IntMould;
  140. public:
  141. SIDMould( int initialvalue, int lower, int upper, int accuracy)
  142. :super( AttrKey::SID, initialvalue, lower, upper, accuracy)
  143. {}
  144. ~SIDMould() {}
  145. static constexpr const char* Unit{ "mm" };
  146. std::string GetDescription()
  147. {
  148. ResDataObject temp, result;
  149. temp.add(ValKey::UPPERLIMIT, m_LimitMax);
  150. temp.add(ValKey::LOWERLIMIT, m_LimitMin);
  151. temp.add(ValKey::ACCURACY, m_Accuracy);
  152. temp.add(ValKey::UNIT, Unit);
  153. result.add(Key.c_str(), temp);
  154. return result.encode();
  155. }
  156. };
  157. class ENTRANCEMould :public IntMould
  158. {
  159. using super = IntMould;
  160. public:
  161. ENTRANCEMould( int initialvalue, int lower, int upper, int accuracy)
  162. :super( AttrKey::ENTRANCE, initialvalue, lower, upper, accuracy)
  163. {}
  164. ~ENTRANCEMould() {}
  165. static constexpr const char* Unit{ "mm" };
  166. std::string GetDescription()
  167. {
  168. ResDataObject temp, result;
  169. temp.add(ValKey::UPPERLIMIT, m_LimitMax);
  170. temp.add(ValKey::LOWERLIMIT, m_LimitMin);
  171. temp.add(ValKey::ACCURACY, m_Accuracy);
  172. temp.add(ValKey::UNIT, Unit);
  173. result.add(Key.c_str(), temp);
  174. return result.encode();
  175. }
  176. };
  177. class SODMould :public IntMould
  178. {
  179. using super = IntMould;
  180. public:
  181. SODMould( int initialvalue, int lower, int upper, float accuracy)
  182. :super( AttrKey::SOD, initialvalue, lower, upper, accuracy)
  183. {}
  184. ~SODMould() {}
  185. static constexpr const char* Unit{ "mm" };
  186. std::string GetDescription()
  187. {
  188. ResDataObject temp, result;
  189. temp.add(ValKey::UPPERLIMIT, m_LimitMax);
  190. temp.add(ValKey::LOWERLIMIT, m_LimitMin);
  191. temp.add(ValKey::ACCURACY, m_Accuracy);
  192. temp.add(ValKey::UNIT, Unit);
  193. result.add(Key.c_str(), temp);
  194. return result.encode();
  195. }
  196. };
  197. class PATIENTSIZEMould :public IntMould
  198. {
  199. using super = IntMould;
  200. public:
  201. PATIENTSIZEMould( int initialvalue, int lower, int upper, int accuracy)
  202. :super( AttrKey::PATIENTSIZE, initialvalue, lower, upper, accuracy)
  203. {}
  204. ~PATIENTSIZEMould() {}
  205. };
  206. class POSITIONNUMBERMould :public IntMould
  207. {
  208. using super = IntMould;
  209. public:
  210. POSITIONNUMBERMould(int initialvalue, int lower, int upper, int accuracy)
  211. :super(AttrKey::POSITIONNUMBER, initialvalue, lower, upper, accuracy)
  212. {}
  213. ~POSITIONNUMBERMould() {}
  214. };
  215. class MAMMOGRIDMould :public IntMould
  216. {
  217. using super = IntMould;
  218. public:
  219. MAMMOGRIDMould(int initialvalue, int lower, int upper, int accuracy)
  220. :super(AttrKey::MAMMO_GRID, initialvalue, lower, upper, accuracy)
  221. {}
  222. ~MAMMOGRIDMould() {}
  223. };
  224. class MAMMOAEMould :public IntMould
  225. {
  226. using super = IntMould;
  227. public:
  228. MAMMOAEMould(int initialvalue, int lower, int upper, int accuracy)
  229. :super(AttrKey::MAMMO_AE, initialvalue, lower, upper, accuracy)
  230. {}
  231. ~MAMMOAEMould() {}
  232. };
  233. class MAMMOTHICKNESSMould :public IntMould
  234. {
  235. using super = IntMould;
  236. public:
  237. MAMMOTHICKNESSMould(int initialvalue, int lower, int upper, int accuracy)
  238. :super(AttrKey::MAMMO_THICKNESS, initialvalue, lower, upper, accuracy)
  239. {}
  240. ~MAMMOTHICKNESSMould() {}
  241. };
  242. class MAMMOTUBEFILTERMould :public IntMould
  243. {
  244. using super = IntMould;
  245. public:
  246. MAMMOTUBEFILTERMould(int initialvalue, int lower, int upper, int accuracy)
  247. :super(AttrKey::MAMMO_TUBEFILTER, initialvalue, lower, upper, accuracy)
  248. {}
  249. ~MAMMOTUBEFILTERMould() {}
  250. };
  251. class MAMMOPRESSDECMould :public IntMould
  252. {
  253. using super = IntMould;
  254. public:
  255. MAMMOPRESSDECMould(int initialvalue, int lower, int upper, int accuracy)
  256. :super(AttrKey::MAMMO_CompPressureDEC, initialvalue, lower, upper, accuracy)
  257. {}
  258. ~MAMMOPRESSDECMould() {}
  259. };
  260. class MAMMODEPRESSMould :public IntMould
  261. {
  262. using super = IntMould;
  263. public:
  264. MAMMODEPRESSMould(int initialvalue, int lower, int upper, int accuracy)
  265. :super(AttrKey::MAMMO_DEPRESS, initialvalue, lower, upper, accuracy)
  266. {}
  267. ~MAMMODEPRESSMould() {}
  268. };
  269. class MAMMOANGLEMould :public FloatMould
  270. {
  271. using super = FloatMould;
  272. public:
  273. MAMMOANGLEMould(float initialvalue, float lower, float upper, float accuracy)
  274. :super(AttrKey::MAMMO_ANGLE, initialvalue, lower, upper, accuracy)
  275. {}
  276. ~MAMMOANGLEMould() {}
  277. };
  278. class MAMMOHEIGHTMould :public FloatMould
  279. {
  280. using super = FloatMould;
  281. public:
  282. MAMMOHEIGHTMould(float initialvalue, float lower, float upper, float accuracy)
  283. :super(AttrKey::MAMMO_HEIGHT, initialvalue, lower, upper, accuracy)
  284. {}
  285. ~MAMMOHEIGHTMould() {}
  286. };
  287. class MAMMOPRESSVALMould :public FloatMould
  288. {
  289. using super = FloatMould;
  290. public:
  291. MAMMOPRESSVALMould(float initialvalue, float lower, float upper, float accuracy)
  292. :super(AttrKey::MAMMO_PRESSVAL, initialvalue, lower, upper, accuracy)
  293. {}
  294. ~MAMMOPRESSVALMould() {}
  295. };
  296. class MAMMOAGDMould :public FloatMould
  297. {
  298. using super = FloatMould;
  299. public:
  300. MAMMOAGDMould(float initialvalue, float lower, float upper, float accuracy)
  301. :super(AttrKey::MAMMO_AGD, initialvalue, lower, upper, accuracy)
  302. {}
  303. ~MAMMOAGDMould() {}
  304. };
  305. class MAMMOMAGMould :public FloatMould
  306. {
  307. using super = FloatMould;
  308. public:
  309. MAMMOMAGMould(float initialvalue, float lower, float upper, float accuracy)
  310. :super(AttrKey::MAMMO_MAG, initialvalue, lower, upper, accuracy)
  311. {}
  312. ~MAMMOMAGMould() {}
  313. };
  314. //-----------------------------------------------------------------------------
  315. // ConfigInfo
  316. //-----------------------------------------------------------------------------
  317. namespace ConfKey
  318. {
  319. static const char* DiosType = "Vender";
  320. static const char* DiosModel = "Model";
  321. static const char* DiosConfig = "DeviceConfig";
  322. static const char* DiosAttribute = "Attribute";
  323. static const char* DiosDescription = "Description";
  324. static const char* DiosSCFType = "SCFType";
  325. static const char* DiosSCFTCPIP = "TCPIP";
  326. static const char* DiosSCFCOM = "COM";
  327. static const char* DiosSCFIP = "ip";
  328. static const char* DiosSCFPort = "port";
  329. static const char* DiosSCFBaudrate = "baudrate";
  330. static const char* DiosSCFBytesize = "bytesize";
  331. static const char* DiosSCFParity = "parity";
  332. static const char* DiosSCFStopbits = "stopbits";
  333. static const char* DiosIsConnect = "IsConnect";
  334. }
  335. }
  336. }