/// <summary> /// </summary> /// <param name="entity"/> /// <param name="now"/> /// <param name="target"/> /// <param name="factor"/> /// <param name="ctx"/> /// <returns/> public WeightValue LAYER_BALANCE_FOR_PHOTO(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)); } FabLot lot = entity as FabLot; int checkStepCount = (int)factor.Criteria[0]; if (checkStepCount == 0) { checkStepCount = 10; } var currentStep = lot.CurrentFabStep; var currentProd = lot.FabProduct; FabStep nextPhoto = currentStep.GetNextPhotoNearByMe(currentProd, checkStepCount, out _); LayerStats sts = WeightHelper.GetLayerBalacne(nextPhoto.StdStep.DspEqpGroup); if (sts == null) { AoEquipment aeqp = null; foreach (var eqp in nextPhoto.StdStep.AllEqps) { aeqp = AoFactory.Current.GetEquipment(eqp.EqpID); if (aeqp != null) { break; } } if (aeqp == null) { return(new WeightValue(0)); } sts = WeightHelper.CalcLayerBalance(aeqp); } LayerStats.StepWipStat wipStat = sts.GetWipStat(nextPhoto.StdStepID); string desc = string.Empty; float score = 0f; if (wipStat != null) { score = sts.GetLayerBalanceScore(wipStat, out desc); } return(new WeightValue(score * factor.Factor, desc)); }
/// <summary> /// </summary> /// <param name="entity"/> /// <param name="now"/> /// <param name="target"/> /// <param name="factor"/> /// <param name="ctx"/> /// <returns/> public WeightValue LAYER_BALANCE_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; LayerStats sts = ctx.Get(Constants.WF_LAYER_BALANCE_PRIORITY, default(LayerStats)); LayerStats.StepWipStat wipStat = sts.GetWipStat(lot.CurrentStep.StdStepID); string desc = string.Empty; float score = 0f; if (wipStat != null) { score = sts.GetLayerBalanceScore(wipStat, out desc); } return(new WeightValue(score * factor.Factor, desc)); }