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); }
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); }
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); }
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); }
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); }
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); }
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); } }
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); } } } }
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); }
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); }
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); }
/// <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); }
internal static bool IsSkipStep(FabProduct prod, FabStep step) { //if (step.StepType == "MAIN") // return false; return(false); }
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); }
/// <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); }
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); }
private static bool IsProductChange(FabProduct fromProduct, FabProduct toProduct) { if (fromProduct == null) { return(true); } return(fromProduct.ProductID != toProduct.ProductID); }
private static List <StayHour> GetStayHours(FabProduct prod) { List <StayHour> list; if (dic.TryGetValue(prod, out list)) { return(list); } return(null); }
/// <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); } }
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; }
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); }
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); }
internal static FabProduct GetPrevFirst(this FabProduct prod) { if (prod.PrevInterBoms == null) { return(null); } foreach (FabInterBom bom in prod.PrevInterBoms) { return(bom.Product); } return(null); }
/// <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); }
/// <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); }
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); }
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); }
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); }
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); } } }
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); }