123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 SUBSYSTEM_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // SUBSYSTEM_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #pragma once
- #ifdef SUBSYSTEMRF_EXPORTS
- #define SUBSYSTEMRF_API __declspec(dllexport)
- #else
- #define SUBSYSTEMRF_API __declspec(dllimport)
- #endif
- #ifndef SUBSYSTEMRF_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "SubSystemRFX64D.lib")
- #else
- #pragma comment(lib, "SubSystemRFX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "SubSystemRFD.lib")
- #else
- #pragma comment(lib, "SubSystemRF.lib")
- #endif
- #endif
- #endif
- //#include "logicdevice.h"
- //#include "CommonLogicClient.h"
- //#include "DIOSLogicDeviceStructure.h"
- //#include "HWMSM_API.h"
- #include "commonDataStruct.h"
- struct CSubSystemInterface
- {
- virtual bool SendExpEnableNotify(bool expenable) = 0;
- virtual bool ProcessNotify(const char* strKey, ResDataObject& ResNotify) = 0;
- virtual bool ProcessIMGNotify(const char* strKey, ResDataObject& ResNotify, bool bSaveEnd=true) = 0;
- virtual int SendNotifyToUp(ResDataObject * NotifyData) = 0;
- virtual bool SendXrayOnNotify(bool xrayenable) = 0;
- virtual RET_STATUS TransformSMsate(const char * state) = 0;
- virtual int AddErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0) = 0;
- virtual int DelErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0) = 0;
- virtual RET_STATUS ClearError() = 0;
- virtual RET_STATUS ConnectETHEbus(const char PARAM_IN *pParam)=0;
- virtual RET_STATUS DisConnectETHEbus()=0;
- };
- // 此类是从 SubSystem.dll 导出的
- class SUBSYSTEMRF_API CSubSystemRF : public LogicDevice, public CSubSystemInterface
- {
- public:
- CSubSystemRF(void);
- virtual ~CSubSystemRF(void);
- // TODO: 在此添加您的方法。
- public:
- void *m_pData;
- void *m_pSubSystemManager;
- //ResourceCommand Request In and Response Out
- virtual RET_STATUS OpenLogicDevice();
- virtual RET_STATUS CloseLogicDevice();
- virtual bool SetSubSystemObj(CSubSystemRF *p, int Simulator, const char* path);
- virtual bool GetConfigRes(ResDataObject & pConfig);
- virtual bool GetDeviceConfigRes(ResDataObject & pConfig);
- virtual bool SetDeviceConfigRes();
- virtual bool InitResource();
- virtual bool RealeseResource();
- virtual RET_STATUS SetDetectorAcqMode(ResDataObject & pParam);
- virtual RET_STATUS CheckImage(ResDataObject & pParam);
- /*RET_STATUS AddDeviceDriver(const char* path);
- RET_STATUS DelcDeviceDriver(const char* path);
- RET_STATUS AddUnitDevice(ResDataObject & pConfig, bool bNeedSoftSync = true);
- RET_STATUS DelUnitDevice(ResDataObject & pConfig);*/
- //get device type,returns device type GUID
- virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
- //notify to lower layer
- virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
- //get device resource
- virtual RET_STATUS GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
- virtual RET_STATUS Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
- //向子系统设备设参数,如检查信息,APR参数
- virtual RET_STATUS SetAPRIndex(int index);//用于设置多能APR或者拼接APR参数,index为0为普通APR,index>0为多组APR参数同时设置,如多能曝光参数
- virtual RET_STATUS SetAPR(APRStruct PARAM_IN &pParam);
- virtual RET_STATUS SetWorkStation(ResDataObject PARAM_IN& pParam);
- virtual RET_STATUS EnableEXP();
- virtual RET_STATUS DisableEXP();
- virtual RET_STATUS SetExamInfo(ResDataObject PARAM_IN& pParam);
- virtual RET_STATUS SetStudyInfo(ResDataObject PARAM_IN& pParam);
- virtual RET_STATUS SetTechParamsInfo(ResDataObject PARAM_IN& pParam);
- virtual RET_STATUS StartSMMachine();
- virtual RET_STATUS SetApplicationMode(ResDataObject & nApplicationMode);
- virtual RET_STATUS GetApplicationType(const char PARAM_OUT *applicationtype);
- virtual RET_STATUS SetSEQResource(ResDataObject PARAM_IN& pDeviceResource);
- virtual RET_STATUS GetSEQResource(ResDataObject PARAM_OUT *pDeviceResource);
- virtual RET_STATUS ConnectETHEbus(const char PARAM_IN *pParam);
- virtual RET_STATUS DisConnectETHEbus();
- //UI通过该接口获取数据容器中的参数
- virtual RET_STATUS GetECMData(const char PARAM_OUT *pParam);
- //UIt退出当前Seq
- virtual RET_STATUS ExitSeq();
- virtual RET_STATUS EnterExam();
- virtual RET_STATUS ExitExam();
-
- virtual RET_STATUS ClearError();
- virtual RET_STATUS SetAcquisitionWorkflowMode(int nmode);
- //UI触发时序状态机变迁接口
- virtual RET_STATUS TransformSMsate(const char * state);
- virtual RET_STATUS StarExpSeq();
- virtual RET_STATUS SetFrameRate(const char *fps);
- virtual RET_STATUS SetROI(ResDataObject &pROI);
- //////////////校正相关接口/////////////////
- virtual RET_STATUS StartCalibration(int nCalType); //seqprep之后
- virtual RET_STATUS GetRequestedDose(FLOAT &Dose);
- virtual RET_STATUS AcceptCurrImgage();
- virtual RET_STATUS RejectCurrImgage(void);
- virtual RET_STATUS AbortCalibration(void);
- virtual RET_STATUS FinishCalibration(void);
- virtual RET_STATUS SetCorrectionType(DWORD corrOptions);
- ///////////////////////////////////////////
- //////////////拼接相关接口/////////////////
- virtual RET_STATUS SetupStitching(int type, int ImgNumber, int StepLength, int SID, int Direction);
- virtual RET_STATUS CancelStitching();
- //virtual RET_STATUS AcceptStitchingImg();
- //virtual RET_STATUS RejectStitchingImg();
- ///////////////////////////////////////////
- bool ExitSMManger();
- int WaitforNotify(HANDLE exit);
- //模拟手闸信号,用于demo
- /*virtual RET_STATUS PR2Simulator(int simulatorstatus);*/
- //获取抽象设备路径 提供给驱动调用的接口
- //virtual RET_STATUS SetAbstrctlogicPath(const char* PARAM_IN AbstractName, const char*PARAM_IN Abstractpath) = 0;
-
- int StayInSatate(HANDLE exitFlag, int strState);
- int UISkipSatate(HANDLE exitFlag, int strFromState, int &strToSatate);
- void SetStateEvent(int state);
- //void Pausetime(DWORD dwSpan);
- bool work();
- virtual RET_STATUS RESET();
- protected:
- bool ProcessNotify(const char* strKey, ResDataObject& ResNotify);
- bool ProcessIMGNotify(const char* strKey, ResDataObject& ResNotify, bool bSaveEnd = true);
- int SendNotifyToUp(ResDataObject * NotifyData);
- int AddErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0);
- int DelErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0);
- private:
- void loginfo(const char* pstr);
- bool SendExpEnableNotify(bool expenable);
- bool SendXrayOnNotify(bool xrayenable);
- virtual bool CheckDriverState();
- int WaitforStateNotify(const char* strState, int State, HANDLE exit);
- int Find(const char *name, ResDataObject& Res);
- bool CheckNeedConnectETHEbus(const char PARAM_IN *pParam);
- };
|