Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs =================================================================== diff -u -rcb903e8cdb76e9733979fe508ee097107c022a28 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs (.../HeightStructuresCalculation.cs) (revision cb903e8cdb76e9733979fe508ee097107c022a28) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresCalculation.cs (.../HeightStructuresCalculation.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -41,7 +41,7 @@ /// Thrown when is null. public HeightStructuresCalculation(GeneralHeightStructuresInput generalInputParameters) { - InputParameters = new HeightStructuresInput(generalInputParameters); + InputParameters = new HeightStructuresInput(); Name = Resources.HeightStructuresCalculation_DefaultName; AddDemoInput(); } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs =================================================================== diff -u -r5b8f476716cb75977616203318fa250f608fe7a5 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 5b8f476716cb75977616203318fa250f608fe7a5) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresInput.cs (.../HeightStructuresInput.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base; using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; @@ -34,7 +33,6 @@ public class HeightStructuresInput : Observable, ICalculationInput { private readonly NormalDistribution levelOfCrestOfStructure; - private readonly GeneralHeightStructuresInput generalInputParameters; private readonly NormalDistribution modelFactorOvertoppingSuperCriticalFlow; private readonly LogNormalDistribution allowableIncreaseOfLevelForStorage; private readonly LogNormalDistribution storageStructureArea; @@ -49,16 +47,8 @@ /// /// Creates a new instance of the class. /// - /// General height structures calculation input parameters that apply to each calculation. - /// When is null. - public HeightStructuresInput(GeneralHeightStructuresInput generalInputParameters) + public HeightStructuresInput() { - if (generalInputParameters == null) - { - throw new ArgumentNullException("generalInputParameters"); - } - this.generalInputParameters = generalInputParameters; - levelOfCrestOfStructure = new NormalDistribution(2) { StandardDeviation = (RoundedDouble) 0.05 @@ -300,53 +290,5 @@ } #endregion - - #region General input parameters - - /// - /// Gets the gravitational acceleration. - /// - public RoundedDouble GravitationalAcceleration - { - get - { - return generalInputParameters.GravitationalAcceleration; - } - } - - /// - /// Gets the model factor overtopping flow. - /// - public LogNormalDistribution ModelFactorOvertoppingFlow - { - get - { - return generalInputParameters.ModelFactorOvertoppingFlow; - } - } - - /// - /// Gets the model factor for storage volume. - /// - public LogNormalDistribution ModelFactorForStorageVolume - { - get - { - return generalInputParameters.ModelFactorForStorageVolume; - } - } - - /// - /// Gets the model factor for incoming flow volume. - /// - public RoundedDouble ModelFactorForIncomingFlowVolume - { - get - { - return generalInputParameters.ModelFactorForIncomingFlowVolume; - } - } - - #endregion } } \ No newline at end of file Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs =================================================================== diff -u -rcb903e8cdb76e9733979fe508ee097107c022a28 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision cb903e8cdb76e9733979fe508ee097107c022a28) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Plugin/HeightStructuresGuiPlugin.cs (.../HeightStructuresGuiPlugin.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -31,7 +31,6 @@ using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Forms.Helpers; using Ringtoets.Common.Forms.PresentationObjects; @@ -135,13 +134,14 @@ }; } - private static ExceedanceProbabilityCalculationActivity CreateHydraRingExceedenceProbabilityCalculationActivity(ProbabilityAssessmentInput probabilityAssessmentInput, - FailureMechanismSection failureMechanismSection, + private static ExceedanceProbabilityCalculationActivity CreateHydraRingExceedenceProbabilityCalculationActivity(HeightStructuresFailureMechanism failureMechanism, string hlcdDirectory, HeightStructuresCalculation calculation) { var hydraulicBoundaryLocationId = (int) calculation.InputParameters.HydraulicBoundaryLocation.Id; + var failureMechanismSection = failureMechanism.Sections.First(); // TODO: Obtain dike section based on cross section of structure with reference line var sectionLength = failureMechanismSection.GetSectionLength(); + var generalInputParameters = failureMechanism.GeneralInput; var inputParameters = calculation.InputParameters; return HydraRingActivityFactory.Create( @@ -152,32 +152,31 @@ HydraRingUncertaintiesType.All, new StructuresOvertoppingCalculationInput(hydraulicBoundaryLocationId, new HydraRingSection(1, failureMechanismSection.Name, sectionLength, inputParameters.OrientationOfTheNormalOfTheStructure), - inputParameters.GravitationalAcceleration, - inputParameters.ModelFactorOvertoppingFlow.Mean, inputParameters.ModelFactorOvertoppingFlow.StandardDeviation, + generalInputParameters.GravitationalAcceleration, + generalInputParameters.ModelFactorOvertoppingFlow.Mean, generalInputParameters.ModelFactorOvertoppingFlow.StandardDeviation, inputParameters.LevelOfCrestOfStructure.Mean, inputParameters.LevelOfCrestOfStructure.StandardDeviation, inputParameters.OrientationOfTheNormalOfTheStructure, inputParameters.ModelFactorOvertoppingSuperCriticalFlow.Mean, inputParameters.ModelFactorOvertoppingSuperCriticalFlow.StandardDeviation, inputParameters.AllowableIncreaseOfLevelForStorage.Mean, inputParameters.AllowableIncreaseOfLevelForStorage.StandardDeviation, - inputParameters.ModelFactorForStorageVolume.Mean, inputParameters.ModelFactorForStorageVolume.StandardDeviation, + generalInputParameters.ModelFactorForStorageVolume.Mean, generalInputParameters.ModelFactorForStorageVolume.StandardDeviation, inputParameters.StorageStructureArea.Mean, inputParameters.StorageStructureArea.StandardDeviation, - inputParameters.ModelFactorForIncomingFlowVolume, + generalInputParameters.ModelFactorForIncomingFlowVolume, inputParameters.FlowWidthAtBottomProtection.Mean, inputParameters.FlowWidthAtBottomProtection.StandardDeviation, inputParameters.CriticalOvertoppingDischarge.Mean, inputParameters.CriticalOvertoppingDischarge.StandardDeviation, inputParameters.FailureProbabilityOfStructureGivenErosion, inputParameters.WidthOfFlowApertures.Mean, inputParameters.WidthOfFlowApertures.StandardDeviation, inputParameters.DeviationOfTheWaveDirection, inputParameters.StormDuration.Mean, inputParameters.StormDuration.StandardDeviation), calculation.ClearOutput, - output => { ParseHydraRingOutput(calculation, probabilityAssessmentInput, output); }); + output => { ParseHydraRingOutput(calculation, failureMechanism.ProbabilityAssessmentInput, output); }); } private void CalculateAll(HeightStructuresFailureMechanism failureMechanism, IEnumerable calculations, IAssessmentSection assessmentSection) { // TODO: Remove "Where" filter when validation is implemented ActivityProgressDialogRunner.Run(Gui.MainWindow, calculations.Where(calc => calc.InputParameters.HydraulicBoundaryLocation != null) .Select(calc => CreateHydraRingExceedenceProbabilityCalculationActivity( - failureMechanism.ProbabilityAssessmentInput, - failureMechanism.Sections.First(), // TODO: Pass dike section based on cross section of structure with reference line + failureMechanism, Path.GetDirectoryName(assessmentSection.HydraulicBoundaryDatabase.FilePath), calc)).ToList()); } @@ -497,8 +496,7 @@ return; } var activity = CreateHydraRingExceedenceProbabilityCalculationActivity( - context.FailureMechanism.ProbabilityAssessmentInput, - context.FailureMechanism.Sections.First(), // TODO: Pass dike section based on cross section of calculation with reference line + context.FailureMechanism, Path.GetDirectoryName(context.AssessmentSection.HydraulicBoundaryDatabase.FilePath), calculation); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -r5b8f476716cb75977616203318fa250f608fe7a5 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 5b8f476716cb75977616203318fa250f608fe7a5) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -34,34 +34,16 @@ public class HeightStructuresInputTest { [Test] - public void Constructor_NullGeneralInput_ThrowsArgumentNullException() - { - // Setup & Call - TestDelegate test = () => new HeightStructuresInput(null); - - // Assert - Assert.Throws(test); - } - - [Test] public void Constructor_DefaultPropertyValuesAreSet() { - // Setup - var generalInput = new GeneralHeightStructuresInput(); - // Call - var input = new HeightStructuresInput(generalInput); + var input = new HeightStructuresInput(); // Assert Assert.IsInstanceOf(input); Assert.IsInstanceOf(input); Assert.IsNull(input.HydraulicBoundaryLocation); - Assert.AreEqual(generalInput.GravitationalAcceleration, input.GravitationalAcceleration); - Assert.AreEqual(generalInput.ModelFactorOvertoppingFlow, input.ModelFactorOvertoppingFlow); - Assert.AreEqual(generalInput.ModelFactorForStorageVolume, input.ModelFactorForStorageVolume); - Assert.AreEqual(generalInput.ModelFactorForIncomingFlowVolume, input.ModelFactorForIncomingFlowVolume); - AssertAreEqual(0.05, input.LevelOfCrestOfStructure.StandardDeviation); AssertAreEqual(1.1, input.ModelFactorOvertoppingSuperCriticalFlow.Mean); AssertAreEqual(0.03, input.ModelFactorOvertoppingSuperCriticalFlow.StandardDeviation); @@ -78,7 +60,7 @@ public void Properties_ModelFactorOvertoppingSuperCriticalFlow_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); RoundedDouble defaultModelFactorOvertoppingSupercriticalFlowStandardDeviation = input.ModelFactorOvertoppingSuperCriticalFlow.StandardDeviation; @@ -100,7 +82,7 @@ public void Properties_HydraulicBoundaryLocation_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var location = new HydraulicBoundaryLocation(0, "test", 0, 0); // Call @@ -114,7 +96,7 @@ public void Properties_DeviationOfTheWaveDirection_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); RoundedDouble deviationOfTheWaveDirection = new RoundedDouble(5, random.NextDouble()); @@ -130,7 +112,7 @@ public void Properties_StormDuration_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); RoundedDouble defaultStormDurationStandardDeviation = input.StormDuration.StandardDeviation; @@ -152,7 +134,7 @@ public void Properties_LevelOfCrestOfStructure_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); NormalDistribution levelOfCrestOfStructure = new NormalDistribution(5) @@ -173,7 +155,7 @@ public void Properties_OrientationOfTheNormalOfTheStructure_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); RoundedDouble orientationOfTheNormalOfTheStructure = new RoundedDouble(5, random.NextDouble()); @@ -189,7 +171,7 @@ public void Properties_AllowableIncreaseOfLevelForStorage_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); LogNormalDistribution allowableIncreaseOfLevelForStorage = new LogNormalDistribution(5) @@ -210,7 +192,7 @@ public void Properties_StorageStructureArea_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); LogNormalDistribution storageStructureArea = new LogNormalDistribution(5) @@ -231,7 +213,7 @@ public void Properties_FlowWidthAtBottomProtection_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); LogNormalDistribution flowWidthAtBottomProtection = new LogNormalDistribution(5) @@ -252,7 +234,7 @@ public void Properties_CriticalOvertoppingDischarge_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); LogNormalDistribution criticalOvertoppingDischarge = new LogNormalDistribution(5) @@ -273,7 +255,7 @@ public void Properties_FailureProbabilityOfStructureGivenErosion_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); RoundedDouble failureProbabilityOfStructureGivenErosion = new RoundedDouble(5, random.NextDouble()); @@ -289,7 +271,7 @@ public void Properties_WidthOfFlowApertures_ExpectedValues() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var random = new Random(22); NormalDistribution widthOfFlowApertures = new NormalDistribution(5) Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs =================================================================== diff -u -rb784ac8be54e88a798f4b7b7ad54ffe47b587e20 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs (.../HeightStructuresInputContextTest.cs) (revision b784ac8be54e88a798f4b7b7ad54ffe47b587e20) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresInputContextTest.cs (.../HeightStructuresInputContextTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -46,7 +46,7 @@ public void ConstructorWithData_Always_ExpectedPropertiesSet() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var calculationMock = mocksRepository.StrictMock(); var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); @@ -68,7 +68,7 @@ public void Constructor_NullCalculation_ThrowsArgumentNullException() { // Setup - var input = new HeightStructuresInput(new GeneralHeightStructuresInput()); + var input = new HeightStructuresInput(); var failureMechanismMock = mocksRepository.StrictMock(); var assessmentSectionMock = mocksRepository.StrictMock(); mocksRepository.ReplayAll(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs =================================================================== diff -u -r26359a31a29af21b6690cacd9b810b1565af9e4b -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision 26359a31a29af21b6690cacd9b810b1565af9e4b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -67,7 +67,7 @@ mockRepository.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); - var input = new HeightStructuresInput(failureMechanism.GeneralInput); + var input = new HeightStructuresInput(); var properties = new HeightStructuresInputContextProperties(); var inputContext = new HeightStructuresInputContext(input, calculationMock, failureMechanism, assessmentSectionMock); @@ -147,7 +147,7 @@ mockRepository.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); - var input = new HeightStructuresInput(failureMechanism.GeneralInput); + var input = new HeightStructuresInput(); input.Attach(observerMock); var inputContext = new HeightStructuresInputContext(input, calculationMock, failureMechanism, assessmentSectionMock); @@ -179,7 +179,7 @@ mockRepository.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); - var input = new HeightStructuresInput(failureMechanism.GeneralInput); + var input = new HeightStructuresInput(); var inputContext = new HeightStructuresInputContext(input, calculationMock, failureMechanism, assessmentSectionMock); // Call Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresInputContextTreeNodeInfoTest.cs =================================================================== diff -u -rcb903e8cdb76e9733979fe508ee097107c022a28 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresInputContextTreeNodeInfoTest.cs (.../HeightStructuresInputContextTreeNodeInfoTest.cs) (revision cb903e8cdb76e9733979fe508ee097107c022a28) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresInputContextTreeNodeInfoTest.cs (.../HeightStructuresInputContextTreeNodeInfoTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -81,7 +81,7 @@ var generalInput = new GeneralHeightStructuresInput(); var assessmentSectionMock = mocksRepository.StrictMock(); var heightStructuresInputContext = new HeightStructuresInputContext( - new HeightStructuresInput(new GeneralHeightStructuresInput()), + new HeightStructuresInput(), new HeightStructuresCalculation(generalInput), new HeightStructuresFailureMechanism(), assessmentSectionMock); @@ -103,7 +103,7 @@ var assessmentSectionMock = mocksRepository.StrictMock(); var generalInput = new GeneralHeightStructuresInput(); var heightStructuresInputContext = new HeightStructuresInputContext( - new HeightStructuresInput(new GeneralHeightStructuresInput()), + new HeightStructuresInput(), new HeightStructuresCalculation(generalInput), new HeightStructuresFailureMechanism(), assessmentSectionMock); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/UITypeEditors/HeightStructuresInputContextHydraulicBoundaryLocationEditorTest.cs =================================================================== diff -u -r37a53b1ca9a4cdfc6e6df7f065cd540c627f2622 -r7f4ee0fa245a18426c81c11c8f9ea18e73e42d07 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/UITypeEditors/HeightStructuresInputContextHydraulicBoundaryLocationEditorTest.cs (.../HeightStructuresInputContextHydraulicBoundaryLocationEditorTest.cs) (revision 37a53b1ca9a4cdfc6e6df7f065cd540c627f2622) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/UITypeEditors/HeightStructuresInputContextHydraulicBoundaryLocationEditorTest.cs (.../HeightStructuresInputContextHydraulicBoundaryLocationEditorTest.cs) (revision 7f4ee0fa245a18426c81c11c8f9ea18e73e42d07) @@ -54,7 +54,7 @@ hydraulicBoundaryDatabase.Locations.Add(new TestHydraulicBoundaryLocation()); var failureMechanism = new HeightStructuresFailureMechanism(); - var heightStructuresInput = new HeightStructuresInput(failureMechanism.GeneralInput); + var heightStructuresInput = new HeightStructuresInput(); var calculationMock = mockRepository.StrictMock(); var assessmentSectionMock = mockRepository.StrictMock(); @@ -101,12 +101,11 @@ hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); var failureMechanism = new HeightStructuresFailureMechanism(); - var heightStructuresInput = new HeightStructuresInput(failureMechanism.GeneralInput) + var heightStructuresInput = new HeightStructuresInput { HydraulicBoundaryLocation = hydraulicBoundaryLocation }; - var calculationMock = mockRepository.StrictMock(); var assessmentSectionMock = mockRepository.StrictMock(); assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase)