Esempio n. 1
0
        public static void SetUsedArrange(this CurrentArrange item, string productVersion)
        {
            item.UsedMaskProductVersion = productVersion;

            var list = item.LoadableList;

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

            if (list.Count > 1)
            {
                list.Sort(new EqpArrangeInfoComparer2(productVersion));
            }

            item.UsedEqpArrange = list[0];

            if (string.IsNullOrEmpty(item.UsedMaskProductVersion))
            {
                //Mask 미사용 옵션, Arrange의 ProductVersion으로 대체(??)
                if (LcdHelper.Equals(item.UsedEqpArrange.ProductVer, "ALL") == false)
                {
                    item.UsedMaskProductVersion = item.UsedEqpArrange.ProductVer;
                }
            }
        }
Esempio n. 2
0
        private static void SetWipStayHours(this QTimeInfo info, string lotID, DateTime planStartTime)
        {
            if (info.HasQTime() == false)
            {
                return;
            }

            foreach (var it in info.List)
            {
                string fromStepID = it.FromStep.StepID;
                var    finds      = InputMart.Instance.WipStayHoursDict.FindRows(lotID, fromStepID);
                if (finds == null)
                {
                    continue;
                }

                var find = finds.FirstOrDefault();
                if (find == null)
                {
                    continue;
                }

                DateTime fromStepOutTime = LcdHelper.Min(find.FROM_STEP_OUT_TIME, planStartTime);
                if (fromStepOutTime == DateTime.MinValue)
                {
                    continue;
                }

                it.FromStepOutTime = fromStepOutTime;
            }
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        internal static LineType GetLineType(this FabAoEquipment eqp)
        {
            if (eqp == null)
            {
                return(LineType.NONE);
            }

            string eqpID = LcdHelper.ToUpper(eqp.EqpID);

            if (eqp != null && eqpID.Contains("UPH"))
            {
                return(LineType.SUB);
            }

            var preset = eqp.Preset;

            if (preset != null)
            {
                string presetID = LcdHelper.ToUpper(preset.Name);
                if (presetID != null & presetID.Contains("ULINE"))
                {
                    return(LineType.SUB);
                }
            }

            return(LineType.MAIN);
        }
Esempio n. 5
0
        public static string GetDefaultPhotoStep(string shopID)
        {
            try
            {
                string groupCode = Constants.CONF_ENG_DEFAULT_VALUE;
                string codeName  = string.Format("DEFAULT_PHOTO_STEP_{0}", shopID);

                string codeValue;
                if (ConfigHelper.TryGetValue(groupCode, codeName, out codeValue))
                {
                    return(codeValue);
                }
            }
            catch { }

            const string ARRAY_PHOTO_STEP = "1300;3300;4300;5300";
            const string CF_PHOTO_STEP    = "R300;G300;B300;S300";

            if (LcdHelper.Equals(shopID, Constants.ArrayShop))
            {
                return(ARRAY_PHOTO_STEP);
            }

            if (LcdHelper.Equals(shopID, Constants.CfShop))
            {
                return(CF_PHOTO_STEP);
            }

            return(string.Empty);
        }
Esempio n. 6
0
        private static float GetAdditionalSetupTime(string eqpGroupID, string stepID, string productID, float idleTime)
        {
            float addSetupTime = 0f;

            var finds = InputMart.Instance.SetupTimeIdlebyStep.FindRows(eqpGroupID, stepID).ToList();

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

            //product matched
            var matchList = finds.FindAll(t => t.PRODUCT_ID == productID);

            //all
            if (matchList == null || matchList.Count == 0)
            {
                matchList = finds.FindAll(t => LcdHelper.Equals(t.PRODUCT_ID, "ALL"));
            }

            var list = matchList.FindAll(t => t.IDLE_TIME <= idleTime);

            if (list != null && list.Count > 0)
            {
                //range matched
                list.Sort(new CompareHelper.SetupTimeIdleComparer());
                addSetupTime = list[0].SETUP_TIME;
            }

            return(addSetupTime);
        }
Esempio n. 7
0
        public static bool AvailableChangeProductVer(FabStdStep stdStep, string productVer)
        {
            string shopID = stdStep.ShopID;
            string stepID = stdStep.StepID;

            //1300 이전 공정 이면서 Ver에 X가 없는 Version은 변경 투입 가능함.
            if (BopHelper.IsArrayShop(shopID))
            {
                if (IsProductVer_X(productVer) == false)
                {
                    if (LcdHelper.Equals(Constants.GATE_PHOTO_STEP, stepID))
                    {
                        return(true);
                    }

                    //1300 이전 공정은 ProductVersion 변경가능 함.
                    var fromStep = BopHelper.FindStdStep(Constants.ArrayShop, Constants.GATE_PHOTO_STEP);
                    if (fromStep != null)
                    {
                        if (stdStep.StepSeq <= fromStep.StepSeq)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Esempio n. 8
0
        private static DateTime GetAvailableSetupTime(FabAoEquipment eqp, DateTime now)
        {
            DateTime availableTime = eqp.AvailableSetupTime;

            //마스크 사용시
            if (eqp.InUseMask != null)
            {
                //실제Setup시 Seize된 툴이 들어옴. 현재 이전의 LoadInfo을 참조해야함.
                if (eqp.InUseMask.LoadInfos.Count > 1)
                {
                    MaskLoadInfo loadInfo = eqp.InUseMask.LoadInfos[eqp.InUseMask.LoadInfos.Count - 2];
                    if (loadInfo.EqpID != eqp.EqpID)
                    {
                        availableTime = LcdHelper.Max(eqp.AvailableSetupTime, (DateTime)loadInfo.AvailableTime);

                        if (availableTime > now)
                        {
                            availableTime = now;
                        }
                    }
                }
            }

            return(availableTime);
        }
Esempio n. 9
0
        public int GetWips(WipType wipType, string productVersion)
        {
            List <FabLot> list = GetWipList(wipType);

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

            int wipQty = 0;

            foreach (FabLot lot in list)
            {
                if (LcdHelper.IsEmptyID(productVersion))
                {
                    wipQty += lot.UnitQty;
                }
                else if (lot.OrigProductVersion == productVersion)
                {
                    wipQty += lot.UnitQty;
                }
            }

            return(wipQty);
        }
Esempio n. 10
0
        private static void WriteWeightPresetLog(FabWeightPreset preset)
        {
            if (preset == null)
            {
                return;
            }

            string presetID    = preset.Name;
            string mapPresetID = preset.MapPresetID;

            foreach (FabWeightFactor factor in preset.FactorList)
            {
                Outputs.WeightPresetLog row = new WeightPresetLog();

                row.VERSION_NO    = ModelContext.Current.VersionNo;
                row.PRESET_ID     = presetID;
                row.MAP_PRESET_ID = mapPresetID;
                row.FACTOR_ID     = factor.Name;
                row.FACTOR_TYPE   = factor.Type.ToString();
                row.FACTOR_WEIGHT = factor.Factor;
                row.FACTOR_NAME   = Constants.NULL_ID;
                row.SEQUENCE      = (int)factor.Sequence;
                row.ORDER_TYPE    = factor.OrderType.ToString();
                row.CRITERIA      = factor.OrigCriteria;
                row.ALLOW_FILTER  = LcdHelper.ToStringYN(factor.IsAllowFilter);

                OutputMart.Instance.WeightPresetLog.Add(row);
            }
        }
Esempio n. 11
0
        internal static IList <IMaterial> GetBankWip(PegPart pegPart)
        {
            FabPegPart pp   = pegPart.ToFabPegPart();
            FabProduct prod = pp.Current.Product;
            FabStep    step = pp.Current.Step;

            string key = LcdHelper.CreateKey(step.ShopID, step.StepID);

            List <FabPlanWip> list;

            CellBankPlanWips.TryGetValue(key, out list);

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

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

            foreach (var item in list)
            {
                if (item.ProductID == prod.ProductID)
                {
                    result.Add(item);
                }
            }

            return(result);
        }
Esempio n. 12
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);
        }
Esempio n. 13
0
        internal static CellBom FindCellBomAtFrom(string productID, string prodVer, CellActionType actionType)
        {
            List <CellBom> list = GetCellBomAtFrom(productID, actionType);

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

            CellBom bom = null;

            foreach (var item in list)
            {
                if (actionType != CellActionType.None && item.ActionType != actionType)
                {
                    continue;
                }

                if (LcdHelper.IsEmptyID(item.CellCode))
                {
                    continue;
                }

                if (prodVer != Constants.ALL && prodVer != item.FromProductVer)
                {
                    continue;
                }

                bom = item;
                break;
            }

            return(bom);
        }
Esempio n. 14
0
        private static void AddItem(this EqpArrangeSet setInfo, EqpArrangeInfo item)
        {
            if (item == null)
            {
                return;
            }

            //All Items
            LcdHelper.AddSort(setInfo.Items, item, EqpArrangeInfoComparer.Default);

            //Group Items
            //SubEqp는 defaultArrange 미지정, 모두 Default로 처리(2019.09.07)
            bool isDefault = setInfo.IsSubEqp ? true : LcdHelper.Equals(item.LimitType, setInfo.DefaultArrange);

            var    groups   = isDefault ? setInfo.DefaultGroups : setInfo.EtcGroups;
            string groupKey = item.GetGroupKey();

            List <EqpArrangeInfo> list;

            if (groups.TryGetValue(groupKey, out list) == false)
            {
                groups.Add(groupKey, list = new List <EqpArrangeInfo>());
            }

            LcdHelper.AddSort(list, item, EqpArrangeInfoComparer.Default);
        }
Esempio n. 15
0
        public static bool IsFixedProductVer(FabStdStep stdStep, string productVer)
        {
            string shopID = stdStep.ShopID;

            //Ver는 Array Shop에서만 유효
            if (BopHelper.IsArrayShop(shopID) == false)
            {
                return(false);
            }

            //1300 ~ 5300 공정까지만 ProductVersion 유효(2020.01.13 - by.liujian(유건))
            //5300 이후 ProductVersion 무시
            var toStep = BopHelper.FindStdStep(Constants.ArrayShop, Constants.ITO_PHOTO_STEP);

            if (toStep != null)
            {
                if (stdStep.StepSeq > toStep.StepSeq)
                {
                    return(false);
                }
            }

            //1300 이전 공정 이면서 Ver에 X가 없는 Version은 변경 투입 가능함.
            if (AvailableChangeProductVer(stdStep, productVer))
            {
                return(false);
            }

            if (LcdHelper.IsEmptyID(productVer))
            {
                return(false);
            }

            return(true);
        }
Esempio n. 16
0
        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));
                }
            }
        }
Esempio n. 17
0
        private static bool IsVersionChange(string fromVersion, string toVersion)
        {
            if (LcdHelper.IsEmptyID(fromVersion))
            {
                return(true);
            }

            return(fromVersion != toVersion);
        }
Esempio n. 18
0
        private static Time GetMaskTransferTime(string from, string to)
        {
            if (LcdHelper.IsEmptyID(from))
            {
                return(Time.FromMinutes(30));
            }

            return(Time.FromMinutes(60));
        }
Esempio n. 19
0
        public static bool IsSameID(this string p)
        {
            if (LcdHelper.Equals(p, Constants.SAME))
            {
                return(true);
            }

            return(false);
        }
Esempio n. 20
0
        public static bool IsAllID(this string p)
        {
            if (LcdHelper.Equals(p, Constants.ALL))
            {
                return(true);
            }

            return(false);
        }
Esempio n. 21
0
        public static bool IsOtherID(this string p)
        {
            if (LcdHelper.Equals(p, Constants.OTHER))
            {
                return(true);
            }

            return(false);
        }
Esempio n. 22
0
        private static bool IsMatched(string arrangeStr, string targetStr)
        {
            if (LcdHelper.Equals(arrangeStr, "ALL") || LcdHelper.Equals(targetStr, "ALL"))
            {
                return(true);
            }

            return(arrangeStr == targetStr);
        }
Esempio n. 23
0
        private static EqpArrangeSet ImportEqpArrangeSet(string key, string eqpID, FabEqp targetEqp, string stepID,
                                                         string productID, string productVer, FabStdStep stdStep, bool isFixedProductVer, bool isSubEqp)
        {
            //SubEqp의 경우는 defaultArrange 미지정
            string defaultArrange = isSubEqp ? null : stdStep.DefaultArrange;

            EqpArrangeSet setInfo = new EqpArrangeSet
            {
                Key                  = key,
                EqpID                = eqpID,
                TargetEqp            = targetEqp,
                StepID               = stepID,
                ProductID            = productID,
                ProductVer           = productVer,
                StdStep              = stdStep,
                DefaultArrange       = defaultArrange,
                DefaultLimitTypeList = LcdHelper.ParseLimitType(defaultArrange),
                IsFixedProductVer    = isFixedProductVer,
                IsSubEqp             = isSubEqp
            };

            var list = GetEqpArrangeInfo(eqpID);

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

            foreach (var arr in list)
            {
                if (arr.ActivateType == ActivateType.NONE)
                {
                    continue;
                }

                //MainRunStep이 등록된 설비의 경우, 타 Step의 M은 무시(2019.06.16 - by.liujian(유건))
                if (arr.ActivateType == ActivateType.M)
                {
                    var mainRunStep = targetEqp.MainRunSteps;
                    if (mainRunStep != null && mainRunStep.Count > 0)
                    {
                        if (mainRunStep.Find(t => t.StepID == stepID) == null)
                        {
                            continue;
                        }
                    }
                }

                if (arr.IsMatched(stepID, productID, productVer, isFixedProductVer))
                {
                    setInfo.AddItem(arr);
                }
            }

            return(setInfo);
        }
Esempio n. 24
0
        public static void AddNextInterBom(this FabProduct prod, FabInterBom bom)
        {
            if (LcdHelper.ArrayContains(prod.NextInterBoms, bom))
            {
                return;
            }

            FabInterBom[] ps = prod.NextInterBoms;

            LcdHelper.ArrayAdd(ref ps, bom);

            prod.NextInterBoms = ps;
        }
Esempio n. 25
0
        public static FabWeightPreset GetWeightPreset(string presetID)
        {
            if (LcdHelper.IsEmptyID(presetID))
            {
                return(null);
            }

            FabWeightPreset preset;

            InputMart.Instance.FabWeightPreset.TryGetValue(presetID, out preset);

            return(preset);
        }
Esempio n. 26
0
        private StepRouteByProdVersion GetStepProdVersion(string productVersion)
        {
            if (LcdHelper.IsEmptyID(productVersion))
            {
                return(null);
            }

            StepRouteByProdVersion info;

            _verList.TryGetValue(productVersion, out info);

            return(info);
        }
Esempio n. 27
0
        private static bool IsWaitSmallSizeLot(AoEquipment aeqp, JobFilterInfo info, FabLot lot, double waitQty, double setupTime, double ratio, StepTime st)
        {
            var step = lot.CurrentFabStep;

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

            var stdStep = step.StdStep;

            if (stdStep == null || stdStep.IsInputStep)
            {
                return(false);
            }

            FabAoEquipment eqp = aeqp.ToFabAoEquipment();

            TimeSpan firstInflowTime = TimeSpan.FromMinutes(setupTime);
            decimal  allowTime       = 3m;

            WeightFactor wf;

            WeightHelper.TryGetEqpWeightFactor(eqp, Constants.WF_ALLOW_RUN_DOWN_TIME, out wf);
            if (wf != null)
            {
                allowTime = (decimal)wf.Criteria[0];
            }

            double inflowQty1 = Convert.ToDouble(InFlowAgent.GetInflowQty(info, aeqp, (decimal)firstInflowTime.TotalHours, 0));
            double inflowQty2 = Convert.ToDouble(InFlowAgent.GetInflowQty(info, aeqp, allowTime, 0));

            double waitQty1 = waitQty + inflowQty1;
            double waitQty2 = waitQty + inflowQty2;

            //Setup 시간 이내에 유입이 있나?
            if (LcdHelper.IsIncludeInRange(waitQty, waitQty1 * 0.95d, waitQty1 * 1.05d))
            {
                //지정된 시간내에 유입재공이 있나?
                if (LcdHelper.IsIncludeInRange(waitQty, waitQty2 * 0.95d, waitQty2 * 1.05d))
                {
                    double requiredSec = st.TactTime * waitQty2;

                    bool isSmall = requiredSec < setupTime * 60 * ratio;

                    return(isSmall);
                }
            }

            return(false);
        }
Esempio n. 28
0
        internal static SimEqpType GetSimType(string simType)
        {
            var type = LcdHelper.ToEnum(simType, SimEqpType.None);

            if (type == SimEqpType.None)
            {
                string upper = simType.ToUpper();

                if (upper == SimEqpType.Inline.ToString().ToUpper())
                {
                    return(SimEqpType.Inline);
                }

                if (upper == SimEqpType.Table.ToString().ToUpper())
                {
                    return(SimEqpType.Table);
                }

                if (upper == SimEqpType.Chamber.ToString().ToUpper())
                {
                    return(SimEqpType.Chamber);
                }

                if (upper == SimEqpType.ParallelChamber.ToString().ToUpper())
                {
                    return(SimEqpType.ParallelChamber);
                }

                if (upper == SimEqpType.LotBatch.ToString().ToUpper())
                {
                    return(SimEqpType.LotBatch);
                }

                if (upper == SimEqpType.BatchInline.ToString().ToUpper())
                {
                    return(SimEqpType.BatchInline);
                }

                if (upper == SimEqpType.Bucket.ToString().ToUpper())
                {
                    return(SimEqpType.Bucket);
                }

                if (upper == SimEqpType.UnitBatch.ToString().ToUpper())
                {
                    return(SimEqpType.UnitBatch);
                }
            }

            return(type);
        }
Esempio n. 29
0
        public static float CheckAheadSetupTime(this FabAoEquipment eqp, float setupTime, FabLot lot)
        {
            DateTime now = eqp.NowDT;
            float    addIdleSetupTime = 0f;

            string stepID    = lot.CurrentStepID;
            string productID = lot.CurrentProductID;

            if (setupTime > 0 && eqp.AvailableSetupTime < now)
            {
                DateTime availableTime   = GetAvailableSetupTime(eqp, now);
                DateTime aheadSetupStart = LcdHelper.Max(availableTime, (now.AddMinutes(-setupTime)));

                //IDLE에 따른 추가 Setup시간 반영 (AheadSetup에 따라 Idle 시간이 판단됨, 추가 IDLE_SETUP TIME은 Ahead미반영)
                addIdleSetupTime = SetupMaster.GetAdditionalSetupTime(eqp, stepID, productID, aheadSetupStart);
                if (addIdleSetupTime > 0)
                {
                    lot.CurrentFabPlan.IsIdleSetup = true;
                }

                if (aheadSetupStart < now)
                {
                    setupTime = setupTime - (float)(now - aheadSetupStart).TotalMinutes;
                    eqp.AvailableSetupTime = aheadSetupStart;

                    if (setupTime == 0 && addIdleSetupTime == 0)
                    {
                        eqp.OnStateChanged(LoadingStates.SETUP, lot);
                    }
                }
                else
                {
                    eqp.AvailableSetupTime = DateTime.MaxValue;
                }

                return(setupTime + addIdleSetupTime);
            }

            //AheadSetup이 아닐 경우(또는 Setup시간이 0 이지만 추가 Setup이 있을 경우 Setup을 함)
            //기존: Setup이 필요하지만 Setup시간이 0이면 Setup을 하지 않음
            //변경 : Setup이 필요하지만 Setup시간이 0 이어도 추가 Setup 정보가 있을 경우 Setup을 함.
            addIdleSetupTime = SetupMaster.GetAdditionalSetupTime(eqp, stepID, productID, now);
            if (addIdleSetupTime > 0)
            {
                lot.CurrentFabPlan.IsIdleSetup = true;
            }

            setupTime += addIdleSetupTime;

            return(setupTime);
        }
Esempio n. 30
0
        internal static bool IsUnpackTargetStep(string shopID, string stepID)
        {
            if (LcdHelper.Equals(shopID, "ARRAY") && stepID == "1200")
            {
                return(true);
            }

            if (LcdHelper.Equals(shopID, "CF") && stepID == "1300")
            {
                return(true);
            }

            return(false);
        }