Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -r72e8e672bbfb506c8a9b71b8999591bae5cbafe7 -r19d976fb7e64bc4c23ca6a601eb47d876b1fecff --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 72e8e672bbfb506c8a9b71b8999591bae5cbafe7) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 19d976fb7e64bc4c23ca6a601eb47d876b1fecff) @@ -188,44 +188,40 @@ return; } + GeneralResult generalResult = designWaterLevelCalculation.CalculateIllustrationPoints + ? GetGeneralResult(calculator.IllustrationPointsResult) + : null; + HydraulicBoundaryLocationOutput hydraulicBoundaryLocationOutput = CreateHydraulicBoundaryLocationOutput( - messageProvider, designWaterLevelCalculation.Name, calculationInput.Beta, norm, calculator.Converged); + messageProvider, designWaterLevelCalculation.Name, calculationInput.Beta, norm, calculator.Converged, generalResult); - if (designWaterLevelCalculation.CalculateIllustrationPoints) - { - SetGeneralResult(hydraulicBoundaryLocationOutput, calculator.IllustrationPointsResult); - } - designWaterLevelCalculation.Output = hydraulicBoundaryLocationOutput; } /// - /// Sets a based on the information - /// of to the . + /// Gets a based on the information of . /// - /// The - /// for which to set the . /// The to base the /// to create on. - private void SetGeneralResult(HydraulicBoundaryLocationOutput hydraulicBoundaryLocationOutput, - HydraRingGeneralResult hydraRingGeneralResult) + /// A . + private GeneralResult GetGeneralResult(HydraRingGeneralResult hydraRingGeneralResult) { if (hydraRingGeneralResult == null) { log.Warn(calculator.IllustrationPointsParserErrorMessage); - return; + return null; } try { - GeneralResult generalResult = - GeneralResultConverter.ConvertToGeneralResultTopLevelSubMechanismIllustrationPoint(hydraRingGeneralResult); - hydraulicBoundaryLocationOutput.SetGeneralResult(generalResult); + return GeneralResultConverter.ConvertToGeneralResultTopLevelSubMechanismIllustrationPoint(hydraRingGeneralResult); } catch (IllustrationPointConversionException e) { log.Warn(Resources.SetGeneralResult_Converting_IllustrationPointResult_Failed, e); } + + return null; } /// @@ -236,6 +232,7 @@ /// The target reliability for the calculation. /// The target probability for the calculation. /// The value indicating whether the calculation converged. + /// The general result with illustration points. /// A . /// Thrown when /// or the calculated probability falls outside the [0.0, 1.0] range and is not . @@ -244,7 +241,8 @@ string hydraulicBoundaryLocationName, double targetReliability, double targetProbability, - bool? calculatorConverged) + bool? calculatorConverged, + GeneralResult generalResult) { double designWaterLevel = calculator.DesignWaterLevel; double reliability = calculator.ReliabilityIndex; @@ -259,7 +257,8 @@ return new HydraulicBoundaryLocationOutput(designWaterLevel, targetProbability, targetReliability, probability, reliability, - converged); + converged, + generalResult); } ///