Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs =================================================================== diff -u -r1923 -r1924 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs (.../DamWbiMacroStabilityInwardsKernelWrapper.cs) (revision 1923) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamWbiMacroStabilityInwards/DamWbiMacroStabilityInwardsKernelWrapper.cs (.../DamWbiMacroStabilityInwardsKernelWrapper.cs) (revision 1924) @@ -12,6 +12,7 @@ using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Standard.Calculation; using Deltares.DamEngine.Data.Standard.Logging; +using Deltares.DamEngine.Data.Geotechnics; using Deltares.WTIStability.Calculation.Wrapper; namespace Deltares.DamEngine.Calculators.KernelWrappers.DamWbiMacroStabilityInwards @@ -332,8 +333,33 @@ public bool EvaluateDesign(DamKernelInput damKernelInput, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out DesignAdvise designAdvise, out string evaluationMessage) { - // ToDo: Not clear yet if this must be done or how - throw new NotImplementedException(); + DamWbiMacroStabilityInput macroStabilityInput = kernelDataInput as DamWbiMacroStabilityInput; + DamWbiMacroStabilityOutput macroStabilityOutput = kernelDataOutput as DamWbiMacroStabilityOutput; + ThrowWhenWbiMacroStabilityKernelInputNull(macroStabilityInput); + ThrowWhenWbiMacroStabilityKernelOutputNull(macroStabilityOutput); + ThrowWhenWbiMacroStabilityDamKernelInputNull(damKernelInput); + + double fosRequired = damKernelInput.Location.ModelFactors.RequiredSafetyFactorStabilityInnerSlope.Value; + double fosAchieved = macroStabilityOutput.StabilityOutputItems[0].SafetyFactor; + //ToDo MWDAM-1357: not clear where the exitPointXCoordinate must come from + //double exitPointXCoordinate = macroStabilityOutput.StabilityOutputItems[0].CircleSurfacePointRightXCoordinate; + double exitPointXCoordinate = 1.123; // ToDo replace by value aboven. set a value for test. + GeometryPoint limitPointForShoulderDesign = damKernelInput.Location.SurfaceLine.GetLimitPointForShoulderDesign(); + evaluationMessage = String.Format(Resources.FactorAchievedVsFactorRequired, fosAchieved, fosRequired); + if (exitPointXCoordinate > limitPointForShoulderDesign.X) + { + designAdvise = DesignAdvise.ShoulderInwards; + } + else + { + designAdvise = DesignAdvise.SlopeInwards; + } + bool isDesignReady = fosAchieved >= fosRequired; + if (isDesignReady) + { + designAdvise = DesignAdvise.None; + } + return isDesignReady; } public void PrepareDesign(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput,