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

///1	X WorkStart   2	工件到位(PLC)   工件到位。托盘到达工位，并且托盘上有工件。
///2	X RepairPartStatusPLC 3	RepairPartStatusPLC 备用
///3	STRING RepairPathString    4	RepairPathString	"工位返修字符串（121211112222111）,前2位是西门子字符串格式，第一位是总长度，第二位是实际长度"
///4	X EngineTypeGetOverMES    5	传递机型(MES)   MES传递总成信息给PLC（上线工位）
///5	X PartPalletGoOver    6	PartPalletGoOver 上线工位。0：正常工作；1：空托盘放行，PLC读取到此标志不走申请上线逻辑。
///6	X MaterialVerifyOver  7	MaterialVerifyOver MES保存完质量数据，物料数据等与PLC信号交互完成后通知PLC，所以工步都完成，才可以放行工件，正常工作时工件放行的必要条件。
///7	X FalseGo 8	FalseGo 按MES界面[不合格放行]按钮，MES发送此信号。操作者判断工件不合格，通知设备，按不合格方式放行工件，工件流转到返修下线工位后，返修下线。MES工作完成MES0.3=1，MES合格放行MES0.5=0，MES0.4=1
///8	INT EngineTypeID    9	EngineTypeID MES发动机机型标志(必须PLC)
///9	STRING EngineID    10	EngineID MES发动机编号(必须PLC)
///10	STRING EngineType  11	机型(MES) MES发动机机型(必须PLC)
///11	X PartPalletStatus    13	PartPalletStatus MES激发变量托盘到位离开(必须PLC)
///12	X HeartBeatPLC    14	HeartBeatPLC 心跳处理：PLC收到MES心跳信号后，PLC延时5秒后，数值取反再写回PLC，写回PLC开始计时，如果5秒钟MES无反馈报通讯故障。
///13	X HeartBeatMIS    15	HeartBeatMIS 间隔时间5S，心跳处理。收到PLC心跳信号后，MES按原值回写。PLC收到MES信号后延时5秒，取反写入，以此循环。
///14	X TargetTimeRead  16	TargetTimeRead MES允许可读工位运行时间
///15	Int MachineTargetTime   17	MachineTargetTime 目标运行时间
///16	Int MachineActualTime   18	MachineActualTime 实际运行时间
///17	X MesRead 19	允许保存(PLC)   质量数据可以读数据
///18	X MesReadOver 20	保存完成(MES)   MES保存完数据(必须MIS)
///19	INT QualityMask 21	合格标志(PLC)   质量数据工位合格标志0:没有工作；1：合格 ；2 ：不合格(必须PLC)
///20	B PalletInfo  22	PalletInfo	0空托盘，1合格件，2不合格件
///21	INT RepairStatusPLC 23	RepairStatusPLC	0正常件，1返修件
///22	INT OrderNo 24	订单号(MES)    订单号(MES)
///23	X StorageNo   25	库位号(MES)    库位号(MES)
///24	X AllowPass       26	允许放行(MES)   允许放行
///25	X PartLoadFinish  27	PartLoadFinish PartLoadFinish
///26	X Reserved_7  28	Reserved_7 备用
///27	X Reserved_8  29	Reserved_8 备用
///28	X Reserved_9  30	Reserved_9 备用
///29	X Reserved_10 31	Reserved_10 备用
///30	X Reserved_11 32	Reserved_11 备用
///31	X Reserved_12 33	Reserved_12 备用
///32	X Reserved_13 34	Reserved_13 备用
///33	X Reserved_14 35	Reserved_14 备用
///34	Int PLCSPareint1    36	PLCSPareint1 备用
///35	Int PLCSPareint2    37	PLCSPareint2 备用
///36	Int PLCSPareint3    38	PLCSPareint3 备用
///37	STRING PLCSarestring1  39	PLCSarestring1 备用
///38	STRING PLCSarestring2  40	PLCSarestring2 备用
///39	STRING MarkID  42	MarkID 机体打标号（MES）前2位是西门子字符串格式，第一位是总长度，第二位是实际长度
///40	X PartLoad    43	PartLoad 上线工位，PLC向MES申请总成编号。收到该信号后，MES将机型标志（DBB22 ~23）、总成号（DBB24 ~63）、总成机型DBB64 ~103写入PLC。之后MES通过信号“传递机型（DBX0.1）”通知PLC。
///41	X EngineTypeGetOverPLC    44	传递机型（PLC）	PLC将机型标志（DBB50…51）、工件编号（DBB52…101）、产品型号（DBB102…187）、托盘编号（DBB188…189）准备完毕后，通知MES。
///42	X PartLoadOK  48	PartLoadOK 备用
///43	X Reserved_18 49	Reserved_18 备用
///44	X PalletDown  50	PalletDown 暂时保留，项目未使用
///45	X ConfirmOkGo 51	ConfirmOkGo 按MES界面[合格放行]按钮，MES发送此信号。操作者判断工件合格，通知设备，工件按合格方式放行工件。MES工作完成MES0.3=1，MES合格放行MES0.5=1，MES0.4=0
///46	X ResetDevice 52	ResetDevice 针对手动工位，无HMI，需要复位设备在MES页面操作。
///47	X UnloadCompleted 53	UnloadCompleted 暂时保留，项目未使用
///48	X MachineTime_ReadOver    54	MachineTime_ReadOver 备用
///49	X Reserved_19 58	Reserved_19 备用
///50	X FixOK   59	FixOK 手动拧紧工位，单工步螺栓拧紧完成，通知PC读取数据。
///51	X Reserved_21 61	Reserved_21 备用
///52	X Reserved_22 62	Reserved_22 备用
///53	X Reserved_23 63	Reserved_23 备用
///54	X Reserved_24 64	Reserved_24 备用
///55	X Reserved_25 65	Reserved_25 备用
///56	X FixAllow    66	FixAllow	"设备工作的必须信号,对于有物料验证的工位，MES验证完成给出此信号，对于无物料验证工位，MES直接给出此信号。"
///57	X FixOver 67	FixOver 用于手动拧紧且有质量数据工位。通知设备当前工步拧紧螺钉工作结束。
///58	X MatchingCompleted   68	MatchingCompleted 分线上总线，匹配成功是1；不成功是0。
///59	X	Match	69	Match	分线上总线，匹配成功是1；不成功是0。
///60	X	Reserved_2	70	Reserved_2	备用
///61	X	IsAutoGetEngineID	71	IsAutoGetEngineID	自动手动申请工件编号。0是自动方式；1：手动方式。暂时保留，生成流水号方式是在数据库中实现的
///62	X	RepairUplineMES	72	RepairUplineMES	上线清空MOBY（针对上线工位）：通知PLC从新开始申请上线流程
///63	INT	EngineTypeID_MES	73	机型代码(MES)	MES发动机机型标志(必须MES)
///64	STRING	EngineID_MES	74	工件编号(MES)	MES发动机编号(必须MES)
///65	STRING	EngineType_MES	75	EngineType_MES	MES发动机机型(必须MES)
///66	X	Reserved_20	76	Reserved_20	备用
///67	INT	ProcessCode	77	ProcessCode	手动拧紧工位：由MES通知PLC拧紧序号
///68	B	OnLineState	79	OnLineState	通过线体工位PC实现下达工位工作状态：工位有三种状态：在线、离线、屏蔽。在线：0正常状态，实现正常功能。1离线:设备脱离MES工作，进入不交互模式。
///69	INT	PartPalletCode	80	托盘号(MES)	托盘编号(B5A)
///70	INT	BoltCode	88	BoltCode	手动拧紧工位：指导PLC所用套筒
///71	INT	RepairStatus	93	RepairStatus	"0正常件，1返修件。对于上线工位MES给出是正常上线还是返修上线,返修路径"
///72	DInt	Reserved_15	110	Reserved_15	备用
///73	DInt	Reserved_16	111	Reserved_16	备用
///74	B	Reserved_17	112	Reserved_17	备用
///75	INT	SPareint1	113	SPareint1	备用int1
///76	INT	SPareint2	114	SPareint2	备用int2
///77	INT	SPareint3	115	SPareint3	备用int3
///78	STRING	Sparestring1	116	Sparestring1	备用字符串1
///79	STRING	Sparestring2	117	Sparestring2	备用字符串2
///80	X	MachineStatusPutOn	1000	机床上电(PLC)	机床上电(必须PLC)
///81	X	MachineStatusWorkOn	1001	循环开始(PLC)	循环开始(必须PLC)
///82	X	MachineStatusAlarm	1002	设备报警(PLC)	机床故障(必须PLC)
///83	X	MachineStatusNoPart	1003	MachineStatusNoPart	上料无件(必须PLC)
///84	X	MachineStatusBlock	1004	MachineStatusBlock	下料堵塞(必须PLC)


namespace MesWork
{
    /// <summary>
    /// 这是变量类型代码的配置，几乎是不变的
    /// 请不要随意修改，为了保证变量版本同一，并且方便维护，请联系发行人修改！
    /// 请注意，此修改为全局修改！
    /// </summary>
    public enum EnumTagTypeCodeID
    {
        /// <summary>
        /// 工件到位(PLC)
        /// 变量类型：Bool
        /// 解释：托盘到达工位，并且托盘上有工件。
        /// </summary>
        WorkStart = 2,
        /// <summary>
        /// 
        /// </summary>
        RepairPartStatusPLC         = 3,
        /// <summary>
        /// 工位返修字符串
        /// 变量类型：String
        /// 解释：工位返修字符串
        /// </summary>
        RepairPathString = 4,
        /// <summary>
        /// 传递机型(MES)
        /// 变量类型：Bool
        /// 解释：MES传递总成信息给PLC（上线工位）
        /// </summary>
        EngineTypeGetOverMES = 5,
        /// <summary>
        /// 
        /// </summary>
        PartPalletGoOver            = 6,
        /// <summary>
        /// 
        /// </summary>
        MaterialVerifyOver          = 7,
        /// <summary>
        /// 
        /// </summary>
        FalseGo                     = 8,
        /// <summary>
        /// 
        /// </summary>
        EngineTypeID                = 9,
        /// <summary>
        /// 
        /// </summary>
        EngineID                    = 10,
        /// <summary>
        /// 机型(MES)
        /// 变量类型：String
        /// </summary>
        EngineType = 11,
        /// <summary>
        /// 
        /// </summary>
        PartPalletStatus            = 13,
        /// <summary>
        /// 
        /// </summary>
        HeartBeatPLC                = 14,
        /// <summary>
        /// 
        /// </summary>
        HeartBeatMIS                = 15,
        /// <summary>
        /// 
        /// </summary>
        TargetTimeRead              = 16,
        /// <summary>
        /// 
        /// </summary>
        MachineTargetTime           = 17,
        /// <summary>
        /// 
        /// </summary>
        MachineActualTime           = 18,
        /// <summary>
        /// 允许保存(PLC)
        /// 变量类型：Bool
        /// </summary>
        MesRead = 19,
        /// <summary>
        /// 保存完成(MES)
        /// 变量类型：Bool
        /// </summary>
        MesReadOver = 20,
        /// <summary>
        /// 合格标志(PLC)
        /// 变量类型：Int
        /// </summary>
        QualityMask = 21,
        /// <summary>
        /// 
        /// </summary>
        PalletInfo                  = 22,
        /// <summary>
        /// 
        /// </summary>
        RepairStatusPLC             = 23,
        /// <summary>
        /// 订单号(MES)
        /// 变量类型：Int
        /// </summary>
        OrderNo = 24,
        /// <summary>
        /// 库位号(MES)
        /// 变量类型：Bool
        /// </summary>
        StorageNo = 25,
        /// <summary>
        /// 允许放行(MES)
        /// 变量类型：Bool
        /// </summary>
        AllowPass = 26,
        /// <summary>
        /// 
        /// </summary>
        PartLoadFinish              = 27,
        /// <summary>
        /// 
        /// </summary>
        Reserved_7                  = 28,
        /// <summary>
        /// 
        /// </summary>
        Reserved_8                  = 29,
        /// <summary>
        /// 
        /// </summary>
        Reserved_9                  = 30,
        /// <summary>
        /// 
        /// </summary>
        Reserved_10                 = 31,
        /// <summary>
        /// 
        /// </summary>
        Reserved_11                 = 32,
        /// <summary>
        /// 
        /// </summary>
        Reserved_12                 = 33,
        /// <summary>
        /// 
        /// </summary>
        Reserved_13                 = 34,
        /// <summary>
        /// 
        /// </summary>
        Reserved_14                 = 35,
        /// <summary>
        /// 
        /// </summary>
        PLCSPareint1                = 36,
        /// <summary>
        /// 
        /// </summary>
        PLCSPareint2                = 37,
        /// <summary>
        /// 
        /// </summary>
        PLCSPareint3                = 38,
        /// <summary>
        /// 订单号(PLC)
        /// </summary>
        OrderFormPLC = 39,
        /// <summary>
        /// 
        /// </summary>
        PLCSarestring2              = 40,
        /// <summary>
        /// 
        /// </summary>
        MarkID                      = 42,
        /// <summary>
        /// 
        /// </summary>
        PartLoad                    = 43,
        /// <summary>
        /// 传递机型（PLC）
        /// 变量类型：Bool
        /// </summary>
        EngineTypeGetOverPLC = 44,
        /// <summary>
        /// 
        /// </summary>
        PartLoadOK                  = 48,
        /// <summary>
        /// 
        /// </summary>
        Reserved_18                 = 49,
        /// <summary>
        /// 
        /// </summary>
        PalletDown                  = 50,
        /// <summary>
        /// 
        /// </summary>
        ConfirmOkGo                 = 51,
        /// <summary>
        /// 
        /// </summary>
        ResetDevice                 = 52,
        /// <summary>
        /// 
        /// </summary>
        UnloadCompleted             = 53,
        /// <summary>
        /// 
        /// </summary>
        MachineTime_ReadOver        = 54,
        /// <summary>
        /// 
        /// </summary>
        Reserved_19                 = 58,
        /// <summary>
        /// 
        /// </summary>
        FixOK                       = 59,
        /// <summary>
        /// 
        /// </summary>
        Reserved_21                 = 61,
        /// <summary>
        /// 
        /// </summary>
        Reserved_22                 = 62,
        /// <summary>
        /// 
        /// </summary>
        Reserved_23                 = 63,
        /// <summary>
        /// 
        /// </summary>
        Reserved_24                 = 64,
        /// <summary>
        /// 
        /// </summary>
        Reserved_25                 = 65,
        /// <summary>
        /// 
        /// </summary>
        FixAllow                    = 66,
        /// <summary>
        /// 
        /// </summary>
        FixOver                     = 67,
        /// <summary>
        /// 
        /// </summary>
        MatchingCompleted           = 68,
        /// <summary>
        /// 
        /// </summary>
        Match                       = 69,
        /// <summary>
        /// 
        /// </summary>
        Reserved_2                  = 70,
        /// <summary>
        /// 
        /// </summary>
        IsAutoGetEngineID           = 71,
        /// <summary>
        /// 
        /// </summary>
        RepairUplineMES             = 72,
        /// <summary>
        /// 机型代码(MES)
        /// 变量类型：Int
        /// </summary>
        EngineTypeID_MES = 73,
        /// <summary>
        /// 工件编号(MES)
        /// 变量类型：String
        /// </summary>
        EngineID_MES = 74,
        /// <summary>
        /// 
        /// </summary>
        EngineType_MES              = 75,
        /// <summary>
        /// 
        /// </summary>
        Reserved_20                 = 76,
        /// <summary>
        /// 
        /// </summary>
        ProcessCode                 = 77,
        /// <summary>
        /// 
        /// </summary>
        OnLineState                 = 79,
        /// <summary>
        /// 托盘号(MES)
        /// 变量类型：Int
        /// </summary>
        PartPalletCode = 80,
        /// <summary>
        /// 
        /// </summary>
        BoltCode                    = 88,
        /// <summary>
        /// 
        /// </summary>
        RepairStatus                = 93,
        /// <summary>
        /// 
        /// </summary>
        Reserved_15                 = 110,
        /// <summary>
        /// 
        /// </summary>
        Reserved_16                 = 111,
        /// <summary>
        /// 
        /// </summary>
        Reserved_17                 = 112,
        /// <summary>
        /// 
        /// </summary>
        SPareint1                   = 113,
        /// <summary>
        /// 
        /// </summary>
        SPareint2                   = 114,
        /// <summary>
        /// 
        /// </summary>
        SPareint3                   = 115,
        /// <summary>
        /// 
        /// </summary>
        Sparestring1                = 116,
        /// <summary>
        /// 
        /// </summary>
        Sparestring2                = 117,
        /// <summary>
        /// 机床上电(PLC)
        /// 变量类型：Bool
        /// </summary>
        MachineStatusPutOn = 1000,
        /// <summary>
        /// 循环开始(PLC)
        /// 变量类型：Bool
        /// </summary>
        MachineStatusWorkOn = 1001,
        /// <summary>
        /// 设备报警(PLC)
        /// 变量类型：Bool
        /// </summary>
        MachineStatusAlarm = 1002,
        /// <summary>
        /// 上料无件(PLC)
        /// 变量类型：Bool
        /// </summary>
        MachineStatusNoPart = 1003,
        /// <summary>
        /// 下料堵塞(PLC)
        /// 变量类型：Bool
        /// </summary>
        MachineStatusBlock = 1004,
        /// <summary>
        /// 下料堵塞(PLC)
        /// 变量类型：Bool
        /// </summary>
        havePart70 = 10003,
    }
}
