internal static Dictionary <string, WaitingWipInfo> SetWatingWipInfo(AoEquipment eqp, List <JobFilterInfo> joblist) { WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_ONGOING_PRODUCT_WIP_PRIORITY); if (wf == null) { return(null); } Dictionary <string, WaitingWipInfo> waiting = new Dictionary <string, WaitingWipInfo>(); foreach (var job in joblist) { var fps = (job.Step.Process as FabProcess).FirstPhotoStep; if (fps == null) { continue; } string stepKey = fps.StepKey; if (waiting.ContainsKey(stepKey)) { continue; } WaitingWipInfo info = ResHelper.GetTargetStepWaitingWip(stepKey); waiting.Add(stepKey, info); } return(waiting); }
private static bool HasFilterInfo(AoEquipment eqp, FabLot lot) { if (lot.DispatchFilterInfo == null) { return(false); } if (lot.DispatchFilterInfo.FilterType == DispatchFilter.None) { return(false); } WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_PREVENT_SMALL_LOT_FILTER); if (wf == null || wf.Factor == 0) { //자신의 초기 Step일 경우에 Lot Priority 가 1,2,3 일 경우 필터하지 않음 if (lot.CurrentStep == lot.Wip.InitialStep) { if (lot.Wip.Priority == 1 || lot.Wip.Priority == 2 || lot.Wip.Priority == 3) { return(false); } } } return(true); }
public static T GetCriteria <T>(WeightFactor factor, int index, T defaultValue) { try { if (factor == null) { return(defaultValue); } var criteria = factor.Criteria; if (criteria == null || criteria.Length <= index) { return(defaultValue); } var ovalue = criteria[index]; if (ovalue is T) { return((T)ovalue); } return(defaultValue); } catch { return(defaultValue); } }
private static bool IsFilterDummyWaitEqp(this JobFilterInfo info, FabAoEquipment eqp, List <FabAoEquipment> eqpList) { if (eqpList == null) { return(false); } WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_DUMMY_WAIT_EQP_FILTER); if (wf == null || wf.Factor == 0) { return(false); } //연속진행인 경우 if (info.IsRunning) { return(false); } var waitEqps = eqpList.FindAll(x => x.IsDummyWait); bool isFilter = waitEqps.Count > 0; return(isFilter); }
private static bool IsFilterRunMode(this JobFilterInfo info, FabAoEquipment eqp, List <JobFilterInfo> jobList) { WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_RUN_MODE_FILTER); if (wf == null || wf.Factor == 0) { return(false); } //연속진행인 경우 if (info.IsRunning) { return(false); } string eqpGroup = eqp.TargetEqp.EqpGroup; string runMode = eqp.GetCurrentRunMode(); var branchStep = BranchStepMaster.GetBranchStep(eqpGroup, runMode); if (branchStep == null) { return(false); } if (branchStep.IsAllProduct) { return(false); } var productList = branchStep.ProductList; if (productList == null || productList.Count == 0) { return(false); } string productID = info.ProductID; string ownerType = info.OwnerType; bool isFilter = true; if (branchStep.IsLoadable(productID, ownerType)) { isFilter = false; } if (isFilter) { string defaultOwnerType = SiteConfigHelper.GetDefaultOwnerType(); if (ExistRemainWip(jobList, productList, defaultOwnerType) == false) { isFilter = false; } } return(isFilter); }
private void buttonUpdateWeight_Click(object sender, EventArgs e) { WeightFactor cur = (WeightFactor)bindingSourceWeight.Current; using (MyDBContext db = new MyDBContext()) { var thisF = db.WeightFactors.Single(f => f.Id == cur.Id); thisF.Weight = Convert.ToInt32(txtWeight.Value); thisF.keyWord = txtToFind.Text; thisF.Dimension = comboBoxDim.Text; //db.WeightFactors.Attach(cur); db.SaveChanges(); comboBoxDim_SelectedIndexChanged(sender, e); } }
public static bool IsFilterPreventLayerChange(AoEquipment aeqp, FabLot lot) { var eqp = aeqp.ToFabAoEquipment(); //if (eqp.EqpID == "THCVDC00" && eqp.NowDT >= LcdHelper.StringToDateTime("20200108 090229")) // Console.WriteLine("B"); WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_PREVENT_LAYER_CHANGE_FILTER); if (wf == null || wf.Factor == 0) { return(false); } var step = lot.CurrentFabStep; if (IsLastRunStep(eqp, step)) { return(false); } var stepList = SimHelper.GetDspEqpSteps(eqp.DspEqpGroupID); if (stepList == null || stepList.Count <= 1) { return(false); } var last = eqp.GetLastPlan(); if (last == null) { return(false); } bool isFilter = ExistRunEqpByDspEqpGroup(eqp, last.FabStep) == false; //if (isFilter) // info.FilterReason = string.Format(""); return(isFilter); }
private static bool IsFilterSetup(this JobFilterInfo info, AoEquipment aeqp) { WeightFactor wf = WeightHelper.GetWeightFactor(aeqp.Target.Preset, Constants.WF_SETUP_FILTERING); if (wf == null || wf.Factor == 0) { return(false); } FabLot lot = info.Sample; if (lot == null) { return(false); } FabAoEquipment eqp = aeqp.ToFabAoEquipment(); var step = info.Step; //if (eqp.EqpID == "CHPIL300" && eqp.NowDT >= LcdHelper.StringToDateTime("20200119 105032") // && lot.CurrentProductID == "CW42512AB000") // Console.WriteLine("B"); if (eqp.IsLastPlan(lot)) { return(false); } double setupTime = info.SetupTime; if (setupTime <= 0) { return(false); } double ratio = Convert.ToDouble(wf.Criteria[0]); double continuousQty = info.WaitSum; if (continuousQty > 0) { continuousQty += InFlowMaster.GetContinuousQty(lot, step); } if (eqp.IsParallelChamber) { continuousQty = continuousQty / eqp.GetChamberCapacity(); } var st = step.GetStepTime(aeqp.EqpID, info.ProductID); if (st == null) { return(false); } double tactTime = st.TactTime; double workSec = Math.Round(continuousQty * tactTime, 2); double setupSec = Math.Round(setupTime * 60 * ratio, 2); bool isFilter = workSec < setupSec; if (isFilter == false) { return(false); } //단순 Setup > Tact Time 일 경우 Inflow를 고려 //다른 곳에서 진행중인가? Yes : 필터, No: 소량검사 if (SimHelper.IsAnyWorking(eqp, lot) == false) { //기다려도 오지 않는 작은 Lot인가? Yes : 필터하지 않음. No : 필터 if (IsWaitSmallSizeLot(aeqp, info, lot, continuousQty, setupTime, ratio, st)) { isFilter = false; } } if (isFilter) { info.FilterReason = string.Format("SetupTime:{0} > {1}(Qty:{2} * Tact:{3})", setupSec, workSec, continuousQty, st.TactTime); } return(isFilter); }
private static bool IsFilterNewEqpAssign(this JobFilterInfo info, FabAoEquipment eqp, List <FabAoEquipment> workingEqpList) { WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_NEW_EQP_ASSIGN_FILTERING); if (wf == null || wf.Factor == 0) { return(false); } //연속진행인 경우 if (info.IsRunning) { return(false); } //Setup이 필요없는 제품의 경우 Filter 제외(2019.12.16 - by.liujian(유건)) if (eqp.IsParallelChamber == false) { var setupTime = info.SetupTime; if (setupTime <= 0) { return(false); } } ////NoAssign 제품의 경우는 IsFilterSetup로 체크(bong - J/C 증가로 제외) //if (info.IsNoAssign) // return false; //if (eqp.EqpID == "FHMPH100" && eqp.NowDT >= LcdHelper.StringToDateTime("20200113 203008")) // Console.WriteLine("B"); double param1 = (double)wf.Criteria[0]; double param2 = (double)wf.Criteria[1]; //if (info.IsNoAssign) //{ // WeightFactor awf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_ALLOW_RUN_DOWN_TIME); // if (awf != null && awf.Factor != 0) // param1 = param1 + Convert.ToDouble(awf.Criteria[0]); //} int workCnt = workingEqpList != null ? workingEqpList.Count : 0; //param1 string reason; bool isFilter = IsFilterNewEqpAssign(info, eqp, param1, workCnt, out reason); //param2 if (isFilter == false && workCnt > 0) { if (param2 > param1) { isFilter = IsFilterNewEqpAssign(info, eqp, param2, workCnt, out reason); } } if (isFilter) { info.FilterReason = reason; } return(isFilter); }
private static bool IsCfPhotoTargetLine(AoEquipment aeqp, FabLot lot) { var eqp = aeqp.ToFabAoEquipment(); WeightFactor wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_CF_PHOTO_TARGET_LINE_FILTER); if (wf == null || wf.Factor == 0) { return(true); } //if(eqp.EqpID == "FHRPH100" && eqp.NowDT >= LcdHelper.StringToDateTime("20200115 073000") // && lot.CurrentProductID == "TH645A1AB100") // Console.WriteLine("B"); var lineType = eqp.GetLineType(); if (lineType == LineType.NONE) { return(true); } bool isPegged = lot.CurrentFabPlan.IsPegged; if (isPegged == false) { if (eqp.IsLastPlan(lot)) { return(true); } else { if (lineType == LineType.SUB) { return(false); } else { return(true); } } } var stepTarget = lot.CurrentFabPlan.MainTarget; if (stepTarget == null || stepTarget.Mo == null) { return(true); } var targetLine = stepTarget.Mo.LineType; if (lineType != targetLine) { if (ExistRemainStepPlan(lot, lineType) == false) { return(false); } } return(true); }
public WeightValue OWNER_TYPE_PRIORITY(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } FabLot lot = entity as FabLot; float score = 0f; string desc = string.Empty; string ownerType = lot.OwnerType; if (factor.Criteria != null && factor.Criteria.Length > 0) { string[] types = (string[])factor.Criteria; if (types.Length > 0) { if (ownerType == types[0]) { score = 1f; } } if (types.Length > 1) { if (ownerType == types[1]) { score = 0.5f; } } if (types.Length > 2) { if (ownerType == types[2]) { score = 0f; } } } return(new WeightValue(score * factor.Factor, desc)); }
public WeightValue ALLOW_RUN_DOWN_TIME(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx) { FabAoEquipment eqp = target as FabAoEquipment; FabLot lot = entity as FabLot; var wf = WeightHelper.GetWeightFactor(eqp.Target.Preset, Constants.WF_ALLOW_RUN_DOWN_TIME); if (wf == null || wf.Factor == 0) { return(new WeightValue(0)); } decimal inflowHour = (decimal)wf.Criteria[0]; var idleTime = eqp.GetIdleRunTime(); decimal adjustHour = inflowHour - Convert.ToDecimal(idleTime.TotalHours); if (adjustHour < 0) { return(new WeightValue(0)); } var inflowQty = InFlowMaster.GetAllowRunDownWip(eqp, lot.CurrentProductID, lot.OrigProductVersion, lot.OwnerType, lot.CurrentStep as FabStep, adjustHour); float score = 0f; if (inflowQty > 0) { score = 1f; } string desc = string.Format("[inflow:{0}]", inflowQty); return(new WeightValue(score * factor.Factor, desc)); }
public WeightValue SMALL_LOT(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } FabAoEquipment eqp = target as FabAoEquipment; FabLot lot = entity as FabLot; int smallSize = (int)factor.Criteria[0]; if (smallSize == 0) { return(new WeightValue(0)); } int stepCount = (int)factor.Criteria[1]; if (stepCount == 0) { return(new WeightValue(0)); } var job = InFlowMaster.GetJobState(lot); if (job == null) { return(new WeightValue(0)); } int currentUnitQty = lot.UnitQty; string shopID = lot.CurrentShopID; string productID = lot.CurrentProductID; string productVer = lot.CurrentProductVersion; bool isLastPlan = ResHelper.IsLastPlan(eqp, lot); float score = 0f; if (isLastPlan) { score = 1f; } FabStep step = lot.CurrentFabStep; string stepType = step.StepType; int cnt = 0; int runQty = 0; int waitQty = 0; int total = 0; while (cnt < stepCount) { List <FabStep> preSteps = step.GetPrevSteps(productID); List <FabLot> runWips = job.GetPrevStepWipList(step, WipType.Run, productVer); List <FabLot> waitWips = job.GetPrevStepWipList(step, WipType.Wait, productVer); if (runWips.Count <= 0 && waitWips.Count <= 0) { cnt++; continue; } int prevRunQty = runWips.Sum(x => x.UnitQty); int preWaitQty = waitWips.Sum(x => x.UnitQty); runQty += prevRunQty; waitQty += preWaitQty; total += runQty + waitQty; foreach (FabStep prevStep in preSteps) { if (prevStep.StepType == "MAIN") { step = prevStep; } if (step == null) { continue; } } cnt++; } int compareQty = currentUnitQty + total; string desc = string.Format("[SmallSize:{0}, CompareQty:{1}, IsLast:{2}]", smallSize, compareQty, isLastPlan); if (compareQty > smallSize) { score = 1f; } return(new WeightValue(score * factor.Factor, desc)); }
public WeightValue CU_DENSITY_3402(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } FabAoEquipment eqp = target as FabAoEquipment; FabLot lot = entity as FabLot; FabStep step = lot.CurrentFabStep; string targetStep = "3402"; int limitDensity = (int)factor.Criteria[0]; if (limitDensity == 0) { return(new WeightValue(0)); } float currDensity = eqp.AcidDensity == null ? 0 : eqp.AcidDensity.CurrentAcid; string desc = string.Format("[Density:{0}, Limit:{1}]", currDensity, limitDensity); float score = 0f; if (step.StepID == targetStep && currDensity < limitDensity) { score = 1f; } return(new WeightValue(score * factor.Factor, desc)); }
public WeightValue NEXT_STEP_RUN_PRIORITY(ISimEntity entity, DateTime now, ActiveObject target, WeightFactor factor, IDispatchContext ctx) { if (factor.Factor == 0) { return(new WeightValue(0)); } float criteria0 = WeightHelper.GetCriteria(factor, 0, 0.5f); FabAoEquipment eqp = target as FabAoEquipment; FabLot lot = entity as FabLot; FabStep nextStep = BopHelper.GetNextMandatoryStep(lot); float score = 0f; int workingCnt = 0; int adv = 0; if (nextStep != null && nextStep.IsMandatoryStep) { bool checkProductVersion = true; var workingEqps = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion); //checkProductVersion = false if (workingEqps == null || workingEqps.Count == 0) { checkProductVersion = false; workingEqps = nextStep.StdStep.GetWorkingEqpList(lot, checkProductVersion); } workingCnt = workingEqps == null ? 0 : workingEqps.Count; if (workingCnt > 0) { score = checkProductVersion ? 1f : criteria0; } var hasDummy = workingEqps.Find(t => t.IsDummyWait) != null; if (hasDummy) { adv = 2; score *= adv; } } string nextStepID = nextStep != null ? nextStep.StepID : Constants.NULL_ID; string desc = string.Format("[Next:{0}, Working:{1}, Adv:{2}]", nextStepID, workingCnt, adv); return(new WeightValue(score * factor.Factor, desc)); }
public static bool TryGetEqpWeightFactor(AoEquipment aeqp, string factorName, out WeightFactor wf) { wf = WeightHelper.GetWeightFactor(aeqp.Target.Preset, factorName); if (wf == null || wf.Factor == 0) { return(false); } return(true); }
private void BuildWeightFactor(WeightFactor f, WeightPresets item) { if (f.Name == Constants.WF_ALLOW_RUN_DOWN_TIME) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); decimal inflowHour; if (decimal.TryParse(criteria[0], out inflowHour) == false) { inflowHour = 0; } f.Criteria = new object[] { inflowHour }; } else if (f.Name == Constants.WF_MAX_MOVE_LIMIT_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); decimal limitQty; if (decimal.TryParse(criteria[0], out limitQty) == false) { limitQty = decimal.MaxValue; } f.Criteria = new object[] { limitQty }; } else if (f.Name == Constants.WF_MIN_MOVEQTY_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); int minMoveQty; if (int.TryParse(criteria[0], out minMoveQty) == false) { minMoveQty = 0; } f.Criteria = new object[] { minMoveQty }; } else if (f.Name == Constants.WF_STEP_TARGET_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); int precedeDay; int delayDay; if (int.TryParse(criteria[0], out precedeDay) == false) { precedeDay = 0; } if (int.TryParse(criteria[1], out delayDay) == false) { delayDay = 0; } f.Criteria = new object[] { precedeDay, delayDay }; } else if (f.Name == Constants.WF_NEW_EQP_ASSIGN_FILTERING) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); double param1; if (double.TryParse(criteria[0], out param1) == false) { param1 = 0; } double param2; if (double.TryParse(criteria[1], out param2) == false) { param2 = 0; } f.Criteria = new object[] { param1, param2 }; } else if (f.Name == Constants.WF_SETUP_FILTERING) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); decimal arg; if (decimal.TryParse(criteria[0], out arg) == false) { arg = 0; } f.Criteria = new object[] { arg }; } else if (f.Name == Constants.WF_REQUIRED_EQP_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); double inflowHour; if (double.TryParse(criteria[0], out inflowHour) == false) { inflowHour = 8; } double advantage; if (double.TryParse(criteria[1], out advantage) == false) { advantage = 0; } f.Criteria = new object[] { inflowHour, advantage }; } else if (f.Name == Constants.WF_SMALL_BATCH_MERGE_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); int arg1; if (int.TryParse(criteria[0], out arg1) == false) { arg1 = 80; } int arg2; if (int.TryParse(criteria[1], out arg2) == false) { arg2 = 2; } f.Criteria = new object[] { arg1, arg2 }; } else if (f.Name == Constants.WF_LOT_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); int arg1; if (!int.TryParse(criteria[0], out arg1)) { arg1 = 1; } int arg2; if (!int.TryParse(criteria[1], out arg2)) { arg2 = 0; } f.Criteria = new object[] { arg1, arg2 }; } else if (f.Name == Constants.WF_LAST_RUN) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); float value; if (float.TryParse(criteria[0], out value) == false) { value = 1; } f.Criteria = new object[] { value }; } else if (f.Name == Constants.WF_SETUP_TIME_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); int value; if (int.TryParse(criteria[0], out value) == false) { value = 1; } f.Criteria = new object[] { value }; } else if (f.Name == Constants.WF_MAX_QTIME_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3); int value0; if (int.TryParse(criteria[0], out value0) == false) { value0 = 1; } int value1; if (int.TryParse(criteria[1], out value1) == false) { value1 = 1; } int value2; if (int.TryParse(criteria[2], out value2) == false) { value2 = 1; } f.Criteria = new object[] { value0, value1, value2 }; } else if (f.Name == Constants.WF_LAYER_BALANCE_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); decimal value; if (decimal.TryParse(criteria[0], out value) == false) { value = 1; } f.Criteria = new object[] { value }; } else if (f.Name == Constants.WF_NEXT_STEP_CONTINUOUS_PRODUCTION_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3); int value0; if (int.TryParse(criteria[0], out value0) == false) { value0 = 3; } int value1; if (int.TryParse(criteria[1], out value1) == false) { value1 = 120; } int value2; if (int.TryParse(criteria[2], out value2) == false) { value2 = 400; } f.Criteria = new object[] { value0, value1, value2 }; } else if (f.Name == Constants.WF_LAYER_BALANCE_FOR_PHOTO) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); int value; if (int.TryParse(criteria[0], out value) == false) { value = 1; } f.Criteria = new object[] { value }; } else if (f.Name == Constants.WF_ASSIGN_STEP_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); int value; if (int.TryParse(criteria[0], out value) == false) { value = 1; } f.Criteria = new object[] { value }; } else if (f.Name == Constants.WF_OWNER_TYPE_PRIORITY) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 3); f.Criteria = new object[] { criteria }; } else if (f.Name == Constants.WF_CU_DENSITY_3400) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); int acidLimit1; if (int.TryParse(criteria[0], out acidLimit1) == false) { acidLimit1 = 0; } f.Criteria = new object[] { acidLimit1 }; } else if (f.Name == Constants.WF_CU_DENSITY_3402) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); int acidLimit2; if (int.TryParse(criteria[0], out acidLimit2) == false) { acidLimit2 = 0; } f.Criteria = new object[] { acidLimit2 }; } else if (f.Name == Constants.WF_SMALL_LOT) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 2); int unitQyt; if (!int.TryParse(criteria[0], out unitQyt)) { unitQyt = 0; } int stepCount; if (!int.TryParse(criteria[1], out stepCount)) { stepCount = 0; } f.Criteria = new object[] { unitQyt, stepCount }; } else if (f.Name == Constants.WF_ALLOW_SMALL_LOT_FILTER) { var criteria = WeightHelper.ParseCriteria(item.CRITERIA, 1); decimal inflowHour; if (decimal.TryParse(criteria[0], out inflowHour) == false) { inflowHour = 0; } f.Criteria = new object[] { inflowHour }; } }