using System.ComponentModel;

namespace JiShe.CollectBus.Common.Enums
{
    /// <summary>
    /// 规约标识 高位在前 D1+D0
    /// </summary>
    public enum ProtocolIdentification
    {
        禁用 = 00,
        电力负荷管理系统数据传输 = 01,
        本规约使用 = 10,
        保留 = 11
    }

    /// <summary>
    /// 传输方向位
    /// </summary>
    public enum DIR
    {
        主站下行报文 = 0,
        终端上行报文 = 1
    }

    /// <summary>
    /// 启动标识位
    /// </summary>
    public enum PRM
    {
        从动站报文 = 0,
        启动站报文 = 1,
    }

    /// <summary>
    /// 帧计数有效位
    /// </summary>
    public enum FCV
    {
        FCB位无效 = 0,
        FCB位有效 = 1
    }

    /// <summary>
    /// 控制域（PRM=1）启动站功能码
    /// </summary>
    public enum CMasterStationFunCode
    {
        复位命令 = 1,
        用户数据 = 4,
        链路测试 = 9,
        请求1级数据 = 10,
        请求2级数据 = 11
    }

    /// <summary>
    /// 控制域（PRM=0）从动站功能码
    /// </summary>
    public enum CFromStationFunCode
    {
        确认 = 0,
        用户数据 = 8,
        无所召唤的数据 = 9,
        链路数据 = 11
    }

    /// <summary>
    /// 应用层功能码
    /// </summary>
    public enum AFN
    {
        确认或否认 = 00,
        复位 = 01,
        链路接口检测 = 02,
        中继站命令 = 03,
        设置参数 = 04,
        控制命令 = 05,
        身份认证及密钥协商 = 06,
        备用 = 07,
        请求被级联终端主动上报 = 08,
        请求终端配置 = 09,
        查询参数 = 10,
        请求任务数据 = 11,
        [Description("请求一类数据")]
        请求实时数据 = 12,
        [Description("请求二类数据")]
        请求历史数据 = 13,
        请求事件数据 = 14,
        文件传输 = 15,
        数据转发 = 16,
    }

    /// <summary>
    /// 帧时间标签有效位
    /// </summary>
    public enum TpV
    {
        附加信息域中无时间标签 = 0,
        附加信息域中带时间标签 = 1
    }

    /// <summary>
    /// 首帧末帧标志
    /// </summary>
    public enum FIRFIN
    {
        中间帧 = 00,
        结束帧 = 01,
        第一帧 = 10,
        单帧 = 11
    }

    /// <summary>
    /// 请求确认标志位
    /// </summary>
    public enum CON
    {
        不需要对该帧进行确认 = 0,
        需要对该帧进行确认 = 1
    }

    /// <summary>
    /// 通信协议类型 数值0-255
    /// </summary>
    public enum CommunicationProtocolType
    {
        DLT6451997 = 1,
        交流采样装置 = 2,
        DLT6452007 = 30,
        串行接口连接窄带低压载波通讯 = 31
    }

    public enum BaudRate
    {
        Br300 = 0,
        Br600 = 1,
        Br1200 = 2,
        Br2400 = 3,
        Br4800 = 4,
        Br7200 = 5,
        Br9600 = 6,
        Br19200 = 7
    }
    public enum StopBit
    {
        Stop1 = 0,
        Stop2
    }
    public enum Parity
    {
        None = 0,
        /// <summary>
        /// 偶校验
        /// </summary>
        Even,
        /// <summary>
        /// 奇校验
        /// </summary>
        Odd
    }
    public enum DataBit
    {
        D5 = 0,
        D6,
        D7,
        D8
    }

    public enum IssuedEventType
    {
        Heartbeat,
        Login,
        Data
    }

    /// <summary>
    /// 查询参数数据项
    /// </summary>
    public enum QueryParameterDataItems
    {
        尖峰平谷时段=94,
        电网频率 =97,

    }

    /// <summary>
    /// 一类数据项
    /// </summary>
    public enum ATypeOfDataItems
    {
        相位角=49,
        当前正向有功电能示值=129,
        当前反向无功电能示值 = 131,
        上月最大需量 =149,
    }

    /// <summary>
    /// 二类数据项
    /// </summary>
    public enum IIdataTypeItems
    {
        [Description("Td_d")]
        日最大需量=3,
        [Description("Td_c")]
        总有功功率 =81,
        [Description("Td_c")]
        A相有功功率 =82,
        [Description("Td_c")]
        B相有功功率 = 83,
        [Description("Td_c")]
        C相有功功率 = 84,
        [Description("Td_c")]
        总无功功率 =85,
        [Description("Td_c")]
        A相无功功率 =86,
        [Description("Td_c")]
        B相无功功率 =87,
        [Description("Td_c")]
        C相无功功率 =88,
        [Description("Td_c")]
        A相电压 =89,
        [Description("Td_c")]
        B相电压 = 90,
        [Description("Td_c")]
        C相电压 = 91,
        [Description("Td_c")]
        A相电流 =92,
        [Description("Td_c")]
        B相电流 = 93,
        [Description("Td_c")]
        C相电流 = 94,
        [Description("Td_c")]
        正向有功电量 =97,
        [Description("Td_c")]
        正向无功电量 =98,
        [Description("Td_c")]
        反向有功电量 =99,
        [Description("Td_c")]
        反向无功电量 =100,
        [Description("Td_c")]
        正向有功电量示值 =101,
        [Description("Td_c")]
        正向无功电量示值 =102,
        [Description("Td_c")]
        反向有功电量示值 =103,
        [Description("Td_c")]
        反向无功电量示值 =104,
        [Description("Td_c")]
        总功率因数 =105,
        [Description("Td_c")]
        A相功率因数 =106,
        [Description("Td_c")]
        B相功率因数 =107,
        [Description("Td_c")]
        C相功率因数 =108,
        [Description("Td_c")]
        一象限无功 =145,
        [Description("Td_c")]
        四象限无功 =146,
        [Description("Td_c")]
        二象限无功 =147,
        [Description("Td_c")]
        三象限无功 =148,
        [Description("Td_d")]
        日冻结电量示值 = 161,
        [Description("Td_d")]
        日冻结反向电量示值 =163,
        [Description("Td_m")]
        月冻结电量示值 =177,
        [Description("Td_m")]
        月冻结反向电量示值 =179,
    }

    /// <summary>
    /// 冻结密度 
    /// </summary>
    public enum FreezeDensity
    {
        [Description("不冻结")]
        No = 0,
        //冻结时刻
        [Description("15分，30分，45分，0分")]
        Min15=1,
        [Description("30分，0分")]
        Min30 =2,
        [Description("0分")]
        Min60 =3,
        [Description("5分,10分，15，...，0")]
        Min5 =254,
        [Description("1分,2分，3，...，0")]
        Min1 =255,
    }

    /// <summary>
    /// 相位角
    /// </summary>
    public enum ATypeOfDataItems49
    {
        UabUa=0,
        Ub=2,
        UcbUc=4,
        Ia=6,
        Ib=8,
        Ic=10
    }

    /// <summary>
    /// 数据时标
    /// </summary>
    public enum TdType
    {
        [Description("曲线类")]
        Td_c,
        [Description("日冻结类")]
        Td_d,
        [Description("月冻结类")]
        Td_m,
    }

    public enum CmdType
    {
        Valve = 1,
        Lock,
        Reading,
        BalanceDown,
        BalanceRead,
        PowerDown,
        PowerRead,
        ArchivesDown,
        ArchivesRead,
        Clear,
        TimeSet,
        Identity,
        ReadMeterNum,
        Event,

        /// <summary>
        /// 抄读电流
        /// </summary>
        ReadingCurrent,
        CurrentDown,
        CurrentRead,

        /// <summary>
        /// 威胜的功率下发(海洋职业学院专用)
        /// </summary>
        WsPowerDown,
        WsOnPowerDown,
        ReadMeterStatus,
        ReadTimeSetMonth,
        ReadTimeSet,
        ReadTimeSetNum,

        /// <summary>
        /// 读取正在运行的时段
        /// </summary>
        ReadCurrentTime
    }

    public enum TerminalVersionInfoEnum
    {
        MakerNo = 0,
        DeviceNo = 4,
        SoftwareVersionNo =12,
        SoftwareReleaseDate=16,
        CapacityInformationCode=19,
        ProtocolVersionNo= 30,
        HardwareVersionNo = 34,
        HardwareReleaseDate=38
    }

    public enum FN
    {
        登录 = 1,
        心跳 = 3
    }

    /// <summary>
    /// 数据冻结密度
    /// </summary>
    public enum DensityEnums
    {
        Sec_1 = 255,
        Sec_5 = 254,
        Sec_60 = 3,
        Sec_30 = 2,
        Sec_15 = 1,
        Sec_0 = 0
    }

    /// <summary>
    /// 数据冻结密度单位
    /// </summary>
    public enum DensityUnit 
    {
        /// <summary>
        /// 秒
        /// </summary>
        Second=0,
        /// <summary>
        /// 分钟
        /// </summary>
        Minute=1,
        /// <summary>
        /// 小时
        /// </summary>
        Hour=2,
        /// <summary>
        /// 天
        /// </summary>
        Day=3,
        /// <summary>
        /// 月
        /// </summary>
        Month=4,
        /// <summary>
        /// 年
        /// </summary>
        Year=5

    }

}
