Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/SensorPlLine1Creator.cs
===================================================================
diff -u -r4540 -r5653
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/SensorPlLine1Creator.cs (.../SensorPlLine1Creator.cs) (revision 4540)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/PlLinesCreator/SensorPlLine1Creator.cs (.../SensorPlLine1Creator.cs) (revision 5653)
@@ -286,7 +286,7 @@
lineConstructor.Insert(new PlLinePoint(XShoulderBaseInside, offset));
}
- // insert offset below dike toe at river?
+ // insert offset below dike toe at polder?
if (useLocationAsDataSource.IsSatisfiedBy(SensorLocation.SourceTypePl1PlLineOffsetBelowDikeToeAtPolder))
{
double offset = lastZ = ZDikeToeAtPolder - SensorLocation.PlLineOffsetBelowDikeToeAtPolder;
Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs
===================================================================
diff -u -r5608 -r5653
--- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5608)
+++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/OperationalStabilityProfile1DTests.cs (.../OperationalStabilityProfile1DTests.cs) (revision 5653)
@@ -36,6 +36,9 @@
// "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideBishopGrid\DAMLive.damx"
// with DamLive rev.4860
[TestCase("CalculateStabilityInsideBishopGrid1")]
+ // This tests if the sensor location data is used in the calculation by changing the source type of Pl1 offset below diketop to
+ // use the specified location data
+ [TestCase("CalculateStabilityInsideBishopGrid1", true)]
// Following testcase based on the DamLive test Deltares.DamLive.Tests.StabilityInsideUpliftVanBeeSwarmTest
// "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideUpliftVanBeeSwarm\DAMLive.damx"
// with DamLive rev.4860
@@ -44,13 +47,18 @@
// "Deltares.DamLive.Tests\TestData\IntegrationTests\StabilityInsideUpliftVanGrid\DAMLive.damx"
// with DamLive rev.4860
[TestCase("CalculateStabilityInsideUpliftVanGrid1")]
- public void GivenStabilityInsideProfile1DProject_WhenCalculatingWithSpecifiedModel_ThenExpectedResultIsGenerated(string baseName)
+ public void GivenStabilityInsideProfile1DProject_WhenCalculatingWithSpecifiedModel_ThenExpectedResultIsGenerated(string baseName, bool isUseSensorLocationData = false)
{
const string calcDir = "DAMLive.Calc";
const string testFilesLocation = @".\TestFiles\Operational\Profile1DTests\";
- string projectPath = baseName;
+ string baseOutputName = baseName;
+ if (isUseSensorLocationData)
+ {
+ baseOutputName += "_UseLocationData";
+ }
+ string projectPath = baseOutputName;
string inputFilename = baseName + "InputFile.xml";
- string outputFilename = baseName + "OutputFile.xml";
+ string outputFilename = baseOutputName + "OutputFile.xml";
if (Directory.Exists(calcDir))
{
Directory.Delete(calcDir, true); // delete previous results
@@ -69,7 +77,11 @@
string inputString = File.ReadAllText(testFilesLocation + inputFilename);
inputString = XmlAdapter.ChangeValueInXml(inputString, "ProjectPath", projectPath); // Current directory will be used
inputString = XmlAdapter.ChangeValueInXml(inputString, "CalculationMap", calcDir); // Current directory will be used
-
+ if (isUseSensorLocationData)
+ {
+ // Change the source type of Pl1 offset below diketop location data (=1)
+ inputString = XmlAdapter.ChangeValueInXml(inputString, "SourceTypePl1PlLineOffsetBelowDikeTopAtPolder", "1");
+ }
// When
// Run calculation
Output actualOutput = GeneralHelper.RunAfterInputValidation(inputString, true, outputFilename);
Index: DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/XmlAdapter.cs
===================================================================
diff -u -r5426 -r5653
--- DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/XmlAdapter.cs (.../XmlAdapter.cs) (revision 5426)
+++ DamEngine/trunk/src/Deltares.DamEngine.TestHelpers/XmlAdapter.cs (.../XmlAdapter.cs) (revision 5653)
@@ -53,12 +53,13 @@
/// The modified input
public static string SelectLocations(string input, string[] locationNames)
{
+
string result = input;
const string searchString = @"";
MatchCollection locationBlocks = Regex.Matches(result, searchString, RegexOptions.Singleline);
for (int i = locationBlocks.Count - 1; i > -1; i--)
{
- bool isMatch = locationNames.Any(locationName => Regex.IsMatch(locationBlocks[i].Value, "Name=" + "\"" + locationName + "\""));
+ bool isMatch = locationNames.Any(locationName => Regex.IsMatch(locationBlocks[i].Value, "Name=\"" + locationName.Replace("+", "\\+") + "\""));
if (!isMatch)
{
result = result.Remove(locationBlocks[i].Index, locationBlocks[i].Length);
Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj
===================================================================
diff -u -r5642 -r5653
--- DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 5642)
+++ DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 5653)
@@ -248,6 +248,9 @@
PreserveNewest
+
+ PreserveNewest
+
Index: DamEngine/trunk/src/Deltares.DamEngine.IntegrationTests/TestFiles/Operational/Profile1DTests/CalculateStabilityInsideBishopGrid1_UseLocationDataOutputFile.xml
===================================================================
diff -u
Binary files differ