private void PrePareTarget_Fab(MergedPegPart mpp) { if (InputMart.Instance.GlobalParameters.ApplyCellOutPlan == false) { mpp.Items.Clear(); foreach (var mm in InputMart.Instance.FabMoMaster.Values) { if (BopHelper.IsCellShop(mm.ShopID)) { continue; } FabPegPart pp = new FabPegPart(mm, mm.Product); foreach (FabMoPlan mo in mm.MoPlanList) { FabPegTarget pt = CreateHelper.CreateFabPegTarget(pp, mo); pp.AddPegTarget(pt); if (pp.SampleMs == null) { pp.SampleMs = pt; } } mpp.Merge(pp); } } }
/// <summary> /// </summary> /// <param name="target"/> /// <param name="m"/> /// <param name="isRun"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public bool CAN_PEG_MORE0(Mozart.SeePlan.Pegging.PegTarget target, Mozart.SeePlan.Pegging.IMaterial m, bool isRun, ref bool handled, bool prevReturnValue) { FabPlanWip wip = m.ToFabPlanWip(); FabPegTarget pt = target.ToFabPegTarget(); if (wip.IsHold == false) { return(true); } // Hold Peg 방지 옵션 //if (pt.CalcDate < wip.AvailableTime) // return false; return(true); }
internal static int ComparePegTarget(PegTarget x, PegTarget y) { FabPegTarget a = x.ToFabPegTarget(); FabPegTarget b = y.ToFabPegTarget(); int cmp = a.DueDate.CompareTo(b.DueDate); if (cmp == 0) { cmp = a.LineType.CompareTo(b.LineType); } if (cmp == 0) { cmp = a.Qty.CompareTo(b.Qty); } return(cmp); }
internal static void WritePeg(PegTarget target, IMaterial m, double qty) { Outputs.PegHistory hist = new Outputs.PegHistory(); FabStep step = target.PegPart.CurrentStage.Tag as FabStep; FabPegTarget pt = target as FabPegTarget; FabPlanWip wip = m as FabPlanWip; FabMoPlan mo = pt.MoPlan as FabMoPlan; var prod = (pt.PegPart as FabPegPart).Product as FabProduct; hist.VERSION_NO = ModelContext.Current.VersionNo; hist.FACTORY_ID = step.FactoryID; hist.AREA_ID = step.AreaID; hist.SHOP_ID = step.ShopID; hist.PRODUCT_ID = prod.ProductID; hist.PRODUCT_VERSION = wip.WipInfo.ProductVersion; hist.PRODUCT_TYPE = prod.ProductType.ToString(); hist.PROCESS_ID = prod.ProcessID; hist.STEP_ID = step.StepID; hist.PEG_QTY = qty; hist.LOT_ID = wip.Wip.LotID; hist.LOT_QTY = wip.Wip.UnitQty; hist.LOT_STATUS = wip.LotState.ToString(); hist.TARGET_DATE = pt.CalcDate; hist.TARGET_PRODUCT_ID = pt.ProductID; //hist.TARGET_PROCESS_ID = pt.ProcessID; hist.DEMAND_ID = mo.DemandID; hist.DEMAND_PRODUCT_ID = mo.PreMoPlan.ProductID; hist.DEMAND_PLAN_DATE = mo.DueDate; hist.DEMAND_QTY = mo.Qty; hist.WIP_PROCESS_ID = wip.WipInfo.WipProcessID; hist.WIP_STEP_ID = wip.WipInfo.WipStepID; hist.WIP_STATE = wip.WipInfo.WipState; hist.OWNER_TYPE = wip.WipInfo.OwnerType; hist.TARGET_KEY = pt.TargetKey; OutputMart.Instance.PegHistory.Add(hist); }
/// <summary> /// </summary> /// <param name="pegTarget"/> /// <param name="stage"/> /// <param name="isRun"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public TimeSpan GET_TARGET_TAT0(Mozart.SeePlan.Pegging.PegTarget pegTarget, Mozart.SeePlan.Pegging.PegStage stage, bool isRun, ref bool handled, TimeSpan prevReturnValue) { FabPegTarget target = pegTarget as FabPegTarget; FabStep step = pegTarget.PegPart.CurrentStep as FabStep; float waitTat = (float)SiteConfigHelper.GetDefaultWaitTAT().TotalMinutes; float runTat = (float)SiteConfigHelper.GetDefaultRunTAT().TotalMinutes; StepTat tat = step.GetTat(target.ProductID, target.IsMainLint); if (tat != null) { waitTat = tat.WaitTat; runTat = tat.RunTat; } float time = isRun ? runTat : waitTat; return(TimeSpan.FromMinutes(time)); }
internal static FabPegPart CreateCellBankPegPart(FabPegPart pp, FabProduct prod) { FabPegPart newPP = new FabPegPart(pp.MoMaster as FabMoMaster, prod); newPP.Steps = new List <PlanStep>(pp.Steps); foreach (FabPegTarget item in pp.PegTargetList) { FabPegTarget pt = item.Clone(newPP) as FabPegTarget; pt.TargetKey = PegHelper.CreateTargetKey(pt.TargetKey, prod.ProductID.Substring(0, 2)); newPP.AddPegTarget(pt); if (newPP.SampleMs == null) { newPP.SampleMs = pt; } } return(newPP); }
internal static void WriteStepTarget(FabPegTarget pt, bool isOut, string stepType, bool isExtraAdd) { FabPegPart pp = pt.PegPart as FabPegPart; FabStep step = pp.Current.Step; FabProduct prod = pp.FabProduct; //Key : FactoryID, ShopID, ProductID, StepID, StepType, TargetShift, TargetKey string factoryID = step.FactoryID; string shopID = step.ShopID; string prodductID = prod.ProductID; string stepID = step.StepID; stepType = GetStepType(stepType); if (stepType == Constants.IN) { stepID = string.Format("{0}_{1}", shopID, Constants.IN); } else if (stepType == Constants.OUT) { stepID = string.Format("{0}_{1}", shopID, Constants.OUT); } DateTime targetShift = ShopCalendar.ShiftStartTimeOfDayT(pt.CalcDate); string targetKey = pt.TargetKey; Outputs.StepTarget row = OutputMart.Instance.StepTarget.Find(factoryID, shopID, prodductID, stepID, stepType, targetShift, targetKey); if (row != null) { if (isOut) { row.TARGET_OUT_QTY = +Convert.ToDecimal(pt.CalcQty); } else { row.TARGET_IN_QTY = +Convert.ToDecimal(pt.CalcQty); } } else { row = new Outputs.StepTarget(); row.VERSION_NO = ModelContext.Current.VersionNo; row.FACTORY_ID = step.FactoryID; row.AREA_ID = step.AreaID; row.SHOP_ID = step.ShopID; row.PRODUCT_ID = prod.ProductID; row.STEP_ID = stepID; row.TARGET_DATE = pt.CalcDate; row.TARGET_SHIFT = targetShift; row.DEMAND_ID = pt.FabMoPlan.DemandID; row.DEMAND_PRODUCT_ID = pt.FabMoPlan.PreMoPlan.ProductID; row.DEMAND_PLAN_DATE = pt.FabMoPlan.DueDate; row.DEMAND_QTY = pt.FabMoPlan.Qty; row.TARGET_KEY = pt.TargetKey; row.STEP_TYPE = stepType; row.SEQ = pt.Seq++; // GetSequence(step, stepType, isExtraAdd); if (isOut) { row.TARGET_IN_QTY = 0; row.TARGET_OUT_QTY = Convert.ToDecimal(pt.CalcQty); } else { row.TARGET_IN_QTY = Convert.ToDecimal(pt.CalcQty); row.TARGET_OUT_QTY = 0; } //InTarget용(BuildInPlan) if (isExtraAdd) { row.TARGET_IN_QTY = Convert.ToDecimal(pt.CalcQty); row.TARGET_OUT_QTY = Convert.ToDecimal(pt.CalcQty); } OutputMart.Instance.StepTarget.Add(row); } }
internal static void WriteStepTarget(FabPegTarget pt, bool isOut, string stepType) { WriteStepTarget(pt, isOut, stepType, false); }