Index: Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs =================================================================== diff -u -rcf2dc4330cecec3b8c8acae9e195280323fc2a50 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs (.../CalculationServiceHelper.cs) (revision cf2dc4330cecec3b8c8acae9e195280323fc2a50) +++ Ringtoets/Common/src/Ringtoets.Common.Service/CalculationServiceHelper.cs (.../CalculationServiceHelper.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,8 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Linq; using log4net; using Ringtoets.Common.Service.Properties; @@ -34,50 +32,6 @@ private static readonly ILog log = LogManager.GetLogger(typeof(CalculationServiceHelper)); /// - /// Method for performing validation. Error and status information is logged during - /// the execution of the operation. - /// - /// The name of the calculation. - /// The method used to perform the validation. - /// True if has no validation errors; False otherwise. - public static bool PerformValidation(string name, Func validationFunc) - { - LogValidationBeginTime(name); - - var inputValidationResults = validationFunc(); - - if (inputValidationResults.Any()) - { - LogMessagesAsError(Resources.Error_in_validation_0, inputValidationResults); - } - - LogValidationEndTime(name); - - return !inputValidationResults.Any(); - } - - /// - /// Method for performing calculations. Error and status information is logged during - /// the execution of the operation. - /// - /// The name of the calculation. - /// The method used to perform the calculation. - /// When throws an exception, this will not be caught in this method. - public static void PerformCalculation(string name, Action calculationFunc) - { - LogCalculationBeginTime(name); - - try - { - calculationFunc(); - } - finally - { - LogCalculationEndTime(name); - } - } - - /// /// Logs messages as errors. /// /// The format for the message. Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -44,6 +44,13 @@ private IDesignWaterLevelCalculator calculator; private bool canceled; + /// + /// Performs validation over the values on the given . + /// Error and status information is logged during the execution of the operation. + /// + /// The file path of the hydraulic boundary database file which to validate. + /// The object which is used to build log messages. + /// Truec> if there were no validation errors; Falsec> otherwise. public bool Validate(string name, string hydraulicBoundaryDatabaseFilePath, ICalculationMessageProvider messageProvider) { string calculationName = messageProvider.GetCalculationName(name); @@ -60,6 +67,14 @@ return !validationProblem.Any(); } + /// + /// Performs a calculation for the design water level. + /// + /// The hydraulic boundary location used in the calculation. + /// The path which points to the hydraulic boundary database file. + /// The id of the assessment section. + /// The norm of the assessment section. + /// The object which is used to build log messages. public void Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) { string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -45,6 +46,13 @@ private IWaveHeightCalculator calculator; private bool canceled; + /// + /// Performs validation over the values on the given . + /// Error and status information is logged during the execution of the operation. + /// + /// The file path of the hydraulic boundary database file which to validate. + /// The object which is used to build log messages. + /// Truec> if there were no validation errors; Falsec> otherwise. public bool Validate(string name, string hydraulicBoundaryDatabaseFilePath, ICalculationMessageProvider messageProvider) { string calculationName = messageProvider.GetCalculationName(name); @@ -61,6 +69,14 @@ return !validationProblem.Any(); } + /// + /// Performs a calculation for wave height. + /// + /// The hydraulic boundary location used in the calculation. + /// The path which points to the hydraulic boundary database file. + /// The id of the assessment section. + /// The norm of the assessment section. + /// The object which is used to build log messages. public void Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) { string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs =================================================================== diff -u -r3d9b418d483c122040e11a7e074d666c64e9d7b5 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs (.../CalculationServiceHelperTest.cs) (revision 3d9b418d483c122040e11a7e074d666c64e9d7b5) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/CalculationServiceHelperTest.cs (.../CalculationServiceHelperTest.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -31,77 +31,6 @@ public class CalculationServiceHelperTest { [Test] - public void PerformValidation_ValidationFuncReturnsMessages_WritesLogMessagesAndReturnsFalse() - { - // Setup - string name = "Test name"; - string[] errorMessages = - { - "Error message 1" - }; - - // Call - bool valid = false; - Action call = () => valid = CalculationServiceHelper.PerformValidation(name, () => errorMessages); - - // Assert - TestHelper.AssertLogMessages(call, messages => - { - var msgs = messages.ToArray(); - Assert.AreEqual(3, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie mislukt: {0}", errorMessages[0]), msgs[1]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[2]); - }); - Assert.IsFalse(valid); - } - - [Test] - public void PerformValidation_ValidationFuncReturnsEmtpyList_WritesStartAndEndLogMessagesAndReturnsTrue() - { - // Setup - string name = "Test name"; - string[] errorMessages = - {}; - - // Call - bool valid = false; - Action call = () => valid = CalculationServiceHelper.PerformValidation(name, () => errorMessages); - - // Assert - TestHelper.AssertLogMessages(call, messages => - { - var msgs = messages.ToArray(); - Assert.AreEqual(2, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", name), msgs[1]); - }); - Assert.IsTrue(valid); - } - - [Test] - public void PerformCalculation_WithCalculation_ExecutesCalculationActionAndWritesStartAndEndAndErrorLogMessages() - { - // Setup - string name = "Test name"; - - int called = 0; - - // Call - Action call = () => CalculationServiceHelper.PerformCalculation(name, () => called++); - - // Assert - TestHelper.AssertLogMessages(call, messages => - { - var msgs = messages.ToArray(); - Assert.AreEqual(2, msgs.Length); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", name), msgs[0]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", name), msgs[1]); - }); - Assert.AreEqual(1, called); - } - - [Test] public void LogMessagesAsError_Always_LogsMessagesInGivenFormat() { // Setup Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -82,7 +82,6 @@ /// Calculation input parameters that apply to all instances. /// The amount of contribution for this failure mechanism in the assessment section. /// The directory of the HLCD file that should be used for performing the calculation. - /// A double with a value on a successful calculation, double.NaN otherwise. internal void CalculateDikeHeight(GrassCoverErosionInwardsCalculation calculation, IAssessmentSection assessmentSection, FailureMechanismSection failureMechanismSection, GeneralGrassCoverErosionInwardsInput generalInput, double failureMechanismContribution, string hlcdDirectory) Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsWaveConditionsCalculationService.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsWaveConditionsCalculationService.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationService.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsWaveConditionsCalculationService.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -30,10 +30,17 @@ namespace Ringtoets.GrassCoverErosionOutwards.Service { /// - /// Service that provides methods for performing Hydra-Ring wave conditions calculations. + /// Service that provides methods for performing Hydra-Ring wave conditions calculations for the grass cover erosion outwards failure mechanism. /// public class GrassCoverErosionOutwardsWaveConditionsCalculationService : WaveConditionsCalculationServiceBase { + /// + /// Performs validation over the values on the given and . + /// Error and status information is logged during the execution of the operation. + /// + /// The for which to validate the values. + /// The file path of the hydraulic boundary database file which to validate. + /// Truec> if there were no validation errors; Falsec> otherwise. public bool Validate(GrassCoverErosionOutwardsWaveConditionsCalculation calculation, string hydraulicBoundaryDatabaseFilePath) { return ValidateWaveConditionsInput( @@ -43,6 +50,17 @@ Resources.GrassCoverErosionOutwardsWaveConditionsCalculationService_LogMessage_DesignWaterLevel_name); } + /// + /// Performs a wave conditions calculation for the grass cover erosion outwards failure mechanism based on the supplied + /// and sets + /// if the calculation was successful. + /// Error and status information is logged during the execution of the operation. + /// + /// The that holds all the information required to perform the calculation. + /// The that holds information about the norm used in the calculation. + /// The grass cover erosion outwards failure mechanism, which contains general parameters that apply to all + /// instances. + /// The path of the HLCD file that should be used for performing the calculation. public void Calculate( GrassCoverErosionOutwardsWaveConditionsCalculation calculation, GrassCoverErosionOutwardsFailureMechanism failureMechanism, Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationActivity.cs =================================================================== diff -u -rb2306061789f5e34a6f0994552b4431d01d220f0 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationActivity.cs (.../HeightStructuresCalculationActivity.cs) (revision b2306061789f5e34a6f0994552b4431d01d220f0) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationActivity.cs (.../HeightStructuresCalculationActivity.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -23,10 +23,8 @@ using System.Linq; using Core.Common.Base.Service; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.Service; using Ringtoets.HeightStructures.Data; using Ringtoets.HydraRing.Calculation.Activities; -using Ringtoets.HydraRing.Calculation.Data.Output; namespace Ringtoets.HeightStructures.Service { Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs =================================================================== diff -u -r7eea4fd806f40a4a4516c04d57ee9995cbbbadc8 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision 7eea4fd806f40a4a4516c04d57ee9995cbbbadc8) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -58,7 +58,14 @@ /// Truec> if has no validation errors; Falsec> otherwise. public bool Validate(HeightStructuresCalculation calculation, IAssessmentSection assessmentSection) { - return CalculationServiceHelper.PerformValidation(calculation.Name, () => ValidateInput(calculation.InputParameters, assessmentSection)); + CalculationServiceHelper.LogValidationBeginTime(calculation.Name); + + var messages = ValidateInput(calculation.InputParameters, assessmentSection); + CalculationServiceHelper.LogMessagesAsError(RingtoetsCommonServiceResources.Error_in_validation_0, messages); + + CalculationServiceHelper.LogValidationEndTime(calculation.Name); + + return !messages.Any(); } public void Cancel() @@ -80,7 +87,6 @@ /// The to create the input with for the calculation. /// The amount of contribution for this failure mechanism in the assessment section. /// The directory of the HLCD file that should be used for performing the calculation. - /// A on a successful calculation, null otherwise. internal void Calculate(HeightStructuresCalculation calculation, IAssessmentSection assessmentSection, FailureMechanismSection failureMechanismSection, @@ -118,7 +124,7 @@ } finally { - log.InfoFormat("Hoogte kunstwerken berekeningsverslag. Klik op details voor meer informatie.\n{0}", calculator.OutputFileContent); + log.InfoFormat(Resources.HeightStructuresCalculationService_Calculate_Calculation_report_Click_details_for_full_report, calculator.OutputFileContent); CalculationServiceHelper.LogCalculationEndTime(calculationName); } } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.Designer.cs =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -82,6 +82,17 @@ } /// + /// Looks up a localized string similar to Hoogte kunstwerken berekeningsverslag. Klik op details voor meer informatie. + ///{0}. + /// + internal static string HeightStructuresCalculationService_Calculate_Calculation_report_Click_details_for_full_report { + get { + return ResourceManager.GetString("HeightStructuresCalculationService_Calculate_Calculation_report_Click_details_for" + + "_full_report", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De berekening voor hoogte kunstwerk '{0}' is niet gelukt.. /// internal static string HeightStructuresCalculationService_Calculate_Error_in_height_structures_0_calculation { Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.resx =================================================================== diff -u -r5e6eacaf76f765ba77febee673e9e94895e46feb -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.resx (.../Resources.resx) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Properties/Resources.resx (.../Resources.resx) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -120,4 +120,8 @@ De berekening voor hoogte kunstwerk '{0}' is niet gelukt. + + Hoogte kunstwerken berekeningsverslag. Klik op details voor meer informatie. +{0} + \ No newline at end of file Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivity.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivityBase.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivityBase.cs (.../HydraRingActivityBase.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Activities/HydraRingActivityBase.cs (.../HydraRingActivityBase.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -20,7 +20,6 @@ // All rights reserved. using Core.Common.Base.Service; -using Ringtoets.HydraRing.Calculation.Services; namespace Ringtoets.HydraRing.Calculation.Activities { @@ -29,11 +28,6 @@ /// public abstract class HydraRingActivityBase : Activity { - protected override void OnCancel() - { - HydraRingCalculationService.CancelRunningCalculation(); - } - protected override void OnRun() { if (!Validate()) Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DesignWaterLevelCalculator.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DesignWaterLevelCalculator.cs (.../DesignWaterLevelCalculator.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DesignWaterLevelCalculator.cs (.../DesignWaterLevelCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics; @@ -30,7 +31,7 @@ /// Calculator which calculates the water level associated to the result of iterating towards a /// probability of failure given a norm. /// - public class DesignWaterLevelCalculator : HydraRingCalculatorBase, IDesignWaterLevelCalculator + internal class DesignWaterLevelCalculator : HydraRingCalculatorBase, IDesignWaterLevelCalculator { private readonly string hlcdDirectory; private readonly string ringId; @@ -41,10 +42,10 @@ /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. + /// Thrown when is null. internal DesignWaterLevelCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; targetProbabilityParser = new ReliabilityIndexCalculationParser(); DesignWaterLevel = double.NaN; @@ -56,7 +57,7 @@ public void Calculate(AssessmentLevelCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DikeHeightCalculator.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DikeHeightCalculator.cs (.../DikeHeightCalculator.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DikeHeightCalculator.cs (.../DikeHeightCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics; @@ -30,21 +31,19 @@ /// Calculator which calculates the dike height associated to the result of iterating towards a /// probability of failure given a norm. /// - public class DikeHeightCalculator : HydraRingCalculatorBase, IDikeHeightCalculator + internal class DikeHeightCalculator : HydraRingCalculatorBase, IDikeHeightCalculator { - private readonly string hlcdDirectory; - private readonly string ringId; private readonly ReliabilityIndexCalculationParser targetProbabilityParser; /// /// Create a new instance of . /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. + /// Thrown when is null. internal DikeHeightCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; targetProbabilityParser = new ReliabilityIndexCalculationParser(); DikeHeight = double.NaN; @@ -54,7 +53,7 @@ public void Calculate(DikeHeightCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs =================================================================== diff -u -rb2306061789f5e34a6f0994552b4431d01d220f0 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs (.../HydraRingCalculatorFactory.cs) (revision b2306061789f5e34a6f0994552b4431d01d220f0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/HydraRingCalculatorFactory.cs (.../HydraRingCalculatorFactory.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; + namespace Ringtoets.HydraRing.Calculation.Calculator.Factory { /// Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs =================================================================== diff -u -rb2306061789f5e34a6f0994552b4431d01d220f0 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs (.../IHydraRingCalculatorFactory.cs) (revision b2306061789f5e34a6f0994552b4431d01d220f0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/Factory/IHydraRingCalculatorFactory.cs (.../IHydraRingCalculatorFactory.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,8 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; + namespace Ringtoets.HydraRing.Calculation.Calculator.Factory { /// @@ -33,6 +35,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IDesignWaterLevelCalculator CreateDesignWaterLevelCalculator(string hlcdDirectory, string ringId); /// @@ -41,6 +44,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IDikeHeightCalculator CreateDikeHeightCalculator(string hlcdDirectory, string ringId); /// @@ -49,6 +53,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IOvertoppingCalculator CreateOvertoppingCalculator(string hlcdDirectory, string ringId); /// @@ -57,6 +62,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IWaveConditionsCosineCalculator CreateWaveConditionsCosineCalculator(string hlcdDirectory, string ringId); /// @@ -65,6 +71,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IWaveHeightCalculator CreateWaveHeightCalculator(string hlcdDirectory, string ringId); /// @@ -73,6 +80,7 @@ /// The directory where the hydraulic database can be found. /// The id of the traject which is used in the calculation. /// A new . + /// Thrown when is null. IStructuresOvertoppingCalculator CreateStructuresOvertoppingCalculator(string hlcdDirectory, string ringId); } } \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/HydraRingCalculatorBase.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/HydraRingCalculatorBase.cs (.../HydraRingCalculatorBase.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/HydraRingCalculatorBase.cs (.../HydraRingCalculatorBase.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -32,17 +33,30 @@ /// /// Base implementation for a calculator which uses Hydra-Ring to perform different calculations. /// - public abstract class HydraRingCalculatorBase + internal abstract class HydraRingCalculatorBase { private readonly HydraRingOutputFileParser outputFileParser; private Process hydraRingProcess; + private readonly string hlcdDirectory; + private readonly string ringId; + /// - /// Constructs a new which a default Hydra-Ring file parser + /// Creates a new instance of with a default Hydra-Ring file parser /// initialized. /// - protected HydraRingCalculatorBase() + /// The directory in which the Hydraulic Boundary Database can be found. + /// The id of the traject which is used in the calculation. + /// Thrown when is null. + protected HydraRingCalculatorBase(string hlcdDirectory, string ringId) { + if (hlcdDirectory == null) + { + throw new ArgumentNullException("hlcdDirectory"); + } + this.hlcdDirectory = hlcdDirectory; + this.ringId = ringId; + outputFileParser = new HydraRingOutputFileParser(); } @@ -79,13 +93,9 @@ /// /// Performs the actual calculation by running the Hydra-Ring executable. /// - /// The directory in which the Hydraulic Boundary Database can be found. - /// The id of the traject which is used in the calculation. /// The uncertainty type used in the calculation. /// The object containing input data. protected void Calculate( - string hlcdDirectory, - string ringId, HydraRingUncertaintiesType uncertaintiesType, HydraRingCalculationInput hydraRingCalculationInput) { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/OvertoppingCalculator.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/OvertoppingCalculator.cs (.../OvertoppingCalculator.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/OvertoppingCalculator.cs (.../OvertoppingCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Overtopping; @@ -30,10 +31,8 @@ /// Calculator for calculating probability of failure by overtopping or overflow and the /// associated wave height. This is used in a Grass Cover Erosion Inwards assessment. /// - public class OvertoppingCalculator : HydraRingCalculatorBase, IOvertoppingCalculator + internal class OvertoppingCalculator : HydraRingCalculatorBase, IOvertoppingCalculator { - private readonly string hlcdDirectory; - private readonly string ringId; private readonly ExceedanceProbabilityCalculationParser exceedanceProbabilityCalculationParser; private readonly OvertoppingCalculationWaveHeightParser waveHeightParser; @@ -42,10 +41,10 @@ /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. + /// Thrown when is null. internal OvertoppingCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; exceedanceProbabilityCalculationParser = new ExceedanceProbabilityCalculationParser(); waveHeightParser = new OvertoppingCalculationWaveHeightParser(); @@ -60,7 +59,7 @@ public void Calculate(OvertoppingCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/StructuresOvertoppingCalculator.cs =================================================================== diff -u -rb2306061789f5e34a6f0994552b4431d01d220f0 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/StructuresOvertoppingCalculator.cs (.../StructuresOvertoppingCalculator.cs) (revision b2306061789f5e34a6f0994552b4431d01d220f0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/StructuresOvertoppingCalculator.cs (.../StructuresOvertoppingCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,28 +19,27 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Structures; using Ringtoets.HydraRing.Calculation.Parsers; namespace Ringtoets.HydraRing.Calculation.Calculator { - public class StructuresOvertoppingCalculator : HydraRingCalculatorBase, IStructuresOvertoppingCalculator + internal class StructuresOvertoppingCalculator : HydraRingCalculatorBase, IStructuresOvertoppingCalculator { - private readonly string hlcdDirectory; - private readonly string ringId; private readonly ExceedanceProbabilityCalculationParser exceedanceProbabilityCalculationParser; /// /// Create a new instance of . /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. + /// Thrown when is null. internal StructuresOvertoppingCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; exceedanceProbabilityCalculationParser = new ExceedanceProbabilityCalculationParser(); ExceedanceProbabilityBeta = double.NaN; @@ -50,7 +49,7 @@ public void Calculate(StructuresOvertoppingCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveConditionsCosineCalculator.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveConditionsCosineCalculator.cs (.../WaveConditionsCosineCalculator.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveConditionsCosineCalculator.cs (.../WaveConditionsCosineCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.WaveConditions; @@ -30,21 +31,19 @@ /// Interface for a calculator which calculates values for a wave at a water level. /// These are used in different failure mechanisms as input. /// - public class WaveConditionsCosineCalculator : HydraRingCalculatorBase, IWaveConditionsCosineCalculator + internal class WaveConditionsCosineCalculator : HydraRingCalculatorBase, IWaveConditionsCosineCalculator { - private readonly string hlcdDirectory; - private readonly string ringId; private readonly WaveConditionsCalculationParser waveConditionsCalculationParser; /// /// Create a new instance of . /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. + /// Thrown when is null. internal WaveConditionsCosineCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; waveConditionsCalculationParser = new WaveConditionsCalculationParser(); WaveHeight = double.NaN; @@ -58,7 +57,7 @@ public void Calculate(WaveConditionsCosineCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveHeightCalculator.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveHeightCalculator.cs (.../WaveHeightCalculator.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/WaveHeightCalculator.cs (.../WaveHeightCalculator.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics; @@ -30,21 +31,19 @@ /// Calculator which calculates the wave height associated to the result of iterating towards a /// probability of failure given a norm. /// - public class WaveHeightCalculator : HydraRingCalculatorBase, IWaveHeightCalculator + internal class WaveHeightCalculator : HydraRingCalculatorBase, IWaveHeightCalculator { - private readonly string hlcdDirectory; - private readonly string ringId; private readonly ReliabilityIndexCalculationParser targetProbabilityParser; /// /// Create a new instance of . /// /// The directory in which the Hydraulic Boundary Database can be found. /// The id of the traject which is used in the calculation. - internal WaveHeightCalculator(string hlcdDirectory, string ringId) + /// Thrown when is null. + internal WaveHeightCalculator(string hlcdDirectory, string ringId) + : base(hlcdDirectory, ringId) { - this.hlcdDirectory = hlcdDirectory; - this.ringId = ringId; targetProbabilityParser = new ReliabilityIndexCalculationParser(); WaveHeight = double.NaN; @@ -56,7 +55,7 @@ public void Calculate(WaveHeightCalculationInput input) { - Calculate(hlcdDirectory, ringId, HydraRingUncertaintiesType.All, input); + Calculate(HydraRingUncertaintiesType.All, input); } protected override IEnumerable GetParsers() Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -25,7 +25,7 @@ using System.Data.SQLite; using System.IO; using Ringtoets.HydraRing.Calculation.Data.Output; -using Ringtoets.HydraRing.Calculation.Services; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Parsers { @@ -56,7 +56,7 @@ { try { - Output = DoParse(Path.Combine(workingDirectory, HydraRingFileName.OutputDatabaseFileName), sectionId); + Output = DoParse(Path.Combine(workingDirectory, HydraRingFileConstants.OutputDatabaseFileName), sectionId); } catch { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/HydraRingOutputFileParser.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/HydraRingOutputFileParser.cs (.../HydraRingOutputFileParser.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/HydraRingOutputFileParser.cs (.../HydraRingOutputFileParser.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -21,7 +21,7 @@ using System.IO; using Ringtoets.HydraRing.Calculation.Properties; -using Ringtoets.HydraRing.Calculation.Services; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Parsers { @@ -37,12 +37,12 @@ public void Parse(string workingDirectory, int sectionId) { - string outputFileName = sectionId + HydraRingFileName.OutputFileSuffix; + string outputFileName = sectionId + HydraRingFileConstants.OutputFileSuffix; string outputFilePath = Path.Combine(workingDirectory, outputFileName); if (!File.Exists(outputFilePath)) { - outputFileName = sectionId + HydraRingFileName.LogFileExtension; + outputFileName = sectionId + HydraRingFileConstants.LogFileExtension; outputFilePath = Path.Combine(workingDirectory, outputFileName); } @@ -53,7 +53,7 @@ catch { var message = string.Format(Resources.Parse_Cannot_read_FileName_0_nor_FileName_1_from_FolderPath_2_, - sectionId + HydraRingFileName.OutputFileSuffix, + sectionId + HydraRingFileConstants.OutputFileSuffix, outputFileName, workingDirectory); throw new HydraRingFileParserException(message); Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/OvertoppingCalculationWaveHeightParser.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/OvertoppingCalculationWaveHeightParser.cs (.../OvertoppingCalculationWaveHeightParser.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/OvertoppingCalculationWaveHeightParser.cs (.../OvertoppingCalculationWaveHeightParser.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -24,7 +24,7 @@ using System.IO; using System.Linq; using Ringtoets.HydraRing.Calculation.Data.Output; -using Ringtoets.HydraRing.Calculation.Services; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Parsers { @@ -63,7 +63,7 @@ public void Parse(string workingDirectory, int sectionId) { - string fileName = string.Format("{0}{1}", sectionId, HydraRingFileName.OutputFileSuffix); + string fileName = string.Format("{0}{1}", sectionId, HydraRingFileConstants.OutputFileSuffix); try { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ReliabilityIndexCalculationParser.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ReliabilityIndexCalculationParser.cs (.../ReliabilityIndexCalculationParser.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ReliabilityIndexCalculationParser.cs (.../ReliabilityIndexCalculationParser.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -24,7 +24,7 @@ using System.IO; using System.Linq; using Ringtoets.HydraRing.Calculation.Data.Output; -using Ringtoets.HydraRing.Calculation.Services; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Parsers { @@ -44,7 +44,7 @@ { try { - using (var streamReader = new StreamReader(Path.Combine(workingDirectory, HydraRingFileName.DesignTablesFileName))) + using (var streamReader = new StreamReader(Path.Combine(workingDirectory, HydraRingFileConstants.DesignTablesFileName))) { var fileContents = streamReader.ReadToEnd(); var lines = fileContents.Split('\n'); Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/WaveConditionsCalculationParser.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/WaveConditionsCalculationParser.cs (.../WaveConditionsCalculationParser.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/WaveConditionsCalculationParser.cs (.../WaveConditionsCalculationParser.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -22,7 +22,7 @@ using System.Globalization; using System.IO; using Ringtoets.HydraRing.Calculation.Data.Output; -using Ringtoets.HydraRing.Calculation.Services; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Parsers { @@ -49,7 +49,7 @@ public void Parse(string workingDirectory, int sectionId) { - string fileName = string.Format("{0}{1}", sectionId, HydraRingFileName.OutputFileSuffix); + string fileName = string.Format("{0}{1}", sectionId, HydraRingFileConstants.OutputFileSuffix); try { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -rb2306061789f5e34a6f0994552b4431d01d220f0 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision b2306061789f5e34a6f0994552b4431d01d220f0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -49,7 +49,6 @@ Properties\GlobalAssembly.cs - @@ -114,7 +113,6 @@ Resources.resx - @@ -135,10 +133,8 @@ - - @@ -151,6 +147,10 @@ Core.Common.Utils False + + {b69d5b6c-6e14-4fa9-9ebc-8f97678cdb70} + Ringtoets.HydraRing.IO + Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingCalculationService.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingFileName.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingInitializationService.cs =================================================================== diff -u -r4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingInitializationService.cs (.../HydraRingInitializationService.cs) (revision 4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingInitializationService.cs (.../HydraRingInitializationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -24,6 +24,7 @@ using System.Reflection; using Ringtoets.HydraRing.Calculation.Data; using Ringtoets.HydraRing.Calculation.Providers; +using Ringtoets.HydraRing.IO; namespace Ringtoets.HydraRing.Calculation.Services { @@ -111,7 +112,7 @@ { get { - return Path.Combine(TemporaryWorkingDirectory, HydraRingFileName.DesignTablesFileName); + return Path.Combine(TemporaryWorkingDirectory, HydraRingFileConstants.DesignTablesFileName); } } @@ -122,7 +123,7 @@ { get { - return Path.Combine(TemporaryWorkingDirectory, HydraRingFileName.OutputDatabaseFileName); + return Path.Combine(TemporaryWorkingDirectory, HydraRingFileConstants.OutputDatabaseFileName); } } @@ -133,7 +134,7 @@ { get { - return Path.Combine(hlcdDirectory, HydraRingFileName.HlcdDatabaseFileName); + return Path.Combine(hlcdDirectory, HydraRingFileConstants.HlcdDatabaseFileName); } } @@ -144,7 +145,7 @@ { get { - return Path.Combine(hydraRingDirectory, HydraRingFileName.HydraRingExecutableFileName); + return Path.Combine(hydraRingDirectory, HydraRingFileConstants.HydraRingExecutableFileName); } } @@ -169,7 +170,7 @@ "outputverbosity = basic", "outputtofile = file", "projectdbfilename = " + sectionId + databaseFileExtension, - "outputfilename = " + HydraRingFileName.DesignTablesFileName, + "outputfilename = " + HydraRingFileConstants.DesignTablesFileName, "configdbfilename = " + ConfigurationDatabaseFilePath, "hydraulicdbfilename = " + HlcdFilePath); @@ -183,7 +184,7 @@ { get { - return Path.Combine(hydraRingDirectory, HydraRingFileName.ConfigurationDatabaseFileName); + return Path.Combine(hydraRingDirectory, HydraRingFileConstants.ConfigurationDatabaseFileName); } } } Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/IHydraRingCalculationService.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraRingFileConstants.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraRingFileConstants.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraRingFileConstants.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,64 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.HydraRing.IO +{ + /// + /// Class containing (parts of) file names that are generated during a Hydra-Ring calculation. + /// + internal static class HydraRingFileConstants + { + /// + /// The tail and extension of the file containing output generated during a calculation. + /// + internal const string OutputFileSuffix = "-output.txt"; + + /// + /// The extension of the log file for a certain section. + /// + internal const string LogFileExtension = ".log"; + + /// + /// The file name of the file containing the output of a calculation. + /// + internal const string DesignTablesFileName = "designTable.txt"; + + /// + /// The file name of the working database which contains input and output. + /// + internal const string OutputDatabaseFileName = "temp.sqlite"; + + /// + /// The file name of the HLCD database. + /// + internal const string HlcdDatabaseFileName = "HLCD.sqlite"; + + /// + /// The file name of the executable of Hydra-Ring. + /// + internal const string HydraRingExecutableFileName = "MechanismComputation.exe"; + + /// + /// The database which contains configuration paramters. + /// + internal const string ConfigurationDatabaseFileName = "config.sqlite"; + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicDatabaseHelper.cs =================================================================== diff -u -r4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicDatabaseHelper.cs (.../HydraulicDatabaseHelper.cs) (revision 4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicDatabaseHelper.cs (.../HydraulicDatabaseHelper.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -22,9 +22,11 @@ using System; using System.IO; using Core.Common.IO.Exceptions; +using Core.Common.Utils; using Ringtoets.HydraRing.Data; using Ringtoets.HydraRing.IO.HydraulicBoundaryDatabaseContext; using Ringtoets.HydraRing.IO.HydraulicLocationConfigurationDatabaseContext; +using Ringtoets.HydraRing.IO.Properties; namespace Ringtoets.HydraRing.IO { @@ -44,11 +46,30 @@ { try { + FileUtils.ValidateFilePath(filePath); + } + catch (ArgumentException e) + { + return e.Message; + } + + string directoryName; + try + { + directoryName = Path.GetDirectoryName(filePath); + } + catch (PathTooLongException) + { + return string.Format(Resources.HydraulicDatabaseHelper_ValidatePathForCalculation_Invalid_path_0_, filePath); + } + + try + { using (var db = new HydraulicBoundarySqLiteDatabaseReader(filePath)) { db.GetVersion(); } - string hlcdFilePath = Path.Combine(Path.GetDirectoryName(filePath), "hlcd.sqlite"); + string hlcdFilePath = Path.Combine(directoryName, HydraRingFileConstants.HlcdDatabaseFileName); new HydraulicLocationConfigurationSqLiteDatabaseReader(hlcdFilePath).Dispose(); } catch (CriticalFileReadException e) Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/AssemblyInfo.cs =================================================================== diff -u -r3ba0c50f3a3548264d60e9f347079d0586c53f28 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 3ba0c50f3a3548264d60e9f347079d0586c53f28) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -20,8 +20,11 @@ // All rights reserved. using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Ringtoets.HydraRing.IO")] [assembly: AssemblyProduct("Ringtoets.HydraRing.IO")] -[assembly: Guid("B69D5B6C-6E14-4FA9-9EBC-8F97678CDB70")] \ No newline at end of file +[assembly: Guid("B69D5B6C-6E14-4FA9-9EBC-8F97678CDB70")] +[assembly: InternalsVisibleTo("Ringtoets.HydraRing.Calculation")] +[assembly: InternalsVisibleTo("Ringtoets.HydraRing.Calculation.Test")] \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.Designer.cs =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -127,6 +127,15 @@ } /// + /// Looks up a localized string similar to Het opgegeven bestandspad ({0}) is niet geldig.. + /// + public static string HydraulicDatabaseHelper_ValidatePathForCalculation_Invalid_path_0_ { + get { + return ResourceManager.GetString("HydraulicDatabaseHelper_ValidatePathForCalculation_Invalid_path_0_", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Het bevragen van de database is mislukt.. /// public static string HydraulicLocationConfigurationSqLiteDatabaseReader_Critical_Unexpected_Exception { Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.resx =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.resx (.../Resources.resx) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Properties/Resources.resx (.../Resources.resx) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -138,4 +138,7 @@ Golfhoogte + + Het opgegeven bestandspad ({0}) is niet geldig. + \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Ringtoets.HydraRing.IO.csproj =================================================================== diff -u -r5a759c89e803b85ef4ef2f411547e2458cfd9bc6 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Ringtoets.HydraRing.IO.csproj (.../Ringtoets.HydraRing.IO.csproj) (revision 5a759c89e803b85ef4ef2f411547e2458cfd9bc6) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/Ringtoets.HydraRing.IO.csproj (.../Ringtoets.HydraRing.IO.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -50,6 +50,7 @@ Properties\GlobalAssembly.cs + Code Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityBaseTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityBaseTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityBaseTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,150 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Service; +using NUnit.Framework; +using Ringtoets.HydraRing.Calculation.Activities; + +namespace Ringtoets.HydraRing.Calculation.Test.Activities +{ + [TestFixture] + public class HydraRingActivityBaseTest + { + [Test] + public void Constructor_ReturnsNewInstance() + { + // Call + var activity = new TestHydraRingActivity(); + + // Assert + Assert.IsInstanceOf(activity); + } + + [Test] + public void Run_NotValid_StateFailedCalculatedFalse() + { + // Setup + var activity = new TestHydraRingActivity(); + + // Call + activity.Run(); + + // Assert + Assert.AreEqual(activity.State, ActivityState.Failed); + Assert.IsFalse(activity.Calculated); + } + + [Test] + public void Run_IsValid_StateExecutedCalculatedTrue() + { + // Setup + var activity = new TestHydraRingActivity + { + IsValid = true + }; + + // Call + activity.Run(); + + // Assert + Assert.AreEqual(activity.State, ActivityState.Executed); + Assert.IsTrue(activity.Calculated); + } + + [Test] + public void Cancel_Always_StateCanceledCanceledTrue() + { + // Setup + var activity = new TestHydraRingActivity(); + + // Call + activity.Cancel(); + + // Assert + Assert.AreEqual(activity.State, ActivityState.Canceled); + Assert.IsTrue(activity.Canceled); + } + + [Test] + public void Finish_Always_FinishedTrue() + { + // Setup + var activity = new TestHydraRingActivity(); + + // Call + activity.Finish(); + + // Assert + Assert.IsTrue(activity.Finished); + } + + [Test] + public void UpdateProgressText_Always_SetsProgressTextWithFormat() + { + // Setup + var activity = new TestHydraRingActivity(); + string currentStepName = "Some step name."; + int totalStep = new Random(21).Next(); + int currentStep = new Random(21).Next(); + + // Call + activity.PublicUpdateProgressText(currentStepName, currentStep, totalStep); + + // Assert + Assert.AreEqual(string.Format("Stap {0} van {1} | {2}", currentStep, totalStep, currentStepName), activity.ProgressText); + } + } + + public class TestHydraRingActivity : HydraRingActivityBase + { + public bool Canceled { get; private set; } + public bool Finished { get; private set; } + public bool Calculated { get; private set; } + + public bool IsValid { private get; set; } + + protected override void OnCancel() + { + Canceled = true; + } + + protected override void OnFinish() + { + Finished = true; + } + + protected override void PerformCalculation() + { + Calculated = true; + } + + protected override bool Validate() + { + return IsValid; + } + + public void PublicUpdateProgressText(string currentStepName, int currentStep, int totalStep) + { + UpdateProgressText(currentStepName, currentStep, totalStep); + } + } +} \ No newline at end of file Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/HydraRingActivityTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DesignWaterLevelCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DesignWaterLevelCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DesignWaterLevelCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class DesignWaterLevelCalculatorTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DikeHeightCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DikeHeightCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/DikeHeightCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class DikeHeightCalculatorTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/HydraRingCalculatorBaseTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/HydraRingCalculatorBaseTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/HydraRingCalculatorBaseTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class HydraRingCalculatorBaseTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/OvertoppingCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/OvertoppingCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/OvertoppingCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class OvertoppingCalculatorTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/StructuresOvertoppingCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/StructuresOvertoppingCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/StructuresOvertoppingCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class StructuresOvertoppingCalculatorTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveConditionsCosineCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveConditionsCosineCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveConditionsCosineCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,31 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class WaveConditionsCosineCalculatorTest + { + + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveHeightCalculatorTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveHeightCalculatorTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Calculator/WaveHeightCalculatorTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,41 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using NUnit.Framework; +using Ringtoets.HydraRing.Calculation.Calculator; + +namespace Ringtoets.HydraRing.Calculation.Test.Calculator +{ + [TestFixture] + public class WaveHeightCalculatorTest + { + [Test] + public void DefaultConstructor_InitializesOutputNaN() + { + // Call + var calculator = new WaveHeightCalculator(string.Empty, string.Empty); + + // Assert + Assert.IsNaN(calculator.ReliabilityIndex); + Assert.IsNaN(calculator.WaveHeight); + } + } +} \ No newline at end of file Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ExceedanceProbabilityCalculationExceptionParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 02670d8c9fceeaea5f829937a2eb269f3488c6b1 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ExceedanceProbabilityCalculationParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingFileParserExceptionTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingFileParserExceptionTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingFileParserExceptionTest.cs (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -0,0 +1,75 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using NUnit.Framework; +using Ringtoets.HydraRing.Calculation.Parsers; + +namespace Ringtoets.HydraRing.Calculation.Test.Parsers +{ + [TestFixture] + public class HydraRingFileParserExceptionTest + { + [Test] + public void DefaultConstructor_InnerExceptionNullAndMessageDefault() + { + // Setup + string expectedMessage = string.Format("Exception of type '{0}' was thrown.", typeof(HydraRingFileParserException).FullName); + + // Call + HydraRingFileParserException exception = new HydraRingFileParserException(); + + // Assert + Assert.IsInstanceOf(exception); + Assert.IsNull(exception.InnerException); + Assert.AreEqual(expectedMessage, exception.Message); + } + + [Test] + public void Constructor_WithCustomMessage_InnerExceptionNullAndMessageSetToCustom() + { + // Setup + const string expectedMessage = "Some exception message"; + + // Call + HydraRingFileParserException exception = new HydraRingFileParserException(expectedMessage); + + // Assert + Assert.IsNull(exception.InnerException); + Assert.AreEqual(expectedMessage, exception.Message); + } + + [Test] + public void Constructor_WithCustomMessageAndInnerException_InnerExceptionSetAndMessageSetToCustom() + { + // Setup + const string expectedMessage = "Some exception message"; + Exception expectedInnerException = new Exception(); + + // Call + HydraRingFileParserException exception = new HydraRingFileParserException(expectedMessage, expectedInnerException); + + // Assert + Assert.AreSame(expectedInnerException, exception.InnerException); + Assert.AreEqual(expectedMessage, exception.Message); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingOutputFileParserTest.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingOutputFileParserTest.cs (.../HydraRingOutputFileParserTest.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/HydraRingOutputFileParserTest.cs (.../HydraRingOutputFileParserTest.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.IO; using Core.Common.TestUtil; using NUnit.Framework; Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/OvertoppingCalculationWaveHeightExceptionParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 02670d8c9fceeaea5f829937a2eb269f3488c6b1 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/OvertoppingCalculationWaveHeightParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ReliabilityIndexCalculationExceptionParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 02670d8c9fceeaea5f829937a2eb269f3488c6b1 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/ReliabilityIndexCalculationParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/WaveConditionsCalculationExceptionParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 02670d8c9fceeaea5f829937a2eb269f3488c6b1 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Parsers/WaveConditionsCalculationParserTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -54,7 +54,14 @@ Properties\GlobalAssembly.cs - + + + + + + + + @@ -87,11 +94,12 @@ - + + - - - + + + @@ -135,6 +143,10 @@ {888d4097-8bc2-4703-9fb1-8744c94d525e} Ringtoets.HydraRing.Calculation + + {B69D5B6C-6E14-4FA9-9EBC-8F97678CDB70} + Ringtoets.HydraRing.IO + {74CBA865-9338-447F-BAD9-28312446AE84} Ringtoets.HydraRing.Calculation.TestUtil Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicDatabaseHelperTest.cs =================================================================== diff -u -rfef3460a27a37aaa34948649aae3dd9ae143041c -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicDatabaseHelperTest.cs (.../HydraulicDatabaseHelperTest.cs) (revision fef3460a27a37aaa34948649aae3dd9ae143041c) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicDatabaseHelperTest.cs (.../HydraulicDatabaseHelperTest.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -101,6 +101,22 @@ } [Test] + public void ValidatePathForCalculation_InvalidFilePath_ReturnsMessageWithError() + { + // Setup + var invalidFilePath = "C:\\Thisissomeverylongpath\\toadirectorywhich\\doesntevenexist\\Nowlets\\finishwithsomelongname\\" + + "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong" + + "naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame" + + "\\followedbythefile"; + + // Call + var result = HydraulicDatabaseHelper.ValidatePathForCalculation(invalidFilePath); + + // Assert + StringAssert.StartsWith(string.Format("Het opgegeven bestandspad ({0}) is niet geldig.", invalidFilePath), result); + } + + [Test] public void HaveEqualVersion_InvalidFile_ThrowsCriticalFileReadException() { // Setup Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Service/WaveConditionsCalculationServiceBase.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/Revetment/src/Ringtoets.Revetment.Service/WaveConditionsCalculationServiceBase.cs (.../WaveConditionsCalculationServiceBase.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Service/WaveConditionsCalculationServiceBase.cs (.../WaveConditionsCalculationServiceBase.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -40,6 +40,9 @@ namespace Ringtoets.Revetment.Service { + /// + /// Base class for calculating wave conditions for failure mechanisms. + /// public abstract class WaveConditionsCalculationServiceBase { private static readonly ILog log = LogManager.GetLogger(typeof(WaveConditionsCalculationServiceBase)); @@ -118,7 +121,7 @@ return outputs; } - private static string[] ValidateInput(string hydraulicBoundaryDatabaseFilePath, + protected static string[] ValidateInput(string hydraulicBoundaryDatabaseFilePath, WaveConditionsInput input, string calculatedValueName) { Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.Designer.cs =================================================================== diff -u -re2dbd70747659819d97614b9a73733babaa7b106 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e2dbd70747659819d97614b9a73733babaa7b106) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -82,63 +82,43 @@ } /// - /// Looks up a localized string similar to Blokken waterstand '{0}' berekenen.. + /// Looks up a localized string similar to Berekening '{0}' voor blokken beëindigd.. /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Calculate_blocks_waterlevel_0_ { + internal static string StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_blocks_finished { get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Calculate_blocks_water" + - "level_0_", resourceCulture); + return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_b" + + "locks_finished", resourceCulture); } } /// - /// Looks up a localized string similar to Zuilen waterstand '{0}' berekenen.. + /// Looks up a localized string similar to Berekening '{0}' voor blokken gestart.. /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Calculate_columns_waterlevel_0_ { + internal static string StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_blocks_started { get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Calculate_columns_wate" + - "rlevel_0_", resourceCulture); + return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_b" + + "locks_started", resourceCulture); } } /// - /// Looks up a localized string similar to Blokken berekening '{0}' voor waterstand '{1}' beëindigd om: {2}. + /// Looks up a localized string similar to Berekening '{0}' voor zuilen beëindigd.. /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_blocks_for_waterlevel_1_ended_time_2_ { + internal static string StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_columns_finished { get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_blocks_for_w" + - "aterlevel_1_ended_time_2_", resourceCulture); + return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_c" + + "olumns_finished", resourceCulture); } } /// - /// Looks up a localized string similar to Blokken berekening '{0}' voor waterstand '{1}' gestart om: {2}. + /// Looks up a localized string similar to Berekening '{0}' voor zuilen gestart.. /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_blocks_for_waterlevel_1_started_time_2_ { + internal static string StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_columns_started { get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_blocks_for_w" + - "aterlevel_1_started_time_2_", resourceCulture); + return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_c" + + "olumns_started", resourceCulture); } } - - /// - /// Looks up a localized string similar to Zuilen berekening '{0}' voor waterstand '{1}' beëindigd om: {2}. - /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_columns_for_waterlevel_1_ended_time_2_ { - get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_columns_for_" + - "waterlevel_1_ended_time_2_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Zuilen berekening '{0}' voor waterstand '{1}' gestart om: {2}. - /// - internal static string StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_columns_for_waterlevel_1_started_time_2_ { - get { - return ResourceManager.GetString("StabilityStoneCoverWaveConditionsCalculationActivity_OnRun_Subject_0_columns_for_" + - "waterlevel_1_started_time_2_", resourceCulture); - } - } } } Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.resx =================================================================== diff -u -re2dbd70747659819d97614b9a73733babaa7b106 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.resx (.../Resources.resx) (revision e2dbd70747659819d97614b9a73733babaa7b106) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Properties/Resources.resx (.../Resources.resx) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -1,119 +1,132 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Blokken berekening '{0}' voor waterstand '{1}' gestart om: {2} + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Berekening '{0}' voor blokken gestart. - - Blokken berekening '{0}' voor waterstand '{1}' beëindigd om: {2} + + Berekening '{0}' voor blokken beëindigd. - - Zuilen berekening '{0}' voor waterstand '{1}' gestart om: {2} + + Berekening '{0}' voor zuilen gestart. - - Zuilen berekening '{0}' voor waterstand '{1}' beëindigd om: {2} + + Berekening '{0}' voor zuilen beëindigd. - - Blokken waterstand '{0}' berekenen. - - - Zuilen waterstand '{0}' berekenen. - \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Ringtoets.StabilityStoneCover.Service.csproj =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Ringtoets.StabilityStoneCover.Service.csproj (.../Ringtoets.StabilityStoneCover.Service.csproj) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/Ringtoets.StabilityStoneCover.Service.csproj (.../Ringtoets.StabilityStoneCover.Service.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -51,7 +51,6 @@ Resources.resx - Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationActivity.cs =================================================================== diff -u -r1b0460d5f81926d0366ab10e4b0e9f6d75809c71 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationActivity.cs (.../StabilityStoneCoverWaveConditionsCalculationActivity.cs) (revision 1b0460d5f81926d0366ab10e4b0e9f6d75809c71) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationActivity.cs (.../StabilityStoneCoverWaveConditionsCalculationActivity.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -87,7 +87,7 @@ { calculationService.OnProgress = UpdateProgressText; calculationService.Calculate( - calculation, failureMechanism, assessmentSection, hlcdFilePath); + calculation, assessmentSection, failureMechanism.GeneralInput, hlcdFilePath); } protected override void OnFinish() Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationActivityOutput.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationService.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationService.cs (.../StabilityStoneCoverWaveConditionsCalculationService.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverWaveConditionsCalculationService.cs (.../StabilityStoneCoverWaveConditionsCalculationService.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -26,59 +26,74 @@ using Ringtoets.Common.Service; using Ringtoets.Revetment.Data; using Ringtoets.Revetment.Service; -using Ringtoets.Revetment.Service.Properties; using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.StabilityStoneCover.Service.Properties; +using RingtoetsRevetmentsServicesResources = Ringtoets.Revetment.Service.Properties.Resources; + namespace Ringtoets.StabilityStoneCover.Service { /// - /// Service that provides methods for performing Hydra-Ring wave conditions calculations. + /// Service that provides methods for performing Hydra-Ring wave conditions calculations for the stability of stone revetment failure mechanism. /// public class StabilityStoneCoverWaveConditionsCalculationService : WaveConditionsCalculationServiceBase { private readonly ILog log = LogManager.GetLogger(typeof(StabilityStoneCoverWaveConditionsCalculationService)); + /// + /// Performs validation over the values on the given and . + /// Error and status information is logged during the execution of the operation. + /// + /// The for which to validate the values. + /// The file path of the hydraulic boundary database file which to validate. + /// Truec> if there were no validation errors; Falsec> otherwise. public bool Validate(StabilityStoneCoverWaveConditionsCalculation calculation, string hydraulicBoundaryDatabaseFilePath) { return ValidateWaveConditionsInput( calculation.InputParameters, calculation.Name, - hydraulicBoundaryDatabaseFilePath, - Resources.WaveConditionsCalculationService_ValidateInput_default_DesignWaterLevel_name); + hydraulicBoundaryDatabaseFilePath, + RingtoetsRevetmentsServicesResources.WaveConditionsCalculationService_ValidateInput_default_DesignWaterLevel_name); } - public void Calculate( - StabilityStoneCoverWaveConditionsCalculation calculation, - StabilityStoneCoverFailureMechanism failureMechanism, - IAssessmentSection assessmentSection, - string hlcdFilePath) + /// + /// Performs a wave conditions calculation for the stability of stone revetment failure mechanism based on the supplied + /// and sets + /// if the calculation was successful. + /// Error and status information is logged during the execution of the operation. + /// + /// The that holds all the information required to perform the calculation. + /// The that holds information about the norm used in the calculation. + /// Calculation input parameters that apply to all instances. + /// The path of the HLCD file that should be used for performing the calculation. + public void Calculate(StabilityStoneCoverWaveConditionsCalculation calculation, IAssessmentSection assessmentSection, GeneralStabilityStoneCoverWaveConditionsInput generalWaveConditionsInput, string hlcdFilePath) { string calculationName = calculation.Name; CalculationServiceHelper.LogCalculationBeginTime(calculationName); - var aBlocks = failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput.A; - var bBlocks = failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput.B; - var cBlocks = failureMechanism.GeneralInput.GeneralBlocksWaveConditionsInput.C; + var aBlocks = generalWaveConditionsInput.GeneralBlocksWaveConditionsInput.A; + var bBlocks = generalWaveConditionsInput.GeneralBlocksWaveConditionsInput.B; + var cBlocks = generalWaveConditionsInput.GeneralBlocksWaveConditionsInput.C; - var aColumns = failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput.A; - var bColumns = failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput.B; - var cColumns = failureMechanism.GeneralInput.GeneralColumnsWaveConditionsInput.C; + var aColumns = generalWaveConditionsInput.GeneralColumnsWaveConditionsInput.A; + var bColumns = generalWaveConditionsInput.GeneralColumnsWaveConditionsInput.B; + var cColumns = generalWaveConditionsInput.GeneralColumnsWaveConditionsInput.C; var ringId = assessmentSection.Id; var norm = assessmentSection.FailureMechanismContribution.Norm; TotalWaterLevelCalculations = calculation.InputParameters.WaterLevels.Count() * 2; - log.InfoFormat("Berekening '{0}' voor blokken gestart.", calculationName); + log.InfoFormat(Resources.StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_blocks_started, calculationName); IEnumerable blocksOutputs = CalculateWaveConditions(calculationName, calculation.InputParameters, aBlocks, bBlocks, cBlocks, norm, ringId, hlcdFilePath); - log.InfoFormat("Berekening '{0}' voor blokken beëindigd.", calculationName); + log.InfoFormat(Resources.StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_blocks_finished, calculationName); IEnumerable columnsOutputs = null; if (!Canceled) { - log.InfoFormat("Berekening '{0}' voor zuilen gestart.", calculationName); + log.InfoFormat(Resources.StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_columns_started, calculationName); columnsOutputs = CalculateWaveConditions(calculationName, calculation.InputParameters, aColumns, bColumns, cColumns, norm, ringId, hlcdFilePath); - log.InfoFormat("Berekening '{0}' voor zuilen beëindigd.", calculationName); + log.InfoFormat(Resources.StabilityStoneCoverWaveConditionsCalculationService_Calculate_Calculation_0_for_columns_finished, calculationName); } if (!Canceled) Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/Ringtoets.StabilityStoneCover.Service.Test.csproj =================================================================== diff -u -r8577bc9fb1f6f28a32d09587ba6991183accd787 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/Ringtoets.StabilityStoneCover.Service.Test.csproj (.../Ringtoets.StabilityStoneCover.Service.Test.csproj) (revision 8577bc9fb1f6f28a32d09587ba6991183accd787) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/Ringtoets.StabilityStoneCover.Service.Test.csproj (.../Ringtoets.StabilityStoneCover.Service.Test.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -58,7 +58,6 @@ - Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/StabilityStoneCoverWaveConditionsCalculationActivityOutputTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/StabilityStoneCoverWaveConditionsCalculationServiceTest.cs =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/StabilityStoneCoverWaveConditionsCalculationServiceTest.cs (.../StabilityStoneCoverWaveConditionsCalculationServiceTest.cs) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Service.Test/StabilityStoneCoverWaveConditionsCalculationServiceTest.cs (.../StabilityStoneCoverWaveConditionsCalculationServiceTest.cs) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -266,9 +266,7 @@ { // Call Action call = () => new StabilityStoneCoverWaveConditionsCalculationService().Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert TestHelper.AssertLogMessages(call, messages => @@ -337,9 +335,7 @@ { // Call Action call = () => new StabilityStoneCoverWaveConditionsCalculationService().Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert TestHelper.AssertLogMessages(call, messages => @@ -404,9 +400,7 @@ // Call stabilityStoneCoverWaveConditionsCalculationService.Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); } mockRepository.VerifyAll(); } @@ -428,9 +422,7 @@ // Call new StabilityStoneCoverWaveConditionsCalculationService().Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert WaveConditionsCosineCalculationInput[] testWaveConditionsInputs = testWaveConditionsCosineCalculator.ReceivedInputs.ToArray(); @@ -498,9 +490,7 @@ // Call stabilityStoneCoverWaveConditionsCalculationService.Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert Assert.IsFalse(calculation.HasOutput); @@ -523,9 +513,7 @@ { // Call new StabilityStoneCoverWaveConditionsCalculationService().Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert Assert.IsNotNull(calculation.Output); @@ -553,9 +541,7 @@ // Call TestDelegate test = () => new StabilityStoneCoverWaveConditionsCalculationService().Calculate(calculation, - stabilityStoneCoverFailureMechanism, - assessmentSectionStub, - validFilePath); + assessmentSectionStub, stabilityStoneCoverFailureMechanism.GeneralInput, validFilePath); // Assert Assert.Throws(test); Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e69acb9595f7bf1d202ddd1fb51934b66768b75d refers to a dead (removed) revision in file `Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj =================================================================== diff -u -r02670d8c9fceeaea5f829937a2eb269f3488c6b1 -re69acb9595f7bf1d202ddd1fb51934b66768b75d --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.csproj) (revision 02670d8c9fceeaea5f829937a2eb269f3488c6b1) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.csproj) (revision e69acb9595f7bf1d202ddd1fb51934b66768b75d) @@ -44,11 +44,6 @@ Properties\GlobalAssembly.cs - - True - True - Resources.resx - @@ -105,13 +100,6 @@ False - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - -