Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/PipingCalculationConfigurationImporter.cs
===================================================================
diff -u -rf7a31f0e8db5d1dcb2b08fb9d4fbeb91863ebd82 -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/PipingCalculationConfigurationImporter.cs (.../PipingCalculationConfigurationImporter.cs) (revision f7a31f0e8db5d1dcb2b08fb9d4fbeb91863ebd82)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/PipingCalculationConfigurationImporter.cs (.../PipingCalculationConfigurationImporter.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -143,7 +143,7 @@
else if (readCalculation.AssessmentLevel.HasValue)
{
pipingCalculation.InputParameters.UseAssessmentLevelManualInput = true;
- pipingCalculation.InputParameters.AssessmentLevel = (RoundedDouble) readCalculation.AssessmentLevel;
+ pipingCalculation.InputParameters.AssessmentLevel = (RoundedDouble) readCalculation.AssessmentLevel.Value;
}
return true;
@@ -198,7 +198,7 @@
if (hasEntryPoint)
{
- var entryPoint = (double) readCalculation.EntryPointL;
+ double entryPoint = readCalculation.EntryPointL.Value;
try
{
@@ -214,7 +214,7 @@
if (hasExitPoint)
{
- var exitPoint = (double) readCalculation.ExitPointL;
+ double exitPoint = readCalculation.ExitPointL.Value;
try
{
@@ -329,7 +329,7 @@
{
var normalDistribution = new NormalDistribution();
- var mean = (double) readCalculation.PhreaticLevelExitMean;
+ double mean = readCalculation.PhreaticLevelExitMean.Value;
try
{
@@ -345,7 +345,7 @@
return false;
}
- var standardDeviation = (double)readCalculation.PhreaticLevelExitStandardDeviation;
+ double standardDeviation = readCalculation.PhreaticLevelExitStandardDeviation.Value;
try
{
@@ -367,7 +367,7 @@
if (readCalculation.DampingFactorExitMean.HasValue && readCalculation.DampingFactorExitStandardDeviation.HasValue)
{
var logNormalDistribution = new LogNormalDistribution();
- var mean = (double)readCalculation.DampingFactorExitMean;
+ double mean = readCalculation.DampingFactorExitMean.Value;
try
{
@@ -383,7 +383,7 @@
return false;
}
- var standardDeviation = (double)readCalculation.DampingFactorExitStandardDeviation;
+ double standardDeviation = readCalculation.DampingFactorExitStandardDeviation.Value;
try
{
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs
===================================================================
diff -u -r3fa1f22b25a81f42d033e29e29d57e362eff8662 -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs (.../WaveConditionsCalculationConfigurationImporter.cs) (revision 3fa1f22b25a81f42d033e29e29d57e362eff8662)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Importers/WaveConditionsCalculationConfigurationImporter.cs (.../WaveConditionsCalculationConfigurationImporter.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -26,7 +26,6 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.Hydraulics;
-using Ringtoets.Common.IO;
using Ringtoets.Common.IO.FileImporters;
using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Properties;
@@ -143,7 +142,7 @@
}
///
- /// Reads the entry point and exit point.
+ /// Reads the boundaries of the calculation.
///
/// The calculation read from the imported file.
/// The calculation to configure.
@@ -152,7 +151,7 @@
{
if (readCalculation.UpperBoundaryRevetment.HasValue)
{
- var upperBoundaryRevetment = (double) readCalculation.UpperBoundaryRevetment;
+ double upperBoundaryRevetment = readCalculation.UpperBoundaryRevetment.Value;
try
{
@@ -170,7 +169,7 @@
if (readCalculation.LowerBoundaryRevetment.HasValue)
{
- var lowerBoundaryRevetment = (double) readCalculation.LowerBoundaryRevetment;
+ double lowerBoundaryRevetment = readCalculation.LowerBoundaryRevetment.Value;
try
{
@@ -188,7 +187,7 @@
if (readCalculation.UpperBoundaryWaterLevels.HasValue)
{
- var upperBoundaryWaterLevels = (double) readCalculation.UpperBoundaryWaterLevels;
+ double upperBoundaryWaterLevels = readCalculation.UpperBoundaryWaterLevels.Value;
try
{
@@ -206,7 +205,7 @@
if (readCalculation.LowerBoundaryWaterLevels.HasValue)
{
- var lowerBoundaryWaterLevels = (double) readCalculation.LowerBoundaryWaterLevels;
+ double lowerBoundaryWaterLevels = readCalculation.LowerBoundaryWaterLevels.Value;
try
{
@@ -227,12 +226,9 @@
private void ReadStepSize(ReadWaveConditionsCalculation readCalculation, IWaveConditionsCalculation calculation)
{
- if (readCalculation.StepSize != null)
+ if (readCalculation.StepSize.HasValue)
{
- var stepSize = (double) readCalculation.StepSize;
-
- calculation.InputParameters.StepSize = (WaveConditionsInputStepSize)
- new WaveConditionsInputStepSizeConverter().ConvertFrom(stepSize.ToString("0.0"));
+ calculation.InputParameters.StepSize = readCalculation.StepSize.Value;
}
}
@@ -274,7 +270,7 @@
{
if (readCalculation.Orientation.HasValue)
{
- var orientation = (double) readCalculation.Orientation;
+ double orientation = readCalculation.Orientation.Value;
try
{
@@ -308,22 +304,22 @@
if (readCalculation.UseForeshore.HasValue)
{
- calculation.InputParameters.UseForeshore = (bool) readCalculation.UseForeshore;
+ calculation.InputParameters.UseForeshore = readCalculation.UseForeshore.Value;
}
if (readCalculation.UseBreakWater.HasValue)
{
- calculation.InputParameters.UseBreakWater = (bool) readCalculation.UseBreakWater;
+ calculation.InputParameters.UseBreakWater = readCalculation.UseBreakWater.Value;
}
- if (readCalculation.BreakWaterType != null)
+ if (readCalculation.BreakWaterType.HasValue)
{
- calculation.InputParameters.BreakWater.Type = (BreakWaterType) new BreakWaterTypeConverter().ConvertFrom(readCalculation.BreakWaterType);
+ calculation.InputParameters.BreakWater.Type = readCalculation.BreakWaterType.Value;
}
if (readCalculation.BreakWaterHeight.HasValue)
{
- calculation.InputParameters.BreakWater.Height = (RoundedDouble) readCalculation.BreakWaterHeight;
+ calculation.InputParameters.BreakWater.Height = (RoundedDouble) readCalculation.BreakWaterHeight.Value;
}
return true;
}
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs
===================================================================
diff -u -r038eb94cddc025675fb784caca7acd7f4ec39b89 -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs (.../ReadWaveConditionsCalculation.cs) (revision 038eb94cddc025675fb784caca7acd7f4ec39b89)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/ReadWaveConditionsCalculation.cs (.../ReadWaveConditionsCalculation.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -20,7 +20,9 @@
// All rights reserved.
using System;
+using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
+using Ringtoets.Revetment.Data;
namespace Ringtoets.Revetment.IO.Readers
{
@@ -84,7 +86,7 @@
///
/// Gets the step size of the read calculation.
///
- public double? StepSize { get; }
+ public WaveConditionsInputStepSize? StepSize { get; }
///
/// Gets the name of the foreshore profile of the read calculation.
@@ -104,7 +106,7 @@
///
/// Gets the breakwater type of the read calculation.
///
- public string BreakWaterType { get; }
+ public BreakWaterType? BreakWaterType { get; }
///
/// Gets the breakwater height of the read calculation.
@@ -156,7 +158,7 @@
///
/// Gets or sets the value for .
///
- public double? StepSize{ internal get; set; }
+ public WaveConditionsInputStepSize? StepSize{ internal get; set; }
///
/// Gets or sets the value for .
@@ -176,7 +178,7 @@
///
/// Gets or sets the value for .
///
- public string BreakWaterType { internal get; set; }
+ public BreakWaterType? BreakWaterType { internal get; set; }
///
/// Gets or sets the value for .
Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs
===================================================================
diff -u -r9b6fa40a91299ecbbaffdbc79faf904b6c492d2f -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision 9b6fa40a91299ecbbaffdbc79faf904b6c492d2f)
+++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Readers/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -23,8 +23,11 @@
using System.Collections.Generic;
using System.Xml.Linq;
using Core.Common.Base.IO;
+using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.IO;
using Ringtoets.Common.IO.Readers;
using Ringtoets.Common.IO.Schema;
+using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Properties;
using RingtoestCommonIOResources = Ringtoets.Common.IO.Properties.Resources;
@@ -83,11 +86,11 @@
LowerBoundaryRevetment = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.LowerBoundaryRevetment),
UpperBoundaryWaterLevels = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.UpperBoundaryWaterLevels),
LowerBoundaryWaterLevels = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.LowerBoundaryWaterLevels),
- StepSize = calculationElement.GetDoubleValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize),
+ StepSize = (WaveConditionsInputStepSize?) calculationElement.GetConvertedValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.StepSize),
ForeshoreProfile = calculationElement.GetStringValueFromDescendantElement(WaveConditionsCalculationConfigurationSchemaIdentifiers.ForeshoreProfile),
Orientation = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.Orientation),
UseBreakWater = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseBreakWater),
- BreakWaterType = calculationElement.GetStringValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
+ BreakWaterType = (BreakWaterType?)calculationElement.GetConvertedValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterType),
BreakWaterHeight = calculationElement.GetDoubleValueFromDescendantElement(ConfigurationSchemaIdentifiers.BreakWaterHeight),
UseForeshore = calculationElement.GetBoolValueFromDescendantElement(ConfigurationSchemaIdentifiers.UseForeshore)
};
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs
===================================================================
diff -u -r1144837cd4defc65250e08e83d9ab8583324e21b -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision 1144837cd4defc65250e08e83d9ab8583324e21b)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/ReadWaveConditionsCalculationTest.cs (.../ReadWaveConditionsCalculationTest.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -21,7 +21,9 @@
using System;
using NUnit.Framework;
+using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
+using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Readers;
namespace Ringtoets.Revetment.IO.Test.Readers
@@ -73,11 +75,11 @@
const double lowerBoundaryRevetment = 2.2;
const double upperBoundaryWaterLevels = 3.3;
const double lowerBoundaryWaterLevels = 4.4;
- const double stepSize = 5.5;
+ const WaveConditionsInputStepSize stepSize = WaveConditionsInputStepSize.Half;
const string foreshoreProfileName = "Name of the foreshore profile";
const double orientation = 6.6;
const bool useBreakWater = true;
- const string breakWaterType = "caisson";
+ const BreakWaterType breakWaterType = BreakWaterType.Caisson;
const double breakWaterHeight = 7.7;
const bool useForeshore = false;
Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs
===================================================================
diff -u -r3f40ee696a93367a869de85b3ed0fad2c54a23f2 -r29289635457e7d05e24c8fb923e0c6f56f152add
--- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 3f40ee696a93367a869de85b3ed0fad2c54a23f2)
+++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Readers/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 29289635457e7d05e24c8fb923e0c6f56f152add)
@@ -26,7 +26,9 @@
using Core.Common.Base.IO;
using Core.Common.TestUtil;
using NUnit.Framework;
+using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.IO.Readers;
+using Ringtoets.Revetment.Data;
using Ringtoets.Revetment.IO.Readers;
namespace Ringtoets.Revetment.IO.Test.Readers
@@ -320,11 +322,11 @@
Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment);
Assert.AreEqual(3.3, calculation.UpperBoundaryWaterLevels);
Assert.AreEqual(4.4, calculation.LowerBoundaryWaterLevels);
- Assert.AreEqual(0.5, calculation.StepSize);
+ Assert.AreEqual(WaveConditionsInputStepSize.Half, calculation.StepSize);
Assert.AreEqual("Voorlandprofiel", calculation.ForeshoreProfile);
Assert.AreEqual(5.5, calculation.Orientation);
Assert.IsTrue(calculation.UseBreakWater);
- Assert.AreEqual("caisson", calculation.BreakWaterType);
+ Assert.AreEqual(BreakWaterType.Caisson, calculation.BreakWaterType);
Assert.AreEqual(6.6, calculation.BreakWaterHeight);
Assert.IsFalse(calculation.UseForeshore);
}
@@ -350,11 +352,11 @@
Assert.AreEqual(2.2, calculation.LowerBoundaryRevetment);
Assert.IsNull(calculation.UpperBoundaryWaterLevels);
Assert.IsNull(calculation.LowerBoundaryWaterLevels);
- Assert.AreEqual(0.5, calculation.StepSize);
+ Assert.AreEqual(WaveConditionsInputStepSize.Half, calculation.StepSize);
Assert.IsNull(calculation.ForeshoreProfile);
Assert.IsNull(calculation.Orientation);
Assert.IsTrue(calculation.UseBreakWater);
- Assert.AreEqual("caisson", calculation.BreakWaterType);
+ Assert.AreEqual(BreakWaterType.Caisson, calculation.BreakWaterType);
Assert.AreEqual(3.3, calculation.BreakWaterHeight);
Assert.IsNull(calculation.UseForeshore);
}