/// <summary> /// </summary> /// <param name="pegPart"/> /// <param name="isRun"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public TimeSpan GET_TAT0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, TimeSpan prevReturnValue) { MicronBETestBEPegPart pp = pegPart as MicronBETestBEPegPart; double tat = FindHelper.FindTAT(pp.Product.LineID, pp.Product.ProductID, pp.CurrentStep.StepID, isRun); return(TimeSpan.FromSeconds(tat)); }
/// <summary> /// </summary> /// <param name="pegPart"/> /// <param name="isRun"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public TimeSpan GET_TAT0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, TimeSpan prevReturnValue) { try { MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart; StepTat stepTat = FindHelper.FindTAT(pp.Product.ProductID, pp.CurrentStep.StepID, pp.Product.LineID); if (stepTat == null) { return(TimeSpan.FromSeconds(0)); } double tat = 0; if (isRun) { tat = (double)stepTat.RUN_TAT; } else { tat = (double)stepTat.WAIT_TAT; } return(TimeSpan.FromSeconds(tat)); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(default(TimeSpan)); } }
/// <summary> /// </summary> /// <param name="wstep"/> /// <param name="wlot"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public WorkLot UPDATE0(WorkStep wstep, WorkLot wlot, ref bool handled, WorkLot prevReturnValue) { try { MicronBEAssyBELot lot = wlot.Batch as MicronBEAssyBELot; bool isRun = JobChangeHelper.IsRun(lot); DateTime availableTime = FindHelper.GetNowDT(); MicronBEAssyEqp eqp = FindHelper.FindEquipment(lot.CurrentPlan.ResID); double tactTime = SimulationHelper.GetTactTime(lot.LineID, lot.CurrentStepID, lot.Product.ProductID, eqp); StepTat stepTat = FindHelper.FindTAT(lot.Product.ProductID, lot.CurrentStepID, lot.LineID); if (isRun) { #if DEBUG //var nowDt = FindHelper.GetNowDT(); if (lot.LotID == "LOT11_1" && lot.CurrentStepID == "S0200") { Console.WriteLine(); } //if (nowDt >= new DateTime(2018, 06, 12, 11, 40, 00)) // Console.WriteLine(); #endif double runTat = stepTat == null ? 0 : (double)stepTat.RUN_TAT; #if DEBUG if (runTat > 0) { Console.WriteLine(); } #endif availableTime = availableTime.AddSeconds(tactTime * lot.UnitQtyDouble + runTat); } else { double waitTat = stepTat == null ? 0 : (double)stepTat.WAIT_TAT; #if DEBUG if (waitTat > 0) { Console.WriteLine(); } #endif availableTime = availableTime.AddSeconds(waitTat); } AoEquipment reservationEqp = isRun ? null : lot.ReservationEqp; MicronBEAssyWorkLot newWorkLot = CreateHelper.CreateWorkLot(wlot.Batch, availableTime, wstep.Key, wstep.Steps[0], reservationEqp); return(newWorkLot); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(default(WorkLot)); } }