using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GatewayTool.Models
{
    /// <summary>
    /// 波特率枚举
    /// </summary>  
    public enum EnumBaudrate
    {
        //[Description("")]
        //None = 0,
        [Description("110")]
        rate_110 = 110,
        [Description("300")]
        rate_300 = 300,
        [Description("600")]
        rate_600 = 600,
        [Description("1200")]
        rate_1200 = 1200,
        [Description("2400")]
        rate_2400 = 2400,
        [Description("4800")]
        rate_4800 = 4800,
        [Description("9600")]
        rate_9600 = 9600,
        [Description("14400")]
        rate_14400 = 14400,
        [Description("19200")]
        rate_19200 = 19200,
        [Description("38400")]
        rate_38400 = 38400,
        [Description("43000")]
        rate_43000 = 43000,
        [Description("56000")]
        rate_56000 = 56000,
        [Description("57600")]
        rate_57600 = 57600,
        [Description("115200")]
        rate_115200 = 115200,
        [Description("128000")]
        rate_128000 = 128000,
        [Description("230400")]
        rate_230400 = 230400,
        [Description("256000")]
        rate_256000 = 256000,
        [Description("460800")]
        rate_460800 = 460800,
        [Description("500000")]
        rate_500000 = 500000,
        [Description("512000")]
        rate_512000 = 512000,
        [Description("600000")]
        rate_600000 = 600000,
        [Description("750000")]
        rate_750000 = 750000,
        [Description("921600")]
        rate_921600 = 921600,
        [Description("1000000")]
        rate_1000000 = 1000000,
        [Description("1500000")]
        rate_1500000 = 1500000,
        [Description("2000000")]
        rate_2000000 = 2000000,
    }

    /// <summary>
    /// 数据位枚举
    /// </summary>   
    public enum EnumDataBits
    {
        //[Description("")]
        //None = 0,
        //[Description("5")]
        //Bit_5 = 5,
        //[Description("6")]
        //Bit_6 = 6,
        //[Description("7")]
        //Bit_7 = 7,
        [Description("8")]
        Bit_8 = 8,
        [Description("9")]
        Bit_9 = 9,
    }

    /// <summary>
    /// 停止位枚举
    /// </summary>   
    public enum EnumStopBits
    {
        //[Description("")]
        //None = 0,
        [Description("1")]
        Bit_1 = 1,
        [Description("2")]
        Bit_2 = 2,
    }

    /// <summary>
    /// 校验位枚举
    /// </summary>
    //[JsonConverter(typeof(StringEnumConverter))]
    public enum EnumCheckBit
    {
        [Description("无")]
        none = 0,
        [Description("奇")]
        odd = 1,
        [Description("偶")]
        even = 2,
        //[Description("标记")]
        //mark,
        //[Description("空格")]
        //space,
    }

    /// <summary>
    /// 流控制枚举
    /// </summary>
    //[JsonConverter(typeof(StringEnumConverter))]
    public enum EnumFlowControl
    {
        [Description("无")]
        none = 0,
        //[Description("硬件")]
        //hardware,
        //[Description("软件")]
        //software,
        //[Description("自定义")]
        //custom,
    }

    /// <summary>
    /// 数据来源枚举
    /// </summary>    
    public enum EnumDataSource
    {
        //[Description("")]
        //None = 0,
        [Description("645协议")]
        Protocol_645 = 1,
        [Description("mdb协议")]
        Protocol_mdb = 2,
    }

    /// <summary>
    /// 645协议版本枚举
    /// </summary>    
    public enum EnumVersion645
    {
        //[Description("")]
        //None = 0,
        [Description("07版")]
        Version_07 = 1,
        [Description("97版")]
        Version_97 = 2,
    }

    /// <summary>
    /// 数据格式枚举
    /// </summary>    
    public enum EnumDataFormat
    {
        //[Description("")]
        //None = 0,
        [Description("整型")]
        Integer = 1,
        [Description("布尔")]
        Boolean = 2,
        [Description("浮点")]
        Float = 3,
    }

    /// <summary>
    /// 大小端格式枚举
    /// </summary>    
    public enum EnumBigLittleFormat
    {
        //[Description("")]
        //None = 0,
        [Description("大端")]
        Big = 1,
        [Description("小端")]
        Little = 2,
    }
}