123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #pragma once
- // 下列 ifdef 块是创建使从 DLL 导出更简单的
- // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 GENV2ADAPTER_EXPORTS
- // 符号编译的。在使用此 DLL 的
- // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
- // GENV2ADAPTER_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
- // 符号视为是被导出的。
- #ifndef GENV2ADAPTER_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "GenV2AdapterX64D.lib")
- #else
- #pragma comment(lib, "GenV2AdapterX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "GenV2AdapterD.lib")
- #else
- #pragma comment(lib, "GenV2Adapter.lib")
- #endif
- #endif
- #endif
- #ifdef GENV2ADAPTER_EXPORTS
- #define GENV2ADAPTER_API __declspec(dllexport)
- #define GENV2ADAPTER_C_API extern "C" __declspec(dllexport)
- #else
- #define GENV2ADAPTER_API __declspec(dllimport)
- #define GENV2ADAPTER_C_API extern "C" __declspec(dllimport)
- #endif
- #include "GeneratorDriver.h"
- #include "UIObject.h"
- #include "DapModel.h"
- // 此类是从 GenV2Adapter.dll 导出的
- class GENV2ADAPTER_API GenV2Adapter : public GeneratorDriver
- {
- std::string *m_pWorkpath;
- UIObject *m_pUIOBJ;
- bool m_bGenConnectState;
- string *m_pstrGenType;
- MechV2 *m_pMech;
- CollimatorLogic *m_pCollimator;
- GenUnitLogic *m_pDose;
- SyncHSW_LogicDevice *m_pHsw;
- SyncGen_LogicDeviceEx *m_pSync;
- DapModelUnitLogic *m_pDap;
- public:
- GenV2Adapter(void);
- virtual ~GenV2Adapter(void);
- virtual bool DriverEntry(ResDataObject &Configuration);
- virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo);
- virtual bool SetDriverWorkPath(const char *pWorkPath);
- virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
- virtual void SYSTEM_CALL UnloadDriver();
- bool InitConfiguration();
- //actions
- virtual bool Connect();
- virtual void DisConnect();
- //virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
- virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
- RET_STATUS GetDeviceResource(ResDataObject *pDeviceResource);
- RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
- RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
- //逻辑设备树的加载和卸载
- virtual PVOID SYSTEM_CALL LoadLogicDevices();
- virtual void SYSTEM_CALL UnloadLogicDevices();
- virtual bool SYSTEM_CALL OnHeartBeat();
- virtual bool Device_Probe(ResDataObject &HardwareInfo);
- virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
- ResDataObject m_DeviceConfig;
- string strVendorID;
- string strProductID;
- bool DapQuery(DWORD Timeout);
- bool DapReset();
- };
- GENV2ADAPTER_C_API DriverDPC* GetDriverDPC();
- GENV2ADAPTER_C_API void ReleaseDriverDPC(DriverDPC *p);
|