private static Time GetAfterTat(this StayHour info, FabLot lot, FabStep currStep) { if (currStep == null) { return(Time.Zero); } string key = currStep.StepKey; string productID = lot.CurrentProductID; Time t; if (info.AfterTats.TryGetValue(key, out t) == false) { bool flag = false; foreach (var step in info.StepList) { if (flag) { var tat = step.GetTat(productID, true); if (tat != null) { t += Time.FromMinutes(tat.TAT); } } if (step.StepID == currStep.StepID) { flag = true; } } } return(t); }
private static bool Reset(this StayHour info) { info.FromStepOutTime = DateTime.MinValue; info.CurrStepInTime = DateTime.MinValue; return(false); }
private static void StepChange_Curr(this StayHour info, FabStep currStep, DateTime now) { if (currStep != null) { //FromStepOutTime 미설정된 상태로 중간 Step에 진입한 경우(예외처리) if (info.FromStep.IsMainStep && info.FromStepOutTime == DateTime.MinValue) { if (info.IsMatchedStep(currStep)) { DateTime planStartTime = ModelContext.Current.StartTime; info.FromStepOutTime = planStartTime; #region WriteErrorHistory. string key = string.Format("Qtime{0}/{1}", info.Lot.LotID, currStep.StepKey); ErrHist.WriteIf(key, ErrCategory.SIMULATION, ErrLevel.INFO, currStep.FactoryID, currStep.ShopID, info.Lot.LineID, info.Product.ProductID, info.Lot.CurrentProductVersion, info.Lot.CurrentProcessID, Constants.NULL_ID, currStep.StepID, "NOT FOUND FROM_STEP_OUT_TIME", "Qtime:StepChange_Current"); #endregion } } info.CurrStepInTime = now; } }
public static Time RemainMinHoldTime(this StayHour info, FabLot lot, FabStep step, DateTime now) { Time stayTime = now - info.FromStepOutTime; Time remainTime = info.QTime - stayTime; return(remainTime); }
private static StayHour Clone(this StayHour info) { var clone = info.ShallowCopy(); clone.Reset(); return(clone); }
private static Time GetToStepRunTat(this StayHour info, string productID) { var stepList = info.StepList; if (stepList == null || stepList.Count == 0) { return(Time.Zero); } var last = stepList.LastOrDefault(); return(GetRunTat(last, productID)); }
private static bool IsMatched(this StayHour info, FabStep step, QTimeType qtype) { if (step == null) { return(false); } if (info.QType != qtype) { return(false); } return(info.IsMatchedStep(step)); }
private static void StepChange_Prev(this StayHour info, FabStep prevStep, DateTime now) { if (prevStep != null) { if (prevStep.StepID == info.FromStep.StepID) { info.FromStepOutTime = now; } if (prevStep.StepID == info.ToStep.StepID) { info.ToStepInTime = now; } } }
private static bool IsTraverseStep(StayHour item, FabLot lot) { bool isInclude = false; foreach (var step in item.StepList) { if (lot.PlanSteps.Contains(step.StepKey)) { isInclude = true; break; } } return(isInclude); }
private static bool IsMatchedStep(this StayHour info, FabStep step) { if (step == null) { return(false); } var find = info.StepList.Find(t => t.StepID == step.StepID); if (find != null) { return(true); } return(false); }
internal static Time GetMinimumRemainTime(this FabLot lot, DateTime now) { if (lot.QtimeInfo == null) { return(Time.MinValue); } StayHour sh = lot.QtimeInfo.FindMinimumRemainTime(now); if (sh == null) { return(Time.MaxValue); } return(sh.RemainTime(lot, lot.CurrentFabStep, now)); }
internal static void Add(StayHour sh) { if (dic == null) { dic = new Dictionary <FabProduct, List <StayHour> >(); } List <StayHour> list; if (dic.TryGetValue(sh.Product, out list) == false) { list = new List <StayHour>(); dic.Add(sh.Product, list); } list.Add(sh); }
public static Time RemainTime(this StayHour info, FabLot lot, FabStep step, DateTime now) { //제약 발생 전 if (info.FromStepOutTime == DateTime.MinValue || info.FromStepOutTime == DateTime.MaxValue) { return(Time.MaxValue); } string productID = lot.CurrentProductID; Time currStepRunTat = GetRunTat(step, productID); Time afterTat = info.GetAfterTat(lot, step); Time toStepRunTat = info.GetToStepRunTat(productID); Time afterStepNeedTat = currStepRunTat + afterTat - toStepRunTat; Time stayTime = (now - info.FromStepOutTime); Time remainTime = info.QTime - stayTime - afterStepNeedTat; return(remainTime); }
public static int RemainStepCount(this StayHour info, FabStep currStep) { //제약 발생 전 if (info.FromStepOutTime == DateTime.MinValue || info.FromStepOutTime == DateTime.MaxValue) { return(0); } if (currStep == null) { return(0); } string key = currStep.StepKey; int count = 0; if (info.AtfterStepCount.TryGetValue(key, out count) == false) { bool flag = false; foreach (var step in info.StepList) { if (flag) { count++; } if (step.StepID == currStep.StepID) { flag = true; } } } return(count); }