Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingBreakwater.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingBreakwater.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingBreakwater.cs (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -0,0 +1,50 @@ +// 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.Calculation.Data +{ + /// + /// Container for Hydra-Ring break water related data. + /// + public class HydraRingBreakwater + { + /// + /// Creates a new instance of . + /// + /// The break water type. + /// The break water height. + public HydraRingBreakwater(int type, double height) + { + Type = type; + Height = height; + } + + /// + /// Gets the type. + /// + public int Type { get; private set; } + + /// + /// Gets the height. + /// + public double Height { get; private set; } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingForelandPoint.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingForelandPoint.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/HydraRingForelandPoint.cs (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -0,0 +1,50 @@ +// 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.Calculation.Data +{ + /// + /// Container for Hydra-Ring foreland point related data. + /// + public class HydraRingForelandPoint + { + /// + /// Creates a new instance of the class. + /// + /// The x coordinate. + /// The z coordinate. + public HydraRingForelandPoint(double x, double z) + { + X = x; + Z = z; + } + + /// + /// Gets the x coordinate. + /// + public double X { get; private set; } + + /// + /// Gets the z coordinate. + /// + public double Z { get; private set; } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs =================================================================== diff -u -ra02bc3699e3ded023af30aced1e28e1676a39307 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs (.../HydraRingCalculationInput.cs) (revision a02bc3699e3ded023af30aced1e28e1676a39307) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/HydraRingCalculationInput.cs (.../HydraRingCalculationInput.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -93,6 +93,28 @@ } /// + /// Gets the foreland points to use during the calculation. + /// + public virtual IEnumerable ForelandsPoints + { + get + { + yield break; + } + } + + /// + /// Gets the break waters to use during the calculation. + /// + public virtual IEnumerable BreakWaters + { + get + { + yield break; + } + } + + /// /// Gets the reliability index to use during the calculation. /// /// Only relevant for type 2 computations. Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -rae91337b275c5618d36e9fba5aaabf2fd08c69bf -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision ae91337b275c5618d36e9fba5aaabf2fd08c69bf) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -42,7 +42,9 @@ Properties\GlobalAssembly.cs + + Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingConfigurationService.cs =================================================================== diff -u -rb111025f59ee8ed5c0ea7ea1847ef7eccd554481 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingConfigurationService.cs (.../HydraRingConfigurationService.cs) (revision b111025f59ee8ed5c0ea7ea1847ef7eccd554481) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Services/HydraRingConfigurationService.cs (.../HydraRingConfigurationService.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -145,14 +145,15 @@ configurationDictionary["PresentationSections"] = new List(); configurationDictionary["Profiles"] = GetCalculationProfilesConfiguration(); configurationDictionary["ForelandModels"] = new List(); - configurationDictionary["Forelands"] = new List(); + configurationDictionary["Forelands"] = GetForelandsConfiguration(); configurationDictionary["ProbabilityAlternatives"] = new List(); configurationDictionary["SetUpHeights"] = new List(); configurationDictionary["CalcWindDirections"] = new List(); configurationDictionary["Swells"] = new List(); configurationDictionary["WaveReductions"] = new List(); configurationDictionary["Areas"] = GetAreasConfiguration(); configurationDictionary["Projects"] = GetProjectsConfiguration(); + configurationDictionary["Breakwaters"] = GetSectionBreakWatersConfiguration(); return GenerateDataBaseCreationScript(configurationDictionary); } @@ -480,6 +481,59 @@ return orderDictionaries; } + private IList GetForelandsConfiguration() + { + var orderDictionaries = new List(); + foreach (var hydraRingCalculationInput in hydraRingCalculationInputs) + { + for (var i = 0; i < hydraRingCalculationInput.ForelandsPoints.Count(); i++) + { + var forelandPoint = hydraRingCalculationInput.ForelandsPoints.ElementAt(i); + + orderDictionaries.Add(new OrderedDictionary + { + { + "SectionId", hydraRingCalculationInput.DikeSection.SectionId + }, + { + "SequenceNumber", i + 1 + }, + { + "XCoordinate", GetHydraRingValue(forelandPoint.X) + }, + { + "ZCoordinate", GetHydraRingValue(forelandPoint.Z) + } + }); + } + } + return orderDictionaries; + } + + private IList GetSectionBreakWatersConfiguration() + { + var orderedDictionaries = new List(); + foreach (var hydraRingCalculationInput in hydraRingCalculationInputs) + { + foreach (var breakwater in hydraRingCalculationInput.BreakWaters) + { + orderedDictionaries.Add(new OrderedDictionary + { + { + "SectionId", hydraRingCalculationInput.DikeSection.SectionId + }, + { + "Type", GetHydraRingValue(breakwater.Type) + }, + { + "Height", GetHydraRingValue(breakwater.Height) + } + }); + } + } + return orderedDictionaries; + } + private IList GetSectionFaultTreeModelsConfiguration() { var orderedDictionaries = new List(); Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingBreakwaterTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingBreakwaterTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingBreakwaterTest.cs (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -0,0 +1,46 @@ +// 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.Data; + +namespace Ringtoets.HydraRing.Calculation.Test.Data +{ + [TestFixture] + public class HydraRingBreakwaterTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + int type = 1; + double height = 100.1; + + // Call + HydraRingBreakwater breakwater = new HydraRingBreakwater(type, height); + + // Assert + Assert.IsNotNull(breakwater); + Assert.AreEqual(type, breakwater.Type); + Assert.AreEqual(height, breakwater.Height); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingForelandPointTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingForelandPointTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/HydraRingForelandPointTest.cs (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -0,0 +1,46 @@ +// 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.Data; + +namespace Ringtoets.HydraRing.Calculation.Test.Data +{ + [TestFixture] + public class HydraRingForelandPointTest + { + [Test] + public void Constructor_Always_ExpectedValues() + { + // Setup + double xCoordinate = 1.1; + double zCoordinate = 2.2; + + // Call + var hydraRingForelandPoint = new HydraRingForelandPoint(xCoordinate, zCoordinate); + + // Assert + Assert.IsNotNull(hydraRingForelandPoint); + Assert.AreEqual(xCoordinate, hydraRingForelandPoint.X); + Assert.AreEqual(zCoordinate, hydraRingForelandPoint.Z); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/HydraRingCalculationInputTest.cs =================================================================== diff -u -ra02bc3699e3ded023af30aced1e28e1676a39307 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/HydraRingCalculationInputTest.cs (.../HydraRingCalculationInputTest.cs) (revision a02bc3699e3ded023af30aced1e28e1676a39307) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/HydraRingCalculationInputTest.cs (.../HydraRingCalculationInputTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -42,6 +42,8 @@ Assert.AreEqual(1, hydraRingCalculationInput.DikeSection.SectionId); CollectionAssert.IsEmpty(hydraRingCalculationInput.Variables); CollectionAssert.IsEmpty(hydraRingCalculationInput.ProfilePoints); + CollectionAssert.IsEmpty(hydraRingCalculationInput.ForelandsPoints); + CollectionAssert.IsEmpty(hydraRingCalculationInput.BreakWaters); Assert.IsNaN(hydraRingCalculationInput.Beta); } Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs =================================================================== diff -u -ra02bc3699e3ded023af30aced1e28e1676a39307 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs (.../AssessmentLevelCalculationInputTest.cs) (revision a02bc3699e3ded023af30aced1e28e1676a39307) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/Hydraulics/AssessmentLevelCalculationInputTest.cs (.../AssessmentLevelCalculationInputTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -46,6 +46,8 @@ Assert.IsNotNull(assessmentLevelCalculationInput.DikeSection); Assert.AreEqual(1, assessmentLevelCalculationInput.Variables.Count()); CollectionAssert.IsEmpty(assessmentLevelCalculationInput.ProfilePoints); + CollectionAssert.IsEmpty(assessmentLevelCalculationInput.ForelandsPoints); + CollectionAssert.IsEmpty(assessmentLevelCalculationInput.BreakWaters); Assert.AreEqual(expectedBeta, assessmentLevelCalculationInput.Beta); var dikeSection = assessmentLevelCalculationInput.DikeSection; Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/TargetProbabilityCalculationInputTest.cs =================================================================== diff -u -ra02bc3699e3ded023af30aced1e28e1676a39307 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/TargetProbabilityCalculationInputTest.cs (.../TargetProbabilityCalculationInputTest.cs) (revision a02bc3699e3ded023af30aced1e28e1676a39307) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Data/Input/TargetProbabilityCalculationInputTest.cs (.../TargetProbabilityCalculationInputTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -45,6 +45,8 @@ Assert.AreEqual(1, targetProbabilityCalculationInputImplementation.DikeSection.SectionId); CollectionAssert.IsEmpty(targetProbabilityCalculationInputImplementation.Variables); CollectionAssert.IsEmpty(targetProbabilityCalculationInputImplementation.ProfilePoints); + CollectionAssert.IsEmpty(targetProbabilityCalculationInputImplementation.ForelandsPoints); + CollectionAssert.IsEmpty(targetProbabilityCalculationInputImplementation.BreakWaters); Assert.AreEqual(expectedBeta, targetProbabilityCalculationInputImplementation.Beta); } Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs =================================================================== diff -u -r95ef650c982927603a743b7ccd4f43b45a616f56 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision 95ef650c982927603a743b7ccd4f43b45a616f56) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Integration/HydraRingConfigurationServiceIntegrationTest.cs (.../HydraRingConfigurationServiceIntegrationTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -85,7 +85,9 @@ "INSERT INTO [Areas] VALUES (1, '1', 'Nederland');" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Projects];" + Environment.NewLine + - "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine; + "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine + + Environment.NewLine + + "DELETE FROM [Breakwaters];" + Environment.NewLine; var creationScript = hydraRingConfigurationService.GenerateDataBaseCreationScript(); Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj =================================================================== diff -u -r1ed8634b879f06546f5e532048bbf6481bf39088 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 1ed8634b879f06546f5e532048bbf6481bf39088) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -56,6 +56,8 @@ + + Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs =================================================================== diff -u -rb111025f59ee8ed5c0ea7ea1847ef7eccd554481 -r16353c197a25732675287dfba8679ab25731ab0c --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs (.../HydraRingConfigurationServiceTest.cs) (revision b111025f59ee8ed5c0ea7ea1847ef7eccd554481) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingConfigurationServiceTest.cs (.../HydraRingConfigurationServiceTest.cs) (revision 16353c197a25732675287dfba8679ab25731ab0c) @@ -94,6 +94,8 @@ "DELETE FROM [ForelandModels];" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Forelands];" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (1, 1, 1.1, 2.2);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (1, 2, 2.2, 3.3);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [ProbabilityAlternatives];" + Environment.NewLine + Environment.NewLine + @@ -109,7 +111,11 @@ "INSERT INTO [Areas] VALUES (1, '1', 'Nederland');" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Projects];" + Environment.NewLine + - "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine; + "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine + + Environment.NewLine + + "DELETE FROM [Breakwaters];" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (1, 1, 99.9);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (1, 3, 20.2);" + Environment.NewLine; // Call var creationScript = hydraRingConfigurationService.GenerateDataBaseCreationScript(); @@ -201,6 +207,12 @@ "DELETE FROM [ForelandModels];" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Forelands];" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (1, 1, 1.1, 2.2);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (1, 2, 2.2, 3.3);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (2, 1, 1.1, 2.2);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (2, 2, 2.2, 3.3);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (3, 1, 1.1, 2.2);" + Environment.NewLine + + "INSERT INTO [Forelands] VALUES (3, 2, 2.2, 3.3);" + Environment.NewLine + Environment.NewLine + "DELETE FROM [ProbabilityAlternatives];" + Environment.NewLine + Environment.NewLine + @@ -216,7 +228,15 @@ "INSERT INTO [Areas] VALUES (1, '1', 'Nederland');" + Environment.NewLine + Environment.NewLine + "DELETE FROM [Projects];" + Environment.NewLine + - "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine; + "INSERT INTO [Projects] VALUES (1, 'WTI 2017', 'Ringtoets calculation');" + Environment.NewLine + + Environment.NewLine + + "DELETE FROM [Breakwaters];" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (1, 1, 99.9);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (1, 3, 20.2);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (2, 1, 99.9);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (2, 3, 20.2);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (3, 1, 99.9);" + Environment.NewLine + + "INSERT INTO [Breakwaters] VALUES (3, 3, 20.2);" + Environment.NewLine; // Call var creationScript = hydraRingConfigurationService.GenerateDataBaseCreationScript(); @@ -288,6 +308,24 @@ } } + public override IEnumerable ForelandsPoints + { + get + { + yield return new HydraRingForelandPoint(1.1, 2.2); + yield return new HydraRingForelandPoint(2.2, 3.3); + } + } + + public override IEnumerable BreakWaters + { + get + { + yield return new HydraRingBreakwater(1, 99.9); + yield return new HydraRingBreakwater(3, 20.2); + } + } + public override double Beta { get