コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
0
        private static bool TryGetInterRoute(this FabProduct product, FabStep step, out FabInterBom interBom, bool isFromTo)
        {
            interBom = null;

            FabInterBom[] list = isFromTo ? product.NextInterBoms : product.PrevInterBoms;

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

            foreach (FabInterBom it in list)
            {
                if (step.ShopID != it.CurrentShopID ||
                    it.CurrentStep.StepID != step.StepID)
                {
                    continue;
                }

                interBom = it;
                break;
            }

            return(interBom != null);
        }
コード例 #4
0
ファイル: JobState.cs プロジェクト: yichunbong/CSOT
        public JobState(string shopID, FabProduct product, FabStep step, string ownerType)
        {
            this.SampleProd = product;
            this.ProductID  = product.ProductID;
            this.OwnerType  = ownerType;

            _stepWips         = new Dictionary <FabStep, WipVar>();
            _wipProfile       = new Dictionary <string, WipProfile>();
            _stepRouteInfoDic = new Dictionary <FabStep, StepRouteInfo>();

            // 순서 중요함
            //이전 Step
            List <FabStep> list = BuildBackwardStepChange(step, product);

            BuildStepRouteInfo(list);

            //기준 Step
            BuildStepRouteInfo(step);

            AddRoute(step, true);

            //Next Step
            list = BuildForwardStepChange(step, product);
            BuildStepRouteInfo(list);
        }
コード例 #5
0
ファイル: SimHelper.cs プロジェクト: yichunbong/CSOT
        internal static FabPlanInfo CreateInitLastPlan(EqpStatusInfo info)
        {
            string     shopID = info.LastShopID;
            FabProduct prod   = BopHelper.FindProduct(shopID, info.LastProduct);

            if (prod == null || prod.Process == null)
            {
                return(null);
            }

            FabStep step = prod.Process.FindStep(info.LastStep) as FabStep;

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

            FabPlanInfo plan = new FabPlanInfo(step);

            plan.ShopID         = shopID;
            plan.Product        = prod;
            plan.ProductID      = prod.ProductID;
            plan.ProductVersion = info.LastProductVer;
            plan.OwnerType      = info.LastOwnerType;

            //TODO : last OwnerID
            //plan.OwnerID = null;

            return(plan);
        }
コード例 #6
0
ファイル: JobState.cs プロジェクト: yichunbong/CSOT
        private List <FabStep> BuildForwardStepChange(FabStep step, FabProduct prod)
        {
            List <FabStep> list    = new List <FabStep>();
            FabProduct     orgProd = prod;

            FabStep prevStep = step;

            while (true)
            {
                FabStep nextStep = prevStep.GetNextStep(prod, ref prod);

                if (nextStep == null)
                {
                    break;
                }

                if (orgProd.ProductID != prod.ProductID)
                {
                    break;
                }

                if (list.Contains(nextStep))
                {
                    break;
                }

                AddRoute(nextStep, true);

                list.Add(nextStep);

                prevStep = nextStep;
            }

            return(list);
        }
コード例 #7
0
ファイル: TimeHelper.cs プロジェクト: yichunbong/CSOT
        public static decimal GetAvgTactTimeForEqps(FabStep step, FabProduct product, List <FabAoEquipment> workingEqps)
        {
            Decimal defaultTactTime = (decimal)SiteConfigHelper.GetDefaultTactTime().TotalSeconds;

            if (workingEqps == null)
            {
                return(defaultTactTime);
            }

            int n = workingEqps.Count;

            decimal s = 0;

            foreach (var eqp in workingEqps)
            {
                string   eqpID    = eqp.EqpID;
                StepTime tactTime = step.GetStepTime(eqpID, product.ProductID);

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

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

            if (s > 0m)
            {
                return(n / s);
            }
            else
            {
                return(defaultTactTime);
            }
        }
コード例 #8
0
        private static void FillPrevProduct(this FabProduct product, List <FabProduct> result)
        {
            if (product.PrevInnerBoms.Count > 0)
            {
                foreach (var innerbom in product.PrevInnerBoms)
                {
                    if (!result.Contains(innerbom.Product))
                    {
                        result.Add(innerbom.Product);
                        FillPrevProduct(innerbom.Product, result);
                    }
                }
            }

            int currShopIdx = GetShopIndex(product.ShopID);

            if (product.PrevInterBoms.Count() > 0)
            {
                foreach (FabInterBom interbom in product.PrevInterBoms)
                {
                    int prevShopID = GetShopIndex(interbom.Product.ShopID);
                    if (prevShopID < 0 || currShopIdx <= prevShopID)
                    {
                        continue;
                    }

                    if (!result.Contains(interbom.Product))
                    {
                        result.Add(interbom.Product);
                        FillPrevProduct(interbom.Product, result);
                    }
                }
            }
        }
コード例 #9
0
ファイル: JobState.cs プロジェクト: yichunbong/CSOT
        private List <FabStep> BuildBackwardStepChange(FabStep step, FabProduct prod)
        {
            List <FabStep> list    = new List <FabStep>();
            FabProduct     orgProd = prod;

            while (true)
            {
                FabStep    prevStep = step;
                FabProduct prevProd = prod;

                bool changeProd = prod.TryGetPrevStepInfo(ref step, ref prod);

                if (step == null)
                {
                    break;
                }

                if (changeProd && (orgProd.ProductID != prod.ProductID))
                {
                    break;
                }

                if (list.Contains(step))
                {
                    break;
                }

                AddRoute(step, false);

                list.Add(step);
            }

            return(list);
        }
コード例 #10
0
ファイル: FabStepExt.cs プロジェクト: yichunbong/CSOT
        public static List <FabStep> GetPrevSteps(this FabStep currnetStep, string productID)
        {
            List <FabStep> result = new List <FabStep>();

            if (currnetStep.IsArrayShop && currnetStep.IsFirst)
            {
                return(result);
            }

            foreach (FabStep item in currnetStep.GetInnerPrevSteps())
            {
                result.Add(item);
            }

            FabProduct prod = BopHelper.FindProduct(currnetStep.ShopID, productID);

            FabInterBom bom;

            prod.TryGetPrevInterRoute(currnetStep, out bom);

            if (bom != null)
            {
                result.Add(bom.ChangeStep);
            }

            return(result);
        }
コード例 #11
0
ファイル: FabStepExt.cs プロジェクト: yichunbong/CSOT
        public static List <FabStep> GetNextStepList(this FabStep baseStep, FabProduct baseProduct, int stepCnt = 999)
        {
            List <FabStep> list = new List <FabStep>();

            FabStep    currStep = baseStep;
            FabProduct currProd = baseProduct;

            int cnt = 0;

            while (cnt < stepCnt)
            {
                FabStep nextStep = currStep.GetNextStep(currProd, ref currProd);
                if (nextStep == null)
                {
                    break;
                }

                list.Add(nextStep);

                currStep = nextStep;
                cnt++;
            }

            return(list);
        }
コード例 #12
0
ファイル: FabStepExt.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// 가까운 PhotoStep을 찾습니다.
        /// </summary>
        /// <returns>찾지못할 경우 Null이 반환됩니다.</returns>
        public static FabStep GetNextPhotoNearByMe(this FabStep baseStep, FabProduct baseProduct, int stepCnt, out int idx)
        {
            FabStep    currStep = baseStep;
            FabProduct currProd = baseProduct;

            int cnt = 0;

            while (cnt < stepCnt)
            {
                FabStep nextStep = currStep.GetNextStep(currProd, ref currProd);
                if (nextStep == null)
                {
                    break;
                }

                if (nextStep.StdStep.IsPhoto)
                {
                    idx = cnt;
                    return(nextStep);
                }

                currStep = nextStep;

                //count : only MandatoryStep
                if (nextStep.IsMandatoryStep)
                {
                    cnt++;
                }
            }

            idx = 0;
            return(null);
        }
コード例 #13
0
ファイル: FabStepExt.cs プロジェクト: yichunbong/CSOT
        internal static bool IsSkipStep(FabProduct prod, FabStep step)
        {
            //if (step.StepType == "MAIN")
            //	return false;

            return(false);
        }
コード例 #14
0
ファイル: BopHelper.cs プロジェクト: yichunbong/CSOT
        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);
        }
コード例 #15
0
ファイル: CHANGE_PART.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public List <object> GET_PART_CHANGE_INFOS0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, List <object> prevReturnValue)
        {
            if (isRun)
            {
                return(null);
            }

            FabPegPart pp      = pegPart as FabPegPart;
            FabProduct product = pp.Product as FabProduct;
            FabStep    step    = pp.CurrentStage.Tag as FabStep;

            if (product.HasPrevInterBom == false)
            {
                return(null);
            }

            FabInterBom interbom;

            if (product.TryGetPrevInterRoute(step, out interbom) == false)
            {
                return(null);
            }

            List <object> result = new List <object>()
            {
                interbom
            };

            return(result);
        }
コード例 #16
0
ファイル: PersistInputs.Ext.cs プロジェクト: yichunbong/CSOT
        private FabProduct CheckProduct(string factoryID, string shopID, string productID, string productVer, string where, ref bool hasError)
        {
            FabProduct prod = BopHelper.FindProduct(shopID, productID);

            if (prod == null)
            {
                hasError = true;

                ErrHist.WriteIf(where + productID,
                                ErrCategory.PERSIST,
                                ErrLevel.WARNING,
                                factoryID,
                                shopID,
                                Constants.NULL_ID,
                                productID,
                                productVer,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                Constants.NULL_ID,
                                "NOT FOUND PRODUCT",
                                string.Format("Table:{0}", where)
                                );
            }

            return(prod);
        }
コード例 #17
0
ファイル: SetupMaster.cs プロジェクト: yichunbong/CSOT
        private static bool IsProductChange(FabProduct fromProduct, FabProduct toProduct)
        {
            if (fromProduct == null)
            {
                return(true);
            }

            return(fromProduct.ProductID != toProduct.ProductID);
        }
コード例 #18
0
ファイル: QTimeMaster.cs プロジェクト: yichunbong/CSOT
        private static List <StayHour> GetStayHours(FabProduct prod)
        {
            List <StayHour> list;

            if (dic.TryGetValue(prod, out list))
            {
                return(list);
            }

            return(null);
        }
コード例 #19
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isOut"/>
        /// <param name="handled"/>
        public void WRITE_TARGET0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isOut, ref bool handled)
        {
            FabPegPart pp      = pegPart as FabPegPart;
            FabStep    step    = pegPart.CurrentStage.Tag as FabStep;
            FabProduct product = pp.Product as FabProduct;

            foreach (FabPegTarget pt in pegPart.PegTargetList)
            {
                PegHelper.WriteStepTarget(pt, isOut, step.StepType);
            }
        }
コード例 #20
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;
        }
コード例 #21
0
        public static List <FabProduct> FindPrevAllProducts(this FabProduct product)
        {
            if (product.PrevInnerBoms == null)
            {
                return(null);
            }

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

            FillPrevProduct(product, result);

            return(result.Count > 0 ? result : null);
        }
コード例 #22
0
        public static List <FabInnerBom> GetPrevInnerBom(this FabProduct product, FabStep step, Position pos)
        {
            List <FabInnerBom> bom = new List <FabInnerBom>();

            foreach (FabInnerBom it in product.PrevInnerBoms)
            {
                if (it.OriginStep == step /* && it.Position == pos*/)
                {
                    bom.Add(it);
                }
            }

            return(bom.Count == 0 ? null : bom);
        }
コード例 #23
0
        internal static FabProduct GetPrevFirst(this FabProduct prod)
        {
            if (prod.PrevInterBoms == null)
            {
                return(null);
            }

            foreach (FabInterBom bom in prod.PrevInterBoms)
            {
                return(bom.Product);
            }

            return(null);
        }
コード例 #24
0
        /// <summary>
        /// </summary>
        /// <param name="lot"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IEnumerable <Tuple <Mozart.SeePlan.DataModel.Step, object> > GET_STEP_PLAN_KEYS0(Mozart.SeePlan.Simulation.ILot lot, ref bool handled, IEnumerable <Tuple <Mozart.SeePlan.DataModel.Step, object> > prevReturnValue)
        {
            var slot = lot as FabLot;

            FabProduct prod      = slot.FabProduct;
            string     productID = prod.IsTestProduct ? prod.MainProductID : prod.ProductID;

            var keys    = new List <Tuple <Step, object> >();
            var current = Tuple.Create <Step, object>(slot.CurrentStep, productID);

            keys.Add(current);

            return(keys);
        }
コード例 #25
0
ファイル: Route.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="lot"/>
        /// <param name="loadInfo"/>
        /// <param name="step"/>
        /// <param name="now"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public Step GET_NEXT_STEP1(Mozart.SeePlan.Simulation.ILot lot, Mozart.SeePlan.DataModel.LoadInfo loadInfo, Mozart.SeePlan.DataModel.Step step, DateTime now, ref bool handled, Mozart.SeePlan.DataModel.Step prevReturnValue)
        {
            FabLot      flot  = lot as FabLot;
            var         fstep = step as FabStep;
            FabPlanInfo plan  = loadInfo as FabPlanInfo;

            FabProduct prod = flot.FabProduct;

            FabProduct nextProd = prod;
            var        nextStep = GetNextStep(fstep, prod, plan, ref nextProd);

            flot.Product = nextProd;

            return(nextStep);
        }
コード例 #26
0
ファイル: PegPartExt.cs プロジェクト: yichunbong/CSOT
        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);
        }
コード例 #27
0
        internal static bool IsFrontProduct(this FabProduct product, bool withCellIn = false)
        {
            if (!withCellIn && product.ShopID != Constants.CfShop &&
                product.ShopID != Constants.ArrayShop)
            {
                return(false);
            }

            if (product.ProductGroup != Constants.CF &&
                product.ProductGroup != Constants.TFT)
            {
                return(false);
            }

            return(true);
        }
コード例 #28
0
ファイル: PegHelper.cs プロジェクト: yichunbong/CSOT
        internal static Step GetLastPeggingStgep(PegPart pegPart)
        {
            FabPegPart pp      = pegPart as FabPegPart;
            FabProduct product = pp.Product as FabProduct;
            Step       step    = product.Process.LastStep;

            pp.AddCurrentPlan(product, step as FabStep);

            //StepTarget 추가기록
            foreach (FabPegTarget pt in pp.PegTargetList)
            {
                PegHelper.WriteStepTarget(pt, true, Constants.OUT, true);
            }

            return(step);
        }
コード例 #29
0
ファイル: BopHelper.cs プロジェクト: yichunbong/CSOT
        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);
                }
            }
        }
コード例 #30
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);
        }