#pragma once #include #include "DIOS.Dev.IODevice.hpp" #include "DIOS.Dev.IODevice.Detail.hpp" #include "Collimator.BasicMoulds.hpp" #include "DriverConfigInfo.hpp" namespace nsDetail = DIOS::Dev::Detail; #ifndef DIOSDEVCollimatorDEVICEMOULD_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.Collimator.Mould64D.lib") #else #pragma comment(lib, "DIOS.Dev.Collimator.Mould64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.Collimator.MouldD.lib") #else #pragma comment(lib, "DIOS.Dev.Collimator.MouldD.lib") #endif #endif #endif #ifdef DIOSDEVCollimatorDEVICEMOULD_EXPORTS #define _DIOSDEVCOLLIMATORDEVICEMOULD_API __declspec(dllexport) #else #define _DIOSDEVCOLLIMATORDEVICEMOULD_API __declspec(dllimport) #endif #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::ColliamtorMould”的客户端使用 namespace DIOS::Dev::Detail::Collimator { //获取日志配置路径 _DIOSDEVCOLLIMATORDEVICEMOULD_API string GetProcessDirectory(); //获取配置文件中指定模块的版本号 _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version, HMODULE hMyModule); _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version, ResDataObject& config); _DIOSDEVCOLLIMATORDEVICEMOULD_API bool GetVersion(string& version); _DIOSDEVCOLLIMATORDEVICEMOULD_API void TransJsonText(ResDataObject& config); //----------------------------------------------------------------------------- // CollimatorUnit //----------------------------------------------------------------------------- class _DIOSDEVCOLLIMATORDEVICEMOULD_API CollimatorUnit : public IOLogicUnit { public: CollimatorUnit() {}; virtual ~CollimatorUnit() {}; public: std::unique_ptr m_Mode; std::unique_ptr m_XSize; std::unique_ptr m_YSize; std::unique_ptr m_Filter; std::unique_ptr m_SID; std::unique_ptr m_Angle; std::unique_ptr m_Light; std::unique_ptr m_XRatio; std::unique_ptr m_YRatio; std::unique_ptr m_Reversal; std::unique_ptr m_ConnectionStatus; float m_fThresholdValue{ 0 }; }; //----------------------------------------------------------------------------- // ColliamtorMould //----------------------------------------------------------------------------- namespace nDev = DIOS::Dev; class _DIOSDEVCOLLIMATORDEVICEMOULD_API ColliamtorMould { public: ColliamtorMould(); ~ColliamtorMould(); protected: virtual void Register(Dispatch* Dispatch); protected: virtual int GetMode(); virtual RET_STATUS SetCollimatorMode(int pParams) = 0; virtual int GetXSize(); virtual int GetYSize(); virtual RET_STATUS SetCollimatorSize(float xsize, float ysize) = 0; virtual int GetSID(); virtual RET_STATUS SetCollimatorSID(int sid) = 0; virtual int GetFilter(); virtual RET_STATUS SetCollimatorFilter(int pParams) = 0; virtual int GetAngle(); virtual RET_STATUS SetCollimatorAngle(float pParams) = 0; virtual int GetCollimatorLight(); virtual RET_STATUS SetCollimatorLight(int pParams) = 0; virtual RET_STATUS SetHCollimatorOpen(bool bStatus); virtual RET_STATUS SetHCollimatorClose(bool bStatus); virtual RET_STATUS SetVCollimatorOpen(bool bStatus); virtual RET_STATUS SetVCollimatorClose(bool bStatus); virtual RET_STATUS Reset(); virtual int GetXRatio(); virtual int GetYRatio(); virtual RET_STATUS SetCollimatorRatio(float xproportion, float yproportion); virtual int GetConnectionStatus(); protected: CollimatorUnit m_CollimatorUnit; }; } namespace DIOS::Dev::Detail::Collimator { class _DIOSDEVCOLLIMATORDEVICEMOULD_API DriverMould : public DIOS::Dev::IODriver { public: DriverMould(); ~DriverMould(); virtual std::string GetGUID() const; virtual string GetConnectDLL(string& ConfigFileName); virtual ResDataObject GetConnectParam(string& ConfigFileName); protected: std::list m_ConfigInfo; }; }