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 Dictionary <string, string> GetPhotoStepFromConfig() { string array = SiteConfigHelper.GetDefaultPhotoStep(Constants.ArrayShop); string cf = SiteConfigHelper.GetDefaultPhotoStep(Constants.CfShop); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add(Constants.ArrayShop, array); dic.Add(Constants.CfShop, cf); return(dic); }
/// <summary> /// </summary> /// <param name="hb"/> /// <param name="bucketer"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public Time GET_BUCKET_TIME0(IHandlingBatch hb, AoBucketer bucketer, ref bool handled, Time prevReturnValue) { FabStep step = hb.CurrentStep as FabStep; FabLot lot = hb.Sample as FabLot; string productID = lot.CurrentProductID; var tatInfo = step.GetTat(productID, true); if (tatInfo == null) { return(Time.Zero); } Time remainTime = Time.FromMinutes(tatInfo.TAT); //Wip 초기화시 TrackIn 반영 if (lot.IsWipHandle) { Time now = bucketer.Now; bool isRunWip = lot.Wip.CurrentState == EntityState.RUN; Time stateTat = isRunWip ? tatInfo.RunTat : tatInfo.WaitTat; //current state DateTime stateInTime = lot.Wip.WipStateTime; if (lot.Wip.IsInputLot) { stateInTime = lot.ReleaseTime; } else if (lot.Wip.CurrentState == EntityState.HOLD) { stateInTime = lot.HoldStartTime; } Time stayTime = now - stateInTime; remainTime = Time.Max(stateTat - stayTime, Time.Zero); //+ runTat (run wip 제외) if (isRunWip == false) { remainTime += tatInfo.RunTat; } //Max(defaultMinBucketTime, minBucketTime) (2020.03.11 - by.liujian(유건)) Time defaultMinBucketTime = SiteConfigHelper.GetDefaultMinBucketTime(); remainTime = Time.Max(remainTime, defaultMinBucketTime); } lot.CurrentFabPlan.AoBucketTime = Time.Max(remainTime, Time.Zero); return(remainTime); }
/// <summary> /// </summary> /// <param name="entity"/> /// <param name="now"/> /// <param name="target"/> /// <param name="factor"/> /// <param name="ctx"/> /// <returns/> public WeightValue LOT_PRIORITY(Mozart.Simulation.Engine.ISimEntity entity, DateTime now, Mozart.Simulation.Engine.ActiveObject target, Mozart.SeePlan.DataModel.WeightFactor factor, Mozart.SeePlan.Simulation.IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } FabAoEquipment eqp = target as FabAoEquipment; FabLot lot = entity as FabLot; if (lot.IsDummy) { return(new WeightValue(0)); } //if (eqp.EqpID == "THOVN300" && eqp.NowDT >= LcdHelper.StringToDateTime("20200113 090018")) // Console.WriteLine("B"); bool isLastPlan = eqp.IsLastPlan(lot); float maxPriority = ctx.Get <int>(Constants.WF_LOT_PRIORITY, SiteConfigHelper.GetDefaultLotPriority()); int lotPriority = lot.Priority; float score = 0f; int workingCnt = lot.DispatchFilterInfo.WorkingEqpCnt; if (isLastPlan == false && workingCnt > 0) { score = 0f; } else { if (maxPriority > 0) { score = 1 - (lotPriority / maxPriority); } //working : score * 2 if (isLastPlan) { score = score * 2; } } string desc = string.Format("[{0}/Max{1}]", lotPriority, maxPriority); return(new WeightValue(score * factor.Factor, desc)); }
/// <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)); }
private void SetMixRun() { ConfigGroup mixRuns = SiteConfigHelper.GetChamberMixRun(); ConfigGroup lossInfos = SiteConfigHelper.GetChamberMixRunLoss(); if (mixRuns == null) { return; } foreach (var item in mixRuns.Item.Values) { string[] steps = item.CodeValue.Split(','); if (steps.Length < 2) { continue; } List <FabStdStep> list = new List <FabStdStep>(); foreach (var stdStepID in steps) { FabStdStep step = BopHelper.FindStdStep(Constants.ArrayShop, stdStepID); if (step != null) { list.Add(step); } } if (list.Count < 2) { continue; } float lossValue = 1f; if (lossInfos != null) { ConfigInfo loss; lossInfos.Item.TryGetValue(item.CodeName, out loss); if (loss != null) { if (float.TryParse(loss.CodeValue, out lossValue) == false) { lossValue = 1f; } } } foreach (var step in list) { foreach (var otherStep in list) { if (step == otherStep) { continue; } if (step.MixRunPairSteps == null) { step.MixRunPairSteps = new List <FabStdStep>(); } step.MixRunPairSteps.Add(otherStep); } step.IsMixRunStep = true; step.MixCriteria = lossValue; } } }