예제 #1
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        private void CreateByVersionInfo()
        {
            List <string> vers = EqpArrangeMaster.GetProdVerList(this.StdStep, this.ProductID, Constants.NULL_ID);

            foreach (var item in vers)
            {
                string ver = item;
                if (LcdHelper.IsAllID(item))
                {
                    ver = Constants.NULL_ID;
                }

                if (this.VersionList.Contains(ver) == false)
                {
                    this.VersionList.Add(ver);
                }
            }

            foreach (var item in VersionList)
            {
                StepRouteByProdVersion info;
                if (_verList.TryGetValue(item, out info) == false)
                {
                    _verList.Add(item, info = new StepRouteByProdVersion(this, item));
                }
            }
        }
예제 #2
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);
        }
예제 #3
0
        internal static List <FabSubEqp> GetLoadableSubEqpsByTriggerSubEqp(this FabSubEqp triggerSubEqp, FabLot lot)
        {
            List <FabSubEqp> loadableList = new List <FabSubEqp>();

            //group별 운영
            var group = triggerSubEqp.SubEqpGroup;

            if (group != null && group.SubEqps != null)
            {
                var list = group.SubEqps.Values.ToList();
                foreach (var subEqp in list)
                {
                    if (loadableList.Contains(subEqp))
                    {
                        continue;
                    }

                    //check eqpArrange (subEqp)
                    if (EqpArrangeMaster.IsLoadable_ParallelChamber(subEqp, lot) == false)
                    {
                        continue;
                    }

                    loadableList.Add(subEqp);
                }
            }

            return(loadableList);
        }
예제 #4
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        public void BuildStepRouteInfo(string productVer)
        {
            List <string> eqps = EqpArrangeMaster.GetLoadableEqpList(this.StdStep, this.ProductID, productVer);

            if (eqps != null)
            {
                this.LoadableEqps.AddRange(eqps);
                AddLoadableAoEqp(AoFactory.Current.Equipments);
            }

            //CHECK : jung : LoadableEqp 수량 중복으로 계산함.바로 위에도 있고 해당 함수안에도 있음.
            this.TactSec = TimeHelper.GetAvgTactTime(this.Step, this.Product, productVer);
            this.RunTAT  = TimeHelper.GetAvgProcTime(this.Step, this.Product, productVer);

            //step.LeadTime Hour --> Sec 변환
            var tatInfo = this.Step.GetTat(this.ProductID, true);

            if (tatInfo != null)
            {
                this.WaitTAT = Convert.ToDecimal(tatInfo.TAT * 60) - this.RunTAT;
            }

            if (this.WaitTAT < 0)
            {
                this.WaitTAT = 600;
            }
        }
예제 #5
0
        private static bool IsLoadableDummy(FabAoEquipment eqp, FabLot dummy, decimal inflowHours)
        {
            var now = eqp.NowDT;

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

            if (last == null)
            {
                return(false);
            }

            //M제약에 의해 진행 중인 last의 Arrange가 없어진 경우
            if (EqpArrangeMaster.IsLoadable(eqp, dummy) == false)
            {
                return(false);
            }

            var currEA = dummy.CurrentEqpArrange;

            if (currEA == null || currEA.IsLoableByProductVersion(last.ProductVersion) == false)
            {
                return(false);
            }

            string reason = string.Empty;

            if (FilterMaster.IsEqpRecipeTime(eqp, dummy, now.AddHours((double)inflowHours), ref reason) == false)
            {
                return(false);
            }

            //Dummy Mask 확인
            if (FilterMaster.IsLoadableToolArrange(eqp, dummy, false) == false)
            {
                return(false);
            }

            //MixRun(ParallelChamber)
            if (eqp.IsParallelChamber)
            {
                var subEqp = eqp.TriggerSubEqp;
                if (subEqp != null)
                {
                    if (subEqp.IsLoadable(last.FabStep, now) == false)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #6
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);
        }
예제 #7
0
        internal static bool IsMatched(this FabPlanInfo info, string shopID, string stepID,
                                       string productID, string productVersion, string ownerType, string ownerID, bool checkProductVersion)
        {
            if (info == null)
            {
                return(false);
            }

            if (info.ShopID != shopID)
            {
                return(false);
            }

            if (info.StepID != stepID)
            {
                return(false);
            }

            if (info.ProductID != productID)
            {
                return(false);
            }

            if (checkProductVersion)
            {
                var stdStep = info.FabStep.StdStep;
                if (EqpArrangeMaster.IsFixedProductVer(stdStep, productVersion))
                {
                    if (info.ProductVersion != productVersion)
                    {
                        return(false);
                    }
                }
            }

            if (info.OwnerType != ownerType)
            {
                return(false);
            }

            //TODO : OwnerID 추가 필요
            //if (info.OwnerID != ownerID)
            //    return false;

            return(true);
        }
예제 #8
0
파일: JobState.cs 프로젝트: yichunbong/CSOT
        /// <summary>
        /// 나의 직전 Step(Sub포함) Target시간+Move시간(잔여시간) 이내에 TrackOut 될 수 있는 Lot수량
        /// </summary>
        internal int GetPrevStepRunWipQty(AoEquipment aeqp, FabStep currentStep, string productVersion, DateTime targetTime)
        {
            List <FabLot> runWips = GetPrevStepWipList(currentStep, WipType.Run, productVersion);

            int qty = 0;

            foreach (var lot in runWips)
            {
                if (EqpArrangeMaster.IsLoadable_CheckOnly(aeqp as FabAoEquipment, lot))
                {
                    continue;
                }

                FabPlanInfo plan = lot.CurrentFabPlan;

                if (plan.IsLoaded)
                {
                    AoEquipment prevEqp   = AoFactory.Current.GetEquipment(plan.LoadedResource.Key);
                    AoProcess   proc      = prevEqp.Processes[0];
                    Time        tkOutTime = proc.GetUnloadingTime(lot);
                    tkOutTime += TransferMaster.GetTransferTime(prevEqp, aeqp);

                    if (targetTime < tkOutTime)
                    {
                        continue;
                    }
                }
                else
                {
                    Time tkOutTime = plan.TrackInTime + plan.AoBucketTime;

                    if (targetTime < tkOutTime)
                    {
                        continue;
                    }
                }

                qty += lot.UnitQty;
            }

            return(qty);
        }
예제 #9
0
        public static decimal GetAvgProcTime(FabStep step, FabProduct prod, string productVersion)
        {
            if (step.AvgFlowTime < 0)
            {
                List <string> list = EqpArrangeMaster.GetLoadableEqpList(step.StdStep, prod.ProductID, productVersion);
                if (list == null)
                {
                    StepTat tat = step.GetTat(prod.ProductID, true);
                    if (tat != null)
                    {
                        step.AvgFlowTime = Convert.ToDecimal(tat.TAT * 60);
                    }

                    return(step.AvgFlowTime);
                }

                decimal n = list.Count;
                decimal s = 0;

                foreach (string eqpID in list)
                {
                    StepTime st = step.GetStepTime(eqpID, prod.ProductID);

                    if (st == null || st.ProcTime <= 0)
                    {
                        continue;
                    }

                    s = s + Convert.ToDecimal(1d / st.ProcTime);
                }

                if (s > 0m)
                {
                    step.AvgFlowTime = Math.Round(n / (decimal)s, 2);
                }
                else
                {
                    step.AvgFlowTime = (decimal)SiteConfigHelper.GetDefaultFlowTime().TotalSeconds;
                }
            }
            return(step.AvgFlowTime);
        }
예제 #10
0
        public static WaitingWipInfo GetTargetStepWaitingWip(string stepID)
        {
            var eqps        = EqpArrangeMaster.GetStepAssignedEqps(stepID);
            var waitingInfo = new WaitingWipInfo();

            waitingInfo.TargetStepID = stepID;

            HashSet <FabLot> results = new HashSet <FabLot>();

            foreach (var it in eqps)
            {
                //var targetEqp = AoFactory.Current.GetEquipment(it);

                var lots = AoFactory.Current.WipManager.InEqps(it, WipTags.Agent.Waiting);
                foreach (FabLot lot in lots)
                {
                    if (waitingInfo.TargetStepID != lot.CurrentStepID)
                    {
                        continue;
                    }

                    if (results.Contains(lot))
                    {
                        continue;
                    }

                    results.Add(lot);

                    string key = lot.CurrentProductID;
                    if (!waitingInfo.QtyByProductID.ContainsKey(key))
                    {
                        waitingInfo.QtyByProductID.Add(key, 0);
                    }

                    waitingInfo.QtyByProductID[key] += lot.UnitQty;
                    waitingInfo.TotQty += lot.UnitQty;
                }
            }

            return(waitingInfo);
        }
예제 #11
0
        public static decimal GetAvgTactTime(FabStep step, FabProduct prod, string productVersion)
        {
            if (step.AvgTactTime < 0)
            {
                List <string> eqps = EqpArrangeMaster.GetLoadableEqpList(step.StdStep, prod.ProductID, productVersion);

                if (eqps == null)
                {
                    step.AvgTactTime = 0;
                    return(step.AvgTactTime);
                }

                int n = eqps == null ? 0 : eqps.Count;

                decimal s = 0;
                foreach (string eqpID in eqps)
                {
                    StepTime tactTime = step.GetStepTime(eqpID, prod.ProductID);

                    if (tactTime == null || tactTime.TactTime <= 0)
                    {
                        continue;
                    }

                    s += Convert.ToDecimal(1d / tactTime.TactTime);
                }

                if (s > 0m)
                {
                    step.AvgTactTime = n / s;
                }
                else
                {
                    step.AvgTactTime = (decimal)SiteConfigHelper.GetDefaultTactTime().TotalSeconds;
                }
            }

            return(step.AvgTactTime);
        }
예제 #12
0
        public static int GetContinuousQty(FabLot lot, FabStep baseStep, bool includeFromStep = false)
        {
            if (baseStep == null)
            {
                return(0);
            }

            var jobState = GetJobState(lot);

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

            string productID      = lot.CurrentProductID;
            string productVersion = lot.CurrentProductVersion;

            bool isFixedProductVer = EqpArrangeMaster.IsFixedProductVer(baseStep.StdStep, productVersion);

            if (isFixedProductVer == false)
            {
                productVersion = Constants.NULL_ID;
            }

            int continuousQty = 0;

            if (includeFromStep)
            {
                //run
                int runWipQty = jobState.GetStepWips(baseStep, WipType.Run, productVersion);
                if (runWipQty <= 0)
                {
                    return(continuousQty);
                }

                continuousQty += runWipQty;

                //wait
                int waitWipQty = jobState.GetStepWips(baseStep, WipType.Wait, productVersion);
                if (waitWipQty <= 0)
                {
                    return(continuousQty);
                }

                continuousQty += waitWipQty;
            }

            var pevStepList = baseStep.GetPrevSteps(productID);

            if (pevStepList != null && pevStepList.Count > 0)
            {
                //run
                int runWipQty = 0;
                foreach (var prevStep in pevStepList)
                {
                    runWipQty += jobState.GetStepWips(prevStep, WipType.Run, productVersion);
                }

                if (runWipQty <= 0)
                {
                    return(continuousQty);
                }

                continuousQty += runWipQty;

                //wait
                int waitWipQty = 0;
                foreach (var prevStep in pevStepList)
                {
                    waitWipQty += jobState.GetStepWips(prevStep, WipType.Wait, productVersion);
                }

                if (waitWipQty <= 0)
                {
                    return(continuousQty);
                }

                continuousQty += waitWipQty;
            }

            return(continuousQty);
        }
예제 #13
0
        private static List <FabSubEqp> GetLoadableList(this TriggerSubEqpInfo info, FabLot lot, DateTime now)
        {
            List <FabSubEqp> loadableList = new List <FabSubEqp>();

            if (info == null)
            {
                return(loadableList);
            }

            var triggerSubEqp = info.TriggerSubEqp;

            if (triggerSubEqp == null)
            {
                return(loadableList);
            }

            loadableList.Add(triggerSubEqp);

            //개별 운영
            //var list = info.AvailableList;
            //if (list == null || list.Count == 0)
            //	return loadableList;

            //foreach (var subEqp in list)
            //{
            //	if (loadableList.Contains(subEqp))
            //		continue;

            //	if (subEqp.GroupID != triggerSubEqp.GroupID)
            //		continue;

            //	//check eqpArrange (subEqp)
            //	if (EqpArrangeMaster.IsLoadable_ParallelChamber(subEqp, lot) == false)
            //		continue;

            //	//check state
            //	if (subEqp.IsLoadable(lot.CurrentFabStep, now) == false)
            //		continue;

            //	loadableList.Add(subEqp);
            //}

            //group별 운영
            var group = triggerSubEqp.SubEqpGroup;

            if (group != null && group.SubEqps != null)
            {
                var list = group.SubEqps.Values.ToList();
                foreach (var subEqp in list)
                {
                    if (loadableList.Contains(subEqp))
                    {
                        continue;
                    }

                    //check eqpArrange (subEqp)
                    if (EqpArrangeMaster.IsLoadable_ParallelChamber(subEqp, lot) == false)
                    {
                        continue;
                    }

                    loadableList.Add(subEqp);
                }
            }

            return(loadableList);
        }