Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs
===================================================================
diff -u -r8c7c25ee0b61c182e38073f56cb6376c511ccbf2 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs (.../ReferenceLine.cs) (revision 8c7c25ee0b61c182e38073f56cb6376c511ccbf2)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/ReferenceLine.cs (.../ReferenceLine.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -47,6 +47,7 @@
///
/// Gets the total length of the reference line.
+ /// [m]
///
public double Length { get; private set; }
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs
===================================================================
diff -u -r39e266b1a41bc2ffda5578b019634afd559b92a4 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 39e266b1a41bc2ffda5578b019634afd559b92a4)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Factories/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -84,7 +84,7 @@
MapFeature feature = CreateSingleLineMapFeature(referenceLine.Points);
feature.MetaData[Resources.MetaData_ID] = id;
feature.MetaData[Resources.MetaData_Name] = name;
- feature.MetaData[Resources.MetaData_Length] = new RoundedDouble(2, Math2D.Length(referenceLine.Points));
+ feature.MetaData[Resources.MetaData_Length] = new RoundedDouble(2, referenceLine.Length);
return new[]
{
@@ -131,10 +131,12 @@
{
throw new ArgumentNullException(nameof(hydraulicBoundaryLocations));
}
+
if (designWaterLevelAttributeName == null)
{
throw new ArgumentNullException(nameof(designWaterLevelAttributeName));
}
+
if (waveHeightAttributeName == null)
{
throw new ArgumentNullException(nameof(waveHeightAttributeName));
@@ -227,8 +229,10 @@
mapFeatures[i] = feature;
i++;
}
+
return mapFeatures;
}
+
return new MapFeature[0];
}
@@ -255,8 +259,10 @@
mapFeatures[i] = feature;
}
+
return mapFeatures;
}
+
return new MapFeature[0];
}
@@ -282,8 +288,10 @@
mapFeatures[i] = feature;
i++;
}
+
return mapFeatures;
}
+
return new MapFeature[0];
}
@@ -341,6 +349,7 @@
features[i] = feature;
}
+
return features;
}
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r09a2360e1ee2624ea986c6338ef1c3ca65e8c215 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 09a2360e1ee2624ea986c6338ef1c3ca65e8c215)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -2111,7 +2111,7 @@
}
///
- /// Looks up a localized string similar to Lengte.
+ /// Looks up a localized string similar to Lengte*.
///
public static string MetaData_Length {
get {
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx
===================================================================
diff -u -r09a2360e1ee2624ea986c6338ef1c3ca65e8c215 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 09a2360e1ee2624ea986c6338ef1c3ca65e8c215)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -839,7 +839,7 @@
Koppelingsafstand
- Lengte
+ Lengte*
Normaal (afgekapt)
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs
===================================================================
diff -u -r90a24386ddda4f2807a22df1b7da6db5c794d790 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision 90a24386ddda4f2807a22df1b7da6db5c794d790)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -109,7 +109,7 @@
Assert.AreEqual(name, mapFeature.MetaData["Naam"]);
var expectedLength = new RoundedDouble(2, Math2D.Length(points));
- Assert.AreEqual(expectedLength, (RoundedDouble) mapFeature.MetaData["Lengte"], expectedLength.GetAccuracy());
+ Assert.AreEqual(expectedLength, (RoundedDouble) mapFeature.MetaData["Lengte*"], expectedLength.GetAccuracy());
AssertEqualPointCollections(points, mapFeature.MapGeometries.ElementAt(0));
}
@@ -295,7 +295,7 @@
Assert.AreEqual(sections[i].Name, features.ElementAt(i).MetaData["Naam"]);
var expectedLength = new RoundedDouble(2, Math2D.Length(sections[i].Points));
- Assert.AreEqual(expectedLength, (RoundedDouble) features.ElementAt(i).MetaData["Lengte"], expectedLength.GetAccuracy());
+ Assert.AreEqual(expectedLength, (RoundedDouble) features.ElementAt(i).MetaData["Lengte*"], expectedLength.GetAccuracy());
AssertEqualPointCollections(sections[i].Points, features.ElementAt(i).MapGeometries.First());
}
Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs
===================================================================
diff -u -r44cf5bc0f292171637b0c91b74005effe4d2798c -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision 44cf5bc0f292171637b0c91b74005effe4d2798c)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs (.../AssessmentSection.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -23,7 +23,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using Core.Common.Base;
-using Core.Common.Base.Geometry;
using Ringtoets.ClosingStructures.Data;
using Ringtoets.Common.Data;
using Ringtoets.Common.Data.AssessmentSection;
@@ -219,8 +218,8 @@
set
{
referenceLine = value;
- Piping.PipingProbabilityAssessmentInput.SectionLength = value == null ? double.NaN : Math2D.Length(value.Points);
- MacroStabilityInwards.MacroStabilityInwardsProbabilityAssessmentInput.SectionLength = value == null ? double.NaN : Math2D.Length(value.Points);
+ Piping.PipingProbabilityAssessmentInput.SectionLength = value?.Length ?? double.NaN;
+ MacroStabilityInwards.MacroStabilityInwardsProbabilityAssessmentInput.SectionLength = value?.Length ?? double.NaN;
}
}
@@ -313,6 +312,7 @@
default:
throw new NotSupportedException($"The enum value {nameof(AssessmentSectionComposition)}.{newComposition} is not supported.");
}
+
Composition = newComposition;
SetFailureMechanismRelevancy();
}
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -670,7 +670,7 @@
}
///
- /// Looks up a localized string similar to Totale lengte van het traject in meters..
+ /// Looks up a localized string similar to Totale lengte van het traject in meters (afgerond)..
///
public static string ReferenceLineProperties_Length_Description {
get {
@@ -679,7 +679,7 @@
}
///
- /// Looks up a localized string similar to Lengte [m].
+ /// Looks up a localized string similar to Lengte* [m].
///
public static string ReferenceLineProperties_Length_DisplayName {
get {
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx
===================================================================
diff -u -r16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -349,9 +349,9 @@
Lijst van alle coördinaten (X-coördinaat, Y-coördinaat) die samen de referentielijn vormen.
- Lengte [m]
+ Lengte* [m]
- Totale lengte van het traject in meters.
+ Totale lengte van het traject in meters (afgerond).
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/ReferenceLineProperties.cs
===================================================================
diff -u -r01aeb66af89298c610809907bff83d9b9764c897 -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/ReferenceLineProperties.cs (.../ReferenceLineProperties.cs) (revision 01aeb66af89298c610809907bff83d9b9764c897)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/ReferenceLineProperties.cs (.../ReferenceLineProperties.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -22,6 +22,7 @@
using System;
using System.ComponentModel;
using System.Linq;
+using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Core.Common.Gui.Attributes;
using Core.Common.Gui.Converters;
@@ -60,11 +61,11 @@
[ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
[ResourcesDisplayName(typeof(Resources), nameof(Resources.ReferenceLineProperties_Length_DisplayName))]
[ResourcesDescription(typeof(Resources), nameof(Resources.ReferenceLineProperties_Length_Description))]
- public double Length
+ public RoundedDouble Length
{
get
{
- return data.Length;
+ return new RoundedDouble(2, data.Length);
}
}
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/ReferenceLinePropertiesTest.cs
===================================================================
diff -u -r16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b -rbb7246a859710e284b10c855848be97b8bc0b463
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/ReferenceLinePropertiesTest.cs (.../ReferenceLinePropertiesTest.cs) (revision 16a0e2a1a7df8a5fe4548b9c8839a44f4b871c0b)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/ReferenceLinePropertiesTest.cs (.../ReferenceLinePropertiesTest.cs) (revision bb7246a859710e284b10c855848be97b8bc0b463)
@@ -28,6 +28,7 @@
using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Integration.Forms.PropertyClasses;
namespace Ringtoets.Integration.Forms.Test.PropertyClasses
@@ -79,7 +80,8 @@
var properties = new ReferenceLineProperties(referenceLine);
// Call & Assert
- Assert.AreEqual(referenceLine.Length, properties.Length);
+ Assert.AreEqual(2, properties.Length.NumberOfDecimalPlaces);
+ Assert.AreEqual(referenceLine.Length, properties.Length, properties.Length.GetAccuracy());
CollectionAssert.AreEqual(geometry, properties.Geometry);
}
@@ -99,8 +101,8 @@
PropertyDescriptor lengthProperty = dynamicProperties[0];
PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lengthProperty,
generalCategoryName,
- "Lengte [m]",
- "Totale lengte van het traject in meters.",
+ "Lengte* [m]",
+ "Totale lengte van het traject in meters (afgerond).",
true);
PropertyDescriptor geometryProperty = dynamicProperties[1];