public static void AddWip(FabWipInfo wip) { DateTime outTime = wip.WipStateTime; OutInfo info = CreateHelper.CreateOutInfo(wip, outTime); AddOut(info); }
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); }
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); }
private void CheckWipStateByHoldInfo(FabWipInfo wip, string holdType) { //AvailabaleTime이 MinValue일 경우 바로 가용( DateTime MinValue : HoldEndTime < PlanStartTime 경우임.) if (wip.AvailableTime == DateTime.MinValue) { ErrHist.WriteIf(string.Format("{0}/{1}", wip.LotID, "WipHold"), ErrCategory.PERSIST, ErrLevel.INFO, wip.FactoryID, wip.ShopID, wip.LotID, wip.WipProductID, wip.ProductVersion, wip.WipProcessID, wip.WipEqpID, wip.WipStepID, string.Format("{0} : HoldEndTime < PlanStartTime", holdType), string.Format("Change WIP_STATE : {0} → {1}", wip.CurrentState.ToString(), "WAIT") ); wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.WAIT; } else if (wip.IsSubStepWip) { wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.MOVE; } else { wip.CurrentState = Mozart.SeePlan.Simulation.EntityState.HOLD; } }
private DateTime GetAvailableTime(FabWipInfo wip, string holdCode, DateTime holdStartTime, bool isSubStepHold = false) { DateTime planStartTime = ModelContext.Current.StartTime; if (holdStartTime == DateTime.MinValue) { holdStartTime = planStartTime; } float holdTime = HoldMaster.GetHoldTime(wip.ShopID, holdCode); DateTime holdEndTime = holdStartTime.AddMinutes(holdTime); if (holdEndTime > planStartTime) { return(holdEndTime); } //SubStep Wip의 경우 기준 HoldTime 이후에도 SubStep에 존재시 기본 HoldTime을 추가 반영함(2020.03.05 - by.liujian(유건)) if (isSubStepHold) { var defaultSubStepHoldTime = SiteConfigHelper.GetDefaultSubStepHoldTime(); return(planStartTime.AddMinutes(defaultSubStepHoldTime.TotalMinutes)); } return(planStartTime); }
private void SetAvailableTime(FabWipInfo wip) { if (wip.IsSubStepWip) { string holdCode = wip.HoldCode; DateTime holdStartTime = LcdHelper.Max(wip.LastTrackInTime, wip.LastTrackOutTime); wip.AvailableTime = GetAvailableTime(wip, holdCode, holdStartTime, true); CheckWipStateByHoldInfo(wip, holdCode); return; } if (wip.IsHold) { string holdCode = wip.HoldCode; wip.HoldEndTime = GetAvailableTime(wip, holdCode, wip.HoldTime); wip.SheetIDEndTime = GetAvailableTime(wip, holdCode, wip.SheetIDTime); wip.InspSheetEndTime = GetAvailableTime(wip, holdCode, wip.InspSheetIDTime); List <Tuple <string, DateTime> > list = new List <Tuple <string, DateTime> >(); list.Add(Tuple.Create <string, DateTime>("HOLD", wip.HoldEndTime)); list.Add(Tuple.Create <string, DateTime>("SHEET_ID", wip.SheetIDEndTime)); list.Add(Tuple.Create <string, DateTime>("INSP_SHEET_ID", wip.InspSheetEndTime)); list.Sort(new CompareHelper.WipHoldInfoCompare()); wip.AvailableTime = list[0].Item2; CheckWipStateByHoldInfo(wip, list[0].Item1); } }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="hb"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public Time GET_HOLD_TIME0(Mozart.SeePlan.Simulation.DispatchingAgent da, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled, Mozart.Simulation.Engine.Time prevReturnValue) { Time t = Time.Zero; FabLot lot = hb.ToFabLot(); FabWipInfo wip = lot.Wip; //FabPlanInfo plan = lot.CurrentFabPlan; if (lot.IsInitHold) { t = wip.AvailableTime - da.NowDT; lot.HoldStartTime = da.NowDT; lot.HoldTime = t; lot.IsInitHold = false; // Hold → ExitHold → IsHold 이므로 false로 설정해야됨. 바꿔주지 않을 경우 계속 Hold됨. } return(t); }
private static void DoReserveBatch(this DcnMaster mst, DateTime now) { AoBatchRelease inputBatch = AoFactory.Current.BatchRelease; foreach (DcnPlan plan in mst.Current) { FabProduct prod = plan.Product; if (prod == null) { continue; } FabStep step = prod.Process.FirstStep as FabStep; if (step == null) { continue; } string lotID = EntityHelper.CreateFrontInLotID(prod); double unitQty = plan.AllocQty; FabWipInfo wip = CreateHelper.CreateWipInfo(lotID, prod, step, unitQty); FabLot lot = CreateHelper.CreateLot(wip, LotState.CREATE); DateTime releaseTime = LcdHelper.Max(plan.EqpEndTime, now); lot.ReleaseTime = releaseTime; lot.LotState = LotState.CREATE; lot.ReleasePlan = plan; var inTarget = plan.Target == null ? null : plan.Target.InTarget; lot.FrontInTarget = inTarget; inputBatch.AddEntity(releaseTime, lot); } }
internal static EntityState GetEntityState(FabWipInfo wip) { return(GetEntityState(wip.WipState.ToUpper())); }