Index: Ringtoets/Common/src/Ringtoets.Common.Service/Structures/StructuresCalculationServiceBase.cs =================================================================== diff -u -r72fbec29bf25dac587490ccccd1ed3a70e3da188 -r2f37bb8c74690c7f8b8fb2518deaa51f75983f14 --- Ringtoets/Common/src/Ringtoets.Common.Service/Structures/StructuresCalculationServiceBase.cs (.../StructuresCalculationServiceBase.cs) (revision 72fbec29bf25dac587490ccccd1ed3a70e3da188) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Structures/StructuresCalculationServiceBase.cs (.../StructuresCalculationServiceBase.cs) (revision 2f37bb8c74690c7f8b8fb2518deaa51f75983f14) @@ -22,7 +22,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.IO; using System.Linq; using Core.Common.Base.IO; using log4net; @@ -122,27 +121,25 @@ /// /// The that holds all the information required to perform the calculation. /// The general inputs used in the calculations. - /// The path which points to the hydraulic boundary database file. - /// The preprocessor directory. - /// Preprocessing is disabled when equals . - /// Thrown when , , - /// or is null. - /// Thrown when the + /// The containing all data + /// to perform a hydraulic boundary calculation. + /// Preprocessing is disabled when the preprocessor directory equals . + /// Thrown when any parameter is null. + /// Thrown when the hydraulic boundary database file path /// contains invalid characters. /// Thrown when an unexpected /// enum value is encountered. /// Thrown when: /// - /// No settings database file could be found at the location of + /// No settings database file could be found at the location of the hydraulic boundary database file path /// with the same name. /// Unable to open settings database file. /// Unable to read required data from database file. /// /// Thrown when an error occurs while performing the calculation. public void Calculate(StructuresCalculation calculation, TGeneralInput generalInput, - string hydraulicBoundaryDatabaseFilePath, - string preprocessorDirectory) + HydraulicBoundaryCalculationSettings calculationSettings) { if (calculation == null) { @@ -154,11 +151,18 @@ throw new ArgumentNullException(nameof(generalInput)); } - TCalculationInput input = CreateInput(calculation.InputParameters, generalInput, hydraulicBoundaryDatabaseFilePath, !string.IsNullOrEmpty(preprocessorDirectory)); + if (calculationSettings == null) + { + throw new ArgumentNullException(nameof(calculationSettings)); + } - string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); - var settings = new HydraRingCalculationSettings(hlcdDirectory, preprocessorDirectory); - calculator = HydraRingCalculatorFactory.Instance.CreateStructuresCalculator(settings); + TCalculationInput input = CreateInput(calculation.InputParameters, + generalInput, + calculationSettings.HydraulicBoundaryDatabaseFilePath, + !string.IsNullOrEmpty(calculationSettings.PreprocessorDirectory)); + + calculator = HydraRingCalculatorFactory.Instance.CreateStructuresCalculator( + HydraRingCalculationSettingsFactory.CreateSettings(calculationSettings)); string calculationName = calculation.Name; CalculationServiceHelper.LogCalculationBegin();