DetctorDriver.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #pragma once
  2. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  3. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 DETCTORDRIVER_EXPORTS
  4. // 符号编译的。在使用此 DLL 的
  5. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  6. // DETCTORDRIVER_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  7. // 符号视为是被导出的。
  8. #ifndef DETCTORDRIVER_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "DetctorDriverX64D.lib")
  12. #else
  13. #pragma comment(lib, "DetctorDriverX64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "DetctorDriverD.lib")
  18. #else
  19. #pragma comment(lib, "DetctorDriver.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #include "LogicDriver.h"
  24. #include "Detector_Model_Def.h"
  25. #ifdef DETCTORDRIVER_EXPORTS
  26. #define DETCTORDRIVER_API __declspec(dllexport)
  27. #define DETCTORDRIVER_C_API extern "C" __declspec(dllexport)
  28. #else
  29. #define DETCTORDRIVER_API __declspec(dllimport)
  30. #define DETCTORDRIVER_C_API extern "C" __declspec(dllimport)
  31. #endif
  32. // 此类是从 DetctorDriver.dll 导出的
  33. class DETCTORDRIVER_API DetctorDriver :public LogicDriver
  34. {
  35. //2张表
  36. //AcqModeList
  37. AcqModeInfoListEx *m_pAcqModeList;
  38. //Work Status
  39. ResDataObject *m_pDetectorWorkStatus;//Acq or cali
  40. ResDataObject *m_pDetectorAttach;//Attach Result
  41. ResDataObject *m_pDetectorAttachFlag;//Attach Result
  42. ResDataObject* m_pDetectorConnectStatus;
  43. ResDataObject* m_pDetectorInitialStatus;
  44. ResDataObject* m_pDetectorUFWStatus;//UpdateFirmware result
  45. ResDataObject* m_pSyncData;//xwindowsize,syncmode,triggermode,xwindowstatus,framerate
  46. ResDataObject* m_pAttribute;
  47. ResDataObject* m_pDescription;
  48. public:
  49. DetctorDriver(void);
  50. virtual ~DetctorDriver(void);
  51. //基本接口
  52. virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  53. //get device resource
  54. virtual RET_STATUS SYSTEM_CALL GetDeviceResource(ResDataObject PARAM_OUT *pDeviceResource);
  55. //ResourceCommand Request In and Response Out
  56. virtual RET_STATUS SYSTEM_CALL Request(ResDataObject PARAM_IN *pRequest, ResDataObject PARAM_OUT *pResponse);
  57. //notify to lower layer
  58. virtual RET_STATUS SYSTEM_CALL CmdToLogicDev(ResDataObject PARAM_IN *pCmd);
  59. //对象接口
  60. virtual bool SYSTEM_CALL DriverEntry(ResDataObject& PARAM_IN Configuration);
  61. //配置相关。驱动中的配置信息全部通过driver的接口
  62. virtual RET_STATUS DATA_ACTION GetDeviceConfig(ResDataObject PARAM_OUT *pDeviceConfig);
  63. virtual RET_STATUS DATA_ACTION SetDeviceConfig(ResDataObject PARAM_IN *DeviceConfig);
  64. RET_STATUS SetConfigurationNotify(ResDataObject ResConfig);
  65. virtual RET_STATUS DATA_ACTION EnterExam(int nExamStatus);
  66. virtual RET_STATUS DATA_ACTION ExitExam();
  67. virtual RET_STATUS DATA_ACTION Attach();
  68. virtual RET_STATUS DATA_ACTION AttachConnect();
  69. virtual RET_STATUS OEM_IF SetAttachResult(bool result, const char* DetectorType, const char* DetectorSN);
  70. virtual RET_STATUS OEM_IF SetConnectStatus(int nStatus);
  71. virtual RET_STATUS DATA_ACTION GetConnectStatus(int & nStatus);
  72. virtual RET_STATUS DATA_ACTION SetAttachStatus(int nStatus);
  73. virtual RET_STATUS OEM_IF SetInitialStatus(int nStatus);
  74. virtual RET_STATUS OEM_IF SetUpdateFWStatus(int nStatus);
  75. virtual RET_STATUS DATA_ACTION ResetConnect();
  76. virtual RET_STATUS DATA_ACTION DisConnectFPD();
  77. virtual RET_STATUS DATA_ACTION UpdateFirmware();
  78. virtual RET_STATUS DATA_ACTION RecoverImage(bool bRecoverIt);
  79. virtual RET_STATUS DATA_ACTION SaveSensitivity();
  80. //继承类必须实现的行为1:与继承类共同实现功能
  81. virtual RET_STATUS OEM_IF PowerOnDetector();
  82. virtual RET_STATUS OEM_IF PowerOffDetector();
  83. virtual RET_STATUS OEM_IF SleepDetector();
  84. virtual RET_STATUS OEM_IF WakeupDetector();
  85. virtual RET_STATUS OEM_IF ActiveDetector();
  86. virtual DETECTOR_STATUS OEM_IF GetDetectorStatus();
  87. virtual RET_STATUS OEM_IF SetDetectorStatus(DETECTOR_STATUS status);
  88. virtual RET_STATUS DATA_ACTION ResetError();
  89. AcqModeInfoListEx* OEM_IF GetAcqModeListObject();
  90. virtual RET_STATUS OEM_IF SendDetectorInfo(string strFDI);
  91. virtual RET_STATUS DATA_ACTION GetDetectorInfo(string & strFDI);
  92. };