/// <summary> /// </summary> /// <param name="da"/> /// <param name="hb"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public bool INTERCEPT_IN0(DispatchingAgent da, IHandlingBatch hb, ref bool handled, bool prevReturnValue) { try { MicronBEAssyBEStep currentStep = hb.CurrentStep as MicronBEAssyBEStep; MicronBEAssyBELot lot = hb as MicronBEAssyBELot; if (lot.Product is AssyMcpPart) { AssyMcpPart mcpPart = lot.Product as AssyMcpPart; AssyMcpProduct mcpProduct = mcpPart.FinalProduct as AssyMcpProduct; if (mcpPart.PartChangeStep == lot.CurrentStepID) { Tuple <AssyMcpProduct, AssyMcpPart> baseKey = null; Tuple <AssyMcpProduct, AssyMcpPart> sourceKey = null; AssyMcpPart mergeMcpPart = McpHelper.GetMergeMcpPart(mcpPart); if (mcpPart.IsBase) { baseKey = Tuple.Create(mcpProduct, mcpPart); sourceKey = Tuple.Create(mcpProduct, mergeMcpPart); InputMart.Instance.MatchingLotList.Add(baseKey, lot); } else { baseKey = Tuple.Create(mcpProduct, mergeMcpPart); sourceKey = Tuple.Create(mcpProduct, mcpPart); InputMart.Instance.MatchingLotList.Add(sourceKey, lot); } List <MicronBEAssyBELot> matchLotList = SimulationHelper.MatchingMcpLot(da, baseKey, sourceKey); foreach (MicronBEAssyBELot matchLot in matchLotList) { da.ReEnter(matchLot); } return(true); } } return(false); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(default(bool)); } }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="hb"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public bool IS_HOLD0(DispatchingAgent da, IHandlingBatch hb, ref bool handled, bool prevReturnValue) { FabLot lot = hb.ToFabLot(); //FabWipInfo wip = lot.Wip; //FabPlanInfo plan = lot.CurrentFabPlan; if (lot.IsInitHold) { InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait); return(true); } return(false); }
/// <summary> /// </summary> /// <param name="factory"/> /// <param name="hb"/> /// <param name="handled"/> public void LOCATE_FOR_DISPATCH1(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled) { FabLot lot = hb.ToFabLot(); if (CheckSimulationRunType(lot) == false) { return; } if (hb.IsFinished) { factory.Router.AddInitial((Entity)hb, hb.IsFinished); } else { //InPortWip 처리 if (InitInPortWip(factory, hb)) { return; } var router = EntityControl.Instance; string dispatchKey = router.GetLotDispatchingKey(hb); DispatchingAgent da = factory.GetDispatchingAgent(dispatchKey); if (da == null) { if (factory.DispatchingAgents.Count > 0) { ModelContext.Current.ErrorLister.Write("Entity/WipInit/LocateForDispatch", Mozart.DataActions.ErrorType.Warning, Strings.CAT_SIM_SECONDRESOURCE, string.Format(Strings.WARN_INVALID_IMPLEMENTATION, "Entity/WipInit/LocateForDispatch")); da = factory.DispatchingAgents.FirstOrDefault().Value; } else { throw new InvalidOperationException(Strings.EXCEPTION_NO_REGISTERED_DISPATCHINGAGENT); } } InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait); da.Take(hb); } }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="hb"/> /// <param name="handled"/> public void ON_DISPATCH_IN0(DispatchingAgent da, IHandlingBatch hb, ref bool handled) { try { #if DEBUG if (hb.Sample.LotID == "LOT10_L") { Console.WriteLine(); } #endif SimulationHelper.CollectEqpPlan(hb, null, LoadState.WAIT.ToString()); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); } }
public object GET_LOT_GROUP_KEY0(DispatchingAgent da, IHandlingBatch hb, ref bool handled, object prevReturnValue) { if (InputMart.Instance.GlobalParameters.ApplyLotGroupDispatching == false) { return(null); } FabLot lot = hb.ToFabLot(); FabStep step = lot.CurrentFabStep; string stepID = step.StepID; string productID = lot.CurrentProductID; string prodVer = step.NeedVerCheck ? lot.CurrentProductVersion : Constants.NULL_ID; string onwerType = lot.OwnerType; string onwerID = lot.OwnerID; return(LcdHelper.CreateKey(stepID, productID, prodVer, onwerType, onwerID)); }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="aeqp"/> /// <param name="wips"/> /// <param name="handled"/> public void ON_DISPATCHED0(DispatchingAgent da, AoEquipment aeqp, IHandlingBatch[] wips, ref bool handled) { if (wips != null) { DoubleDictionary <Step, object, StepPlan> stepPlans = StepPlanManager.Current.RunPlans; foreach (var wip in wips) { foreach (var stepPlan in stepPlans) { if (stepPlan.Step.StepID != wip.CurrentStep.StepID) { continue; } Tuple <string, string, string> key = stepPlan.Key as Tuple <string, string, string>; string lineID = key.Item1; string stepID = key.Item2; string prodID = key.Item3; var lot = wip.Sample as MicronBEAssyBELot; if (lineID != lot.LineID) { continue; } if (prodID != lot.Product.ProductID) { continue; } var target = stepPlan.StepTargetList.FirstOrDefault(); if (target == null) { continue; } target.Peg(lot, lot.UnitQty); } } } }
/// <summary> /// </summary> /// <param name="factory"/> /// <param name="hb"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public bool LOCATE_FOR_OTHERS0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled, bool prevReturnValue) { FabLot lot = hb.ToFabLot(); if (lot.LotID == "TH9A1308N3B") { Console.WriteLine(); } if (lot.IsHold || lot.IsMove) { var router = EntityControl.Instance; string dispatchKey = router.GetLotDispatchingKey(hb); DispatchingAgent da = factory.GetDispatchingAgent(dispatchKey); lot.IsInitHold = true; da.Take(hb); return(true); } return(false); }
public static List <MicronBEAssyBELot> MatchingMcpLot(DispatchingAgent da, Tuple <AssyMcpProduct, AssyMcpPart> baseKey, Tuple <AssyMcpProduct, AssyMcpPart> sourceKey) { List <MicronBEAssyBELot> matchLotList = new List <MicronBEAssyBELot>(); return(matchLotList); //try //{ // List<MicronBEAssyBELot> matchLotList = new List<MicronBEAssyBELot>(); // ICollection<MicronBEAssyBELot> baseLotList; // if (InputMart.Instance.MatchingLotList.TryGetValue(baseKey, out baseLotList) == false) // return matchLotList; // ICollection<MicronBEAssyBELot> sourceLotList; // if (InputMart.Instance.MatchingLotList.TryGetValue(sourceKey, out sourceLotList) == false) // return matchLotList; // List<MicronBEAssyBELot> baseLots = new List<MicronBEAssyBELot>(baseLotList); // foreach (MicronBEAssyBELot baseLot in baseLots) // { // double sourceQty = sourceLotList.Sum(x => x.UnitQtyDouble); // if (baseLot.UnitQtyDouble <= sourceQty) // { // baseLotList.Remove(baseLot); // matchLotList.Add(baseLot); // double baseRemainQty = baseLot.UnitQtyDouble; // List<MicronBEAssyBELot> sourceLots = new List<MicronBEAssyBELot>(sourceLotList); // foreach (MicronBEAssyBELot sourceLot in sourceLots) // { // double matchQty = 0d; // double matchCompQty = 0d; // AssyMcpPart mcpPart = FindHelper.FindProduct(sourceLot.Product.ProductID) as AssyMcpPart; // if (sourceLot.UnitQtyDouble <= baseRemainQty) // { // matchCompQty = mcpPart.CompQty; // matchQty = sourceLot.UnitQtyDouble; // baseRemainQty -= matchQty * matchCompQty; // sourceLot.UnitQtyDouble = 0d; // sourceLotList.Remove(sourceLot); // da.Factory.WipManager.Out(sourceLot); // } // else // { // matchCompQty = mcpPart.CompQty; // matchQty = baseRemainQty; // sourceLot.UnitQtyDouble -= matchQty * matchCompQty; // baseRemainQty = 0d; // } // SimulationHelper.UpdateEqpPlanQty(sourceLot, string.Empty, LoadState.WAIT.ToString(), sourceLot.UnitQtyDouble); // var part = FindHelper.FindProduct(baseLot.Product.ProductID) as AssyMcpPart; // if (part != null) // { // if (part.Next == null) // baseLot.Product = part.OutProduct; // else // baseLot.Product = part.Next; // } // //baseLot.Route = baseLot.Product.Process; // MicronBEAssyPlanInfo plan = new MicronBEAssyPlanInfo(); // plan.Init(baseLot.Product.Process.FindStep(baseLot.CurrentStep.StepID)); // plan.LotID = baseLot.LotID; // plan.UnitQty = baseLot.UnitQtyDouble; // plan.ProductID = baseLot.Product.ProductID; // plan.ProcessID = baseLot.Product.Process.ProcessID; // baseLot.SetCurrentPlan(plan); // if (baseRemainQty <= 0d) // break; // } // } // } // return matchLotList; //} //catch (Exception e) //{ // WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); // return default(List<MicronBEAssyBELot>); //} }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="aeqp"/> /// <param name="wips"/> /// <param name="dispatcher"/> /// <param name="handled"/> public void ON_DISPATCH0(DispatchingAgent da, AoEquipment aeqp, IList <IHandlingBatch> wips, IEntityDispatcher dispatcher, ref bool handled) { }
/// <summary> /// </summary> /// <param name="da"/> /// <param name="hb"/> /// <param name="destCount"/> /// <param name="handled"/> public void ON_NOT_FOUND_DESTINATION0(DispatchingAgent da, IHandlingBatch hb, int destCount, ref bool handled) { }