Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs
===================================================================
diff -u -r82af27f82c4dc2248e03c0e22bbe46b5e01e88bb -rb80222df5e484e90e255f10116a7e88ead10a289
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision 82af27f82c4dc2248e03c0e22bbe46b5e01e88bb)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision b80222df5e484e90e255f10116a7e88ead10a289)
@@ -103,8 +103,9 @@
&& TryReadStochasts(readCalculation, calculation)
&& TryReadOrientation(readCalculation, calculation)
&& TryReadFailureProbabilityStructureWithErosion(readCalculation, calculation)
- && TryReadWaveReduction(readCalculation.WaveReduction, calculation))
+ && ValidateWaveReduction(readCalculation.WaveReduction, calculation.InputParameters.ForeshoreProfile, calculation.Name))
{
+ ReadWaveReductionParameters(readCalculation.WaveReduction, calculation.InputParameters);
return calculation;
}
return null;
@@ -375,44 +376,5 @@
return false;
}
-
- ///
- /// Reads the wave reduction parameters.
- ///
- ///
- /// The calculation to configure.
- /// false when there is an invalid wave reduction parameter defined, true otherwise.
- private bool TryReadWaveReduction(WaveReductionConfiguration waveReduction, StructuresCalculation calculation)
- {
- if (!ValidateWaveReduction(waveReduction, calculation.InputParameters.ForeshoreProfile, calculation.Name))
- {
- return false;
- }
-
- if (waveReduction != null)
- {
- if (waveReduction.UseForeshoreProfile.HasValue)
- {
- calculation.InputParameters.UseForeshore = waveReduction.UseForeshoreProfile.Value;
- }
-
- if (waveReduction.UseBreakWater.HasValue)
- {
- calculation.InputParameters.UseBreakWater = waveReduction.UseBreakWater.Value;
- }
-
- if (waveReduction.BreakWaterType.HasValue)
- {
- calculation.InputParameters.BreakWater.Type = (BreakWaterType) new ConfigurationBreakWaterTypeConverter().ConvertTo(waveReduction.BreakWaterType.Value, typeof(BreakWaterType));
- }
-
- if (waveReduction.BreakWaterHeight.HasValue)
- {
- calculation.InputParameters.BreakWater.Height = (RoundedDouble) waveReduction.BreakWaterHeight.Value;
- }
- }
-
- return true;
- }
}
}
\ No newline at end of file