private static string ParseFilteredInfo(EqpDispatchInfo info, ref int filteredWipCnt) { if (info.FilterInfos.Count == 0) { return(string.Empty); } StringBuilder result = new StringBuilder(); foreach (KeyValuePair <string, EntityFilterInfo> filtered in info.FilterInfos) { EntityFilterInfo filterInfo = filtered.Value; filteredWipCnt += filterInfo.FilterWips.Count; StringBuilder fsb = new StringBuilder(); fsb.Append(filterInfo.Reason); fsb.Append(':'); bool first = true; foreach (FabLot fw in filterInfo.FilterWips) { StringBuilder sb = new StringBuilder(); if (!first) { sb.Append(";"); } else { first = false; } SetDefaultLotInfo(sb, fw); fsb.Append(sb); } fsb.Append("\t"); result.Append(fsb); } return(result.ToString()); }
/// <summary> /// </summary> /// <param name="aeqp"/> /// <param name="proc"/> /// <param name="handled"/> public void ON_BEGIN_SETUP0(Mozart.SeePlan.Simulation.AoEquipment aeqp, Mozart.SeePlan.Simulation.AoProcess proc, ref bool handled) { FabAoEquipment eqp = aeqp.ToFabAoEquipment(); EqpDispatchInfo info = aeqp.EqpDispatchInfo; FabLot lot = proc.Entity as FabLot; bool isAheadSetup = eqp.AvailableSetupTime < aeqp.NowDT; if (isAheadSetup) { DispatchLogHelper.UpdateDispatchLogByAheadSetup(eqp, info); } if (eqp.IsAcidConst && eqp.AcidDensity.IsSetupMark) { DateTime inTime = isAheadSetup ? eqp.AvailableSetupTime : eqp.NowDT; AcidMaster.ResetAcidDensity(eqp, lot, inTime); } }
public static void WriteDispatchLog(FabAoEquipment eqp, EqpDispatchInfo info, FabSubEqp subEqp) { if (eqp == null || info == null) { return; } DateTime dispatchTime = info.DispatchTime; if (dispatchTime == DateTime.MinValue || dispatchTime == DateTime.MaxValue) { return; } string dispatchTimeStr = LcdHelper.DbToString(dispatchTime); var last = eqp.LastPlan as FabPlanInfo; string eqpID = eqp.EqpID; string subEqpID = string.Empty; if (subEqp != null) { subEqpID = subEqp.SubEqpID; last = subEqp.LastPlan as FabPlanInfo; } var table = OutputMart.Instance.EqpDispatchLog; var row = table.Find(eqpID, subEqpID, dispatchTimeStr); //parent EqpID 존재시 if (row == null) { if (eqp.IsParallelChamber && subEqp != null) { row = table.Find(eqpID, string.Empty, dispatchTimeStr); } } if (row == null) { row = new EqpDispatchLog(); row.EQP_ID = eqpID; row.SUB_EQP_ID = subEqpID; row.DISPATCHING_TIME = dispatchTimeStr; table.Add(row); } FabEqp targetEqp = eqp.TargetEqp; row.VERSION_NO = ModelContext.Current.VersionNo; row.FACTORY_ID = targetEqp.FactoryID; row.SHOP_ID = targetEqp.ShopID; row.EQP_GROUP = targetEqp.EqpGroup; row.SUB_EQP_ID = subEqpID; if (last != null) { StringBuilder sb = GetDefaultLotInfo(last.LotID, last.ProductID, last.ProductVersion, last.StepID, last.UnitQty.ToString(), last.OwnerType, last.OwnerID, Constants.NULL_ID); row.LAST_WIP = sb.ToString(); } row.SELECTED_WIP = info.SelectedWipLog; row.DISPATCH_WIP_LOG = ParseDispatchWipLog(info); int filteredWipCnt = 0; row.FILTERED_WIP_LOG = ParseFilteredInfo(info, ref filteredWipCnt); row.FILTERED_WIP_CNT = filteredWipCnt; row.SELECTED_WIP_CNT = string.IsNullOrWhiteSpace(info.SelectedWipLog) ? 0 : info.SelectedWipLog.Split(';').Length; row.INIT_WIP_CNT = row.FILTERED_WIP_CNT + info.Batches.Count; if (targetEqp.Preset != null) { row.PRESET_ID = targetEqp.Preset.Name; } }