public PKXCloseControl()
        {
            Command = new FAECInfo.PK_XCLOSE_REQ();

            InitializeComponent();
        }
        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();
                    }
                });
        }
Exemplo n.º 3
0
        private void MakeUnloading()
        {
            FAExtendECPart.ECResult ecResult = new FAExtendECPart.ECResult();

            var seq = Unloading;

            seq.OnStart +=
                delegate
                {
                    RetryInfoUnloadingTray.ClearCount();
                };

            seq.OnStop += delegate { ConveyorMotor.Stop.Execute(this); };
            seq.OnSuspended += delegate { ConveyorMotor.Stop.Execute(this); };
            seq.OnSuspending += delegate { ConveyorMotor.Stop.Execute(this); };

            seq.Steps.Add("Start", new StepInfo());
            seq.Steps.Add("Unloading", new StepInfo());

            seq.AddItem(
                delegate(object obj)
                {
                    if (ProductInfo.VT8792ProductInfo.LotScanCompleted.IsLastTray == true)
                    {
                        if (ProductInfo.VT8792ProductInfo.LotScanCompleted.ScanSuccess)
                            LastPartIDOfProduct = ProductInfo.ECInfo.PACKING_MASTER_INFO.PART_ID;
                        else
                            LastPartIDOfProduct = string.Empty;
                    }
                });

            seq.Steps["Start"].StepIndex = seq.AddItem(Stopper.Down.Sequence);

            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ProductInfo.VT8792ProductInfo.LotScanCompleted.ScanSuccess == false &&
                        ProductInfo.VT8792ProductInfo.LotScanCompleted.ScanCompleted == true)
                    {
                        if (ProductInfo.VT8792ProductInfo.LotScanCompleted.IsLastTray == true)
                        {
                            ProductInfo.VT8792ProductInfo.LotScanCompleted.IsLastTray = false;
                            actor.NextStep();
                        }
                        else
                        {
                            actor.NextStep("Unloading");
                        }

                    }
                    else
                    {
                        actor.NextStep("Unloading");
                    }
                });

            seq.AddItem(
                delegate(object obj)
                {
                    WriteTraceLog(string.Format("Scan Fail And Unloading To Fail C/V. LotID={0}", ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID));
                    FAECInfo.PK_XCLOSE_REQ command = new FAECInfo.PK_XCLOSE_REQ();
                    command.LOT_ID = ProductInfo.ECInfo.PACKING_MASTER_INFO.LOT_ID;
                    command.EQP_ID = Equipment.Config.SystemID;
                    command.OPER_ID = Equipment.CurrentUser.Name;
                    ecResult.Clear();
                    InterfaceUnit.ECPart.AddCommand(command, ecResult);
                });
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (ecResult.ReceiveOk)
                    {
                        if (ecResult.ParsingSuccess)
                        {
                            if (ecResult.ECInfo.PK_XCLOSE.RESULT == FAECInfo.FAECResult.PASS)
                            {
                                WriteTraceLog(" PK_XCLOSE OK");
                                ecResult.ECInfo.PK_XCLOSE.CopyTo(ProductInfo.ECInfo.PK_XCLOSE);
                                actor.NextStep();
                            }
                            else
                            {
                                string windowName = string.Empty;
                                var alarm = Utility.AlarmUtility.GetAlarm(ecResult.LastAlarmNo, "[SSD MODULE] PK_XCLOSE INFO EC RESULT FAIL.");
                                Manager.MessageWindowManager.Instance.Show(Equipment,
                                    "PK_XCLOSE_ECCommFail",
                                    out windowName,
                                    alarm,
                                    string.Empty,
                                    true);
                                actor.NextStep();
                            }
                        }
                        else
                        {
                            var msg = GetErrorMessageOfTrayPXCLOSECheck(ecResult.ECInfo.PK_XCLOSE);
                            string windowName = string.Empty;
                            var alarm = Utility.AlarmUtility.GetAlarm(ecResult.LastAlarmNo, "[SSD MODULE] EC PK_XCLOSE INFO RECEIVE DATA PARSING FAIL.");
                            Manager.MessageWindowManager.Instance.Show(Equipment,
                                    "PK_XCLOSE_ECCommFail",
                                    out windowName,
                                    alarm,
                                    msg,
                                    true);
                            actor.NextStep();
                        }
                    }
                    else if (ecResult.LastAlarmNo != 0)
                    {
                        string windowName = string.Empty;
                        var alarm = Utility.AlarmUtility.GetAlarm(ecResult.LastAlarmNo, "[SSD MODULE] EC PK_XCLOSE INFO RECEIVE FAIL.");
                        Manager.MessageWindowManager.Instance.Show(Equipment,
                                    "PK_XCLOSE_ECCommFail",
                                    out windowName,
                                    alarm,
                                    string.Empty,
                                    true);
                        actor.NextStep();
                    }
                });
            seq.Steps["Unloading"].StepIndex = seq.AddItem(ConfirmUnloadedTray);
            seq.AddItem(
                delegate(FASequence actor, TimeSpan time)
                {
                    if (TimeConveyorDelayRunTimeAfterUnloading.Time < time)
                    {
                        ConveyorMotor.Stop.Execute(actor);
                        actor.NextStep();
                    }
                    else
                        ConveyorMotor.Run.Execute(actor);
                });
            seq.AddItem(Stopper.Up.Execute);
        }