DIOS.Dev.DME.Mould.hpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #pragma once
  2. #include <string>
  3. #include "DIOS.Dev.IODevice.hpp"
  4. #include "DIOS.Dev.IODevice.Detail.hpp"
  5. #include "DME.BasicMoulds.hpp"
  6. #include "DriverConfigInfo.hpp"
  7. namespace nsDetail = DIOS::Dev::Detail;
  8. #ifndef DIOSDEVDMEDEVICEMOULD_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "DIOS.Dev.DME.Mould64D.lib")
  12. #else
  13. #pragma comment(lib, "DIOS.Dev.DME.Mould64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "DIOS.Dev.DME.MouldD.lib")
  18. #else
  19. #pragma comment(lib, "DIOS.Dev.DME.MouldD.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef DIOSDEVDMEDEVICEMOULD_EXPORTS
  24. #define _DIOSDEVDMEDEVICEMOULD_API __declspec(dllexport)
  25. #else
  26. #define _DIOSDEVDMEDEVICEMOULD_API __declspec(dllimport)
  27. #endif
  28. #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::DMEMould”的客户端使用
  29. namespace DIOS::Dev::Detail::DME
  30. {
  31. //获取日志配置路径
  32. _DIOSDEVDMEDEVICEMOULD_API string GetProcessDirectory();
  33. //获取配置文件中指定模块的版本号
  34. _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version, HMODULE hMyModule);
  35. _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version, ResDataObject& config);
  36. _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version);
  37. _DIOSDEVDMEDEVICEMOULD_API void TransJsonText(ResDataObject& config);
  38. //-----------------------------------------------------------------------------
  39. // DMEUnit
  40. //-----------------------------------------------------------------------------
  41. class _DIOSDEVDMEDEVICEMOULD_API DMEUnit : public IOLogicUnit
  42. {
  43. public:
  44. DMEUnit() {};
  45. virtual ~DMEUnit() {};
  46. public:
  47. std::unique_ptr<DistanceMould> m_Distance;
  48. std::unique_ptr<LaserStateMould> m_LaserState;
  49. std::unique_ptr<ConnectionStatusMould> m_ConnectionStatus;
  50. };
  51. //-----------------------------------------------------------------------------
  52. // DMEMould
  53. //-----------------------------------------------------------------------------
  54. namespace nDev = DIOS::Dev;
  55. class _DIOSDEVDMEDEVICEMOULD_API DMEMould
  56. {
  57. public:
  58. DMEMould();
  59. ~DMEMould();
  60. protected:
  61. virtual void Register(Dispatch* Dispatch);
  62. protected:
  63. virtual RET_STATUS FetchDistance() = 0;
  64. virtual RET_STATUS SetCalibrateValue(int pParams);
  65. virtual RET_STATUS SetMeasurementInterval(int pParams);
  66. virtual RET_STATUS SetStartEndPoints(int pParams);
  67. virtual RET_STATUS SetRange(int pParams);
  68. virtual RET_STATUS SetFrequency(int pParams);
  69. virtual RET_STATUS SetResolution(int pParams);
  70. virtual RET_STATUS SetLaserState(int pParams);
  71. virtual RET_STATUS SetMeasureSID(int pParams);
  72. virtual RET_STATUS SetMeasureAngle(int pParams);
  73. virtual RET_STATUS ShutDown();
  74. virtual int GetDistance();
  75. virtual int GetLaserState();
  76. virtual int GetConnectionStatus();
  77. protected:
  78. DMEUnit m_DMEUnit;
  79. };
  80. }
  81. namespace DIOS::Dev::Detail::DME
  82. {
  83. class _DIOSDEVDMEDEVICEMOULD_API DriverMould : public DIOS::Dev::IODriver
  84. {
  85. public:
  86. DriverMould();
  87. ~DriverMould();
  88. virtual std::string GetGUID() const;
  89. virtual string GetConnectDLL(string& ConfigFileName);
  90. virtual ResDataObject GetConnectParam(string& ConfigFileName);
  91. protected:
  92. std::list <ConfigInfo> m_ConfigInfo;
  93. };
  94. }