private void MakeClearProductData()
        {
            FAExtendECPart.ECResult ecResult = new FAExtendECPart.ECResult();

            var seq = ClearProductData;

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (UseProductDataAutoClear == false)
                        actor.NextTerminate();
                    else
                        actor.NextStep();
                });

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    FAECInfo.DATA_CLEAR_REQ command = new FAECInfo.DATA_CLEAR_REQ();
                    command.DATA_ID = ProductInfo.ECInfo.OEM_LBOX_ISSUE.L_BOX_ID;
                    command.MODE = FAECInfo.ClearMode.LBOX;

                    if (Equipment.CurrentUser != null)
                        command.OPER_ID = Equipment.CurrentUser.Name;
                    else
                        command.OPER_ID = "1";

                    ecResult.Clear();
                    InterfaceUnit.ECPart.AddCommand(command, ecResult);
                    actor.NextStep();
                });
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ecResult.ReceiveOk)
                    {
                        if (ecResult.ParsingSuccess)
                        {
                            if (ecResult.ECInfo.DATA_CLEAR.RESULT == FAECInfo.FAECResult.PASS)
                            {
                                ecResult.ECInfo.DATA_CLEAR.CopyTo(ProductInfo.ECInfo.DATA_CLEAR);
                                WriteTraceLog(string.Format("AUTO DATA CLEAR LBOX_ID {0}", ProductInfo.ECInfo.OEM_LBOX_ISSUE.L_BOX_ID));
                                actor.NextStep();
                            }
                            else
                            {
                                WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LBOX_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.OEM_LBOX_ISSUE.L_BOX_ID,
                                    ecResult.LastAlarmNo.ToString()));
                                actor.NextTerminate();
                            }
                        }
                        else
                        {
                            WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LBOX_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.OEM_LBOX_ISSUE.L_BOX_ID,
                                    ecResult.LastAlarmNo.ToString()));
                            actor.NextTerminate();
                        }
                    }
                    else if (ecResult.LastAlarmNo != 0)
                    {
                        WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LBOX_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.OEM_LBOX_ISSUE.L_BOX_ID,
                                    ecResult.LastAlarmNo.ToString()));
                        actor.NextTerminate();
                    }
                });

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    FAECInfo.DATA_CLEAR_REQ command = new FAECInfo.DATA_CLEAR_REQ();
                    command.DATA_ID = ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID;
                    command.MODE = FAECInfo.ClearMode.SBOX;

                    if (Equipment.CurrentUser != null)
                        command.OPER_ID = Equipment.CurrentUser.Name;
                    else
                        command.OPER_ID = "1";

                    ecResult.Clear();
                    InterfaceUnit.ECPart.AddCommand(command, ecResult);
                    actor.NextStep();
                });
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ecResult.ReceiveOk)
                    {
                        if (ecResult.ParsingSuccess)
                        {
                            if (ecResult.ECInfo.DATA_CLEAR.RESULT == FAECInfo.FAECResult.PASS)
                            {
                                ecResult.ECInfo.DATA_CLEAR.CopyTo(ProductInfo.ECInfo.DATA_CLEAR);
                                WriteTraceLog(string.Format("AUTO DATA CLEAR LOT_ID {0}", ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID));
                                actor.NextStep();
                            }
                            else
                            {
                                WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                                actor.NextTerminate();
                            }
                        }
                        else
                        {
                            WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                            actor.NextTerminate();
                        }
                    }
                    else if (ecResult.LastAlarmNo != 0)
                    {
                        WriteTraceLog(string.Format("AUTO DATA CLEAR FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                        actor.NextTerminate();
                    }
                });

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    FAECInfo.PK_XCLOSE_REQ command = new FAECInfo.PK_XCLOSE_REQ();
                    command.EQP_ID = Equipment.Config.SystemID;
                    command.LOT_ID = ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID;

                    if (Equipment.CurrentUser != null)
                        command.OPER_ID = Equipment.CurrentUser.Name;
                    else
                        command.OPER_ID = "1";

                    ecResult.Clear();
                    InterfaceUnit.ECPart.AddCommand(command, ecResult);
                    actor.NextStep();
                });
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ecResult.ReceiveOk)
                    {
                        if (ecResult.ParsingSuccess)
                        {
                            if (ecResult.ECInfo.PK_XCLOSE.RESULT == FAECInfo.FAECResult.PASS)
                            {
                                ecResult.ECInfo.DATA_CLEAR.CopyTo(ProductInfo.ECInfo.DATA_CLEAR);
                                WriteTraceLog(string.Format("PK_XCLOSE LOT_ID {0}", ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID));
                                actor.NextStep();
                            }
                            else
                            {
                                WriteTraceLog(string.Format("PK_XCLOSE FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                                actor.NextTerminate();
                            }
                        }
                        else
                        {
                            WriteTraceLog(string.Format("PK_XCLOSE FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                            actor.NextTerminate();
                        }
                    }
                    else if (ecResult.LastAlarmNo != 0)
                    {
                        WriteTraceLog(string.Format("PK_XCLOSE FAIL. LOT_ID : {0}. EC ALARM NO : {1}",
                                    ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID,
                                    ecResult.LastAlarmNo.ToString()));
                        actor.NextTerminate();
                    }
                });
        }
        public DataClearControl()
        {
            Command = new FAECInfo.DATA_CLEAR_REQ();

            InitializeComponent();
        }