123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #pragma once
- #include "CCOS.Dev.FPDDeviceMould.hpp"
- #include "OEMAcq.h"
- #include "OEMSync.h"
- #include "OEMCalib.h"
- #include "OEMCtrl.h"
- #include "logicClient.h"
- #include "DetectorConfiguration.h"
- #ifdef CCOSDEVFPDRAYENCERF_EXPORTS
- #define CCOSDEVFPDRAYENCERF_API __declspec(dllexport)
- #else
- #define CCOSDEVFPDRAYENCERF_API __declspec(dllimport)
- #endif
- enum class AcqMode
- {
- RAD = 1,
- RAD_PREVIEW = 2,//preview or tomo
- CF = 3,
- PF = 4
- };
- namespace CCOS::Dev::Detail::Detector
- {
- class CCOSDEVFPDRAYENCERF_API RayenceDriver : public FPDDriverMould
- {
- FPDDeviceRayence* pObjDev;
- bool m_bDriverConnect; //driver是否连接的标记位
- ResDataObject m_DeviceConfig;
- ResDataObject m_ConfigAll; //存储当前的配置,用于修改配置时写回文件
- ResDataObject m_Configurations; //存储当前配置中“CONFIGURATION”节点的内容
- std::unique_ptr <ResDataObject> m_pAttribute;
- std::unique_ptr <ResDataObject> m_pDescription;
- public:
- RayenceDriver();
- virtual ~RayenceDriver();
- virtual void Prepare() override;
- virtual bool Connect() override;
- virtual void Disconnect() override;
- virtual bool isConnected() const override;
- virtual auto CreateDevice(int index)->std::unique_ptr <IODevice> override;
- virtual std::string DriverProbe() override;
- virtual std::string GetResource() override;
- virtual std::string DeviceProbe() override;
- bool GetDeviceConfig(std::string& Cfg);
- bool SetDeviceConfig(std::string Cfg);
- bool SaveConfigFile(bool bSendNotify);
- bool GetDeviceConfigValue(ResDataObject config, const char* pInnerKey, int nPathID, string& strValue);
- bool SetDeviceConfigValue(ResDataObject& config, const char* pInnerKey, int nPathID, const char* szValue);
- };
- namespace nsDetail = CCOS::Dev::Detail;
- class CCOSDEVFPDRAYENCERF_API FPDDeviceRayence : public FPDDeviceMould
- {
- using super = IODeviceDetail; //IODeviceDetail类的别名声明
- std::unique_ptr <DetectorCtrlUnit> m_DetectorCtrlUnit;
- std::unique_ptr <AcqUnit> m_AcqUnit;
- std::unique_ptr <SyncUnit> m_SyncUnit;
- std::unique_ptr <CalibUnit> m_CalibUnit;
- std::unique_ptr <DetectorConfiguration> m_DetectorConfiguration;
- PVOID m_pDetector;
- ResDataObject m_ACQMODElist;
- DeviceIndexStruct m_stDeviceConfig;
- std::string m_strWorkPath;
- std::string m_strCurrentAcqMode;
- int m_nImageHeight;
- int m_nImageWidth;
- int m_nImgBits;
- int m_nAngle;
- int m_nPixelSpacing;
- int m_nSensitivity;
- float m_fDose;
- float m_fCurrentPPS;
- float m_fMaxFrameRate;//探测器支持的最大帧率
- WORD* m_pImgBuffer;
- APP_STATUS m_eAppStatus;
- bool m_bConnect;
- ResDataObject m_CalibDoseList;
- ResDataObject m_DetectorModeList;//探测器的采集模式列表
- std::vector<DetectorMode> m_vDetectorModeList;
- public:
- FPDDeviceRayence(std::shared_ptr<IOEventCenter> center, std::string strConfigPath);
- ~FPDDeviceRayence();
- virtual std::string GetGUID() const override;
- virtual bool Prepare() override;
- bool CreateDevice();
- void Register();
- RET_STATUS Connect();
- RET_STATUS SetAcqMode(string nMode);
- RET_STATUS EnterExam(int nExamMode);
- RET_STATUS PrepareAcquisition();
- RET_STATUS StartAcquisition(string in);
- RET_STATUS StopAcquisition();
- RET_STATUS SetExposureTimes(int nTimes);
- RET_STATUS ActiveCalibration(CCOS_CALIBRATION_TYPE eType);
- RET_STATUS PrepareCalibration();
- RET_STATUS GetRequestedDose(std::string& strDose);
- RET_STATUS StartCalibration();
- RET_STATUS StopCalibration();
- RET_STATUS StartOffset(bool isAll);
- RET_STATUS AbortOffset();
- RET_STATUS SetFluPPS(float fFluPPS);
- RET_STATUS GetFluPPS(float& fFluPPS);
- bool Support_DarkCalib();
- bool Support_XrayCalib();
- void OnFPDCallback(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- private:
- bool LoadConfig();
- void OnEventProcessConf(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- void OnEventProcessInfo(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- void OnEventProcessStatus(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- void OnEventProcessData(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- void OnEventProcessError(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- void OnEventProcessWarning(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- protected:
- void RegisterCtrl(nsDetail::Dispatch* Dispatch);
- void RegisterAcq(nsDetail::Dispatch* Dispatch);
- void RegisterSync(nsDetail::Dispatch* Dispatch);
- void RegisterCalib(nsDetail::Dispatch* Dispatch);
- };
- } //end namespace CCOS::Dev::Detail::Detector
|