public OEMSBoxIssueControl()
        {
            Command = new FAECInfo.OEM_SBOX_ISSUE_REQ();

            InitializeComponent();
        }
        private void MakeProcess()
        {
            string windowName = string.Empty;
            FAExtendECPart.ECResult ecResult = new FAExtendECPart.ECResult();

            var seq = Process;

            seq.Steps.Add("RequestSBoxInfo", new StepInfo());
            seq.Steps.Add("PrintLabel", new StepInfo());
            seq.Steps.Add("UnloadLabel", new StepInfo());
            seq.Steps.Add("PrintLargeBoxLabel", new StepInfo());

            seq.AddItem((object obj) => LargeBoxLabelPrintRequest = false);

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (Equipment.RunMode == FAFramework.Equipment.RunModeTypes.HOT_RUN)
                    {
                        FAECInfo.OEM_SBOX_ISSUE_REQ command = new FAECInfo.OEM_SBOX_ISSUE_REQ();
                        command.LOT_ID = ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID;
                        command.GATE = command.GATE = ProductInfo.ECInfo.PACKING_MASTER_INFO.GATE_NO;                        
                        ecResult.Clear();
                        InterfaceUnit.ECPart.AddCommand(command, ecResult);
                        actor.NextStep();
                    }
                    else
                    {
                        actor.NextStep("PrintLabel");
                    }
                });
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ecResult.ReceiveOk)
                    {
                        if (ecResult.ParsingSuccess)
                        {
                            if (ecResult.ECInfo.OEM_SBOX_ISSUE.RESULT == FAECInfo.FAECResult.PASS)
                            {
                                ecResult.ECInfo.OEM_SBOX_ISSUE.CopyTo(ProductInfo.ECInfo.OEM_SBOX_ISSUE);                                
                                actor.NextStep();
                            }
                            else
                            {
                                LabelIssueFail = true;

                                if (ForceOutWhenLabelIssueFail)
                                    actor.NextTerminate();
                                else
                                {
                                    RaiseAlarm(actor, AlarmSmallBoxLabelIssueFail, string.Format("MSG = {0}, Parsing Fail Message = {1}", ecResult.ECInfo.OEM_SBOX_ISSUE.MSG, ecResult.ParsingFailMessage));
                                    actor.NextStep("RequestSBoxInfo");
                                }
                            }
                        }
                        else
                        {
                            LabelIssueFail = true;

                            if (ForceOutWhenLabelIssueFail)
                                actor.NextTerminate();
                            else
                            {
                                RaiseAlarm(actor, AlarmSmallBoxLabelIssueFail, string.Format("Result Fail, Parsing Fail Message = {0}", ecResult.ParsingFailMessage));
                                actor.NextStep("RequestSBoxInfo");
                            }
                        }
                    }
                    else if (ecResult.LastAlarmNo != 0)
                    {
                        LabelIssueFail = true;

                        if (ForceOutWhenLabelIssueFail)
                            actor.NextTerminate();
                        else
                        {
                            RaiseAlarm(actor, AlarmSmallBoxLabelIssueFail, "Data Receive Fail");
                            actor.NextStep("RequestSBoxInfo");
                        }
                    }
                });

            // Foam Pad Label
            seq.AddItem((object obj) => LabelFormat = ProductInfo.ECInfo.OEM_SBOX_ISSUE.FORMAT);
            seq.Steps["PrintLabel"].StepIndex = seq.AddItem((object obj) => AllPrinterNotStandby = false);
            seq.AddItem(PrintLabel);
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (AllPrinterNotStandby)
                    {
                        var alarm = Utility.AlarmUtility.GetAlarm(AlarmAllPrinterNotStandby, "All Printer Not Standby");
                        Manager.MessageWindowManager.Instance.Show(Equipment, "AllPrinterNotStandby", out windowName, alarm, string.Empty, true);
                        actor.NextStep("PrintLabel");
                    }
                    else
                    {
                        Manager.MessageWindowManager.Instance.CloseWindow(windowName);
                        actor.NextStep();
                    }
                });
            seq.AddItem((object obj) => LabelScanSuccess = false);
            seq.AddItem((object obj) => LabelStep = ELabelStep.SmallBoxLabel);
            seq.Steps["UnloadLabel"].StepIndex = seq.AddItem(UnloadLabel);
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (LabelScanSuccess)
                        actor.NextStep();
                    else
                        actor.NextStep("PrintLabel");
                });

            // Box Label
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (LargeBoxLabelPrintRequest)
                    {
                        LabelFormat = ProductInfo.ECInfo.OEM_LBOX_ISSUE.FORMAT;
                        LargeBoxLabelPrintRequest = false;
                        actor.NextStep();
                    }
                    else if (LargeBoxLabelSkip)
                    {
                        actor.NextTerminate();
                    }
                });
            seq.Steps["PrintLargeBoxLabel"].StepIndex = seq.AddItem(PrintLabel);
            seq.AddItem((object obj) => LabelScanSuccess = false);
            seq.AddItem((object obj) => LabelStep = ELabelStep.LargeBoxLabel);
            seq.AddItem(UnloadLabel);
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (LabelScanSuccess)
                        actor.NextStep();
                    else
                        actor.NextStep("PrintLargeBoxLabel");
                });
        }