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

namespace ProductionControl
{
    public enum CurrentPTEnum
    {
        [Description("初始位")]
        InitPT = 1,
        [Description("上料位")]
        UpPT = 2,
        [Description("下料位")]
        DownPT = 3,
        [Description("运行中")]
        Moving = 4,
        [Description("打标中")]
        MakeTag = 5
    }
    public enum CurrentStateEnum
    {
        等待复位 = 0,
        等待启动 = 1,//可复位 
        等待扫码 = 2,//可复位 
        暂停 = 3,//解除告警->等待启动 (可复位、下料中) 
        急停 = 4, //解除告警->等待复位 
        运行中 = 5,
        下料中 = 6, //没有暂停，完成后->等待启动
        打标中 = 7,//可复位、暂停、急停、下料
        自动流程结束 = 8,//可复位、暂停、急停、下料
    }
    public enum WarningEnum
    {
        [Description("正常")]
        Normal = 0,
        [Description("低(可继续)")]
        Low = 1,
        [Description("严重")]
        High = 2
    }

    public enum IODirectionEnum
    {
        [Description("仅输入")]
        输入 = 0,
        [Description("仅输出")]
        输出 = 1,
        [Description("输入与输出")]
        输入输出 = 2,
    }
    public enum AIEngineLibEnum
    {
        [Description("缺陷库")]
        缺陷库 = 0,
        [Description("测量库")]
        测量库 = 1,
        [Description("缺陷与测量库")]
        缺陷与测量库 = 2,
    }
    //public enum PowerLevelEnum
    //{
    //    [Description("低电平")]
    //    高 = 0,
    //    [Description("高电平")]
    //    低 = 1,
    //}

    public enum AxisName
    {
        [Description("0-Axis")]
        Axis0 = 0,
        [Description("1-Axis")]
        Axis1 = 1,
        [Description("2-Axis")]
        Axis2 = 2,
        [Description("3-Axis")]
        Axis3 = 3,
    }
    //[Serializable]
    //[TypeConverter(typeof(ExpandableObjectConverter))]
    //public class MultiAxisName
    //{ 
    //    public int Axis0 { get; set; }
    //    public int Axis1 { get; set; }
    //    //public bool Axis2 { get; set; }
    //    //public bool Axis3 { get; set; }
    //}
    /// <summary>
    /// 轴脉冲模式
    /// </summary>
    public enum AxisPulseOutMode
    {
        OUT_DIR = 0x1,
        OUT_DIR_OUT_NEG = 0x02,
        OUT_DIR_DIR_NEG = 0x04,
        OUT_DIR_ALL_NEG = 0x08,
        O_CW_CCW = 0x10,
        CW_CCW_ALL_NEG = 0x20,
    }

    /// <summary>
    /// 回原点方式
    /// </summary>
    public enum AxitHomeMode
    {
        MODE1_Abs = 0,
        MODE2_Lmt = 1,
        MODE3_Ref = 2,
        MODE4_Abs_Ref = 3,
        MODE5_Abs_NegRef = 4,
        MODE6_Lmt_Ref = 5,
        MODE7_AbsSearch = 6,
        MODE8_LmtSearch = 7,
        MODE9_AbsSearch_Ref = 8,
        MODE10_AbsSearch_NegRef = 9,
        MODE11_LmtSearch_Ref = 10,
        MODE12_AbsSearchReFind = 11,
        MODE13_LmtSearchReFind = 12,
        MODE14_AbsSearchReFind_Ref = 13,
        MODE15_AbsSearchReFind_NegRef = 14,
        MODE16_LmtSearchReFind_Ref = 15,
    }
    public enum AxHomeDirection
    {
        正向 = 0,
        负向 = 1,
    }
    public enum AxMoveMode
    {
        //MODE1_Abs = 0,
        //MODE2_Rel = 1,
        绝对位置 = 0,
        相对位置 = 1,
    }
    public enum SmallAxCmdPos
    {
        倍率0_679X = 0,
        倍率0_7X = 550,
        倍率1_0X = 4780,
        倍率1_5X = 7850,
        倍率2_0X = 10500,
        倍率2_5X = 13300,
        倍率3_0X = 15360,
        倍率3_5X = 16890,
        倍率4_0X = 18230,
        倍率4_5X = 19350,
    }
    public enum CMDName
    {
        IO默认输出 = 0,

        启动按钮 = 10,//输入+输出
        暂停按钮 = 11,//输入+输出
        复位按钮 = 12,//输入+输出

        绿灯输出 = 15,
        黄灯输出 = 16,
        红灯输出 = 17,
        日光灯输出 = 18,

        蜂鸣器输出 = 20,

        //张力读取结束输出 = 25,//张力读取
        张力读取 = 25,//张力读取
        喷墨输出 = 26,

        门磁告警输入 = 30,
        喷墨告警输入 = 31,
        厚度气缸与轴运动告警 = 34,

        下料完成输出 = 35,

        Y轴复位输出 = 40,
        Y轴复位完成输入 = 41,

        X1轴复位输出 = 50,
        X2轴复位输出 = 51,
    }

    //---
    //public int DKCount { get; set; }//堵孔数量
    //public int ZWCount { get; set; }//脏污数量
    //public int GSYCCount { get; set; }//钢丝异常数量
    //public int XWSCount { get; set; }//纤维丝数量
    //public int QKCount { get; set; }//缺口数量
    //public int ZKCount { get; set; }//针孔数量
    //public int PPCount { get; set; }//泡泡数量
    //public int HSCount { get; set; }//划伤数量
    //public int YXCount { get; set; }//压线数量 
    //public int XBCount { get; set; }//斜边数量 new
    //public int SXCount { get; set; }//栅线数量 new
    public enum DefectCodeEnum
    {
        dk,//堵孔
        zw,//脏污
        xws,//纤维丝
        gsyc,//钢丝异常
        qk,//缺口
        zk,//针孔
        pp,//泡泡
        hs,//划伤
        yx,//压线
        xb,//斜边
        sx,//栅线
        ds,//断栅 
    }
    public enum DefectNameEnum
    {
        堵孔,
        脏污,
        纤维丝,
        钢丝异常,
        缺口,
        针孔,
        泡泡,
        划伤,
        压线,
        斜边,
        栅线,
        断栅
    }
    public enum ValType
    {
        字符串,
        数值,
    }
    public static class EnumConvert
    {
        public static DefectNameEnum ConvertDefectCode2Name(DefectCodeEnum val)
        {
            int v = (int)val;
            return (DefectNameEnum)v;
        }
        public static DefectCodeEnum ConvertDefectName2Code(DefectNameEnum val)
        {
            int v = (int)val;
            return (DefectCodeEnum)v;
        }

    }

    #region 设备厂家与型号
    public enum LightDevNameEnum
    {
        康仕达 = 0,
        锐视 = 10,
    }
    #endregion

}