DapV2Adapter.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #pragma once
  2. #include "LogicDriver.h"
  3. #include "UIObject.h"
  4. #include "ResDataObject.h"
  5. #include "DapModel.h"
  6. #include "CollimatorLogic.h"
  7. #ifndef DAPV2ADAPTER_EXPORTS
  8. #ifdef _WIN64
  9. #ifdef _DEBUG
  10. #pragma comment(lib, "DapV2AdapterX64D.lib")
  11. #else
  12. #pragma comment(lib, "DapV2AdapterX64.lib")
  13. #endif
  14. #else
  15. #ifdef _DEBUG
  16. #pragma comment(lib, "DapV2AdapterD.lib")
  17. #else
  18. #pragma comment(lib, "DapV2Adapter.lib")
  19. #endif
  20. #endif
  21. #endif
  22. #ifdef DAPV2ADAPTER_EXPORTS
  23. #define DAPV2ADAPTER_API __declspec(dllexport)
  24. #define DAPV2ADAPTER_C_API extern "C" __declspec(dllexport)
  25. #else
  26. #define DAPV2ADAPTER_API __declspec(dllimport)
  27. #define DAPV2ADAPTER_C_API extern "C" __declspec(dllimport)
  28. #endif
  29. DAPV2ADAPTER_C_API DriverDPC* GetDriverDPC();
  30. DAPV2ADAPTER_C_API void ReleaseDriverDPC(DriverDPC *p);
  31. class DAPV2ADAPTER_API DapV2AdapterDPC : public LogicDriver
  32. {
  33. std::string *m_pWorkpath;
  34. std::string *m_pstrDapType;
  35. UIObject *m_pUIOBJ;
  36. CollimatorLogic *m_pCollimator;
  37. DapModelUnitLogic *m_pDap;
  38. //for webconfig of deviceconfig
  39. //because of no DAP DPC,i wrote here
  40. ConfigInfo *m_pDapVender;
  41. ConfigInfo *m_pDapModel;
  42. ConfigInfo *m_pGenSCFType;
  43. ConfigInfo *m_pGenSCFPort;
  44. ConfigInfo *m_pGenSCFBaudrate;
  45. ConfigInfo *m_pGenSCFBytesize;
  46. ConfigInfo *m_pGenSCFParity;
  47. ConfigInfo *m_pGenSCFStopbits;
  48. RET_STATUS SetDeviceConfig_Base(ResDataObject PARAM_IN *DeviceConfig);
  49. RET_STATUS GetDeviceConfig_Base(ResDataObject PARAM_OUT *pDeviceConfig);
  50. public:
  51. DapV2AdapterDPC(void);
  52. virtual ~DapV2AdapterDPC(void);
  53. //virtual bool DriverEntry(ResDataObject &Configuration);
  54. virtual bool Driver_Probe(ResDataObject &HardwareInfo);
  55. virtual bool SYSTEM_CALL SetDriverWorkPath(const char * PARAM_IN pWorkPath);
  56. virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
  57. virtual void SYSTEM_CALL UnloadDriver();
  58. virtual bool Connect();
  59. virtual void DisConnect();
  60. virtual RET_STATUS GetDeviceResource(ResDataObject *pDeviceResource);
  61. RET_STATUS SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
  62. RET_STATUS GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
  63. //给硬件驱动设置Unique工作路径
  64. //如果是同一设备同一连接情况下,硬件多次接入,系统会保证工作路径是一样的.
  65. //连接后,单一硬件相关的数据要保存在此.
  66. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
  67. //逻辑设备树的加载和卸载
  68. virtual PVOID SYSTEM_CALL LoadLogicDevices();
  69. virtual void SYSTEM_CALL UnloadLogicDevices();
  70. virtual bool Device_Probe(ResDataObject &HardwareInfo);
  71. virtual DWORD SYSTEM_CALL OnNotify(HANDLE evtList[], DWORD count);
  72. bool DapQuery(DWORD Timeout);
  73. bool DapReset();
  74. };