using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DH.Commons.Enums
{
    public enum EnumPLCType
    {
        信捷XC_串口,
        信捷XC_网口,
        信捷XD_串口,
        信捷XD_网口
    }



    public enum EnumPLCInputIO
    {
       启动=0,
       复位=1,
       停止=2,
       急停=3
    }

    public enum EnumPLCOutputIO
    {
        转盘方向=0,
        转盘速度=1,
        转盘使能=2,
        转盘启动=3,
        转盘清料=4,
        指示灯绿=5,
        指示灯黄=6,
        指示灯红=7,
        蜂鸣器=8,
        振动盘=9,
        皮带=10,
        工位1=11,
        工位2=12,
        工位3=13,
        工位4=14,
        工位5=15,
        OK料盒=16,
        NG料盒=17,
        OK吹气时间=18,
        NG吹气时间=19,
        产品计数=20,
        计数清零=21,
        工件最小值=22,
        工具最大值=23,
        启用心跳=24,
        心跳=25

    }


    public enum StreamFormat
    {
        [Description("8位图像")]
        S_RAW8 = 0,
        [Description("10位图像")]
        S_RAW10 = 1,
        [Description("12位图像")]
        S_RAW12 = 2,
        [Description("14位图像")]
        S_RAW14 = 3,
        [Description("16位图像")]
        S_RAW16 = 4,
        [Description("BGR三通道24比特图像")]
        S_BGR24 = 10,
        [Description("BGRA四通道32比特图像")]
        S_BGR32 = 11,
        [Description("BGRA四通道48比特图像")]
        S_BGR48 = 12,
        [Description("BGRA四通道64比特图像")]
        S_BGR64 = 13,
        [Description("RGB三通道24比特图像")]
        S_RGB24 = 14,
        [Description("RGBA四通道32比特图像")]
        S_RGB32 = 15,
        [Description("RGBA四通道48比特图像")]
        S_RGB48 = 16,
        [Description("RGBA四通道64比特图像")]
        S_RGB64 = 17,
        [Description("YUV411")]
        S_YCBCR_411 = 20,
        [Description("YUV422")]
        S_YCBCR_422 = 21,
        [Description("YUV444")]
        S_YCBCR_444 = 22,
        [Description("8位灰度图像")]
        S_MONO8 = 30,
        [Description("10位灰度图像")]
        S_MONO10 = 31,
        [Description("12位灰度图像")]
        S_MONO12 = 32,
        [Description("14位灰度图像")]
        S_MONO14 = 33,
        [Description("16位灰度图像")]
        S_MONO16 = 34,
        S_B8_G8_R8 = 40,
        S_B16_G16_R16 = 44
    }



    /// <summary>
    /// 主板型号
    /// </summary>
    public enum BoardModelEnum
    {
        EC3216 = 0,
        EC3224,
        EC3416,
    }
    /// <summary>
    /// 扩展板类型
    /// </summary>
    public enum ExtensionBoardEnum
    {
        [Description("未外接扩展板")]
        None,
        [Description("一个IO扩展板")]
        ExtIO_1,
        [Description("一个EC3216扩展板")]
        ExtEC3216_1,
        [Description("一个EC3224扩展板")]
        ExtEC3224_1,
        [Description("一个EC3416扩展板")]
        ExtEC3416_1,
    }

    /// <summary>
    /// 转盘类型
    /// </summary>
    public enum MachineDiskType
    {

        [Description("单转盘")]
        SingleDisk = 1,

        [Description("双转盘")]
        DoubleDisk = 2,

    }

    /// <summary>
    /// 运动板卡 IO 类型(IN OUT)
    /// </summary>
    public enum IOType
    {
        [Description("INPUT")]
        INPUT = 0,
        [Description("OUTPUT")]
        OUTPUT = 1
    }

    public enum IOValue
    {
        [Description("关闭")]
        FALSE = 0,
        [Description("开启")]
        TRUE = 1,
        [Description("反转")]
        REVERSE = 2,
    }
    public enum RotationDirectionEnum
    {

        [Description("顺时针(正方向)")]
        Clockwise = 0,

        [Description("逆时针(负方向)")]
        AntiClockwise = 1,

    }

    /// <summary>
    /// IO预定义类型 主要针对输出
    /// </summary>
    public enum IOPrestatement
    {
        [Description("自定义")]
        Customized = 0,

        [Description("指示灯-黄")]
        Light_Yellow = 1,
        [Description("指示灯-绿")]
        Light_Green = 2,
        [Description("指示灯-红")]
        Light_Red = 3,
        [Description("蜂鸣器")]
        Beep = 4,
        [Description("照明灯")]
        Light = 5,

        [Description("急停")]
        EmergencyStop = 99,
    }


    /// <summary>
    /// 相机信号IO输出模式
    /// </summary>
    public enum ActionMode
    {
        [Description("IO断路输出")]
        OpenCircuit = 1,

        [Description("IO开漏输出低电平")]
        LowLevel = 2,

        [Description("取反IO")]
        Reverse = 3,

        [Description("输出500us低脉冲")]
        OutputPulse500us = 5,

        [Description("输出1ms低脉冲")]
        OutputPulse1ms = 6,

        [Description("输出2ms低脉冲")]
        OutputPulse2ms = 9,

        [Description("输出3ms低脉冲")]
        OutputPulse3ms = 10,

        [Description("输出4ms低脉冲")]
        OutputPulse4ms = 11,

        [Description("输出5ms低脉冲")]
        OutputPulse5ms = 12,

        [Description("输出6ms低脉冲")]
        OutputPulse6ms = 13,

        [Description("输出7ms低脉冲")]
        OutputPulse7ms = 14,

        [Description("输出8ms低脉冲")]
        OutputPulse8ms = 15,

        [Description("输出9ms低脉冲")]
        OutputPulse9ms = 16,

        [Description("输出10ms低脉冲")]
        OutputPulse10ms = 17,

        [Description("输出20ms低脉冲")]
        OutputPulse20ms = 18,

        [Description("输出30ms低脉冲")]
        OutputPulse30ms = 19,

        [Description("输出40ms低脉冲")]
        OutputPulse40ms = 20,

        [Description("输出50ms低脉冲")]
        OutputPulse50ms = 21,

        [Description("输出60ms低脉冲")]
        OutputPulse60ms = 22,

        [Description("输出70ms低脉冲")]
        OutputPulse70ms = 23,

        [Description("输出80ms低脉冲")]
        OutputPulse80ms = 24,

        [Description("输出90ms低脉冲")]
        OutputPulse90ms = 25,

        [Description("输出100ms低脉冲")]
        OutputPulse100ms = 26,

        [Description("输出200ms低脉冲")]
        OutputPulse200ms = 27,

        [Description("输出300ms低脉冲")]
        OutputPulse300ms = 28,
    }


    /// <summary>
    /// 吹气信号IO输出模式
    /// </summary>
    public enum BlowType
    {

        [Description("OK吹气口")]
        OK,

        [Description("NG吹气口")]
        NG,

        [Description("吹气口1")]
        Blow1,

        [Description("吹气口2")]
        Blow2,

        [Description("吹气口3")]
        Blow3,

        [Description("吹气口4")]
        Blow4,

        [Description("吹气口5")]
        Blow5,

        [Description("吹气口6")]
        Blow6,



    }

    /// <summary>
    /// 来料检测位号,目前支持两路
    /// </summary>
    public enum BitInputNumberEnum
    {
        [Description("第0路")]
        BitInput0 = 0,

        [Description("第1路")]
        BitInput1,

    }

    /// <summary>
    /// 电平
    /// </summary>
    public enum LogicLevelEnum
    {
        [Description("低电平")]
        LowLevel = 0,
        [Description("高电平")]
        HighLevel,
    }

    /// <summary>
    /// 捕捉位置模式
    /// </summary>
    public enum PositionSourceEnum
    {
        [Description("指令位置")]
        CommandPosition = 0,
        [Description("编码器位置")]
        EncoderPosition = 1,
    }


    /// <summary>
    /// 来料检测捕获位置
    /// </summary>
    public enum SortingInputPositionModeEnum
    {
        [Description("前部")]
        Front = 0,
        [Description("中间")]
        Middle,
    }

    /// <summary>
    /// 回原点模式1
    /// </summary>
    public enum GoHomeMode
    {
        // Negative: 负极限、负方向
        // Positive: 正极限、正方向
        // NeL:负限开关
        // N:无 


        //[ColorSelect("Gray")]
        //[FontColorSelect("Black")]
        [Description("1 负极限:负限开关_中间:无_正极限:无_Index位置:负限位正边_偏移:正方向")]
        Negative_Ne_Center_N_Positive_N_Index_NePo_Offset_Po = 1,

        [Description("2 负极限:无_中间:无_正极限:正限开关_Index位置:正限位负边_偏移:负方向")]
        Negative_N_Center_N_Positive_Po_Index_PoNe_Offset_Ne = 2,

        [Description("3 负极限:无_中间:无_正极限:原点开关_Index位置:原点负边外侧_偏移:负方向")]
        Negative_N_Center_N_Positive_H_Index_HNeO_Offset_Ne = 3,

        [Description("4 负极限:无_中间:无_正极限:原点开关_Index位置:原点负边内侧_偏移:正方向")]
        Negative_N_Center_N_Positive_H_Index_HNeI_Offset_Po = 4,




        [Description("5 负极限:原点开关_中间:无_正极限:无_Index位置:原点正边外侧_偏移:正方向")]
        Negative_H_Center_N_Positive_N_Index_HPoO_Offset_Po = 5,

        [Description("6 负极限:原点开关_中间:无_正极限:无_Index位置:原点正边内侧_偏移:负方向")]
        Negative_H_Center_N_Positive_N_Index_HPoI_Offset_Ne = 6,




        [Description("7 负极限:无_中间:原点开关_正极限:正限开关_Index位置:原点负边外侧_偏移:负方向")]
        Negative_N_Center_H_Positive_Po_Index_HNeO_Offset_Ne = 7,
        [Description("8 负极限:无_中间:原点开关_正极限:正限开关_Index位置:原点负边内侧_偏移:正方向")]
        Negative_N_Center_H_Positive_Po_Index_HNeI_Offset_Po = 8,
        [Description("9 负极限:无_中间:原点开关_正极限:正限开关_Index位置:原点正边内侧_偏移:负方向")]
        Negative_N_Center_H_Positive_Po_Index_HPoI_Offset_Ne = 9,
        [Description("10 负极限:无_中间:原点开关_正极限:正限开关_Index位置:原点正边外侧_偏移:正方向")]
        Negative_N_Center_H_Positive_Po_Index_HPoO_Offset_Po = 10,





        [Description("11 负极限:负限开关_中间:原点开关_正极限:无_Index位置:原点正边外侧_偏移:正方向")]
        Negative_Ne_Center_H_Positive_N_Index_HPoO_Offset_Po = 11,
        [Description("12 负极限:负限开关_中间:原点开关_正极限:无_Index位置:原点正边内侧_偏移:负方向")]
        Negative_Ne_Center_H_Positive_N_Index_HPoI_Offset_Ne = 12,
        [Description("13 负极限:负限开关_中间:原点开关_正极限:无_Index位置:原点负边内侧_偏移:正方向")]
        Negative_Ne_Center_H_Positive_N_Index_HNeI_Offset_Po = 13,
        [Description("14 负极限:负限开关_中间:原点开关_正极限:无_Index位置:原点负边外侧_偏移:负方向")]
        Negative_Ne_Center_H_Positive_N_Index_HNeO_Offset_Ne = 14,





        [Description("17 负极限:负限开关_中间:无_正极限:无_停止位置:负限位正边_偏移:正方向")]
        Negative_Ne_Center_N_Positive_N_Stop_NePo_Offset_Po = 17,



        [Description("18 负极限:无_中间:无_正极限:正限开关_停止位置:正极限负边_偏移:负方向")]
        Negative_N_Center_N_Positive_Po_Stop_PoNe_Offset_Ne = 18,


        [Description("19 负极限:无_中间:无_正极限:原点开关_停止位置:原点负边外侧_偏移:负方向")]
        Negative_N_Center_N_Positive_H_Stop_HNeO_Offset_Ne = 19,
        [Description("20 负极限:无_中间:无_正极限:原点开关_停止位置:原点负边内侧_偏移:正方向")]
        Negative_N_Center_N_Positive_H_Stop_HNeI_Offset_Po = 20,



        [Description("21 负极限:原点开关_中间:无_正极限:无_停止位置:原点正边外侧_偏移:正方向")]
        Negative_H_Center_N_Positive_N_Stop_HPoO_Offset_Po = 21,
        [Description("22 负极限:原点开关_中间:无_正极限:无_停止位置:原点正边内侧_偏移:负方向")]
        Negative_H_Center_N_Positive_N_Stop_HPoI_Offset_Ne = 22,




        [Description("23 负极限:无_中间:原点开关_正极限:正限开关_停止位置:原点负边外侧_偏移:负方向")]
        Negative_N_Center_H_Positive_Po_Stop_HNeO_Offset_Ne = 23,
        [Description("24 负极限:无_中间:原点开关_正极限:正限开关_停止位置:原点负边内侧_偏移:正方向")]
        Negative_N_Center_H_Positive_Po_Stop_HNeI_Offset_Po = 24,
        [Description("25 负极限:无_中间:原点开关_正极限:正限开关_停止位置:原点正边内侧_偏移:负方向")]
        Negative_N_Center_H_Positive_Po_Stop_HPoI_Offset_Ne = 25,
        [Description("26 负极限:无_中间:原点开关_正极限:正限开关_停止位置:原点正边外侧_偏移:正方向")]
        Negative_N_Center_H_Positive_Po_Stop_HPoO_Offset_Po = 26,




        [Description("27 负极限:负限开关_中间:原点开关_正极限:无_停止位置:原点正边外侧_偏移:正方向")]
        Negative_Ne_Center_H_Positive_N_Stop_HPoO_Offset_Ne = 27,
        [Description("28 负极限:负限开关_中间:原点开关_正极限:无_停止位置:原点正边内侧_偏移:负方向")]
        Negative_Ne_Center_H_Positive_N_Stop_HPoI_Offset_Po = 28,
        [Description("29 负极限:负限开关_中间:原点开关_正极限:无_停止位置:原点负边内侧_偏移:正方向")]
        Negative_Ne_Center_H_Positive_N_Stop_HNeI_Offset_Ne = 29,
        [Description("30 负极限:负限开关_中间:原点开关_正极限:无_停止位置:原点负边外侧_偏移:负方向")]
        Negative_Ne_Center_H_Positive_N_Stop_HNeO_Offset_Po = 30,




        [Description("33 负极限:无_中间:无_正极限:无_Index位置:负方向Index_偏移:负方向")]
        Negative_N_Center_N_Positive_N_Index_NeIndex_Offset_Ne = 33,
        [Description("34 负极限:无_中间:无_正极限:无_Index位置:正方向Index_偏移:正方向")]
        Negative_N_Center_N_Positive_N_Index_PoIndex_Offset_Po = 34,

    }

    /// <summary>
    /// 马达/运动板卡运行模式
    /// </summary>
    public enum MotionMode
    {
        /// <summary>
        /// 普通点位运动
        /// </summary>
        [Description("普通点位运动")]
        P2P = 1,

        /// <summary>
        /// 找正限位运动
        /// </summary>
        [Description("找正限位运动")]
        FindPositive = 4,

        /// <summary>
        /// 离开正限位
        /// </summary>
        [Description("离开正限位")]
        LeavePositive = 5,

        /// <summary>
        /// 找负限位运动
        /// </summary>
        [Description("找负限位运动")]
        FindNegative = 6,

        /// <summary>
        /// 离开负限位
        /// </summary>
        [Description("离开负限位")]
        LeaveNegative = 7,

        /// <summary>
        /// 找原点运动
        /// </summary>
        [Description("回原点运动")]
        GoHome = 8,

        /// <summary>
        /// Jog模式
        /// </summary>
        [Description("Jog模式")]
        Jog = 9,

        ///// <summary>
        ///// 读数头找原点方式
        ///// </summary>
        //[Description("找原点inde")]
        //FindOriIndex = 10,

        ///// <summary>
        ///// 插补模式
        ///// </summary>
        //[Description("插补模式")]
        //Coordinate = 11
    }

}