Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs
===================================================================
diff -u -r75ac52f6f7e203e77dd212e6c32d68e7e58c28b2 -r8aea6e032ff8aeb4a4f1b85210fd0e2fbbce3a4a
--- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision 75ac52f6f7e203e77dd212e6c32d68e7e58c28b2)
+++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision 8aea6e032ff8aeb4a4f1b85210fd0e2fbbce3a4a)
@@ -24,7 +24,7 @@
using Core.Common.Base.Service;
using Core.Common.Utils;
using log4net;
-using Ringtoets.Common.Service.Properties;
+using Ringtoets.Common.Service.MessageProviders;
using Ringtoets.HydraRing.Calculation.Activities;
using Ringtoets.HydraRing.Calculation.Data.Output;
using Ringtoets.HydraRing.Data;
@@ -41,29 +41,37 @@
private readonly double norm;
private readonly string hydraulicBoundaryDatabaseFilePath;
private readonly string ringId;
+ private readonly ICalculationMessageProvider messageProvider;
///
/// Creates a new instance of .
///
+ /// The provider of the messages to use during the calculation.
/// The to perform the calculation for.
/// The HLCD file that should be used for performing the calculation.
/// The id of the ring to perform the calculation for.
/// The norm to use during the calculation.
/// Thrown when is null.
- public WaveHeightCalculationActivity(IHydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm)
+ public WaveHeightCalculationActivity(ICalculationMessageProvider messageProvider,
+ IHydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm)
{
+ if (messageProvider == null)
+ {
+ throw new ArgumentNullException("messageProvider");
+ }
+ this.messageProvider = messageProvider;
+
if (hydraulicBoundaryLocation == null)
{
throw new ArgumentNullException("hydraulicBoundaryLocation");
}
-
this.hydraulicBoundaryLocation = hydraulicBoundaryLocation;
+
this.hydraulicBoundaryDatabaseFilePath = hydraulicBoundaryDatabaseFilePath;
this.ringId = ringId;
this.norm = norm;
- Name = string.Format(Resources.WaveHeightCalculationService_Name_Calculate_wave_height_for_location_0_,
- hydraulicBoundaryLocation.Name);
+ Name = messageProvider.GetActivityName(hydraulicBoundaryLocation.Name);
}
protected override void OnRun()
@@ -74,10 +82,13 @@
return;
}
- PerformRun(() => WaveHeightCalculationService.Validate(hydraulicBoundaryLocation, hydraulicBoundaryDatabaseFilePath),
+ PerformRun(() => WaveHeightCalculationService.Validate(
+ messageProvider.GetCalculationName(hydraulicBoundaryLocation.Name),
+ hydraulicBoundaryDatabaseFilePath),
() => hydraulicBoundaryLocation.WaveHeight = (RoundedDouble) double.NaN,
- () => WaveHeightCalculationService.Calculate(hydraulicBoundaryLocation, hydraulicBoundaryDatabaseFilePath,
- ringId, norm));
+ () => WaveHeightCalculationService.Calculate(
+ messageProvider, hydraulicBoundaryLocation, hydraulicBoundaryDatabaseFilePath,
+ ringId, norm));
}
protected override void OnFinish()
@@ -89,7 +100,7 @@
Math.Abs(Output.CalculatedReliabilityIndex - StatisticsConverter.NormToBeta(norm)) <= 1.0e-3;
if (!waveHeightCalculationConvergence)
{
- log.WarnFormat(Resources.WaveHeightCalculationActivity_WaveHeight_calculation_for_location_0_not_converged, hydraulicBoundaryLocation.Name);
+ log.WarnFormat(messageProvider.GetCalculatedNotConvergedMessage(hydraulicBoundaryLocation.Name));
}
hydraulicBoundaryLocation.WaveHeightCalculationConvergence = waveHeightCalculationConvergence
? CalculationConvergence.CalculatedConverged