Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs
===================================================================
diff -u -r6677bd4cf1803da9d7eeb8e945f2fb3f82b32c6e -r8d42ff2fc79d3e478b29cf122c4f35ee1a013c3c
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs (.../MacroStabilityInwardsCalculationConfigurationImporter.cs) (revision 6677bd4cf1803da9d7eeb8e945f2fb3f82b32c6e)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Configurations/MacroStabilityInwardsCalculationConfigurationImporter.cs (.../MacroStabilityInwardsCalculationConfigurationImporter.cs) (revision 8d42ff2fc79d3e478b29cf122c4f35ee1a013c3c)
@@ -92,7 +92,8 @@
&& TrySetSurfaceLine(calculationConfiguration, calculation)
&& TrySetStochasticSoilModel(calculationConfiguration, calculation)
&& TrySetStochasticSoilProfile(calculationConfiguration, calculation)
- && TrySetScenarioParameters(calculationConfiguration.Scenario, calculation))
+ && TrySetScenarioParameters(calculationConfiguration.Scenario, calculation)
+ && TrySetTangentLineZTopBottom(calculationConfiguration, calculation))
{
SetSimpleProperties(calculationConfiguration, calculation.InputParameters);
@@ -105,6 +106,52 @@
}
///
+ /// Assigns the tangent line Z top and tangent line Z bottom parameters to the .
+ ///
+ /// The calculation read from the imported file.
+ /// The calculation to configure.
+ /// true if no tangent line z top and tangent line z bottom was given, or when
+ /// tangent line z top and tangent line z bottom are set to the ,
+ /// false otherwise.
+ private bool TrySetTangentLineZTopBottom(MacroStabilityInwardsCalculationConfiguration calculationConfiguration,
+ MacroStabilityInwardsCalculationScenario calculation)
+ {
+ bool hasTangentLineZTop = calculationConfiguration.TangentLineZTop.HasValue;
+ bool hasTangentLineZBottom = calculationConfiguration.TangentLineZBottom.HasValue;
+
+ if (!hasTangentLineZTop && !hasTangentLineZBottom)
+ {
+ return true;
+ }
+
+ RoundedDouble tangentLineZTop = hasTangentLineZTop
+ ? (RoundedDouble) calculationConfiguration.TangentLineZTop.Value
+ : RoundedDouble.NaN;
+ RoundedDouble tangentLineZBottom = hasTangentLineZBottom
+ ? (RoundedDouble) calculationConfiguration.TangentLineZBottom.Value
+ : RoundedDouble.NaN;
+
+ MacroStabilityInwardsInput input = calculation.InputParameters;
+ try
+ {
+ input.TangentLineZTop = tangentLineZTop;
+ input.TangentLineZBottom = tangentLineZBottom;
+ }
+ catch (ArgumentException e)
+ {
+ Log.LogCalculationConversionError(string.Format(Resources.MacroStabilityInwardsCalculationConfigurationImporter_TrySetTangentLineZTopBottom_Combination_of_TangentLineZTop_0_and_TangentLineZBottom_1_invalid_Reason_2,
+ tangentLineZTop.ToPrecision(input.TangentLineZTop.NumberOfDecimalPlaces),
+ tangentLineZBottom.ToPrecision(input.TangentLineZTop.NumberOfDecimalPlaces),
+ e.Message),
+ calculation.Name);
+
+ return false;
+ }
+
+ return true;
+ }
+
+ ///
/// Assigns the hydraulic boundary location or the assessment level that is set manually.
///
/// The calculation read from the imported file.