Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/Sensors/SensorLocation.cs =================================================================== diff -u -r5767 -r5971 --- DamEngine/trunk/src/Deltares.DamEngine.Data/General/Sensors/SensorLocation.cs (.../SensorLocation.cs) (revision 5767) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/Sensors/SensorLocation.cs (.../SensorLocation.cs) (revision 5971) @@ -256,7 +256,7 @@ { get { - return Location.RiverLevel; + return CurrentScenario.RiverLevel; } } @@ -410,39 +410,39 @@ { if (SourceTypePl1PlLineOffsetBelowDikeToeAtPolder == DataSourceTypeSensors.LocationData) { - return Location.CurrentScenario.PlLineOffsetBelowDikeToeAtPolder; + return CurrentScenario.PlLineOffsetBelowDikeToeAtPolder; } } if (memberName == MemberNames.OffsetBelowDikeTopAtPolder) { if (SourceTypePl1PlLineOffsetBelowDikeTopAtPolder == DataSourceTypeSensors.LocationData) { - return Location.CurrentScenario.PlLineOffsetBelowDikeTopAtPolder; + return CurrentScenario.PlLineOffsetBelowDikeTopAtPolder; } } if (memberName == MemberNames.OffsetBelowDikeTopAtRiver) { if (SourceTypePl1PlLineOffsetBelowDikeTopAtRiver == DataSourceTypeSensors.LocationData) { - return Location.CurrentScenario.PlLineOffsetBelowDikeTopAtRiver; + return CurrentScenario.PlLineOffsetBelowDikeTopAtRiver; } } if (memberName == MemberNames.OffsetBelowShoulderBaseInside) { if (SourceTypePl1PlLineOffsetBelowShoulderBaseInside == DataSourceTypeSensors.LocationData) { - return Location.CurrentScenario.PlLineOffsetBelowShoulderBaseInside; + return CurrentScenario.PlLineOffsetBelowShoulderBaseInside; } } if (memberName == MemberNames.WaterLevelAtRiver) { if (SourceTypePl1WaterLevelAtRiver == DataSourceTypeSensors.LocationData) { - return Location.RiverLevel; + return CurrentScenario.RiverLevel; } if (SourceTypePl1WaterLevelAtRiver == DataSourceTypeSensors.Sensor) Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs =================================================================== diff -u -r5943 -r5971 --- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5943) +++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5971) @@ -66,9 +66,7 @@ } public class PlLinePoints { - public Point2DType Pl1Left { get; set; } // Waterlevel - public Point2DType Pl1AtDikeTopAtPolder { get; set; } - public Point2DType Pl1Right { get; set; } // PolderLevel + public List Points { get; set; } } public static IEnumerable AddTestCases { @@ -97,21 +95,39 @@ }, new PlLinePoints() { - Pl1Left = new Point2DType() - { - X = 0.0, // Expected X-value is leftmost point.X - Z = -0.2 // Expected Z-value is value of sensor MPN-AS-27 at timestep 0 - }, - Pl1AtDikeTopAtPolder = new Point2DType() - { - X = 22.562, // Expected X-value is location of DikeTopAtPolder = 22.562 - Z = -1.3 // Expected Z-value is WaterLevelOutside - PlLineOffsetBelowDikeTopAtPolder = -0.1 - 1.2 = -1.3 - }, - Pl1Right = new Point2DType() - { - X = 57.896, // Expected X-value is rightmost point.X - Z = -2.0 // Expected Z-value is location data Polderlevel of 'Purmer_PU0042+00_K': -3.3 - } + Points = + [ + new Point2DType + { + // Pl1Left + X = 0.0, // Expected X-value is leftmost point.X + Z = -0.1 // Expected Z-value is the value from location data WaterLevelOutside of 'Purmer_PU0042+00_K': -0.1 + }, + new Point2DType + { + // Pl1AtDikeTopAtRiver + X = 18.731, // Expected X-value is location of DikeTopAtRiver = 22.562 + Z = -1.2 // Expected Z-value is WaterLevelOutside - PlLineOffsetBelowDikeTopAtRiver = -0.1 - 1.1 = -1.2 + }, + new Point2DType + { + // Pl1AtDikeTopAtPolder + X = 22.562, // Expected X-value is location of DikeTopAtPolder = 22.562 + Z = -1.3 // Expected Z-value is WaterLevelOutside - PlLineOffsetBelowDikeTopAtPolder = -0.1 - 1.2 = -1.3 + }, + new Point2DType + { + // DikeToeAtPolder + X = 29.374, // Expected X-value is location of DikeToeAtPolder = 22.562 + Z = -2.937 // Expected Z-value is WaterLevelOutside - Pl1PlLineOffsetBelowDikeToeAtPolder = -1.357 - 1.4 = -2.937 + }, + new Point2DType + { + // Pl1Right + X = 57.896, // Expected X-value is rightmost point.X + Z = -2.0 // Expected Z-value is location data Polderlevel of 'Purmer_PU0042+00_K': -2.0 + } + ] }); } } @@ -120,7 +136,7 @@ // "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideBishopGrid\DAMLive.damx" // with DamLive rev.4860 // This tests if the sensor location data is used in the calculation by changing the source type of Pl1 offset below diketop to - [Test, Category(Categories.WorkInProgress)] + [Test] [TestCaseSource(nameof(AddTestCases))] public void GivenStabilityInsideProfile1DProject_WhenCalculatingWithVariatonsOnSpecifiedSensorLocationData_ThenExpectedResultIsGenerated(SensorConfiguration sensorConfiguration, PlLinePoints plLinePoints) { @@ -146,14 +162,11 @@ FullInputModelType expectedMacrostabilityInput = MacroStability.Io.MacroStabilityXmlSerialization.LoadInputFromXmlFile(kernelInputFilename); const double tolerance = 0.0005; List phreaticLine = expectedMacrostabilityInput.StabilityModel.ConstructionStages[0].Waternet.PhreaticLine.WaternetLine.Points.ToList(); - var expectedPoint = new Point2DType() + foreach (var point in plLinePoints.Points) { - X = plLinePoints.Pl1AtDikeTopAtPolder.X, - Z = plLinePoints.Pl1AtDikeTopAtPolder.Z - }; - bool pointExists = phreaticLine.Any(p => p.X.IsNearEqual(expectedPoint.X, tolerance) && p.Z.IsNearEqual(expectedPoint.Z, tolerance)); - Assert.That(pointExists, Is.True, "The expected point was not found in the phreatic line."); -// Output output = DamXmlSerialization.LoadOutputFromXmlFile(outputFilename); + bool pointExists = phreaticLine.Any(p => p.X.IsNearEqual(point.X, tolerance) && p.Z.IsNearEqual(point.Z, tolerance)); + Assert.That(pointExists, Is.True, $"The expected point x={point.X}, z={point.X} was not found in the phreatic line."); + } } private void FillSensorLocation(SensorLocation sensorDataSensorLocation, Location location, SensorConfiguration sensorConfiguration)