Beispiel #1
0
        public static PortConfig Create()
        {
            var result = new PortConfig();

            result.Name     = "默认";
            result.PortName = PortIndex.COM1;
            result.BaudRate = 9600;
            result.DataBits = 8;
            result.Parity   = Parity.None;
            result.StopBits = StopBits.One;
            //result.Protocol = "无";
            //result.DeviceType = DeviceType.光电设备;

            //result.RouteTotal = 1;

            return(result);
        }
Beispiel #2
0
        ///// <summary>
        ///// 通道数量,1到8
        ///// </summary>
        //[Display(Name = "通道数量")]

        //public int RouteTotal { get; set; } = 1;
        ///// <summary>
        ///// 协议厂家
        ///// </summary>
        //[Display(Name = "协议厂家")]
        //public String Protocol { get; set; }

        ///// <summary>
        ///// 设备类型
        ///// </summary>
        //[Display(Name = "设备类型")]
        //public DeviceType DeviceType { get; set; }

        public object Clone()
        {
            var result = new PortConfig();

            result.Id       = this.Id;
            result.Name     = this.Name;
            result.PortName = this.PortName;
            result.BaudRate = this.BaudRate;
            result.DataBits = this.DataBits;
            result.Parity   = this.Parity;
            result.StopBits = this.StopBits;
            //result.Protocol = this.Protocol;
            //result.DeviceType = this.DeviceType;
            //result.RouteTotal = this.RouteTotal;

            return(result);
        }