123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #pragma once
- #include "CCOS.Dev.FPDDeviceMould.hpp"
- #include "OemAcq.h"
- #include "OemSync.h"
- #include "OemCtrl.h"
- #include "OemCalib.h"
- #include "DetectorConfiguration.h"
- #include "MyPingip.h"
- #define CCOSDEVFPDTIRAYDR_API
- #define TiRay4343W 1
- namespace CCOS::Dev::Detail::Detector
- {
- class CCOSDEVFPDTIRAYDR_API TiRayDriver : public FPDDriverMould
- {
- FPDDeviceTiRay* pObjDev;
- bool m_bDriverConnect; //driver是否连接的标记位
- //*** 配置文件相关成员变量begin ***
- ResDataObject m_DeviceConfig;
- ResDataObject m_ConfigAll; //存储当前的配置,用于修改配置时写回文件
- ResDataObject m_Configurations; //存储当前配置中“CONFIGURATION”节点的内容
- std::unique_ptr <ResDataObject> m_pAttribute;
- std::unique_ptr <ResDataObject> m_pDescription;
- std::unique_ptr <DetectorConfiguration> m_DetectorConfiguration;
- //*** 配置文件相关成员变量end ***
- public:
- TiRayDriver();
- virtual ~TiRayDriver();
- 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;
- virtual bool GetDeviceConfig(std::string& Cfg) override;
- virtual bool SetDeviceConfig(std::string Cfg) override;
- 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);
- bool CheckConnect(std::string strIP);
- };
- namespace nsDetail = CCOS::Dev::Detail;
- class CCOSDEVFPDTIRAYDR_API FPDDeviceTiRay : 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 <DeviceTemperatureMould> m_Temperature;
- std::unique_ptr <DeviceBatteryMould> m_Battery;
- std::unique_ptr <DeviceWifiMould> m_Wifi;
- std::unique_ptr <DetectorConfiguration> m_DetectorConfiguration;
- //std::unique_ptr <FPDErrorWarning> m_WarnAndError;
- ResDataObject m_ACQMODElist;
- DeviceIndexStruct m_stDeviceConfig;
- std::string m_strWorkPath;
- int m_nFullImageHeight;
- int m_nFullImageWidth;
- int m_nImgBits;
- int m_nPixelSpacing;
- int m_nSensitivity;
- int m_nAcqMode;
- float m_fDose;
- unsigned short* m_pFullImgBuffer;
- APP_STATUS m_eAppStatus;
- bool m_bDeviceConnect;
- GlobalTime m_stImgCreateTime; //记录图像生成时间(软同步使用开窗时间),用于填写dicom
- SYNC_MODE m_eSyncMode;
- int m_nFPDExpReadyTime; //窗口
- float m_fFactorEXI2UGY; //探测器EXI -> UGY 转换系数
- ResDataObject m_CalibDoseList; //ZSKK校正时加载校正剂量配置
- std::shared_ptr<LinuxEvent> m_WaitCalibDoseEvt;
- float m_fDoseParam;// 校正用的曝光计量,发送到UI 且本地记录
- int m_nCalibTotalExposureNum; //校正曝光总次数
- int m_nCalibCurrentCalibrationRound; //校正曝光第几轮
- int m_nCalibCurrentExposureIndex; //校正曝光第几次
- int m_nCalibCurrentExposureNum; //已校正曝光总次数
- int m_nTargetCalibExi;// 校正时图像需要达到的EXI值 康众4343W增益校正 推荐10000EXI
- bool m_bEnterAcqStatus;//探测器是否真正进入了采集状态,与通知工作流事件触发的状态不同,这个是真正的状态
- CCOS_CALIBRATION_TYPE m_CalibType;
- public:
- FPDDeviceTiRay(std::shared_ptr<IOEventCenter> center, std::string strConfigPath);
- ~FPDDeviceTiRay();
- virtual std::string GetGUID() const override;
- virtual bool Prepare() override;
- bool CreateDevice();
- void Register();
- RET_STATUS ScanDetector(string& strDetectorInfo);
- RET_STATUS Connect();
- RET_STATUS EnterExam(int nExamMode);
- RET_STATUS SetAcqMode(string strMode);
- RET_STATUS GetSyncMode(SYNC_MODE &eSyncMode);
- RET_STATUS PrepareAcquisition();
- RET_STATUS StartAcquisition(string in = "");
- RET_STATUS StopAcquisition();
- RET_STATUS ActiveCalibration(CCOS_CALIBRATION_TYPE eType);
- RET_STATUS PrepareCalibration();
- RET_STATUS GetRequestedDose(std::string& strDose);
- RET_STATUS SetRequestedDose(std::string strDose);
- RET_STATUS StartCalibration();
- RET_STATUS StopCalibration();
- RET_STATUS GetCalibrationStep(int nDetectorID, string& strCalibrationStepInfo);
- RET_STATUS AcceptCalibration();
- RET_STATUS RejectCalibration();
- RET_STATUS ActiveDetector(bool bActive);
- RET_STATUS CompleteCalibration();
- RET_STATUS UpdateCalibMode(CCOS_CALIBRATION_MODE eCalibMode);
- RET_STATUS ActiveSyncMode(int nSyncMode);
- RET_STATUS UpdateLastCalibrationDate(std::string in);
- RET_STATUS UpdateCalibrationFileExpireTime(std::string in);
- RET_STATUS AbortCalibration();
- RET_STATUS SaveCalibrationFile(bool bSaveFlag);
-
- void OnFPDCallback(int nDetectorID, int nEventID, int nEventLevel, const char* pszMsg, int nParam1, float fParam2, int nPtrParamLen, void* pParam);
- bool Support_DarkCalib();
- bool Support_XrayCalib();
- private:
- void SendTemperatureValue(float fValue);
- void SendWifiValue(int nValue);
- void SendBatteryValue(int nValue);
- 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);
- void RegisterOthers(nsDetail::Dispatch* Dispatch);
- };
- }
|