123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #pragma once
- #include <string>
- #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<DistanceMould> m_Distance;
- std::unique_ptr<LaserStateMould> m_LaserState;
- std::unique_ptr<ConnectionStatusMould> 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 <ConfigInfo> m_ConfigInfo;
- };
- }
|