ProtocolDetail.cs 2.03 KB
using RCS.Model.Entity.PrimaryKey;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static RCS.Model.Comm.EnumMsg;

namespace RCS.Model.Entity
{
    /// <summary>
    /// 协议详情
    /// </summary>
    public class ProtocolDetail : IdEntity, ICloneable
    {
        /// <summary>
        /// 序号
        /// </summary>
        public int SerialNo { get; set; }
        /// <summary>
        /// 所属协议
        /// </summary>
        public string ProtocolCode { get; set; }
        [NotMapped]
        public Protocol? Protocol { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 数据起始索引
        /// </summary>
        public double StartIndex { get; set; }

        /// <summary>
        /// 数据结束索引,可空,string类型需要使用
        /// </summary>
        public double EndIndex { get; set; }
        /// <summary>
        /// 数据长度
        /// </summary>
        public int DataLength { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>

        public DataType DataType { get; set; }
        /// <summary>
        /// 目标类型- 数据接收后需要转为的其他类型
        /// </summary>
        public DataType? DestDataType { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string? Desc { get; set; }

        /// <summary>
        /// 父级协议详情ID
        /// </summary>
        public int ParentId { get; set; }

        /// <summary>
        /// 是否必须
        /// </summary>
        public bool IsRequire { get; set; }

        [NotMapped]
        public object? Value { get; set; }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}