Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs
===================================================================
diff -u -r3d6eb89c816218f1cb062f0ad3b0d944942f62e3 -r1e533850c7711172462df1e8f569b9f3ff950045
--- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 3d6eb89c816218f1cb062f0ad3b0d944942f62e3)
+++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 1e533850c7711172462df1e8f569b9f3ff950045)
@@ -36,19 +36,28 @@
///
/// Service that provides methods for performing Hydra-Ring calculations for marginal wave statistics.
///
- internal static class WaveHeightCalculationService
+ public class WaveHeightCalculationService : IWaveHeightCalculationService
{
private static readonly ILog log = LogManager.GetLogger(typeof(WaveHeightCalculationService));
+ private static IWaveHeightCalculationService instance;
///
- /// Performs validation of the values in the given . Error information is logged during
- /// the execution of the operation.
+ /// Gets or sets an instance of .
///
- /// The name to use in the validation logs.
- /// The HLCD file that should be used for performing the calculation.
- /// False if the connection to contains validation errors; True otherwise.
- internal static bool Validate(string name, string hydraulicBoundaryDatabaseFilePath)
+ public static IWaveHeightCalculationService Instance
{
+ get
+ {
+ return instance ?? (instance = new WaveHeightCalculationService());
+ }
+ set
+ {
+ instance = value;
+ }
+ }
+
+ public bool Validate(string name, string hydraulicBoundaryDatabaseFilePath)
+ {
CalculationServiceHelper.LogValidationBeginTime(name);
string validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(hydraulicBoundaryDatabaseFilePath);
@@ -65,20 +74,10 @@
return isValid;
}
- ///
- /// Performs a wave height calculation based on the supplied and returns the result
- /// if the calculation was successful. Error and status information is logged during the execution of the operation.
- ///
- /// The message provider for the services.
- /// 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.
- /// A on a successful calculation, null otherwise.
- internal static ReliabilityIndexCalculationOutput Calculate(ICalculationMessageProvider messageProvider,
- IHydraulicBoundaryLocation hydraulicBoundaryLocation,
- string hydraulicBoundaryDatabaseFilePath,
- string ringId, double norm)
+ public ReliabilityIndexCalculationOutput Calculate(ICalculationMessageProvider messageProvider,
+ IHydraulicBoundaryLocation hydraulicBoundaryLocation,
+ string hydraulicBoundaryDatabaseFilePath,
+ string ringId, double norm)
{
var hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath);
var input = CreateInput(hydraulicBoundaryLocation, norm);