123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- #pragma once
- #include <string>
- #include <algorithm>
- using namespace std;
- #include "DIOS.Dev.MouldDefine.hpp"
- #include "Collimator.BasicMoulds.hpp"
- #pragma warning (disable:4244) // warning C4244: “初始化”: 从“double”转换到“float”,可能丢失数据
- namespace DIOS::Dev::Detail
- {
- namespace Collimator
- {
- static const char* DeviceDriverType = "{A1B2C3D4-5678-9101-1121-314159265358}";//"{18FDF176-DECE-445F-A52C-A14BDD3AC2C1}";
- static const char* CollimatorUnitType = "{566EC9F1-CE5A-4B31-9D2A-E9E80B4CA0CC}"; //"{DD98BBEB-0850-4BE7-997B-8DDECA6BD654}";
- namespace AttrKey
- {
- static const char* MODE = "Mode"; //模式
- static const char* XSIZE = "XSize"; //单边大小
- static const char* YSIZE = "YSize";
- static const char* FILTER = "Filter"; //滤过
- static const char* SID = "SID"; //源板距离
- static const char* ANGLE = "Angle"; //角度
- static const char* LIGHT = "Light"; //定位灯状态
- static const char* ThresholdValue = "ThresholdValue"; //遮光器单边阈值
- static const char* MaxWidth = "MaxWidth"; //单边最大值
- static const char* MaxHigh = "MaxHigh";
- static const char* XRatio = "XRatio"; //单边比例
- static const char* YRatio = "YRatio";
- static const char* Reversal = "Reversal";
- static const char* ConnectionStatus = "ConnectionStatus";
- }
- namespace ActionKey
- {
- static const char* SetCollimatorSize = "SetCollimatorSize";
- static const char* SetCollimatorSID = "SetCollimatorSID";
- static const char* SetCollimatorFilter = "SetCollimatorFilter";
- static const char* SetCollimatorAngle = "SetCollimatorAngle";
- static const char* SetCollimatorMode = "SetCollimatorMode";
- static const char* SetTechParamsInfo = "SetTechParamsInfo";
- static const char* SetCollimatorLight = "SetCollimatorLight";
- static const char* SetHCollimatorOpen = "SetHCollimatorOpen";
- static const char* SetHCollimatorClose = "SetHCollimatorClose";
- static const char* SetVCollimatorOpen = "SetVCollimatorOpen";
- static const char* SetVCollimatorClose = "SetVCollimatorClose";
- static const char* Reset = "Reset";
- static const char* SetCollimatorRatio = "SetCollimatorRatio";
-
- }
- //##################################################################################################
- //定义具体设备属性
- #define UNIT_DATA_INT(NAME, KEY) \
- class NAME :public IntMould\
- {\
- using super = IntMould;\
- public:\
- NAME(int initialvalue, int lower, int upper, int accuracy)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_INT_withLimit(NAME, KEY, INIT, MIN, MAX, ACC) \
- class NAME :public IntMould\
- {\
- using super = IntMould;\
- public:\
- NAME(int initialvalue = INIT, int lower = MIN, int upper = MAX, int accuracy = ACC)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_FLOAT(NAME, KEY) \
- class NAME :public FloatMould\
- {\
- using super = FloatMould;\
- public:\
- NAME(float initialvalue, float lower, float upper, float accuracy)\
- :super(KEY, initialvalue, lower, upper, accuracy)\
- {}\
- ~NAME() {}\
- };\
- #define UNIT_DATA_STR(NAME, KEY) \
- class NAME :public StringMould\
- {\
- using super = StringMould;\
- public:\
- NAME(std::string initialvalue)\
- :super(KEY, initialvalue)\
- {}\
- ~NAME() {}\
- };\
- UNIT_DATA_INT(XSIZEMould, AttrKey::XSIZE);
- UNIT_DATA_INT(YSIZEMould, AttrKey::YSIZE);
- UNIT_DATA_INT(XRATIOMould, AttrKey::XRatio);
- UNIT_DATA_INT(YRATIOMould, AttrKey::YRatio);
- UNIT_DATA_INT(FILTERMould, AttrKey::FILTER);
- UNIT_DATA_INT(SIDMould, AttrKey::SID);
- UNIT_DATA_FLOAT(ANGLEMould, AttrKey::ANGLE);
- UNIT_DATA_INT(MODEMould, AttrKey::MODE);
- UNIT_DATA_INT(LIGHTMould, AttrKey::LIGHT);
- UNIT_DATA_INT(ReversalMould, AttrKey::Reversal);
- UNIT_DATA_INT(ConnectionStatusMould, AttrKey::ConnectionStatus);
-
- //-----------------------------------------------------------------------------
- // ConfigInfo
- //-----------------------------------------------------------------------------
- namespace ConfKey
- {
- static const char* DiosVender = "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";
- //20220412 新增 <ConfigToolInfo> 以及其内部属性,主要用于webconfig
- static const char* DiosConfigToolInfo = "ConfigToolInfo";
- static const char* DiosAttributeInfo = "AttributeInfo";
- static const char* DiosAttributeKey = "AttributeKey";
- static const char* DiosAttributeDescripition = "AttributeDescripition";
- static const char* DiosAccess = "Access";
- static const char* DiosType = "Type";
- static const char* DiosRangeMin = "RangeMin";
- static const char* DiosRangeMax = "RangeMax";
- static const char* DiosListNum = "ListNum";
- static const char* DiosListInfo = "ListInfo";
- static const char* DiosList = "List";
- static const char* DiosRequired = "Required";
- static const char* DiosDefaultValue = "DefaultValue";
- static const char* DiosInnerKey = "InnerKey";
- static const char* DiosPathID = "PathID";
- }
- }
- }
|