Exemplo n.º 1
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <param name="now"/>
        /// <param name="target"/>
        /// <param name="factor"/>
        /// <param name="ctx"/>
        /// <returns/>
        public WeightValue LAST_RUN(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx)
        {
            FabAoEquipment eqp = target as FabAoEquipment;

            var last = eqp.GetLastPlan();             //eqp.LastPlan;

            if (last == null)
            {
                return(new WeightValue(0));
            }

            FabPlanInfo plan = last as FabPlanInfo;

            FabLot lot = entity as FabLot;

            bool isNeedSetup = eqp.IsNeedSetup(lot);

            float markValue = 0;

            if (isNeedSetup == false)
            {
                markValue = 1;

                if (lot.CurrentFabPlan.OwnerType != plan.OwnerType)
                {
                    markValue = 0.5f;
                }
            }

            return(new WeightValue(markValue * factor.Factor));
        }
Exemplo n.º 2
0
        private void SetCurrentMask(FabAoEquipment eqp, FabLot lot)
        {
            if (SimHelper.IsTftRunning)
            {
                var mask = eqp.InUseMask;
                if (mask != null)
                {
                    mask.WorkInfos.Add(lot);

                    lot.CurrentMask           = mask;
                    lot.CurrentFabPlan.MaskID = mask.ToolID;
                }
            }
            else
            {
                var jig = eqp.InUseJig;
                if (jig != null)
                {
                    StringBuilder sb = new StringBuilder();

                    foreach (var item in jig.Masks)
                    {
                        item.WorkInfos.Add(lot);

                        if (sb.Length > 0)
                        {
                            sb.Append(",");
                        }
                        sb.Append(item.JigID);
                    }

                    lot.CurrentFabPlan.MaskID = sb.ToString();
                }
            }
        }
Exemplo n.º 3
0
        private static bool HasFilterInfo(AoEquipment eqp, FabLot lot)
        {
            if (lot.DispatchFilterInfo == null)
            {
                return(false);
            }

            if (lot.DispatchFilterInfo.FilterType == DispatchFilter.None)
            {
                return(false);
            }

            WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_PREVENT_SMALL_LOT_FILTER);

            if (wf == null || wf.Factor == 0)
            {
                //자신의 초기 Step일 경우에 Lot Priority 가 1,2,3 일 경우 필터하지 않음
                if (lot.CurrentStep == lot.Wip.InitialStep)
                {
                    if (lot.Wip.Priority == 1 || lot.Wip.Priority == 2 || lot.Wip.Priority == 3)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Exemplo n.º 4
0
        public static void OnEqpLoadingStateChanged(object sender, object args)
        {
            object[] arr = args as object[];
            if (arr == null || arr.Length != 3)
            {
                return;
            }

            FabSubEqp subEqp = arr[0] as FabSubEqp;

            if (subEqp == null)
            {
                return;
            }

            string stateName = arr[1] as string;

            LoadingStates state;

            if (Enum.TryParse(stateName, out state) == false)
            {
                return;
            }

            FabLot lot = arr[2] as FabLot;

            if (subEqp.SubEqpID.StartsWith("THCVD9") && lot.LotID == "TH9A0759N01")
            {
                Console.WriteLine();
            }

            var eqp = AoFactory.Current.GetEquipment(subEqp.Parent.EqpID) as FabAoEquipment;

            subEqp.OnStateChanged(eqp, state, lot);
        }
Exemplo n.º 5
0
            public void AddLot(FabLot lot)
            {
                string version = lot.CurrentProductVersion;

                List <FabLot> list;

                if (WipList.TryGetValue(version, out list) == false)
                {
                    WipList.Add(version, list = new List <FabLot>());
                }

                list.Add(lot);

                FabStep step = lot.Wip.InitialStep as FabStep;

                if (step.StdStep.IsAferCOA)
                {
                    List <FabLot> list2;
                    if (AfterCOAWips.TryGetValue(version, out list2) == false)
                    {
                        AfterCOAWips.Add(version, list2 = new List <FabLot>());
                    }

                    list2.Add(lot);
                }
            }
Exemplo n.º 6
0
 public LotLocation(FabLot lot, EventType type)
 {
     this.Lot       = lot;
     this.Location  = lot.CurrentFabStep;
     this.EventType = type;
     this.WipType   = SetWipType();
 }
Exemplo n.º 7
0
        internal static void InitLocate(AoEquipment aeqp, IHandlingBatch hb)
        {
            var eqp = aeqp.ToFabAoEquipment();

            FabLot lot = hb.ToFabLot();

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

            var loableList = GetLoadableJigArrangeList(aeqp, lot);

            if (loableList == null || loableList.Count == 0)
            {
                return;
            }

            foreach (var item in loableList[0].Jigs)
            {
                if (item.IsBusy)
                {
                    continue;
                }

                lot.CurrentJig.Add(item);

                if (lot.CurrentJig.Count == eqp.UseJigCount)
                {
                    break;
                }
            }
        }
Exemplo n.º 8
0
        private static List <FabLot> CreateCellInputLot(this CellInProfile profile)
        {
            List <FabLot> list = new List <FabLot>();

            var infos = profile.CellInfos;

            if (infos == null || infos.Count == 0)
            {
                return(list);
            }

            var     prod = profile.Product;
            FabStep step = prod.Process.FirstStep as FabStep;

            foreach (InInfo info in infos)
            {
                DateTime avalableTime = info.ReleaseTime;
                int      unitQty      = info.Qty;

                string     lotID = EntityHelper.CreateCellInLotID(prod);
                FabWipInfo wip   = CreateHelper.CreateWipInfo(lotID, prod, step, unitQty);

                FabLot lot = CreateHelper.CreateLot(wip, Mozart.SeePlan.Simulation.LotState.CREATE);

                lot.ReleaseTime   = LcdHelper.Max((DateTime)avalableTime, ModelContext.Current.StartTime);
                lot.LotState      = Mozart.SeePlan.Simulation.LotState.CREATE;
                lot.FrontInTarget = info.InTarget;

                list.Add(lot);
            }

            return(list);
        }
Exemplo n.º 9
0
        /// <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);
        }
Exemplo n.º 10
0
        private static void AddGroupDispatchInfo(FabAoEquipment eqp, IList <IHandlingBatch> lotList, IHandlingBatch[] selected, WeightPreset preset)
        {
            for (int i = 0; i < lotList.Count; i++)
            {
                var hb = lotList[i];

                FabLot lot = hb.ToFabLot();

                if (hb.HasContents)
                {
                    StringBuilder sb = new StringBuilder();
                    foreach (FabLot item in hb.Contents)
                    {
                        if (sb.Length == 0)
                        {
                            sb.Append(item.LotID);
                        }
                        else
                        {
                            sb.AppendFormat(",{0}", item.LotID);
                        }
                    }

                    lot.LogDetail = string.Format("{0} [{1}→{2}]", hb.UnitQty, hb.Count, sb);
                }
                else
                {
                    Console.WriteLine();
                }
            }

            eqp.EqpDispatchInfo.AddDispatchInfo(lotList, selected, preset);
        }
Exemplo n.º 11
0
        internal static FabLot CreateFrontInLot(FabProduct product, ProductType prodType, int inQty, BatchInfo batch)
        {
            FabStep step = product.Process.FirstStep as FabStep;

            //TODO : 2019.8.27 미사용파악

            //FabWipInfo info = CreateHelper.CreateWipInfoDummy(
            //    CreateFrontInLotID(product),
            //    batch,
            //    product,
            //    product.Process as FabProcess,
            //    step,
            //    prodType,
            //    Constants.NULL_ID,
            //    2,
            //    inQty,
            //    EntityState.WAIT,
            //    null,
            //    string.Empty,
            //    AoFactory.Current.NowDT,
            //    DateTime.MinValue);

            FabWipInfo info = new FabWipInfo();

            EntityHelper.AddBatchInfo(batch, step, inQty);

            FabLot lot = CreateHelper.CreateLot(info, LotState.CREATE);

            lot.LotState = Mozart.SeePlan.Simulation.LotState.CREATE;


            return(lot);
        }
Exemplo n.º 12
0
        public static void WriteDispatchLog_ParallelChamber(FabAoEquipment eqp, FabLot lot)
        {
            if (eqp == null)
            {
                return;
            }

            var subEqpList = eqp.SubEqps;

            if (subEqpList == null)
            {
                return;
            }

            foreach (var subEqp in subEqpList)
            {
                var info = subEqp.EqpDispatchInfo;
                if (info == null)
                {
                    continue;
                }

                var currLot = subEqp.ChamberInfo.Current as FabLot;
                if (currLot != lot)
                {
                    continue;
                }

                WriteDispatchLog(eqp, info, subEqp);

                //기록 후 삭제 처리
                subEqp.EqpDispatchInfo = null;
            }
        }
Exemplo n.º 13
0
        internal static bool IsNeedSetup(FabAoEquipment eqp, FabLot lot)
        {
            if (lot == null)
            {
                return(false);
            }

            if (eqp.IsParallelChamber)
            {
                return(ResHelper.IsNeedChamberSetup(eqp, lot));
            }

            if (ResHelper.IsIgnoreSetup(eqp))
            {
                return(false);
            }

            return(IsNeedSetup(eqp,
                               lot.CurrentShopID,
                               lot.CurrentStepID,
                               lot.CurrentProductID,
                               lot.CurrentProductVersion,
                               lot.OwnerType,
                               lot.OwnerID));
        }
Exemplo n.º 14
0
        public WeightValue ALLOW_RUN_DOWN_TIME(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx)
        {
            FabAoEquipment eqp = target as FabAoEquipment;
            FabLot         lot = entity as FabLot;

            var wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_ALLOW_RUN_DOWN_TIME);

            if (wf == null || wf.Factor == 0)
            {
                return(new WeightValue(0));
            }

            decimal inflowHour = (decimal)wf.Criteria[0];

            var     idleTime   = eqp.GetIdleRunTime();
            decimal adjustHour = inflowHour - Convert.ToDecimal(idleTime.TotalHours);

            if (adjustHour < 0)
            {
                return(new WeightValue(0));
            }

            var inflowQty = InFlowMaster.GetAllowRunDownWip(eqp, lot.CurrentProductID, lot.OrigProductVersion, lot.OwnerType, lot.CurrentStep as FabStep, adjustHour);

            float score = 0f;

            if (inflowQty > 0)
            {
                score = 1f;
            }

            string desc = string.Format("[inflow:{0}]", inflowQty);

            return(new WeightValue(score * factor.Factor, desc));
        }
Exemplo n.º 15
0
        //private static void OnChamberStateChangedTemp(FabAoEquipment eqp, FabLot lot, LoadingStates state, DateTime now, bool isDone)
        //{
        //	if (eqp.IsParallelChamber == false)
        //		return;

        //	int count = eqp.SubEqps.Length;
        //	for (int i = 0; i < count; i++)
        //	{
        //		var subEqp = eqp.SubEqps[i];

        //		if (isDone)
        //		{
        //			subEqp.OnStateChanged(eqp, state, lot, isDone);
        //			continue;
        //		}

        //		ChamberInfo chamberInfo;
        //		if (eqp.CheckParallelChamberState(i, state, lot, out chamberInfo))
        //		{
        //			subEqp.OnStateChanged(eqp, state, lot, isDone);

        //			//TODO : 임시처리로직 ParallelChamber 설비의 BUSY 이벤트 누락 발생으로 임시 처리함. (이슈 확인 후 삭제 필요함.)
        //			if (state == LoadingStates.SETUP)
        //			{
        //				Time delay = Time.Max((subEqp.ChamberInfo.SetupEndTime - now), Time.Zero);
        //				if (delay > Time.Zero)
        //				{
        //					object[] args = new object[3] { subEqp, LoadingStates.BUSY.ToString(), lot };
        //					eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);
        //				}
        //			}
        //		}
        //		else
        //		{
        //			if (state == LoadingStates.BUSY && subEqp.ChamberInfo.Next != null)
        //			{
        //				FabLot itsMe = subEqp.ChamberInfo.Next as FabLot;
        //				if (lot.CurrentPlan == itsMe.CurrentPlan)
        //				{
        //					if (subEqp.ChamberInfo.OutTime > subEqp.SetupEndTime)
        //					{
        //						Time delay = Time.Max((subEqp.ChamberInfo.OutTime - now), Time.Zero);
        //						if (delay > Time.Zero)
        //						{
        //							object[] args = new object[3] { subEqp, LoadingStates.BUSY.ToString(), lot };
        //							eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);
        //						}
        //					}
        //				}
        //			}
        //			else if (state == LoadingStates.IDLERUN)
        //			{
        //				if (subEqp.ChamberInfo.Current != null)
        //				{
        //					Time delay = Time.Max((subEqp.ChamberInfo.OutTime - now), Time.Zero);
        //					if (delay > Time.Zero)
        //					{
        //						object[] args = new object[3] { subEqp, LoadingStates.IDLERUN.ToString(), lot };
        //						eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);
        //					}
        //				}
        //			}
        //			else if (state == LoadingStates.SETUP)
        //			{

        //				if (subEqp.ChamberInfo.Current != null)
        //				{
        //					var workInfo = subEqp.ChamberInfo.List.Find(p => (p.Entity as FabLot).CurrentPlan == lot.CurrentPlan);
        //					if (workInfo != null)
        //					{
        //						Time delay = Time.Max((workInfo.SetupStartTime - now), Time.Zero);
        //						if (delay > Time.Zero)
        //						{
        //							object[] args = new object[3] { subEqp, LoadingStates.SETUP.ToString(), lot };
        //							eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);

        //							subEqp.SetupStartTime = workInfo.SetupStartTime;
        //						}

        //						delay = Time.Max((workInfo.SetupEndTime - now), Time.Zero);
        //						if (delay > Time.Zero)
        //						{
        //							object[] args = new object[3] { subEqp, LoadingStates.BUSY.ToString(), lot };
        //							eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);

        //							subEqp.SetupEndTime = workInfo.SetupEndTime;
        //						}
        //					}
        //				}
        //			}
        //		}

        //		//if (eqp.EqpID == "THCVD500")
        //		//{
        //		//    string lotID = "-";
        //		//    if (subEqp.ChamberInfo.Current != null)
        //		//        lotID = (subEqp.ChamberInfo.Current as FabLot).LotID;

        //		//    Logger.MonitorInfo("{0};{1};{2};{3};{4};{5};{6};{7};{8}\t", eqp.NowDT.ToString("HH:mm:ss"), state, lot == null ? "-" : lot.LotID, subEqp.SubEqpID, lotID, subEqp.ChamberInfo.OutTime == Time.Zero ? "-" : subEqp.ChamberInfo.OutTime.ToString(), subEqp.ChamberInfo.Next == null ? "-" : (subEqp.ChamberInfo.Next as FabLot).LotID, subEqp.ChamberInfo.Next == null ? "-" : subEqp.ChamberInfo.NextOutTime.ToString(), subEqp.ChamberInfo.LastUnits);
        //		//}
        //	}
        //}

        private static void OnChamberStateChanged(FabAoEquipment eqp, FabLot lot, LoadingStates state, DateTime now, bool isDone)
        {
            var findSubEqps = isDone ? eqp.GetSubEqpList() : eqp.FindSubEqpsByState(state, lot);

            if (findSubEqps != null && findSubEqps.Count > 0)
            {
                foreach (var subEqp in findSubEqps)
                {
                    subEqp.OnStateChanged(eqp, state, lot, isDone);

                    //TODO : 임시처리로직 ParallelChamber 설비의 BUSY 이벤트 누락 발생으로 임시 처리함. (이슈 확인 후 삭제 필요함.)
                    if (state == LoadingStates.SETUP)
                    {
                        Time delay = Time.Max((subEqp.ChamberInfo.SetupEndTime - now), Time.Zero);
                        if (delay > Time.Zero)
                        {
                            object[] args = new object[3] {
                                subEqp, LoadingStates.BUSY.ToString(), lot
                            };
                            eqp.AddTimeout(delay, SimHelper.OnEqpLoadingStateChanged, args);
                        }
                    }
                }
            }
        }
Exemplo n.º 16
0
 public MinQTimeComparer(FabLot lot, FabStep step, DateTime now, OrderType orderType)
 {
     this.Lot       = lot;
     this.Step      = step;
     this.OrderType = orderType;
     this.Now       = now;
 }
Exemplo n.º 17
0
        /// <summary>
        /// </summary>
        /// <param name="da"/>
        /// <param name="hb"/>
        /// <param name="destCount"/>
        /// <param name="handled"/>
        public void ON_NOT_FOUND_DESTINATION0(Mozart.SeePlan.Simulation.DispatchingAgent da, Mozart.SeePlan.Simulation.IHandlingBatch hb, int destCount, ref bool handled)
        {
            FabLot lot = hb.ToFabLot();


            //TODO:
            if (lot.CurrentFabStep.StdStep.IsMandatory)
            {
                ErrHist.WriteIf(string.Format("{0}/{1}/{2}", "NotFoundArrange", lot.CurrentFabStep.StepID, lot.CurrentProductID),
                                ErrCategory.SIMULATION,
                                ErrLevel.INFO,
                                lot.CurrentFactoryID,
                                lot.CurrentShopID,
                                lot.LotID,
                                lot.CurrentProductID,
                                lot.CurrentProductVersion ?? lot.Wip.ProductVersion,
                                lot.CurrentProcessID,
                                Constants.NULL_ID,
                                lot.CurrentStepID,
                                "ON NOT FOUND DESTINATION0",
                                string.Format("Check Arrange → LOT_ID:{0}", lot.ToString())
                                );

                return;
            }

            da.Factory.AddToBucketer(hb);
        }
Exemplo n.º 18
0
            public int Compare(IHandlingBatch x, IHandlingBatch y)
            {
                if (object.ReferenceEquals(x, y))
                {
                    return(0);
                }

                FabLot a = x.ToFabLot();
                FabLot b = y.ToFabLot();

                int cmp = x.DispatchInTime.CompareTo(y.DispatchInTime);

                if (cmp == 0)
                {
                    cmp = a.Priority.CompareTo(b.Priority);
                }

                if (cmp == 0)
                {
                    cmp = a.CurrentProductID.CompareTo(b.CurrentProductID);
                }

                if (cmp == 0)
                {
                    cmp = a.CurrentProductVersion.CompareTo(b.CurrentProductVersion);
                }

                return(cmp);
            }
Exemplo n.º 19
0
        private static Time GetAfterTat(this StayHour info, FabLot lot, FabStep currStep)
        {
            if (currStep == null)
            {
                return(Time.Zero);
            }

            string key       = currStep.StepKey;
            string productID = lot.CurrentProductID;

            Time t;

            if (info.AfterTats.TryGetValue(key, out t) == false)
            {
                bool flag = false;
                foreach (var step in info.StepList)
                {
                    if (flag)
                    {
                        var tat = step.GetTat(productID, true);
                        if (tat != null)
                        {
                            t += Time.FromMinutes(tat.TAT);
                        }
                    }

                    if (step.StepID == currStep.StepID)
                    {
                        flag = true;
                    }
                }
            }

            return(t);
        }
Exemplo n.º 20
0
        private static void MoveQty(this FabMask mask, FabAoEquipment eqp, FabLot lot)
        {
            if (mask.HasLimit() == false)
            {
                return;
            }

            int qty = lot.UnitQty;

            if (qty <= 0)
            {
                return;
            }

            foreach (var item in mask.Limits)
            {
                if (item.ActivateType != ActivateType.M)
                {
                    continue;
                }

                item.MoveQty += qty;
                item.Seq++;

                OutCollector.WriteLimitMLog(item, eqp, lot, eqp.NowDT);
            }
        }
Exemplo n.º 21
0
        //internal static LoadingStates GetLoadingState(LoadStates loadState)
        //{
        //    LoadingStates states = LoadingStates.IDLE;

        //    switch (loadState)
        //    {
        //        case LoadStates.SETUP:
        //            states = LoadingStates.SETUP;
        //            break;

        //        case LoadStates.BUSY:
        //            states = LoadingStates.BUSY;
        //            break;

        //        case LoadStates.IDLERUN:
        //            states = LoadingStates.IDLERUN;
        //            break;

        //        case LoadStates.IDLE:
        //            states = LoadingStates.IDLE;
        //            break;

        //        case LoadStates.PM:
        //            states = LoadingStates.PM;
        //            break;

        //        case LoadStates.DOWN:
        //            states = LoadingStates.DOWN;
        //            break;

        //        case LoadStates.WAIT_SETUP:
        //            states = LoadingStates.WAIT_SETUP;
        //            break;

        //        case LoadStates.RENT:
        //            states = LoadingStates.PM;
        //            break;
        //    }

        //    return states;
        //}

        //internal static LoadStates GetLoadState(LoadingStates states)
        //{
        //    LoadStates loadState = LoadStates.IDLE;

        //    switch (states)
        //    {
        //        case LoadingStates.BUSY:
        //            loadState = LoadStates.BUSY;
        //            break;
        //        case LoadingStates.DOWN:
        //            loadState = LoadStates.DOWN;
        //            break;

        //        case LoadingStates.IDLE:
        //            loadState = LoadStates.IDLE;
        //            break;

        //        case LoadingStates.IDLERUN:
        //            loadState = LoadStates.IDLERUN;
        //            break;

        //        case LoadingStates.PM:
        //            loadState = LoadStates.PM;
        //            break;

        //        case LoadingStates.SETUP:
        //            loadState = LoadStates.SETUP;
        //            break;

        //        case LoadingStates.WAIT_SETUP:
        //            loadState = LoadStates.WAIT_SETUP;
        //            break;

        //    }

        //    return loadState;
        //}

        public static List <string> GetNowAvailableChambers(AoEquipment aeqp, FabLot lot, DateTime now)
        {
            if (aeqp.IsParallelChamber == false)
            {
                return(null);
            }

            //AoChamberProc2 가 Parallel Chamber임
            AoChamberProc2 proc = aeqp.FirstProcess <AoChamberProc2>();

            List <string> result = new List <string>();

            foreach (ChamberInfo chamber in proc.Chambers)
            {
                //chamber 진행여부(chamber.Current 는 현재 진행인 상태(currently in process)를 나타냄)
                if (chamber.Current != null)
                {
                    continue;
                }

                //chamber.GetrAvailableTime 이 미래이면 현재 가동중, 현재(now) 이면 idle인 상태
                if (chamber.GetAvailableTime() <= now)
                {
                    result.Add(chamber.Label);
                }
            }

            return(result);
        }
Exemplo n.º 22
0
        private static bool IsLoadable_Limit(this FabMask mask, FabLot lot)
        {
            if (mask.HasLimit() == false)
            {
                return(true);
            }

            bool checkQty = true;

            if (InputMart.Instance.GlobalParameters.ApplyArrangeMType == false)
            {
                checkQty = false;
            }

            int lotSize = SeeplanConfiguration.Instance.LotUnitSize;
            int unitQty = lot.IsDummy ? lotSize : lot.UnitQty;

            int qty = checkQty ? Math.Max(unitQty, 1) : 0;

            var infos = mask.Limits;

            foreach (var item in infos)
            {
                if (item.IsLoadable(qty) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 23
0
        public static Time GetTransferTime(FabLot lot, AoEquipment eqp)
        {
            string from = null;
            string to   = null;

            if (lot != null && lot.PreviousFabPlan != null)
            {
                if (lot.PreviousFabPlan.IsLoaded)
                {
                    FabEqp prevEqp = lot.PreviousPlan.LoadedResource as FabEqp;
                    from = prevEqp.OutStocker;
                }
                else
                {
                    //init wip step --> next step
                    if (lot.Plans.Count == 2)
                    {
                        string wipEqpID = lot.Wip.WipEqpID;
                        var    prevEqp  = ResHelper.FindEqp(wipEqpID);
                        from = prevEqp != null ? prevEqp.OutStocker : wipEqpID;
                    }
                }
            }

            if (eqp != null)
            {
                to = (eqp.Target as FabEqp).InStocker;
            }

            return(GetTransferTime(from, to));
        }
Exemplo n.º 24
0
        private static void SeizeMaskTool(this FabAoEquipment eqp, FabMask mask, FabLot lot)
        {
            if (eqp.InUseMask != null)
            {
                if (mask == null || mask != eqp.InUseMask)
                {
                    eqp.ReleaseMask();
                }
            }

            eqp.InUseMask = mask;

            if (mask != null)
            {
                mask.StateChangeTime = eqp.NowDT;
                mask.StateCode       = ToolStatus.INUSE;

                if (mask.EqpID != eqp.EqpID)
                {
                    ChangeLocation(mask, mask.EqpID, eqp.EqpID);
                }

                mask.EqpID    = eqp.EqpID;
                mask.Location = mask.EqpID;

                mask.AvailableTime = GetNextAvailableTime(eqp, lot);
                mask.AddWorkInfo(lot);
            }
        }
Exemplo n.º 25
0
        private int LotGroupSorter(IHandlingBatch x, IHandlingBatch y)
        {
            DateTime now = AoFactory.Current.NowDT;
            FabLot   a   = x.ToFabLot();
            FabLot   b   = y.ToFabLot();

            int cmp = 0;

            //LotPriority
            if (cmp == 0)
            {
                cmp = a.Priority.CompareTo(b.Priority);
            }

            //MaxQtime
            if (cmp == 0)
            {
                cmp = a.GetMinimumRemainTime(now).CompareTo(b.GetMinimumRemainTime(now));
            }

            //Fifo
            if (cmp == 0)
            {
                cmp = a.DispatchInTime.CompareTo(b.DispatchInTime);
            }

            return(cmp);
        }
Exemplo n.º 26
0
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void ON_TRANSFERED0(Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
        {
            FabLot      lot  = hb.ToFabLot();
            FabPlanInfo plan = lot.CurrentFabPlan;

            plan.TransferEndTime = AoFactory.Current.NowDT;
        }
Exemplo n.º 27
0
        internal static void WriteFilterInfo(IHandlingBatch hb, AoEquipment eqp)
        {
            FabLot lot    = hb.ToFabLot();
            string reason = string.Format("{0}/{1}", lot.DispatchFilterInfo.FilterType, lot.DispatchFilterInfo.FilterReason);

            eqp.EqpDispatchInfo.AddFilteredWipInfo(lot, reason);
        }
Exemplo n.º 28
0
        internal static FabStep GetNextMandatoryStep(FabLot lot)
        {
            string key = LcdHelper.CreateKey(lot.CurrentProductID, lot.CurrentFabStep.Key);

            FabStep next;

            if (_nextMainEqpStepCache.TryGetValue(key, out next) == false)
            {
                FabProduct nextProd = lot.FabProduct;
                next = lot.CurrentFabStep.GetNextStep(nextProd, ref nextProd);

                int safeCnt = 0;
                while (next != null && next.StdStep.IsMandatory == false)
                {
                    next = next.GetNextStep(nextProd, ref nextProd);

                    if (next == null)
                    {
                        break;
                    }

                    safeCnt++;
                    if (safeCnt == 100)
                    {
                        Logger.MonitorInfo("CHECK ROUTE : {0} → NEXT MAIN EQP STEP", lot.CurrentFabStep.StepKey);
                        next = null;
                        break;
                    }
                }

                _nextMainEqpStepCache.Add(key, next);
            }

            return(next);
        }
Exemplo n.º 29
0
        private static bool IsLoadableEqpArrange(AoEquipment aeqp, FabLot lot)
        {
            var eqp = aeqp.ToFabAoEquipment();

            bool checkQty = true;

            if (InputMart.Instance.GlobalParameters.ApplyArrangeMType == false)
            {
                checkQty = false;
            }

            bool isLoadable = EqpArrangeMaster.IsLoadable(eqp, lot, checkQty);

            if (isLoadable == false)
            {
                return(false);
            }

            //1차 선택 (1차 : Mask 미고려 선택, 2차 : Mask 고려 후 선택)
            if (lot.CurrentEqpArrange != null)
            {
                string productVersion = lot.CurrentProductVersion;
                lot.CurrentEqpArrange.SetUsedArrange(productVersion);
            }

            return(true);
        }
Exemplo n.º 30
0
        /// <summary>
        /// </summary>
        /// <param name="entity"/>
        /// <param name="now"/>
        /// <param name="target"/>
        /// <param name="factor"/>
        /// <param name="ctx"/>
        /// <returns/>
        public WeightValue ASSIGN_STEP_PRIORITY(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx)
        {
            if (factor.Factor == 0)
            {
                return(new WeightValue(0));
            }

            FabAoEquipment eqp       = target as FabAoEquipment;
            FabEqp         targetEqp = eqp.TargetEqp;
            FabLot         lot       = entity as FabLot;

            float score = 0f;

            bool isLastStep = false;
            var  last       = eqp.GetLastPlan();

            if (last != null)
            {
                if (last.StepID == lot.CurrentStepID)
                {
                    isLastStep = true;
                }
            }

            if (isLastStep || targetEqp.MainRunSteps.Contains(lot.CurrentFabStep.StdStep))
            {
                score = 1f;
            }

            string lastStepID = last == null ? "-" : last.StepID;
            string desc       = string.Format("[Last : {0}, MainSteps:{1}]",
                                              lastStepID, targetEqp.EqpMainRunsSteps);

            return(new WeightValue(score * factor.Factor, desc));
        }