1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #pragma once
- #include "LogicDriver.h"
- #include "UIObject.h"
- #include "ResDataObject.h"
- #include "DapModel.h"
- #include "CollimatorLogic.h"
- #ifndef DAPV2ADAPTER_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "DapV2AdapterX64D.lib")
- #else
- #pragma comment(lib, "DapV2AdapterX64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "DapV2AdapterD.lib")
- #else
- #pragma comment(lib, "DapV2Adapter.lib")
- #endif
- #endif
- #endif
- #ifdef DAPV2ADAPTER_EXPORTS
- #define DAPV2ADAPTER_API __declspec(dllexport)
- #define DAPV2ADAPTER_C_API extern "C" __declspec(dllexport)
- #else
- #define DAPV2ADAPTER_API __declspec(dllimport)
- #define DAPV2ADAPTER_C_API extern "C" __declspec(dllimport)
- #endif
- DAPV2ADAPTER_C_API DriverDPC* GetDriverDPC();
- DAPV2ADAPTER_C_API void ReleaseDriverDPC(DriverDPC *p);
- class DAPV2ADAPTER_API DapV2AdapterDPC : public LogicDriver
- {
- std::string *m_pWorkpath;
- std::string *m_pstrDapType;
- UIObject *m_pUIOBJ;
- CollimatorLogic *m_pCollimator;
- DapModelUnitLogic *m_pDap;
- //for webconfig of deviceconfig
- //because of no DAP DPC,i wrote here
- ConfigInfo *m_pDapVender;
- ConfigInfo *m_pDapModel;
- ConfigInfo *m_pGenSCFType;
- ConfigInfo *m_pGenSCFPort;
- ConfigInfo *m_pGenSCFBaudrate;
- ConfigInfo *m_pGenSCFBytesize;
- ConfigInfo *m_pGenSCFParity;
- ConfigInfo *m_pGenSCFStopbits;
- RET_STATUS SetDeviceConfig_Base(ResDataObject PARAM_IN *DeviceConfig);
- RET_STATUS GetDeviceConfig_Base(ResDataObject PARAM_OUT *pDeviceConfig);
- public:
- DapV2AdapterDPC(void);
- virtual ~DapV2AdapterDPC(void);
- //virtual bool DriverEntry(ResDataObject &Configuration);
- virtual bool Driver_Probe(ResDataObject &HardwareInfo);
- virtual bool SYSTEM_CALL SetDriverWorkPath(const char * PARAM_IN pWorkPath);
- virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
- virtual void SYSTEM_CALL UnloadDriver();
- virtual bool Connect();
- virtual void DisConnect();
- virtual RET_STATUS GetDeviceResource(ResDataObject *pDeviceResource);
- RET_STATUS SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
- RET_STATUS GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
- //给硬件驱动设置Unique工作路径
- //如果是同一设备同一连接情况下,硬件多次接入,系统会保证工作路径是一样的.
- //连接后,单一硬件相关的数据要保存在此.
- virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
- //逻辑设备树的加载和卸载
- virtual PVOID SYSTEM_CALL LoadLogicDevices();
- virtual void SYSTEM_CALL UnloadLogicDevices();
- virtual bool Device_Probe(ResDataObject &HardwareInfo);
- virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
- bool DapQuery(DWORD Timeout);
- bool DapReset();
- };
|