123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- #pragma once
- #include <string>
- #include "DIOS.Dev.IODevice.hpp"
- #include "DIOS.Dev.IODevice.Detail.hpp"
- #include "DAP.BasicMoulds.hpp"
- #include "DriverConfigInfo.hpp"
- namespace nsDetail = DIOS::Dev::Detail;
- #ifndef DIOSDEVDAPDEVICEMOULD_EXPORTS
- #ifdef _WIN64
- #ifdef _DEBUG
- #pragma comment(lib, "DIOS.Dev.DAP.Mould64D.lib")
- #else
- #pragma comment(lib, "DIOS.Dev.DAP.Mould64.lib")
- #endif
- #else
- #ifdef _DEBUG
- #pragma comment(lib, "DIOS.Dev.DAP.MouldD.lib")
- #else
- #pragma comment(lib, "DIOS.Dev.DAP.MouldD.lib")
- #endif
- #endif
- #endif
- #ifdef DIOSDEVDAPDEVICEMOULD_EXPORTS
- #define _DIOSDEVDAPDEVICEMOULD_API __declspec(dllexport)
- #else
- #define _DIOSDEVDAPDEVICEMOULD_API __declspec(dllimport)
- #endif
- #pragma warning (disable:4251) // warning C4251: class “DIOS::Dev::Detail::Generator::DoseUnit”需要有 dll 接口由 class“DIOS::Dev::Detail::Generator::DAPMould”的客户端使用
- namespace DIOS::Dev::Detail::DAP
- {
- //获取日志配置路径
- _DIOSDEVDAPDEVICEMOULD_API string GetProcessDirectory();
- //获取配置文件中指定模块的版本号
- _DIOSDEVDAPDEVICEMOULD_API bool GetVersion(string& version, HMODULE hMyModule);
- _DIOSDEVDAPDEVICEMOULD_API bool GetVersion(string& version, ResDataObject& config);
- _DIOSDEVDAPDEVICEMOULD_API bool GetVersion(string& version);
- _DIOSDEVDAPDEVICEMOULD_API void TransJsonText(ResDataObject& config);
- //-----------------------------------------------------------------------------
- // DAPUnit
- //-----------------------------------------------------------------------------
- class _DIOSDEVDAPDEVICEMOULD_API DAPUnit : public IOLogicUnit
- {
- public:
- DAPUnit() {};
- virtual ~DAPUnit() {};
- public:
- std::unique_ptr<DOSEMould> m_DAP;
- std::unique_ptr<ConnectionStatusMould> m_ConnectionStatus;
- };
- //-----------------------------------------------------------------------------
- // DAPMould
- //-----------------------------------------------------------------------------
- namespace nDev = DIOS::Dev;
- class _DIOSDEVDAPDEVICEMOULD_API DAPMould
- {
- public:
- DAPMould ();
- ~DAPMould ();
- protected:
- virtual void Register(Dispatch* Dispatch);
- private:
- //caoxue
- RET_STATUS JSGetDAP(std::string& out);
- RET_STATUS JSGetConnectionStatus(std::string& out);
- RET_STATUS JSResetDAP(std::string in, std::string& out);
- RET_STATUS JSObtainDAP(std::string in, std::string& out);
- protected:
- virtual float GetDAP();
- virtual float GetConnectionStatus();
- virtual RET_STATUS ClearDAP() = 0;
- virtual RET_STATUS QueryDAP(float& value) = 0;
- virtual RET_STATUS SetGenCurrentSMState(const std::string value);
- virtual RET_STATUS SetGenPostKV(const std::string value);
- virtual RET_STATUS SetGenPostMAS(const std::string value);
- virtual RET_STATUS SetGenPostMA(const std::string value);
- virtual RET_STATUS SetGenPostMS(const std::string value);
- virtual RET_STATUS SetCollSID(const std::string value);
- virtual RET_STATUS SetCollXSIZE(const std::string value);
- virtual RET_STATUS SetCollYSIZE(const std::string value);
- protected:
- DAPUnit m_DAPUnit;
- };
- }
- namespace DIOS::Dev::Detail::DAP
- {
- class _DIOSDEVDAPDEVICEMOULD_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;
- };
- }
|