SubSystemRF.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  2. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 SUBSYSTEM_EXPORTS
  3. // 符号编译的。在使用此 DLL 的
  4. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  5. // SUBSYSTEM_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  6. // 符号视为是被导出的。
  7. #pragma once
  8. #ifdef SUBSYSTEMRF_EXPORTS
  9. #define SUBSYSTEMRF_API __declspec(dllexport)
  10. #else
  11. #define SUBSYSTEMRF_API __declspec(dllimport)
  12. #endif
  13. #ifndef SUBSYSTEMRF_EXPORTS
  14. #ifdef _WIN64
  15. #ifdef _DEBUG
  16. #pragma comment(lib, "SubSystemRFX64D.lib")
  17. #else
  18. #pragma comment(lib, "SubSystemRFX64.lib")
  19. #endif
  20. #else
  21. #ifdef _DEBUG
  22. #pragma comment(lib, "SubSystemRFD.lib")
  23. #else
  24. #pragma comment(lib, "SubSystemRF.lib")
  25. #endif
  26. #endif
  27. #endif
  28. //#include "logicdevice.h"
  29. //#include "CommonLogicClient.h"
  30. //#include "DIOSLogicDeviceStructure.h"
  31. //#include "HWMSM_API.h"
  32. #include "commonDataStruct.h"
  33. struct CSubSystemInterface
  34. {
  35. virtual bool SendExpEnableNotify(bool expenable) = 0;
  36. virtual bool ProcessNotify(const char* strKey, ResDataObject& ResNotify) = 0;
  37. virtual bool ProcessIMGNotify(const char* strKey, ResDataObject& ResNotify, bool bSaveEnd=true) = 0;
  38. virtual int SendNotifyToUp(ResDataObject * NotifyData) = 0;
  39. virtual bool SendXrayOnNotify(bool xrayenable) = 0;
  40. virtual RET_STATUS TransformSMsate(const char * state) = 0;
  41. virtual int AddErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0) = 0;
  42. virtual int DelErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0) = 0;
  43. virtual RET_STATUS ClearError() = 0;
  44. virtual RET_STATUS ConnectETHEbus(const char PARAM_IN *pParam)=0;
  45. virtual RET_STATUS DisConnectETHEbus()=0;
  46. };
  47. // 此类是从 SubSystem.dll 导出的
  48. class SUBSYSTEMRF_API CSubSystemRF : public LogicDevice, public CSubSystemInterface
  49. {
  50. public:
  51. CSubSystemRF(void);
  52. virtual ~CSubSystemRF(void);
  53. // TODO: 在此添加您的方法。
  54. public:
  55. void *m_pData;
  56. void *m_pSubSystemManager;
  57. //ResourceCommand Request In and Response Out
  58. virtual RET_STATUS OpenLogicDevice();
  59. virtual RET_STATUS CloseLogicDevice();
  60. virtual bool SetSubSystemObj(CSubSystemRF *p, int Simulator, const char* path);
  61. virtual bool GetConfigRes(ResDataObject & pConfig);
  62. virtual bool GetDeviceConfigRes(ResDataObject & pConfig);
  63. virtual bool SetDeviceConfigRes();
  64. virtual bool InitResource();
  65. virtual bool RealeseResource();
  66. virtual RET_STATUS SetDetectorAcqMode(ResDataObject & pParam);
  67. virtual RET_STATUS CheckImage(ResDataObject & pParam);
  68. /*RET_STATUS AddDeviceDriver(const char* path);
  69. RET_STATUS DelcDeviceDriver(const char* path);
  70. RET_STATUS AddUnitDevice(ResDataObject & pConfig, bool bNeedSoftSync = true);
  71. RET_STATUS DelUnitDevice(ResDataObject & pConfig);*/
  72. //get device type,returns device type GUID
  73. virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  74. //notify to lower layer
  75. virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
  76. //get device resource
  77. virtual RET_STATUS GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  78. virtual RET_STATUS Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
  79. //向子系统设备设参数,如检查信息,APR参数
  80. virtual RET_STATUS SetAPRIndex(int index);//用于设置多能APR或者拼接APR参数,index为0为普通APR,index>0为多组APR参数同时设置,如多能曝光参数
  81. virtual RET_STATUS SetAPR(APRStruct PARAM_IN &pParam);
  82. virtual RET_STATUS SetWorkStation(ResDataObject PARAM_IN& pParam);
  83. virtual RET_STATUS EnableEXP();
  84. virtual RET_STATUS DisableEXP();
  85. virtual RET_STATUS SetExamInfo(ResDataObject PARAM_IN& pParam);
  86. virtual RET_STATUS SetStudyInfo(ResDataObject PARAM_IN& pParam);
  87. virtual RET_STATUS SetTechParamsInfo(ResDataObject PARAM_IN& pParam);
  88. virtual RET_STATUS StartSMMachine();
  89. virtual RET_STATUS SetApplicationMode(ResDataObject & nApplicationMode);
  90. virtual RET_STATUS GetApplicationType(const char PARAM_OUT *applicationtype);
  91. virtual RET_STATUS SetSEQResource(ResDataObject PARAM_IN& pDeviceResource);
  92. virtual RET_STATUS GetSEQResource(ResDataObject PARAM_OUT *pDeviceResource);
  93. virtual RET_STATUS ConnectETHEbus(const char PARAM_IN *pParam);
  94. virtual RET_STATUS DisConnectETHEbus();
  95. //UI通过该接口获取数据容器中的参数
  96. virtual RET_STATUS GetECMData(const char PARAM_OUT *pParam);
  97. //UIt退出当前Seq
  98. virtual RET_STATUS ExitSeq();
  99. virtual RET_STATUS EnterExam();
  100. virtual RET_STATUS ExitExam();
  101. virtual RET_STATUS ClearError();
  102. virtual RET_STATUS SetAcquisitionWorkflowMode(int nmode);
  103. //UI触发时序状态机变迁接口
  104. virtual RET_STATUS TransformSMsate(const char * state);
  105. virtual RET_STATUS StarExpSeq();
  106. virtual RET_STATUS SetFrameRate(const char *fps);
  107. virtual RET_STATUS SetROI(ResDataObject &pROI);
  108. //////////////校正相关接口/////////////////
  109. virtual RET_STATUS StartCalibration(int nCalType); //seqprep之后
  110. virtual RET_STATUS GetRequestedDose(FLOAT &Dose);
  111. virtual RET_STATUS AcceptCurrImgage();
  112. virtual RET_STATUS RejectCurrImgage(void);
  113. virtual RET_STATUS AbortCalibration(void);
  114. virtual RET_STATUS FinishCalibration(void);
  115. virtual RET_STATUS SetCorrectionType(DWORD corrOptions);
  116. ///////////////////////////////////////////
  117. //////////////拼接相关接口/////////////////
  118. virtual RET_STATUS SetupStitching(int type, int ImgNumber, int StepLength, int SID, int Direction);
  119. virtual RET_STATUS CancelStitching();
  120. //virtual RET_STATUS AcceptStitchingImg();
  121. //virtual RET_STATUS RejectStitchingImg();
  122. ///////////////////////////////////////////
  123. bool ExitSMManger();
  124. int WaitforNotify(HANDLE exit);
  125. //模拟手闸信号,用于demo
  126. /*virtual RET_STATUS PR2Simulator(int simulatorstatus);*/
  127. //获取抽象设备路径 提供给驱动调用的接口
  128. //virtual RET_STATUS SetAbstrctlogicPath(const char* PARAM_IN AbstractName, const char*PARAM_IN Abstractpath) = 0;
  129. int StayInSatate(HANDLE exitFlag, int strState);
  130. int UISkipSatate(HANDLE exitFlag, int strFromState, int &strToSatate);
  131. void SetStateEvent(int state);
  132. //void Pausetime(DWORD dwSpan);
  133. bool work();
  134. virtual RET_STATUS RESET();
  135. protected:
  136. bool ProcessNotify(const char* strKey, ResDataObject& ResNotify);
  137. bool ProcessIMGNotify(const char* strKey, ResDataObject& ResNotify, bool bSaveEnd = true);
  138. int SendNotifyToUp(ResDataObject * NotifyData);
  139. int AddErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0);
  140. int DelErrorMessagetoErrorList(const char* DevInstance, const char*Code, int &Level, const char* ResInfo, const char* Description, int nMessageType = 0);
  141. private:
  142. void loginfo(const char* pstr);
  143. bool SendExpEnableNotify(bool expenable);
  144. bool SendXrayOnNotify(bool xrayenable);
  145. virtual bool CheckDriverState();
  146. int WaitforStateNotify(const char* strState, int State, HANDLE exit);
  147. int Find(const char *name, ResDataObject& Res);
  148. bool CheckNeedConnectETHEbus(const char PARAM_IN *pParam);
  149. };