GenV2Adapter.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #pragma once
  2. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  3. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 GENV2ADAPTER_EXPORTS
  4. // 符号编译的。在使用此 DLL 的
  5. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  6. // GENV2ADAPTER_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  7. // 符号视为是被导出的。
  8. #ifndef GENV2ADAPTER_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "GenV2AdapterX64D.lib")
  12. #else
  13. #pragma comment(lib, "GenV2AdapterX64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "GenV2AdapterD.lib")
  18. #else
  19. #pragma comment(lib, "GenV2Adapter.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef GENV2ADAPTER_EXPORTS
  24. #define GENV2ADAPTER_API __declspec(dllexport)
  25. #define GENV2ADAPTER_C_API extern "C" __declspec(dllexport)
  26. #else
  27. #define GENV2ADAPTER_API __declspec(dllimport)
  28. #define GENV2ADAPTER_C_API extern "C" __declspec(dllimport)
  29. #endif
  30. #include "GeneratorDriver.h"
  31. #include "UIObject.h"
  32. #include "DapModel.h"
  33. // 此类是从 GenV2Adapter.dll 导出的
  34. class GENV2ADAPTER_API GenV2Adapter : public GeneratorDriver
  35. {
  36. std::string *m_pWorkpath;
  37. UIObject *m_pUIOBJ;
  38. bool m_bGenConnectState;
  39. string *m_pstrGenType;
  40. MechV2 *m_pMech;
  41. CollimatorLogic *m_pCollimator;
  42. GenUnitLogic *m_pDose;
  43. SyncHSW_LogicDevice *m_pHsw;
  44. SyncGen_LogicDeviceEx *m_pSync;
  45. DapModelUnitLogic *m_pDap;
  46. public:
  47. GenV2Adapter(void);
  48. virtual ~GenV2Adapter(void);
  49. virtual bool DriverEntry(ResDataObject &Configuration);
  50. virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo);
  51. virtual bool SetDriverWorkPath(const char *pWorkPath);
  52. virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
  53. virtual void SYSTEM_CALL UnloadDriver();
  54. bool InitConfiguration();
  55. //actions
  56. virtual bool Connect();
  57. virtual void DisConnect();
  58. //virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  59. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
  60. RET_STATUS GetDeviceResource(ResDataObject *pDeviceResource);
  61. RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
  62. RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
  63. //逻辑设备树的加载和卸载
  64. virtual PVOID SYSTEM_CALL LoadLogicDevices();
  65. virtual void SYSTEM_CALL UnloadLogicDevices();
  66. virtual bool SYSTEM_CALL OnHeartBeat();
  67. virtual bool Device_Probe(ResDataObject &HardwareInfo);
  68. virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
  69. ResDataObject m_DeviceConfig;
  70. string strVendorID;
  71. string strProductID;
  72. bool DapQuery(DWORD Timeout);
  73. bool DapReset();
  74. };
  75. GENV2ADAPTER_C_API DriverDPC* GetDriverDPC();
  76. GENV2ADAPTER_C_API void ReleaseDriverDPC(DriverDPC *p);