HslHelper 方法 |
HslHelper 类型公开以下成员。
名称 | 说明 | |
---|---|---|
ByteArrayToStructT | [商业授权] 将原始的字节数组,转换成实际的结构体对象,需要事先定义好结构体内容,否则会转换失败 [Authorization] To convert the original byte array into an actual structure object, the structure content needs to be defined in advance, otherwise the conversion will fail | |
CalculateBitStartIndex |
根据字符串内容,获取当前的位索引地址,例如输入 6,返回6,输入15,返回15,输入B,返回11
| |
CalculateOccupyLength |
根据位偏移的地址,长度信息,计算出实际的地址占用长度
| |
CalculateStartBitIndexAndLength |
根据当前的位偏移地址及读取位长度信息,计算出实际的字节索引,字节数,字节位偏移
| |
CreateTwoArrayFromOneArrayT |
将一个一维数组中的所有数据按照行列信息拷贝到二维数组里,返回当前的二维数组
| |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) | |
ExtractBooleanParameter(String, String) |
解析地址的附加bool参数方法,比如你的地址是s=true;D100,可以提取出"s"的值的同时,修改地址本身,如果"s"不存在的话,返回错误的消息内容 The method of parsing additional parameters of the address, for example, if your address is s=true;D100, you can extract the value of "s" and modify the address itself. If "s" does not exist, return the wrong message content | |
ExtractBooleanParameter(String, String, Boolean) |
解析地址的附加Bool类型参数方法,比如你的地址是s=true;D100,可以提取出"s"的值的同时,修改地址本身,如果"s"不存在的话,返回给定的默认值 The method of parsing additional parameters of the address, for example, if your address is s=true;D100, you can extract the value of "s" and modify the address itself. If "s" does not exist, return the given default value | |
ExtractParameter(String, String) |
解析地址的附加参数方法,比如你的地址是s=100;D100,可以提取出"s"的值的同时,修改地址本身,如果"s"不存在的话,返回错误的消息内容 The method of parsing additional parameters of the address, for example, if your address is s=100;D100, you can extract the value of "s" and modify the address itself. If "s" does not exist, return the wrong message content | |
ExtractParameter(String, String, Int32) |
解析地址的附加参数方法,比如你的地址是s=100;D100,可以提取出"s"的值的同时,修改地址本身,如果"s"不存在的话,返回给定的默认值 The method of parsing additional parameters of the address, for example, if your address is s=100;D100, you can extract the value of "s" and modify the address itself. If "s" does not exist, return the given default value | |
ExtractStartIndex |
解析地址的起始地址的方法,比如你的地址是 A[1] , 那么将会返回 1,地址修改为 A,如果不存在起始地址,那么就不修改地址,返回 -1 The method of parsing the starting address of the address, for example, if your address is A[1], then it will return 1, and the address will be changed to A. If the starting address does not exist, then the address will not be changed and return -1 | |
ExtractTransformParameter |
解析地址的附加DataFormat参数方法,比如你的地址是format=ABCD;D100,可以提取出"format"的值的同时,修改地址本身,如果"format"不存在的话,返回默认的IByteTransform对象 Parse the additional DataFormat parameter method of the address. For example, if your address is format=ABCD;D100, you can extract the value of "format" and modify the address itself. If "format" does not exist, Return the default IByteTransform object | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) | |
GetBitIndexInformation |
获取地址信息的位索引,在地址最后一个小数点的位置
| |
GetHashCode | Serves as the default hash function. (继承自 Object。) | |
GetIpAddressFromInput |
从当前的字符串信息获取IP地址数据,如果是ip地址直接返回,如果是域名,会自动解析IP地址,否则抛出异常 Get the IP address data from the current string information, if it is an ip address, return directly, if it is a domain name, it will automatically resolve the IP address, otherwise an exception will be thrown | |
GetType | Gets the Type of the current instance. (继承自 Object。) | |
GetUTF8Bytes |
从字符串的内容提取UTF8编码的字节,加了对空的校验
| |
IsAddressEndWithIndex |
判断当前的字符串表示的地址,是否以索引为结束
| |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) | |
PathCombine |
将多个路径合成一个更完整的路径,这个方法是多平台适用的
| |
ReadBinaryFromStream |
从流中读取二进制的内容
| |
ReadBool |
按照位为单位从设备中批量读取bool数组,如果地址中包含了小数点,则使用字的方式读取数据,然后解析出位数据 The BOOL array is read in batches from the device in bits, and if the address contains decimal points, the data is read in a word manner, and then the bit data is parsed | |
ReadBoolAsync |
按照位为单位从设备中批量读取bool数组,如果地址中包含了小数点,则使用字的方式读取数据,然后解析出位数据 The BOOL array is read in batches from the device in bits, and if the address contains decimal points, the data is read in a word manner, and then the bit data is parsed | |
ReadCuttingAsyncHelperT |
根据地址的临界条件来切割读取地址的方法,支持bool地址的切割,支持字地址的切割
| |
ReadCuttingHelperT |
根据地址的临界条件来切割读取地址的方法,支持bool地址的切割,支持字地址的切割
| |
ReadSpecifiedLengthFromStream |
从流中接收指定长度的字节数组
| |
ReadStringFromStream |
从流中读取一个字符串内容
| |
SplitReadLength |
切割当前的地址数据信息,根据读取的长度来分割成多次不同的读取内容,需要指定地址,总的读取长度,切割读取长度 Cut the current address data information, and divide it into multiple different read contents according to the read length. You need to specify the address, the total read length, and the cut read length | |
SplitWriteDataT |
根据指定的长度切割数据数组,返回地址偏移量信息和数据分割信息
| |
ThreadSleep |
休眠指定的时间,时间单位为毫秒
| |
ToFormatString |
将串口的一些参数,变成一个统一的格式化的字符串,例如 COM3-9600-8-N-1
| |
ToString | Returns a string that represents the current object. (继承自 Object。) | |
WriteBinaryToStream |
将二进制的内容写入到数据流之中
| |
WriteStringToStream |
将字符串的内容写入到流中去
|
名称 | 说明 | |
---|---|---|
ToJsonString |
获取当前对象的JSON格式表示的字符串。 (由 HslExtension 定义。)Gets the string represented by the JSON format of the current object. |