|
|
1
2
3
4
5
6
7
8
9
10
|
using HHECS.EquipmentModel;
namespace HHECS.DAQClient.Communications
{
public class DataItem
{
public int Id { get; set; }
public string Code { get; set; }
|
|
|
11
12
13
14
15
16
17
|
/// <summary>
/// 地址数据
/// </summary>
/// <remarks>
/// <para>示例:DB100.0.0</para>
/// <para>字符串地址:DB100.0,20表示从DB100.0读取20位</para>
/// </remarks>
|
|
|
18
19
20
21
22
|
public string DataAddress { get; set; }
public EquipmentDataType DataType { get; set; }
public string Value { get; set; }
|
|
|
23
24
25
26
27
|
/// <summary>
/// 数据长度
/// </summary>
/// <remarks>仅<see cref="char"/>类型有效</remarks>
|
唐召明
authored
|
28
|
public ushort Length
|
|
|
29
30
31
|
{
get
{
|
唐召明
authored
|
32
|
_ = ushort.TryParse(DataAddress.Split(',').LastOrDefault() ?? "1", out var val);
|
|
|
33
34
35
|
return val;
}
}
|
|
|
36
37
|
}
}
|