Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationService.cs
===================================================================
diff -u -rf744bb990260662f885d34811a1ea042dae18550 -rdfce818445fc8caa5830d14adc585926a32bfb40
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision f744bb990260662f885d34811a1ea042dae18550)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision dfce818445fc8caa5830d14adc585926a32bfb40)
@@ -21,7 +21,6 @@
using System.IO;
using log4net;
-using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Service;
using Ringtoets.HydraRing.Calculation.Data;
using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics;
@@ -44,18 +43,18 @@
private static readonly ILog log = LogManager.GetLogger(typeof(WaveHeightCalculationService));
///
- /// Performs validation of the values in the given . Error information is logged during
+ /// Performs validation of the values in the given . Error information is logged during
/// the execution of the operation.
///
- /// The for which to validate the values.
/// The for which to validate the values.
- /// False if contains validation errors; True otherwise.
- internal static bool Validate(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ /// 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(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath)
{
var calculationName = string.Format(Resources.WaveHeightCalculationService_Name_Wave_height_for_location_0_, hydraulicBoundaryLocation.Name);
CalculationServiceHelper.LogValidationBeginTime(calculationName);
- string validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(hydraulicBoundaryDatabase.FilePath);
+ string validationProblem = HydraulicDatabaseHelper.ValidatePathForCalculation(hydraulicBoundaryDatabaseFilePath);
var isValid = string.IsNullOrEmpty(validationProblem);
if (!isValid)
@@ -73,16 +72,16 @@
/// 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 to base the input for the calculation upon.
- /// The to base the input for the calculation upon.
/// 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(IAssessmentSection assessmentSection, HydraulicBoundaryDatabase hydraulicBoundaryDatabase,
- HydraulicBoundaryLocation hydraulicBoundaryLocation, string ringId)
+ internal static ReliabilityIndexCalculationOutput Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath,
+ string ringId, int norm)
{
- var hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabase.FilePath);
- var input = CreateInput(assessmentSection, hydraulicBoundaryLocation);
+ var hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath);
+ var input = CreateInput(hydraulicBoundaryLocation, norm);
var targetProbabilityCalculationParser = new ReliabilityIndexCalculationParser();
var calculationName = string.Format(Resources.WaveHeightCalculationService_Name_Wave_height_for_location_0_, hydraulicBoundaryLocation.Name);
@@ -114,9 +113,9 @@
}
}
- private static WaveHeightCalculationInput CreateInput(IAssessmentSection assessmentSection, HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ private static WaveHeightCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, int norm)
{
- return new WaveHeightCalculationInput(1, hydraulicBoundaryLocation.Id, assessmentSection.FailureMechanismContribution.Norm);
+ return new WaveHeightCalculationInput(1, hydraulicBoundaryLocation.Id, norm);
}
}
}
\ No newline at end of file