DIOS.Dev.Collimator.Mould.hpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #pragma once
  2. #include <string>
  3. #include "DIOS.Dev.IODevice.hpp"
  4. #include "DIOS.Dev.IODevice.Detail.hpp"
  5. #include "Collimator.BasicMoulds.hpp"
  6. #include "DriverConfigInfo.hpp"
  7. namespace nsDetail = DIOS::Dev::Detail;
  8. #ifndef DIOSDEVCollimatorDEVICEMOULD_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "DIOS.Dev.Collimator.Mould64D.lib")
  12. #else
  13. #pragma comment(lib, "DIOS.Dev.Collimator.Mould64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "DIOS.Dev.Collimator.MouldD.lib")
  18. #else
  19. #pragma comment(lib, "DIOS.Dev.Collimator.MouldD.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef DIOSDEVCollimatorDEVICEMOULD_EXPORTS
  24. #define _DIOSDEVCOLLIMATORDEVICEMOULD_API __declspec(dllexport)
  25. #else
  26. #define _DIOSDEVCOLLIMATORDEVICEMOULD_API __declspec(dllimport)
  27. #endif
  28. #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::ColliamtorMould”的客户端使用
  29. namespace DIOS::Dev::Detail::Collimator
  30. {
  31. //获取日志配置路径
  32. _DIOSDEVCOLLIMATORDEVICEMOULD_API string GetProcessDirectory();
  33. //获取配置文件中指定模块的版本号
  34. _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version, HMODULE hMyModule);
  35. _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version, ResDataObject& config);
  36. _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version);
  37. _DIOSDEVCOLLIMATORDEVICEMOULD_API void TransJsonText(ResDataObject& config);
  38. //-----------------------------------------------------------------------------
  39. // CollimatorUnit
  40. //-----------------------------------------------------------------------------
  41. class _DIOSDEVCOLLIMATORDEVICEMOULD_API CollimatorUnit : public IOLogicUnit
  42. {
  43. public:
  44. CollimatorUnit() {};
  45. virtual ~CollimatorUnit() {};
  46. public:
  47. std::unique_ptr<MODEMould> m_Mode;
  48. std::unique_ptr<XSIZEMould> m_XSize;
  49. std::unique_ptr<YSIZEMould> m_YSize;
  50. std::unique_ptr<FILTERMould> m_Filter;
  51. std::unique_ptr<SIDMould> m_SID;
  52. std::unique_ptr<ANGLEMould> m_Angle;
  53. std::unique_ptr<LIGHTMould> m_Light;
  54. std::unique_ptr<XRATIOMould> m_XRatio;
  55. std::unique_ptr<YRATIOMould> m_YRatio;
  56. std::unique_ptr<ReversalMould> m_Reversal;
  57. std::unique_ptr<ConnectionStatusMould> m_ConnectionStatus;
  58. float m_fThresholdValue{ 0 };
  59. };
  60. //-----------------------------------------------------------------------------
  61. // ColliamtorMould
  62. //-----------------------------------------------------------------------------
  63. namespace nDev = DIOS::Dev;
  64. class _DIOSDEVCOLLIMATORDEVICEMOULD_API ColliamtorMould
  65. {
  66. public:
  67. ColliamtorMould();
  68. ~ColliamtorMould();
  69. protected:
  70. virtual void Register(Dispatch* Dispatch);
  71. protected:
  72. virtual int GetMode();
  73. virtual RET_STATUS SetCollimatorMode(int pParams) = 0;
  74. virtual int GetXSize();
  75. virtual int GetYSize();
  76. virtual RET_STATUS SetCollimatorSize(float xsize, float ysize) = 0;
  77. virtual int GetSID();
  78. virtual RET_STATUS SetCollimatorSID(int sid) = 0;
  79. virtual int GetFilter();
  80. virtual RET_STATUS SetCollimatorFilter(int pParams) = 0;
  81. virtual int GetAngle();
  82. virtual RET_STATUS SetCollimatorAngle(float pParams) = 0;
  83. virtual int GetCollimatorLight();
  84. virtual RET_STATUS SetCollimatorLight(int pParams) = 0;
  85. virtual RET_STATUS SetHCollimatorOpen(bool bStatus);
  86. virtual RET_STATUS SetHCollimatorClose(bool bStatus);
  87. virtual RET_STATUS SetVCollimatorOpen(bool bStatus);
  88. virtual RET_STATUS SetVCollimatorClose(bool bStatus);
  89. virtual RET_STATUS Reset();
  90. virtual int GetXRatio();
  91. virtual int GetYRatio();
  92. virtual RET_STATUS SetCollimatorRatio(float xproportion, float yproportion);
  93. virtual int GetConnectionStatus();
  94. protected:
  95. CollimatorUnit m_CollimatorUnit;
  96. };
  97. }
  98. namespace DIOS::Dev::Detail::Collimator
  99. {
  100. class _DIOSDEVCOLLIMATORDEVICEMOULD_API DriverMould : public DIOS::Dev::IODriver
  101. {
  102. public:
  103. DriverMould();
  104. ~DriverMould();
  105. virtual std::string GetGUID() const;
  106. virtual string GetConnectDLL(string& ConfigFileName);
  107. virtual ResDataObject GetConnectParam(string& ConfigFileName);
  108. protected:
  109. std::list <ConfigInfo> m_ConfigInfo;
  110. };
  111. }