Пример #1
0
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="wgroup"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public object GET_WORK_STEP_KEY0(IHandlingBatch hb, WorkGroup wgroup, ref bool handled, object prevReturnValue)
        {
            try
            {
                MicronBEAssyBELot lot = hb as MicronBEAssyBELot;

#if DEBUG
                //if(lot.LotID == "LOT05")
                //    Console.WriteLine();
#endif
                string stepKey = JobChangeHelper.GetStepKey(lot.Product, lot.CurrentStep as MicronBEAssyBEStep, JobChangeHelper.IsRun(lot));
                //Tuple<string, int> stepKey = JobChangeHelper.GetStepKey(lot.Product, lot.CurrentStep as CA_PlanningBEStep, false);

                return(stepKey);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(object));
            }
        }
Пример #2
0
        /// <summary>
        /// </summary>
        /// <param name="list"/>
        /// <param name="step"/>
        /// <param name="lot"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public WorkStep UPDATE_FIND_STEP0(IList <WorkStep> list, WorkStep step, WorkLot lot, ref bool handled, WorkStep prevReturnValue)
        {
            try
            {
                MicronBEAssyBELot beLot = lot.Batch.Sample as MicronBEAssyBELot;

                bool isRun = JobChangeHelper.IsRun(lot.Batch as MicronBEAssyBELot);

                string stepKey = JobChangeHelper.GetStepKey(beLot.Product, beLot.CurrentStep as MicronBEAssyBEStep, isRun);

                if (stepKey == null)
                {
                    return(null);
                }

                WorkStep ws = null;
                if (step.Group.Steps != null)
                {
                    try
                    {
                        ws = step.Group.TryGetStep(stepKey);
                    }
                    catch
                    {
                        Console.WriteLine();
                    }
                }
                else
                {
                    Console.WriteLine();
                }

                return(ws);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(WorkStep));
            }
        }
Пример #3
0
        /// <summary>
        /// </summary>
        /// <param name="wstep"/>
        /// <param name="wlot"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IEnumerable <WorkLot> ADVANCE0(WorkStep wstep, WorkLot wlot, ref bool handled, IEnumerable <WorkLot> prevReturnValue)
        {
            try
            {
                var nowDt = FindHelper.GetNowDT();

#if DEBUG
                if (nowDt >= new DateTime(2018, 01, 26, 07, 00, 00))
                {
                    Console.WriteLine();
                }

                if (wstep.Key.ToString() == "S0250" && wlot.Lot.LotID == "LOT10_1")
                {
                    Console.WriteLine();
                }

                if (wlot.Lot.LotID == "LOT11_1")
                {
                    Console.WriteLine();
                }
#endif


                if (wlot.OutTime > FindHelper.GetNowDT().AddHours(10))
                {
                    return(null);
                }

#if DEBUG
                //if (wstep.Key.ToString() == "S0100")
                //    Console.WriteLine();
#endif
                List <WorkLot> list = new List <WorkLot>();

                MicronBEAssyWorkLot currentWLot = wlot as MicronBEAssyWorkLot;

                MicronBEAssyBEStep currentStep = wstep.Steps[0] as MicronBEAssyBEStep;

                string stepKey = JobChangeHelper.GetStepKey(currentWLot.Product, currentStep.GetDefaultNextStep() as MicronBEAssyBEStep, false);

                //string stepKey = currentStep.GetDefaultNextStep().StepID;

                if (stepKey != null)
                {
                    MicronBEAssyWorkStep nextWorkStep = wstep.Group.TryGetStep(stepKey) as MicronBEAssyWorkStep;

                    if (nextWorkStep != null)
                    {
                        MicronBEAssyWorkLot newWorkLot = CreateHelper.CreateWorkLot(wlot.Batch, wlot.OutTime, nextWorkStep.Key, nextWorkStep.Steps.ElementAt(0), null);

                        newWorkLot.LotID   = currentWLot.LotID;
                        newWorkLot.Product = currentWLot.Product;
                        newWorkLot.UnitQty = currentWLot.UnitQty;

                        //if (currentWLot.Product is AssyMcpPart)
                        //{
                        //    MicronBEAssyBEStep workTargetStep = wstep.Steps[0] as MicronBEAssyBEStep;

                        //    if (workTargetStep.StepAction != null && workTargetStep.StepAction.FWTractIn == StepActionInfo.MCP)
                        //    {
                        //        AssyMcpPart mcpPart = currentWLot.Product as AssyMcpPart;

                        //        if (mcpPart.SequenceResolved != (wstep as MicronBEAssyWorkStep).Sequence)
                        //            newWorkLot.Product = mcpPart.Next == null ? mcpPart.OutProduct as Product : mcpPart.Next as Product;
                        //    }
                        //}

                        if (newWorkLot.Product != null)
                        {
                            list.Add(newWorkLot);
                        }
                    }
                }

                return(list);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(IEnumerable <WorkLot>));
            }
        }