123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #pragma once
- #include <string>
- #include <algorithm>
- using namespace std;
- //
- //#include "TmplMould.tlh"
- //#include "TmplMould.tli"
- #include "DIOS.Dev.MouldDefine.hpp"
- #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
- namespace DIOS::Dev::Detail
- {
- namespace DAP
- {
- static const char* DeviceDriverType = "{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}";
- static const char* DAPUnitType = "{123492D6-A546-4ACF-8EF1-2CCAA9EA974E}";
- namespace AttrKey
- {
- static const char* DAP = "DAP";
- static const char* ConnectionStatus = "ConnectionStatus";
- }
- namespace ActionKey
- {
- static const char* Clear_DAP = "Clear_DAP";
- static const char* GetValue_DAP = "GetValue_DAP";
-
- }
- ////-----------------------------------------------------------------------------
- //// FloatMould
- ////-----------------------------------------------------------------------------
- //class FloatMould : public TmplMould <float>
- //{
- // using super = TmplMould <float>;
- //public:
- // FloatMould(const char* strkey, float initialvalue, float min, float max, float accuracy)
- // :super(initialvalue, min, max, accuracy)
- // {
- // Key = strkey;
- // m_Value = initialvalue;
- // }
- //
- // ~FloatMould() {}
- // std::string GetDescription ();
- // std::string GetAttribute ();
- // std::string JSGet();
- // std::string GetKey();
- //protected:
- // std::string Key;
- //};
- //-----------------------------------------------------------------------------
- // DOSEMould
- //-----------------------------------------------------------------------------
- class DOSEMould : public FloatMould
- {
- using super = FloatMould;
- public:
- DOSEMould(float initialvalue, float min, float max, float accuracy)
- :super(AttrKey::DAP, initialvalue, min, max, accuracy) {}
-
- ~DOSEMould() {}
- static constexpr const char * Unit { "dGycm2" };
- std::string strUnit = Unit;
- //std::string GetDescription();
- };
- class ConnectionStatusMould : public IntMould
- {
- using super = IntMould;
- public:
- ConnectionStatusMould(int initialvalue, int min, int max, int accuracy)
- :super(AttrKey::ConnectionStatus, initialvalue, min, max, accuracy) {}
- ~ConnectionStatusMould() {}
- };
- //-----------------------------------------------------------------------------
- // ConfigInfo
- //-----------------------------------------------------------------------------
- namespace ConfKey
- {
- static const char* DiosType = "Vender";
- static const char* DiosModel = "Model";
- static const char* DiosConfig = "DeviceConfig";
- static const char* DiosAttribute = "Attribute";
- static const char* DiosDescription = "Description";
- static const char* DiosSCFType = "SCFType";
- static const char* DiosSCFTCPIP = "TCPIP";
- static const char* DiosSCFCOM = "COM";
- static const char* DiosSCFIP = "ip";
- static const char* DiosSCFPort = "port";
- static const char* DiosSCFBaudrate = "baudrate";
- static const char* DiosSCFBytesize = "bytesize";
- static const char* DiosSCFParity = "parity";
- static const char* DiosSCFStopbits = "stopbits";
- static const char* DiosIsConnect = "IsConnect";
- }
- }
- }
|