示例#1
0
文件: Route.cs 项目: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="ao"/>
        /// <param name="now"/>
        /// <param name="handled"/>
        public void ON_START_TASK0(Mozart.SeePlan.Simulation.IHandlingBatch hb, Mozart.Simulation.Engine.ActiveObject ao, DateTime now, ref bool handled)
        {
            FabLot lot = hb.ToFabLot();

            hb.Apply((x, y) => LoadHelper.OnStartTask(x as FabLot));

            InFlowMaster.ChangeWipLocation(hb, EventType.TrackIn);

            if (ao is AoEquipment)
            {
                FabAoEquipment eqp = ao as FabAoEquipment;

                MaskMaster.StartTask(lot, eqp);
                JigMaster.StartTask(lot, eqp);

                //TODO : 설비의 Property로 작성필요 (LastPlan의 Plan을 보고)
                if (lot.CurrentFabPlan.CurrentRecipeTime != null)
                {
                    eqp.IsEqpRecipeRun = true;
                }
                else
                {
                    eqp.IsEqpRecipeRun = false;
                }
            }

            OutCollector.Write_Rtd_LotUpkTracking(lot);
        }
示例#2
0
        /// <summary>
        /// </summary>
        /// <param name="da"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public bool IS_HOLD0(DispatchingAgent da, IHandlingBatch hb, ref bool handled, bool prevReturnValue)
        {
            FabLot lot = hb.ToFabLot();

            //FabWipInfo wip = lot.Wip;
            //FabPlanInfo plan = lot.CurrentFabPlan;

            if (lot.IsInitHold)
            {
                InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait);
                return(true);
            }

            return(false);
        }
示例#3
0
文件: Route.cs 项目: yichunbong/CSOT
        /// <summary>
        /// Batch Input으로 처음들어오는 곳
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void ON_RELEASE0(AoFactory factory, IHandlingBatch hb, ref bool handled)
        {
            hb.MoveFirst(factory.NowDT);

            FabLot lot = hb.ToFabLot();

            if (lot.ReleasePlan != null)
            {
                lot.ReleasePlan.IsRelease = true;
            }

            InFlowMaster.ChangeWipLocation(hb, EventType.Release);

            OutCollector.CollectInputLot(lot);
            OutCollector.WriteInputLotLog(lot, factory.NowDT);
        }
示例#4
0
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void LOCATE_FOR_DISPATCH1(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
        {
            FabLot lot = hb.ToFabLot();

            if (CheckSimulationRunType(lot) == false)
            {
                return;
            }

            if (hb.IsFinished)
            {
                factory.Router.AddInitial((Entity)hb, hb.IsFinished);
            }
            else
            {
                //InPortWip 처리
                if (InitInPortWip(factory, hb))
                {
                    return;
                }

                var    router      = EntityControl.Instance;
                string dispatchKey = router.GetLotDispatchingKey(hb);

                DispatchingAgent da = factory.GetDispatchingAgent(dispatchKey);

                if (da == null)
                {
                    if (factory.DispatchingAgents.Count > 0)
                    {
                        ModelContext.Current.ErrorLister.Write("Entity/WipInit/LocateForDispatch", Mozart.DataActions.ErrorType.Warning, Strings.CAT_SIM_SECONDRESOURCE,
                                                               string.Format(Strings.WARN_INVALID_IMPLEMENTATION, "Entity/WipInit/LocateForDispatch"));
                        da = factory.DispatchingAgents.FirstOrDefault().Value;
                    }
                    else
                    {
                        throw new InvalidOperationException(Strings.EXCEPTION_NO_REGISTERED_DISPATCHINGAGENT);
                    }
                }

                InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait);

                da.Take(hb);
            }
        }
示例#5
0
文件: Route.cs 项目: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="now"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IHandlingBatch[] STEP_CHANGE0(Mozart.SeePlan.Simulation.IHandlingBatch hb, DateTime now, ref bool handled, Mozart.SeePlan.Simulation.IHandlingBatch[] prevReturnValue)
        {
            FabLot      lot  = hb.ToFabLot();
            FabPlanInfo plan = lot.CurrentFabPlan;


            /*
             * StepChange
             */
            ILot[] lots = hb.StepChange(now);

            //설비의 OutPort에서 Lot을 모으는 InterceptMove를 사용할 경우 해당 위치에서 별도 집계 필요함.
            InFlowMaster.ChangeWipLocation(hb, EventType.TrackOut);


            //FabPlanInfo prev = lot.PreviousFabPlan;

            ////InLineMap 다음StepSkip
            //if (prev.IsLoaded && prev.FabStep.StdStep.IsBaseEqp(prev.ResID))
            //{
            //    plan = lot.CurrentFabPlan;

            //    plan.TransferStartTime = now;
            //    plan.TransferEndTime = now;
            //    plan.EqpInEndTime = now;
            //    plan.EqpInStartTime = now;

            //    plan.Start(now, null);
            //    plan.End(now, null);

            //    lots = hb.StepChange(now);
            //}

            QTimeMaster.StepChange(lots, now);

            return(lots);
        }
示例#6
0
        private bool InitInPortWip(AoFactory factory, IHandlingBatch hb)
        {
            FabLot lot = hb.ToFabLot();

            //if (lot.LotID == "TH961377N00")
            //	Console.WriteLine();

            if (lot.IsInPortWip == false)
            {
                return(false);
            }

            var    wipInitiator = ServiceLocator.Resolve <WipInitiator>();
            string eqpID        = wipInitiator.GetLoadingEquipment(hb);

            AoEquipment eqp;

            if (string.IsNullOrEmpty(eqpID) || factory.Equipments.TryGetValue(eqpID, out eqp) == false)
            {
                Logger.Warn("Can't Locate InportWip to Eqp {0}, check input data!", eqpID ?? "-");

                #region Write ErrorHistory
                ErrHist.WriteIf(string.Format("LocateInportWip{0}", lot.LotID),
                                ErrCategory.SIMULATION,
                                ErrLevel.INFO,
                                lot.CurrentFactoryID,
                                lot.CurrentShopID,
                                lot.LotID,
                                lot.CurrentProductID,
                                lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                lot.CurrentProcessID,
                                eqpID,
                                lot.CurrentStepID,
                                "NOT FOUND EQP",
                                "Can't Locate InportWip");
                #endregion

                return(false);
            }
            else
            {
                FabAoEquipment feqp = eqp.ToFabAoEquipment();

                //Inport Wip (M잔여 수량 체크 X)
                if (EqpArrangeMaster.IsLoadable(feqp, lot, false) == false)
                {
                    #region Write ErrorHistory
                    ErrHist.WriteIf(string.Format("LocateInportWip{0}", lot.LotID),
                                    ErrCategory.SIMULATION,
                                    ErrLevel.INFO,
                                    lot.CurrentFactoryID,
                                    lot.CurrentShopID,
                                    lot.LotID,
                                    lot.CurrentProductID,
                                    lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                    lot.CurrentProcessID,
                                    eqpID,
                                    lot.CurrentStepID,
                                    "NOT FOUND EQP_ARRANGE",
                                    "Can't Locate InportWip");
                    #endregion

                    return(false);
                }

                if (feqp.InitInPortWips == null)
                {
                    feqp.InitInPortWips = new List <IHandlingBatch>();
                }

                feqp.InitInPortWips.Add(hb);

                InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait);

                return(true);
            }
        }
示例#7
0
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void LOCATE_FOR_RUN0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
        {
            var wipInitiator = ServiceLocator.Resolve <WipInitiator>();

            FabLot lot = hb.Sample as FabLot;

            string      eqpID = wipInitiator.GetLoadingEquipment(hb);
            AoEquipment aeqp  = factory.GetEquipment(eqpID);

            if (aeqp == null)
            {
                //If there is not Equipment, handle through Bucketing.
                factory.AddToBucketer(hb);
                Logger.Warn("Eqp {0} is invalid, so locate running wip to dummy bucket. check input data!", eqpID ?? "-");
            }
            else
            {
                //// Checks WIP state that is Run, but processing is completed and located in Outport.
                //bool trackOut = wipInitiator.CheckTrackOut(factory, hb);
                //if (trackOut)
                //{
                //    aeqp.AddOutBuffer(hb);
                //}
                //else
                //{
                //    aeqp.AddRun(hb);
                //}

                var eqp     = aeqp.Target as FabEqp;
                var runWips = eqp.InitRunWips;

                bool lastRunWip = runWips[runWips.Count - 1] == lot;
                if (eqp.State == ResourceState.Up && lastRunWip)
                {
                    MaskMaster.InitLocate(aeqp, hb);
                    JigMaster.InitLocate(aeqp, hb);

                    aeqp.AddRun(hb);                     //※초기Run재공은 OnTrackIn 이벤트 발생안함.
                }
                else
                {
                    DateTime tkInTime     = lot.Wip.LastTrackInTime;
                    var      procTimeInfo = aeqp.GetProcessTime(hb);
                    double   processTime  = procTimeInfo.FlowTime.TotalSeconds + (procTimeInfo.TactTime.TotalSeconds * (hb.UnitQty - 1));
                    DateTime tkOutTime    = tkInTime.AddSeconds(processTime);

                    Time delay = Time.Max((tkOutTime - aeqp.NowDT), Time.Zero);
                    if (delay > Time.Zero)
                    {
                        object[] args = new object[2] {
                            aeqp, hb
                        };
                        aeqp.AddTimeout(delay, SimHelper.OnEqpOutBuffer, args);
                        InFlowMaster.ChangeWipLocation(hb, EventType.TrackIn);

                        lot.CurrentPlan.LoadedResource = eqp;
                    }
                    else
                    {
                        aeqp.AddOutBuffer(hb);
                    }
                }
            }
        }