예제 #1
0
        public static StepTat GetDefaultTAT(this FabStep step)
        {
            if (step.DefaultTAT == null)
            {
                StepTat tat = new StepTat();
                tat.WaitTat = (float)SiteConfigHelper.GetDefaultWaitTAT().TotalMinutes;
                tat.RunTat  = (float)SiteConfigHelper.GetDefaultRunTAT().TotalMinutes;
                tat.TAT     = tat.WaitTat + tat.RunTat;

                step.DefaultTAT = tat;
            }

            return(step.DefaultTAT);
        }
예제 #2
0
파일: Weights.cs 프로젝트: yichunbong/CSOT
        public WeightValue NEXT_STEP_RUN_PRIORITY(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx)
        {
            if (factor.Factor == 0)
            {
                return(new WeightValue(0));
            }

            float criteria0 = WeightHelper.GetCriteria(factor, 0, 0.5f);

            FabAoEquipment eqp = target as FabAoEquipment;
            FabLot         lot = entity as FabLot;

            FabStep nextStep = BopHelper.GetNextMandatoryStep(lot);

            float score      = 0f;
            int   workingCnt = 0;
            int   adv        = 0;

            if (nextStep != null && nextStep.IsMandatoryStep)
            {
                bool checkProductVersion = true;
                var  workingEqps         = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);

                //checkProductVersion = false
                if (workingEqps == null || workingEqps.Count == 0)
                {
                    checkProductVersion = false;
                    workingEqps         = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion);
                }

                workingCnt = workingEqps == null ? 0 : workingEqps.Count;

                if (workingCnt > 0)
                {
                    score = checkProductVersion ? 1f : criteria0;
                }

                var hasDummy = workingEqps.Find(t => t.IsDummyWait) != null;
                if (hasDummy)
                {
                    adv    = 2;
                    score *= adv;
                }
            }

            string nextStepID = nextStep != null ? nextStep.StepID : Constants.NULL_ID;
            string desc       = string.Format("[Next:{0}, Working:{1}, Adv:{2}]", nextStepID, workingCnt, adv);

            return(new WeightValue(score * factor.Factor, desc));
        }
예제 #3
0
        private static void SetMatchedList(this QTimeInfo info, FabStep step)
        {
            if (step == null)
            {
                return;
            }

            if (info.HasQTime() == false)
            {
                return;
            }

            info.MinList = info.List.FindAll(t => t.IsMatched(step, QTimeType.MIN));
            info.MaxList = info.List.FindAll(t => t.IsMatched(step, QTimeType.MAX));
        }
예제 #4
0
        private static void StepChange_Prev(this StayHour info, FabStep prevStep, DateTime now)
        {
            if (prevStep != null)
            {
                if (prevStep.StepID == info.FromStep.StepID)
                {
                    info.FromStepOutTime = now;
                }

                if (prevStep.StepID == info.ToStep.StepID)
                {
                    info.ToStepInTime = now;
                }
            }
        }
예제 #5
0
        private static bool IsMatched(this StayHour info, FabStep step, QTimeType qtype)
        {
            if (step == null)
            {
                return(false);
            }

            if (info.QType != qtype)
            {
                return(false);
            }


            return(info.IsMatchedStep(step));
        }
예제 #6
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        public List <FabLot> GetHoldWipList(FabStep step, string prodVer)
        {
            List <FabLot> result = new List <FabLot>();
            var           list   = GetStepWipList(step, WipType.Wait, prodVer);

            foreach (var item in list)
            {
                if (item.IsHold)
                {
                    result.Add(item);
                }
            }

            return(result);
        }
예제 #7
0
        /// <summary>
        /// </summary>
        /// <param name="syncPart"/>
        /// <param name="wips"/>
        /// <param name="handled"/>
        public void INITIALIZE_SYNC_PART_INFO0(SyncPartInfo syncPart, IList <IHandlingBatch> wips, ref bool handled)
        {
            if (SimHelper.IsCellRunning)
            {
                return;
            }

            var list = wips.Where(x => (x as FabLot).Product == syncPart.TftPart ||
                                  (x as FabLot).Product == syncPart.CfPart);

            if (list == null)
            {
                return;
            }

            foreach (var hb in list)
            {
                var lot = hb as FabLot;

                FabStep step = lot.WipInfo.InitialStep as FabStep;
                if (step.IsPassCfSyncInStep == false)
                {
                    continue;
                }

                //FabProduct cellInProduct = BopHelper.GetCellInProduct(product);

                //if (cellInProduct == null)
                //    continue;

                //SyncProfile prof;
                //if (profiles.TryGetValue(cellInProduct, out prof) == false)
                //    continue;

                //CellInCompProfile comp;
                //if (prof.Profiles.TryGetValue(product.ProductID, out comp) == false)
                //    continue;

                //AgentHelper.AddLotProfile(comp, CreateHelper.CreateLotProfile(lot, DateTime.MinValue));

                //var syncPartInfo = manager.GetSyncPart(cellInProduct);
                //if (syncPartInfo == null)
                //    continue;

                var profileLot = new LotProfile(lot, DateTime.MinValue);
                syncPart.AddProfileLot(profileLot, lot.CurrentShopID == Constants.ArrayShop);
            }
        }
예제 #8
0
        public static void AddCurrentPlan(this FabPegPart pp, FabProduct prod, FabStep step)
        {
            if (prod == null || step == null)
            {
                //TODO : Write Error
                return;
            }

            PlanStep plan = new PlanStep();

            plan.Product = prod;
            plan.Step    = step;
            plan.isDummy = step.IsDummy;

            pp.AddCurrentPlan(plan);
        }
예제 #9
0
        private int GetLoadedEqpCount(List <JobState> jobList, FabStep step, string productVersion, bool recalculate)
        {
            if (jobList == null || jobList.Count == 0)
            {
                return(0);
            }

            int cnt = 0;

            foreach (JobState jobState in jobList)
            {
                cnt += jobState.GetLoadedEqpCount(step, productVersion, recalculate);
            }

            return(cnt);
        }
예제 #10
0
        private static Time GetRunTat(FabStep step, string productID)
        {
            if (step == null)
            {
                return(Time.Zero);
            }

            var tat = step.GetTat(productID, true);

            if (tat == null)
            {
                return(Time.Zero);
            }

            return(tat.RunTat);
        }
예제 #11
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        //TODO : jung, Master에 있어야 함
        private int GetStepWips(List <JobState> jobList, FabStep step, WipType wipType, string productVersion)
        {
            if (jobList == null || jobList.Count == 0)
            {
                return(0);
            }

            int wips = 0;

            foreach (JobState jobState in jobList)
            {
                wips += jobState.GetStepWips(step, wipType, productVersion);
            }

            return(wips);
        }
예제 #12
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        /// <summary>
        /// Step의 수량 구하는 함수
        /// </summary>
        public int GetStepWips(FabStep step, WipType wipType, string productVersion = null)
        {
            if (productVersion == null)
            {
                productVersion = Constants.NULL_ID;
            }

            WipVar wipVar;

            if (_stepWips.TryGetValue(step, out wipVar))
            {
                return(wipVar.GetWips(wipType, productVersion));
            }

            return(0);
        }
예제 #13
0
        private static bool IsMatchedStep(this StayHour info, FabStep step)
        {
            if (step == null)
            {
                return(false);
            }

            var find = info.StepList.Find(t => t.StepID == step.StepID);

            if (find != null)
            {
                return(true);
            }

            return(false);
        }
예제 #14
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        //TODO : jung, Master에 있어야함.
        public List <FabLot> GetStepWipList(List <JobState> jobList, FabStep step, WipType wipType, string ProductVer)
        {
            List <FabLot> result = new List <FabLot>();

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

            foreach (var item in jobList)
            {
                result.AddRange(item.GetStepWipList(step, wipType, ProductVer));
            }

            return(result);
        }
예제 #15
0
        public decimal ArriveWithin(FabStep step, WipType type)
        {
            decimal arriveInQty = 0;

            foreach (WipStep ws in this.WipStepList)
            {
                if (ws.TargetStep != step)
                {
                    arriveInQty += ws.LastPt2D.Y;
                    continue;
                }

                return(arriveInQty + ws.ArriveWithin(type));
            }

            return(LastPt2D.Y);
        }
예제 #16
0
        public WipProfile GetWipProfile(FabStep step, string productVer)
        {
            string key = GetWipProfileKey(step, productVer);

            WipProfile wipProfile;

            _wipProfile.TryGetValue(key, out wipProfile);

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

            wipProfile.CalcProfile();

            return(wipProfile);
        }
예제 #17
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        internal List <FabLot> GetPrevStepWipList(FabStep currentStep, WipType wipType, string productVersion)
        {
            List <FabLot> list      = new List <FabLot>();
            var           prevSteps = currentStep.GetPrevSteps(this.ProductID);

            foreach (FabStep prev in prevSteps)
            {
                if (currentStep.NeedVerCheck == false || prev.NeedVerCheck == false)
                {
                    productVersion = Constants.NULL_ID;
                }

                list.AddRange(GetStepWipList(prev, wipType, productVersion));
            }

            return(list);
        }
예제 #18
0
        public static float GetProcTime(this FabStep step, string eqpID, string productID)
        {
            List <StepTime> list;

            if (step.StepTimes.TryGetValue(productID, out list))
            {
                foreach (StepTime st in list)
                {
                    if (st.EqpID == eqpID)
                    {
                        return(st.ProcTime);
                    }
                }
            }

            return(0f);
        }
예제 #19
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        internal int GetCurrenStepWaitWipQty(AoEquipment aeqp, FabStep currentStep, string productVersion, decimal allowRunDownTime)
        {
            if (allowRunDownTime <= 0)
            {
                return(0);
            }

            FabAoEquipment eqp = aeqp.ToFabAoEquipment();

            List <FabLot> wips = GetStepWipList(currentStep, WipType.Wait, productVersion);

            int qty = 0;

            foreach (var lot in wips)
            {
                //해당 설비에서 로딩가능한 대기재공인지 Lot
                if (eqp != null && EqpArrangeMaster.IsLoadable_CheckOnly(eqp, lot) == false)
                {
                    continue;
                }

                //잔여 AllowTime 안에 Hold가 풀리는지
                if (lot.IsHold)
                {
                    Time remainHold = lot.HoldTime - (eqp.NowDT - lot.HoldStartTime);

                    if ((decimal)remainHold.TotalHours > allowRunDownTime)
                    {
                        continue;
                    }
                }

                //Min Qtime (최소대기시간) 내에 풀리는지?
                if (lot.CurrentFabPlan.LotFilterInfo.FilterType == DispatchFilter.MinQtime)
                {
                    if ((decimal)lot.CurrentFabPlan.LotFilterInfo.RemainMinStayTime.TotalHours > allowRunDownTime)
                    {
                        continue;
                    }
                }

                qty += lot.UnitQty;
            }

            return(qty);
        }
예제 #20
0
파일: Route.cs 프로젝트: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="lot"/>
        /// <param name="task"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public LoadInfo CREATE_LOAD_INFO0(Mozart.SeePlan.Simulation.ILot lot, Mozart.SeePlan.DataModel.Step task, ref bool handled, Mozart.SeePlan.DataModel.LoadInfo prevReturnValue)
        {
            FabLot  flot = lot as FabLot;
            FabStep step = task as FabStep;

            FabPlanInfo info = new FabPlanInfo(step);

            info.ShopID  = step.ShopID;
            info.LotID   = flot.LotID;
            info.Product = flot.FabProduct;
            info.UnitQty = flot.UnitQty;

            info.ProductID = info.Product.ProductID;
            info.ProcessID = info.Product.ProcessID;

            info.OwnerType = flot.OwnerType;
            info.OwnerID   = flot.OwnerID;

            //Change ProductVersion
            flot.CurrentProductVersion = step.IsArrayShop ? flot.OrigProductVersion : "00001";

            info.ProductVersion = flot.CurrentProductVersion;

            if (flot.CurrentProcessID != info.ProcessID)
            {
                flot.Route = step.Process;
            }

            info.WipInfo = flot.Wip;
            info.Lot     = flot;

            info.LotFilterInfo             = new LotFilterInfo();
            info.LotFilterInfo.FilterType  = DispatchFilter.None;
            info.LotFilterInfo.Reason      = Constants.NULL_ID;
            info.LotFilterInfo.RecipeTimes = new Dictionary <string, EqpRecipeInfo>();

            if (flot.PlanSteps == null)
            {
                flot.PlanSteps = new List <string>();
            }

            flot.PlanSteps.Add(step.StepKey);

            return(info);
        }
예제 #21
0
        public void CalcWipProfile(FabStep step, FabWeightPreset wp, AoEquipment inputEqp)
        {
            StepRouteInfo info = GetStepRouteInfo(step);

            if (info == null)
            {
                return;
            }


            foreach (var prodVer in info.VersionList)
            {
                string key = GetWipProfileKey(step, prodVer);

                WipProfile wipProfile = CreateWipProfile(step, prodVer, 0, wp, inputEqp, 0, false);
                _wipProfile[key] = wipProfile;
            }
        }
예제 #22
0
        public static StepTime CreateAverageStepTime(FabStep step, FabEqp eqp, string productID, float tact, float proc, string reason)
        {
            StepTime st = CreateHelper.CreateStepTime(eqp, step, productID, tact, proc);

            List <StepTime> list;

            if (step.StepTimes.TryGetValue(productID, out list) == false)
            {
                list = new List <StepTime>();
            }

            list.Add(st);

            //TODO : Output:
            //OutputMart.Instance.AppxStepTime.Add(item);

            return(st);
        }
예제 #23
0
        public object GET_LOT_GROUP_KEY0(DispatchingAgent da, IHandlingBatch hb, ref bool handled, object prevReturnValue)
        {
            if (InputMart.Instance.GlobalParameters.ApplyLotGroupDispatching == false)
            {
                return(null);
            }

            FabLot  lot  = hb.ToFabLot();
            FabStep step = lot.CurrentFabStep;

            string stepID    = step.StepID;
            string productID = lot.CurrentProductID;
            string prodVer   = step.NeedVerCheck ? lot.CurrentProductVersion : Constants.NULL_ID;
            string onwerType = lot.OwnerType;
            string onwerID   = lot.OwnerID;

            return(LcdHelper.CreateKey(stepID, productID, prodVer, onwerType, onwerID));
        }
예제 #24
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        public int GetLoadedEqpCount(FabStep step, string productVersion, bool recalculate)
        {
            string        stdStepSeq = step.StdStepID;
            StepRouteInfo dsi        = GetStepRouteInfo(step);

            if (dsi == null)
            {
                return(0);
            }

            if (recalculate)
            {
                //InFlowAgent.GetFabManager(step.StdStep.DspEqpGroup);
            }


            return(dsi.GetLoadedCout(productVersion));
        }
예제 #25
0
        internal static void WriteProductRoute()
        {
            foreach (var prod in InputMart.Instance.FabProduct.Values)
            {
                //Array제품이 BOP상 CF에도 등록되어 있으므로 제외
                if (prod.IsArrayShopProduct() && IsCfShop(prod.ShopID))
                {
                    continue;
                }

                FabStep    firstStep   = prod.Process.FirstStep as FabStep;
                FabProduct nextProd    = prod;
                FabStep    currentStep = firstStep;
                FabStep    prvStep     = null;

                float idx = 0;
                while (true)
                {
                    idx++;
                    WriteProductRoute(nextProd, currentStep, idx);

                    WriteAdditionalSubStep(nextProd, currentStep, prvStep, idx);

                    FabStep nextStep = currentStep.GetNextStep(nextProd, ref nextProd);
                    if (nextStep == null)
                    {
                        break;
                    }

                    prvStep     = currentStep;
                    currentStep = nextStep;

                    if (idx > 200)
                    {
                        break;
                    }
                }

                foreach (FabStep step in prod.FabProcess.NonPathSteps.Values)
                {
                    WriteProductRoute(prod, step, 999);
                }
            }
        }
예제 #26
0
        private decimal GetStayWaitTime(List <JobState> jobList, FabStep rStep, string prodVer)
        {
            var waitList = GetStepWipList(rStep, WipType.Wait, prodVer);

            DateTime minDate = DateTime.MaxValue;

            foreach (var lot in waitList)
            {
                DateTime targetTime = lot.DispatchInTime;

                if (lot.CurrentState == EntityState.HOLD)
                {
                    targetTime = lot.HoldStartTime.AddMinutes(lot.HoldTime.TotalMinutes);
                }

                if (targetTime == DateTime.MinValue)
                {
                    continue;                     //나오면안됨.
                }
                if (targetTime < minDate)
                {
                    minDate = targetTime;
                }
            }

            if (minDate == DateTime.MaxValue)
            {
                return(0);
            }

            if (AoFactory.Current.NowDT < minDate)
            {
                return(0);
            }

            var stay = AoFactory.Current.NowDT - minDate;

            if (stay.TotalSeconds > 0)
            {
                Console.WriteLine();
            }

            return(Convert.ToDecimal(stay.TotalSeconds));
        }
예제 #27
0
        internal static FabStep CreateDummyStep(string factoryID, string shopID, string stepID)
        {
            FabStep step = new FabStep(stepID);

            step.FactoryID = factoryID;
            step.ShopID    = shopID;
            step.StepType  = "DUMMY";
            step.IsDummy   = true;

            FabStdStep stdStep = new FabStdStep();

            stdStep.FactoryID = factoryID;
            stdStep.AreaID    = shopID;
            stdStep.StepID    = stepID;

            step.StdStep = stdStep;

            return(step);
        }
예제 #28
0
        public static Time RemainTime(this StayHour info, FabLot lot, FabStep step, DateTime now)
        {
            //제약 발생 전
            if (info.FromStepOutTime == DateTime.MinValue || info.FromStepOutTime == DateTime.MaxValue)
            {
                return(Time.MaxValue);
            }

            string productID        = lot.CurrentProductID;
            Time   currStepRunTat   = GetRunTat(step, productID);
            Time   afterTat         = info.GetAfterTat(lot, step);
            Time   toStepRunTat     = info.GetToStepRunTat(productID);
            Time   afterStepNeedTat = currStepRunTat + afterTat - toStepRunTat;

            Time stayTime   = (now - info.FromStepOutTime);
            Time remainTime = info.QTime - stayTime - afterStepNeedTat;

            return(remainTime);
        }
예제 #29
0
        public static List <FabInnerBom> GetNextInnerBom(this FabProduct product, FabStep step)
        {
            List <FabInnerBom> bom = new List <FabInnerBom>();

            if (SimHelper.IsCellRunning && step.StepID == Constants.CellInStepID)
            {
                return(null);
            }

            foreach (FabInnerBom it in product.NextInnerBoms)
            {
                if (it.OriginStep == step)
                {
                    bom.Add(it);
                }
            }

            return(bom.Count == 0 ? null : bom);
        }
예제 #30
0
        private static void StepChange(this QTimeInfo info, FabStep prevStep, FabStep currStep, DateTime now)
        {
            var lot = info.Lot;

            if (lot == null)
            {
                return;
            }

            if (info.HasQTime() == false)
            {
                return;
            }

            info.StepChange_Prev(prevStep, now);

            info.SetMatchedList(currStep);
            info.StepChange_Curr(currStep, now);
        }