Blame view

HHECS.DAQClient/Communications/DataItem.cs 930 Bytes
唐召明 authored
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; }
-  
唐召明 authored
11
12
13
14
15
16
17
        /// <summary>
        /// 地址数据
        /// </summary>
        /// <remarks>
        /// <para>示例:DB100.0.0</para>
        /// <para>字符串地址:DB100.0,20表示从DB100.0读取20</para>
        /// </remarks>
唐召明 authored
18
19
20
21
22
        public string DataAddress { get; set; }

        public EquipmentDataType DataType { get; set; }

        public string Value { get; set; }
-  
唐召明 authored
23
24
25
26
27
28
29
30
31
32
33
34
35

        /// <summary>
        /// 数据长度
        /// </summary>
        /// <remarks><see cref="char"/>类型有效</remarks>
        public int Length
        {
            get
            {
                _ = int.TryParse(DataAddress.Split(',').LastOrDefault() ?? "1", out var val);
                return val;
            }
        }
唐召明 authored
36
37
    }
}