Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs
===================================================================
diff -u -rf4c9e0545d96afcd7738cc9493dfa57222baab44 -raf38b1637df89b53b4a9ab7df31d570e21a3191e
--- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision f4c9e0545d96afcd7738cc9493dfa57222baab44)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInput.cs (.../WaveConditionsInput.cs) (revision af38b1637df89b53b4a9ab7df31d570e21a3191e)
@@ -40,10 +40,8 @@
private const double designWaterLevelSubstraction = 0.01;
private DikeProfile dikeProfile;
- private HydraulicBoundaryLocation hydraulicBoundaryLocation;
private RoundedDouble upperRevetmentLevel;
private RoundedDouble lowerRevetmentLevel;
- private RoundedDouble upperWaterLevel;
private RoundedDouble stepSize;
private RoundedDouble upperBoundaryCalculatorSeries;
private RoundedDouble lowerBoundaryCalculatorSeries;
@@ -55,9 +53,7 @@
{
upperRevetmentLevel = new RoundedDouble(2);
lowerRevetmentLevel = new RoundedDouble(2);
- upperWaterLevel = new RoundedDouble(2);
stepSize = new RoundedDouble(1);
-
upperBoundaryCalculatorSeries = new RoundedDouble(2);
lowerBoundaryCalculatorSeries = new RoundedDouble(2);
@@ -83,18 +79,7 @@
///
/// Gets or sets the hydraulic boundary location from which to use the assessment level.
///
- public HydraulicBoundaryLocation HydraulicBoundaryLocation
- {
- get
- {
- return hydraulicBoundaryLocation;
- }
- set
- {
- hydraulicBoundaryLocation = value;
- UpdateUpperWaterLevel();
- }
- }
+ public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; set; }
///
/// Gets or sets if needs to be taken into account.
@@ -165,6 +150,21 @@
}
///
+ /// Gets or sets the step size for wave conditions calculations.
+ ///
+ public RoundedDouble StepSize
+ {
+ get
+ {
+ return stepSize;
+ }
+ set
+ {
+ stepSize = value.ToPrecision(stepSize.NumberOfDecimalPlaces);
+ }
+ }
+
+ ///
/// Gets or sets the upper boundary for the calculator series.
///
/// Thrown when value is smaller than or equal to .
@@ -205,36 +205,6 @@
}
///
- /// Gets or sets the step size for wave conditions calculations.
- ///
- public RoundedDouble StepSize
- {
- get
- {
- return stepSize;
- }
- set
- {
- stepSize = value.ToPrecision(stepSize.NumberOfDecimalPlaces);
- }
- }
-
- ///
- /// Gets the upper water level.
- ///
- public RoundedDouble UpperWaterLevel
- {
- get
- {
- return upperWaterLevel;
- }
- private set
- {
- upperWaterLevel = value.ToPrecision(upperWaterLevel.NumberOfDecimalPlaces);
- }
- }
-
- ///
/// Gets the water levels to calculate for.
///
public IEnumerable WaterLevels
@@ -261,22 +231,17 @@
}
}
- private void UpdateUpperWaterLevel()
+ private double DetermineUpperWaterLevel()
{
- if (hydraulicBoundaryLocation != null && !double.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel))
- {
- UpperWaterLevel = (RoundedDouble) (hydraulicBoundaryLocation.DesignWaterLevel - designWaterLevelSubstraction);
- }
- else
- {
- UpperWaterLevel = (RoundedDouble) 0;
- }
+ return HydraulicBoundaryLocation != null && !double.IsNaN(HydraulicBoundaryLocation.DesignWaterLevel)
+ ? HydraulicBoundaryLocation.DesignWaterLevel - designWaterLevelSubstraction
+ : (RoundedDouble) 0;
}
private IEnumerable DetermineWaterLevels()
{
var waterLevels = new List();
- var upperBoundary = new RoundedDouble(2, Math.Min(UpperWaterLevel, Math.Min(UpperRevetmentLevel, UpperBoundaryCalculatorSeries)));
+ var upperBoundary = new RoundedDouble(2, Math.Min(DetermineUpperWaterLevel(), Math.Min(UpperRevetmentLevel, UpperBoundaryCalculatorSeries)));
var lowerBoundary = new RoundedDouble(2, Math.Max(LowerRevetmentLevel, LowerBoundaryCalculatorSeries));
if (double.IsNaN(upperBoundary) ||