#pragma once #include #include "DIOS.Dev.IODevice.hpp" #include "DIOS.Dev.IODevice.Detail.hpp" #include "DME.BasicMoulds.hpp" #include "DriverConfigInfo.hpp" namespace nsDetail = DIOS::Dev::Detail; #ifndef DIOSDEVDMEDEVICEMOULD_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.DME.Mould64D.lib") #else #pragma comment(lib, "DIOS.Dev.DME.Mould64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "DIOS.Dev.DME.MouldD.lib") #else #pragma comment(lib, "DIOS.Dev.DME.MouldD.lib") #endif #endif #endif #ifdef DIOSDEVDMEDEVICEMOULD_EXPORTS #define _DIOSDEVDMEDEVICEMOULD_API __declspec(dllexport) #else #define _DIOSDEVDMEDEVICEMOULD_API __declspec(dllimport) #endif #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::DMEMould”的客户端使用 namespace DIOS::Dev::Detail::DME { //获取日志配置路径 _DIOSDEVDMEDEVICEMOULD_API string GetProcessDirectory(); //获取配置文件中指定模块的版本号 _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version, HMODULE hMyModule); _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version, ResDataObject& config); _DIOSDEVDMEDEVICEMOULD_API bool GetVersion(string& version); _DIOSDEVDMEDEVICEMOULD_API void TransJsonText(ResDataObject& config); //----------------------------------------------------------------------------- // DMEUnit //----------------------------------------------------------------------------- class _DIOSDEVDMEDEVICEMOULD_API DMEUnit : public IOLogicUnit { public: DMEUnit() {}; virtual ~DMEUnit() {}; public: std::unique_ptr m_Distance; std::unique_ptr m_LaserState; std::unique_ptr m_ConnectionStatus; }; //----------------------------------------------------------------------------- // DMEMould //----------------------------------------------------------------------------- namespace nDev = DIOS::Dev; class _DIOSDEVDMEDEVICEMOULD_API DMEMould { public: DMEMould(); ~DMEMould(); protected: virtual void Register(Dispatch* Dispatch); protected: virtual RET_STATUS FetchDistance() = 0; virtual RET_STATUS SetCalibrateValue(int pParams); virtual RET_STATUS SetMeasurementInterval(int pParams); virtual RET_STATUS SetStartEndPoints(int pParams); virtual RET_STATUS SetRange(int pParams); virtual RET_STATUS SetFrequency(int pParams); virtual RET_STATUS SetResolution(int pParams); virtual RET_STATUS SetLaserState(int pParams); virtual RET_STATUS SetMeasureSID(int pParams); virtual RET_STATUS SetMeasureAngle(int pParams); virtual RET_STATUS ShutDown(); virtual int GetDistance(); virtual int GetLaserState(); virtual int GetConnectionStatus(); protected: DMEUnit m_DMEUnit; }; } namespace DIOS::Dev::Detail::DME { class _DIOSDEVDMEDEVICEMOULD_API DriverMould : public DIOS::Dev::IODriver { public: DriverMould(); ~DriverMould(); virtual std::string GetGUID() const; virtual string GetConnectDLL(string& ConfigFileName); virtual ResDataObject GetConnectParam(string& ConfigFileName); protected: std::list m_ConfigInfo; }; }