Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs =================================================================== diff -u -r72e8e672bbfb506c8a9b71b8999591bae5cbafe7 -r19d976fb7e64bc4c23ca6a601eb47d876b1fecff --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 72e8e672bbfb506c8a9b71b8999591bae5cbafe7) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 19d976fb7e64bc4c23ca6a601eb47d876b1fecff) @@ -189,44 +189,40 @@ return; } + GeneralResult generalResult = waveHeightCalculation.CalculateIllustrationPoints + ? GetGeneralResult(calculator.IllustrationPointsResult) + : null; + HydraulicBoundaryLocationOutput hydraulicBoundaryLocationOutput = CreateHydraulicBoundaryLocationOutput( - messageProvider, waveHeightCalculation.Name, calculationInput.Beta, norm, calculator.Converged); + messageProvider, waveHeightCalculation.Name, calculationInput.Beta, norm, calculator.Converged, generalResult); - if (waveHeightCalculation.CalculateIllustrationPoints) - { - SetGeneralResult(hydraulicBoundaryLocationOutput, calculator.IllustrationPointsResult); - } - waveHeightCalculation.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; } /// @@ -237,6 +233,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 . @@ -245,7 +242,8 @@ string hydraulicBoundaryLocationName, double targetReliability, double targetProbability, - bool? calculatorConverged) + bool? calculatorConverged, + GeneralResult generalResult) { double waveHeight = calculator.WaveHeight; double reliability = calculator.ReliabilityIndex; @@ -260,7 +258,7 @@ return new HydraulicBoundaryLocationOutput(waveHeight, targetProbability, targetReliability, probability, reliability, - converged); + converged, generalResult); } ///