DIOS.Dev.Generator.Mould.hpp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. #pragma once
  2. #include <string>
  3. #include "DriverConfigInfo.hpp"
  4. #include "DIOS.Dev.IODevice.hpp"
  5. #include "DIOS.Dev.IODevice.Detail.hpp"
  6. #include "Generator.BasicMoulds.hpp"
  7. #include "Logger.temp.h"
  8. namespace nsDetail = DIOS::Dev::Detail;
  9. #ifndef DIOSDEVGENDEVICEMOULD_EXPORTS
  10. #ifdef _WIN64
  11. #ifdef _DEBUG
  12. #pragma comment(lib, "DIOS.Dev.Generator.Mould64D.lib")
  13. #else
  14. #pragma comment(lib, "DIOS.Dev.Generator.Mould64.lib")
  15. #endif
  16. #else
  17. #ifdef _DEBUG
  18. #pragma comment(lib, "DIOS.Dev.Generator.MouldD.lib")
  19. #else
  20. #pragma comment(lib, "DIOS.Dev.Generator.MouldD.lib")
  21. #endif
  22. #endif
  23. #endif
  24. #ifdef DIOSDEVGENDEVICEMOULD_EXPORTS
  25. #define _DIOSDEVGENDEVICEMOULD_API __declspec(dllexport)
  26. #else
  27. #define _DIOSDEVGENDEVICEMOULD_API __declspec(dllimport)
  28. #endif
  29. #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::GeneratorMould”的客户端使用
  30. namespace DIOS::Dev::Detail::Generator
  31. {
  32. //-----------------------------------------------------------------------------
  33. // DoseUnit
  34. //-----------------------------------------------------------------------------
  35. class _DIOSDEVGENDEVICEMOULD_API DoseUnit : public IOLogicUnit
  36. {
  37. public:
  38. DoseUnit() {};
  39. virtual ~DoseUnit() {};
  40. public:
  41. std::unique_ptr<KVMould> m_KV;
  42. std::unique_ptr<MAMould> m_MA;
  43. std::unique_ptr<MSMould> m_MS;
  44. std::unique_ptr<MASMould> m_MAS;
  45. std::unique_ptr<TECHMODEMould> m_Techmode;
  46. std::unique_ptr<WORKSTATIONMould> m_WS;
  47. std::unique_ptr<FOCUSMould> m_Focus;
  48. std::unique_ptr<AECFIELDMould> m_AECField;
  49. std::unique_ptr<AECFILMMould> m_AECFilm;
  50. std::unique_ptr<AECDENSITYMould> m_AECDensity;
  51. std::unique_ptr<TUBEHEATMould> m_HE;
  52. std::unique_ptr<POSTKVMould> m_PostKV;
  53. std::unique_ptr<POSTMAMould> m_PostMA;
  54. std::unique_ptr<POSTMSMould> m_PostMS;
  55. std::unique_ptr<POSTMASMould> m_PostMAS;
  56. std::unique_ptr<GENSYNSTATEMould> m_GenSynState;
  57. std::unique_ptr<GENSTATEMould> m_GenState;
  58. std::unique_ptr<TOTALEXPNUMMould> m_GenTotalExpNumber;
  59. std::unique_ptr<TOTALACQTIMESMould> m_GenTotalAcqTimes;
  60. std::unique_ptr<TUBECOOLTIMEMould> m_GenTubeCoolWaitTimes;
  61. std::unique_ptr<TUBEOVERLOADNUMMould> m_GenTubeOverLoadNumber;
  62. std::unique_ptr<CUREXPNUMMould> m_GenCurrentExpNumber;
  63. std::unique_ptr<EXPMODEMould> m_ExpMode;
  64. std::unique_ptr<FRAMERATEMould> m_FrameRate;
  65. std::unique_ptr<MODALITYMould> m_Modality;
  66. std::unique_ptr<BATTERYCHARGSTATEMould> m_BatteryChargeState;
  67. std::unique_ptr<REFERENCEAIRKERMAMould> m_ReferenceAirKerma;
  68. std::unique_ptr<KVLISTMould> m_KVList;
  69. std::unique_ptr<MASLISTMould> m_mAsList;
  70. };
  71. //-----------------------------------------------------------------------------
  72. // GeneratorMould
  73. //-----------------------------------------------------------------------------
  74. namespace nDev = DIOS::Dev;
  75. class _DIOSDEVGENDEVICEMOULD_API GeneratorMould
  76. {
  77. public:
  78. GeneratorMould ();
  79. ~GeneratorMould ();
  80. protected:
  81. virtual void Register(Dispatch* Dispatch);
  82. virtual void RegisterKV (Dispatch* Dispatch); // 子类可能希望注册更多的
  83. virtual void RegisterMA(Dispatch* Dispatch);
  84. virtual void RegisterMS(Dispatch* Dispatch);
  85. virtual void RegisterMAS(Dispatch* Dispatch);
  86. virtual void RegisterFOCUS(Dispatch* Dispatch);
  87. virtual void RegisterTECHMODE(Dispatch* Dispatch);
  88. virtual void RegisterAEC(Dispatch* Dispatch);
  89. virtual void RegisterExpEnable(Dispatch* Dispatch);
  90. virtual void RegisterGeneratortoSyncStatus(Dispatch* Dispatch);
  91. private:
  92. //caoxue
  93. nDev::RET_STATUS JSIncKV (std::string in, std::string& out);
  94. nDev::RET_STATUS JSDecKV (std::string in, std::string& out);
  95. nDev::RET_STATUS JSGetKV (std::string& out);
  96. nDev::RET_STATUS JSSetKV (std::string in, std::string& out);
  97. nDev::RET_STATUS JSIncMA(std::string in, std::string& out);
  98. nDev::RET_STATUS JSDecMA(std::string in, std::string& out);
  99. nDev::RET_STATUS JSGetMA(std::string& out);
  100. nDev::RET_STATUS JSSetMA(std::string in, std::string& out);
  101. nDev::RET_STATUS JSIncMS(std::string in, std::string& out);
  102. nDev::RET_STATUS JSDecMS(std::string in, std::string& out);
  103. nDev::RET_STATUS JSGetMS(std::string& out);
  104. nDev::RET_STATUS JSSetMS(std::string in, std::string& out);
  105. nDev::RET_STATUS JSIncMAS(std::string in, std::string& out);
  106. nDev::RET_STATUS JSDecMAS(std::string in, std::string& out);
  107. nDev::RET_STATUS JSGetMAS(std::string& out);
  108. nDev::RET_STATUS JSSetMAS(std::string in, std::string& out);
  109. nDev::RET_STATUS JSGetTECHMODE(std::string& out);
  110. nDev::RET_STATUS JSSetTECHMODE(std::string in, std::string& out);
  111. nDev::RET_STATUS JSGetFOCUS(std::string& out);
  112. nDev::RET_STATUS JSSetFOCUS(std::string in, std::string& out);
  113. nDev::RET_STATUS JSGetAECDENSITY(std::string& out);
  114. nDev::RET_STATUS JSSetAECDENSITY(std::string in, std::string& out);
  115. nDev::RET_STATUS JSGetAECFIELD(std::string& out);
  116. nDev::RET_STATUS JSSetAECFIELD(std::string in, std::string& out);
  117. nDev::RET_STATUS JSGetAECFILM(std::string& out);
  118. nDev::RET_STATUS JSSetAECFILM(std::string in, std::string& out);
  119. nDev::RET_STATUS JSGetWORKSTATION(std::string& out);
  120. nDev::RET_STATUS JSSetWORKSTATION(std::string in, std::string& out);
  121. nDev::RET_STATUS JSGetHE(std::string& out);
  122. nDev::RET_STATUS JSQueryHE(std::string in, std::string& out);
  123. nDev::RET_STATUS JSGetPOSTKV(std::string& out);
  124. nDev::RET_STATUS JSObtainPOSTKV(std::string in, std::string& out);
  125. nDev::RET_STATUS JSGetPOSTMA(std::string& out);
  126. nDev::RET_STATUS JSObtainPOSTMA(std::string in, std::string& out);
  127. nDev::RET_STATUS JSGetPOSTMS(std::string& out);
  128. nDev::RET_STATUS JSObtainPOSTMS(std::string in, std::string& out);
  129. nDev::RET_STATUS JSGetPOSTMAS(std::string& out);
  130. nDev::RET_STATUS JSObtainPOSTMAS(std::string in, std::string& out);
  131. nDev::RET_STATUS JSSetAPR (std::string in, std::string& out);
  132. nDev::RET_STATUS JSGetGeneratortoSyncStatus(std::string& out);
  133. nDev::RET_STATUS JSSetGeneratortoSyncStatus(std::string in, std::string& out);
  134. nDev::RET_STATUS JSGetGeneratortoStatus(std::string& out);
  135. nDev::RET_STATUS JSGetGenTotalExpNumber(std::string& out);
  136. nDev::RET_STATUS JSGetGenTotalAcqTimes(std::string& out);
  137. nDev::RET_STATUS JSGetGenTubeCoolWaitTimes(std::string& out);
  138. nDev::RET_STATUS JSGetGenTubeOverLoadNumber(std::string& out);
  139. nDev::RET_STATUS JSGetGenCurrentExpNumber(std::string& out);
  140. nDev::RET_STATUS JSGetGeneratorBatteryChargState(std::string& out);
  141. nDev::RET_STATUS JSGetGeneratorReferenceAirKerma(std::string& out);
  142. nDev::RET_STATUS JSGetGeneratorKVList(std::string& out);
  143. nDev::RET_STATUS JSGetGeneratormAsList(std::string& out);
  144. nDev::RET_STATUS JSSetExpEnable(std::string in, std::string& out);
  145. nDev::RET_STATUS JSSetExpDisable(std::string in, std::string& out);
  146. nDev::RET_STATUS JSReset(std::string in, std::string& out);
  147. nDev::RET_STATUS JSSetExpMode(std::string in, std::string& out);
  148. nDev::RET_STATUS JSSetFrameRate(std::string in, std::string& out);
  149. nDev::RET_STATUS JSSetModality(std::string in, std::string& out);
  150. protected:
  151. virtual nDev::RET_STATUS IncKV () = 0;
  152. virtual nDev::RET_STATUS DecKV () = 0;
  153. virtual float GetKV ();
  154. virtual nDev::RET_STATUS SetKV (float value) = 0;
  155. virtual nDev::RET_STATUS IncMA () = 0;
  156. virtual nDev::RET_STATUS DecMA () = 0;
  157. virtual float GetMA ();
  158. virtual nDev::RET_STATUS SetMA (float value) = 0;
  159. virtual nDev::RET_STATUS IncMS () = 0;
  160. virtual nDev::RET_STATUS DecMS () = 0;
  161. virtual float GetMS ();
  162. virtual nDev::RET_STATUS SetMS (float value) = 0;
  163. virtual nDev::RET_STATUS IncMAS () = 0;
  164. virtual nDev::RET_STATUS DecMAS () = 0;
  165. virtual float GetMAS ();
  166. virtual nDev::RET_STATUS SetMAS (float value) = 0;
  167. virtual int GetTechmode ();
  168. virtual nDev::RET_STATUS SetTechmode (int value) = 0;
  169. virtual int GetFocus ();
  170. virtual nDev::RET_STATUS SetFocus (int value) = 0;
  171. virtual int GetAECDensity ();
  172. virtual nDev::RET_STATUS SetAECDensity (int value) = 0;
  173. virtual int GetAECField ();
  174. virtual nDev::RET_STATUS SetAECField (int value) = 0;
  175. virtual int GetAECFilm ();
  176. virtual nDev::RET_STATUS SetAECFilm (int value) = 0;
  177. virtual int GetWS ();
  178. virtual nDev::RET_STATUS SetWS (const std::string value) = 0;
  179. virtual int GetHE();
  180. virtual nDev::RET_STATUS QueryHE(int& value) = 0;
  181. virtual float GetPostKV();
  182. virtual nDev::RET_STATUS QueryPostKV(float& value) = 0;
  183. virtual float GetPostMA();
  184. virtual nDev::RET_STATUS QueryPostMA(float& value) = 0;
  185. virtual float GetPostMS();
  186. virtual nDev::RET_STATUS QueryPostMS(float& value) = 0;
  187. virtual float GetPostMAS();
  188. virtual nDev::RET_STATUS QueryPostMAS(float& value) = 0;
  189. virtual int GetGenSynState();
  190. virtual nDev::RET_STATUS SetGenSynState(int value) = 0;
  191. virtual int GetGenState();
  192. virtual nDev::RET_STATUS SetGenState(int value) = 0;
  193. virtual int GetGenTotalExpNumber();
  194. virtual int GetGenTotalAcqTimes();
  195. virtual int GetGenTubeCoolWaitTimes();
  196. virtual int GetGenTubeOverLoadNumber();
  197. virtual int GetGenCurrentExpNumber();
  198. virtual int GetGeneratorBatteryChargState();
  199. virtual int GetGeneratorReferenceAirKerma();
  200. virtual string GetGeneratorKVList();
  201. virtual string GetGeneratormAsList();
  202. virtual nDev::RET_STATUS SetAPR (const _tAPRArgs & t) = 0;
  203. virtual nDev::RET_STATUS SetExpEnable() = 0;
  204. virtual nDev::RET_STATUS SetExpDisable() = 0;
  205. virtual nDev::RET_STATUS Reset()=0;
  206. virtual nDev::RET_STATUS SetExpMode(std::string value) = 0;
  207. virtual nDev::RET_STATUS SetFrameRate(FLOAT frameRate) = 0;
  208. protected:
  209. DoseUnit m_DoseUnit;
  210. };
  211. }
  212. namespace DIOS::Dev::Detail::Generator
  213. {
  214. class _DIOSDEVGENDEVICEMOULD_API DriverMould : public DIOS::Dev::IODriver
  215. {
  216. public:
  217. DriverMould ();
  218. ~DriverMould ();
  219. virtual std::string GetGUID () const;
  220. protected:
  221. std::list <ConfigInfo> m_ConfigInfo;
  222. };
  223. }