Index: Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs =================================================================== diff -u -r82af27f82c4dc2248e03c0e22bbe46b5e01e88bb -rb80222df5e484e90e255f10116a7e88ead10a289 --- Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision 82af27f82c4dc2248e03c0e22bbe46b5e01e88bb) +++ Ringtoets/Common/src/Ringtoets.Common.IO/FileImporters/CalculationConfigurationImporter.cs (.../CalculationConfigurationImporter.cs) (revision b80222df5e484e90e255f10116a7e88ead10a289) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Core.Common.Base.Data; using Core.Common.Base.IO; using Core.Common.IO.Readers; using log4net; @@ -30,6 +31,7 @@ using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.IO.Configurations; +using Ringtoets.Common.IO.Configurations.Helpers; using Ringtoets.Common.IO.Properties; using Ringtoets.Common.IO.Readers; @@ -198,7 +200,7 @@ if (locationName != null) { - var location = hydraulicBoundaryLocations.FirstOrDefault(l => l.Name == locationName); + HydraulicBoundaryLocation location = hydraulicBoundaryLocations.FirstOrDefault(l => l.Name == locationName); if (location == null) { @@ -290,7 +292,7 @@ if (foreshoreProfileName != null) { - var foreshoreProfile = foreshoreProfiles.FirstOrDefault(fp => fp.Name == foreshoreProfileName); + ForeshoreProfile foreshoreProfile = foreshoreProfiles.FirstOrDefault(fp => fp.Name == foreshoreProfileName); if (foreshoreProfile == null) { @@ -309,6 +311,39 @@ return true; } + /// + /// Assigns the parameters to the . + /// + /// Type of the input for which values are assigned from the configuration. + /// The wave reduction configuration containing values for the parameters. + /// The input to assign the values to. + protected static void ReadWaveReductionParameters(WaveReductionConfiguration waveReduction, T input) + where T : IUseBreakWater, IUseForeshore + { + if (waveReduction != null) + { + if (waveReduction.UseForeshoreProfile.HasValue) + { + input.UseForeshore = waveReduction.UseForeshoreProfile.Value; + } + + if (waveReduction.UseBreakWater.HasValue) + { + input.UseBreakWater = waveReduction.UseBreakWater.Value; + } + + if (waveReduction.BreakWaterType.HasValue) + { + input.BreakWater.Type = (BreakWaterType) new ConfigurationBreakWaterTypeConverter().ConvertTo(waveReduction.BreakWaterType.Value, typeof(BreakWaterType)); + } + + if (waveReduction.BreakWaterHeight.HasValue) + { + input.BreakWater.Height = (RoundedDouble) waveReduction.BreakWaterHeight.Value; + } + } + } + private ReadResult ReadConfiguration() { try