Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/IntegrationTests/DesignCalculatorTests.cs (.../DesignCalculatorTests.cs) (revision 3364)
@@ -49,5 +49,23 @@
Assert.AreEqual(null, output.Results.CalculationResults);
Assert.AreEqual("Geen segmenten met faalmechanisme StabilityInside aanwezig", output.Results.CalculationMessages[0].Message1);
}
+
+ [Test]
+ [SetUICulture("nl-NL")]
+ public void TestInputXML()
+ {
+ // Based on InputFile.xml as produced by DAM UI in debug mode
+ Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+ const string fileName = @"TestFiles\InputFile.xml";
+ string inputString = File.ReadAllText(fileName);
+ EngineInterface engineInterface = new EngineInterface(inputString);
+ Assert.IsNotNull(engineInterface.DamProjectData);
+ string outputString = engineInterface.Run();
+ var output = DamXmlSerialization.LoadOutputFromXmlString(outputString);
+ Assert.AreEqual(0, output.Results.CalculationMessages.Length);
+ Assert.AreEqual(1, output.Results.CalculationResults.Length);
+ Assert.AreEqual(1.7086, output.Results.CalculationResults[0].StabilityDesignResults.SafetyFactor, 0.0001);
+ }
+
}
}
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/Deltares.DamEngine.IntegrationTests.csproj (.../Deltares.DamEngine.IntegrationTests.csproj) (revision 3364)
@@ -86,6 +86,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputFile.xml
===================================================================
diff -u
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputFile.xml (revision 0)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.IntegrationTests/TestFiles/InputFile.xml (revision 3364)
@@ -0,0 +1,397 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators/General/Geometry2DTo1DConverter.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators/General/Geometry2DTo1DConverter.cs (.../Geometry2DTo1DConverter.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators/General/Geometry2DTo1DConverter.cs (.../Geometry2DTo1DConverter.cs) (revision 3364)
@@ -169,9 +169,9 @@
{
throw new Geometry2DTo1DConverterException(String.Format("Soil material '{0}' belonging to layer '{1}' not available in soillist", layer.SoilName, layer.Name));
}
- if (SoilList.AquiferDictionary.ContainsKey(layer.Soil))
+ if (SoilList.AquiferDictionary.ContainsKey(layer.Soil.Name))
{
- layer.IsAquifer = SoilList.AquiferDictionary[layer.Soil];
+ layer.IsAquifer = SoilList.AquiferDictionary[layer.Soil.Name];
}
}
var aquifers = soilProfile.GetAquiferLayers();
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityTestHelper.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityTestHelper.cs (.../DamMacroStabilityTestHelper.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityTestHelper.cs (.../DamMacroStabilityTestHelper.cs) (revision 3364)
@@ -149,22 +149,22 @@
BelowPhreaticLevel = 20
};
soilList.Soils.Add(s15);
- soilList.AquiferDictionary = new Dictionary();
- soilList.AquiferDictionary.Add(s1, false);
- soilList.AquiferDictionary.Add(s2, false);
- soilList.AquiferDictionary.Add(s3, true);
- soilList.AquiferDictionary.Add(s4, false);
- soilList.AquiferDictionary.Add(s5, true);
- soilList.AquiferDictionary.Add(s6, false);
- soilList.AquiferDictionary.Add(s7, false);
- soilList.AquiferDictionary.Add(s8, false);
- soilList.AquiferDictionary.Add(s9, false);
- soilList.AquiferDictionary.Add(s10, false);
- soilList.AquiferDictionary.Add(s11, false);
- soilList.AquiferDictionary.Add(s12, false);
- soilList.AquiferDictionary.Add(s13, true);
- soilList.AquiferDictionary.Add(s14, false);
- soilList.AquiferDictionary.Add(s15, false);
+ soilList.AquiferDictionary = new Dictionary();
+ soilList.AquiferDictionary.Add(s1.Name, false);
+ soilList.AquiferDictionary.Add(s2.Name, false);
+ soilList.AquiferDictionary.Add(s3.Name, true);
+ soilList.AquiferDictionary.Add(s4.Name, false);
+ soilList.AquiferDictionary.Add(s5.Name, true);
+ soilList.AquiferDictionary.Add(s6.Name, false);
+ soilList.AquiferDictionary.Add(s7.Name, false);
+ soilList.AquiferDictionary.Add(s8.Name, false);
+ soilList.AquiferDictionary.Add(s9.Name, false);
+ soilList.AquiferDictionary.Add(s10.Name, false);
+ soilList.AquiferDictionary.Add(s11.Name, false);
+ soilList.AquiferDictionary.Add(s12.Name, false);
+ soilList.AquiferDictionary.Add(s13.Name, true);
+ soilList.AquiferDictionary.Add(s14.Name, false);
+ soilList.AquiferDictionary.Add(s15.Name, false);
return soilList;
}
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Data/Geotechnics/SoilList.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Data/Geotechnics/SoilList.cs (.../SoilList.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Data/Geotechnics/SoilList.cs (.../SoilList.cs) (revision 3364)
@@ -31,7 +31,7 @@
///
public class SoilList
{
- private Dictionary aquiferDictionary = new Dictionary();
+ private Dictionary aquiferDictionary = new Dictionary();
private List soils;
public SoilList()
@@ -66,7 +66,7 @@
///
/// The aquifer dictionary.
///
- public Dictionary AquiferDictionary
+ public Dictionary AquiferDictionary
{
get
{
@@ -120,9 +120,9 @@
public void Remove(Soil soil)
{
Soils.Remove(soil);
- if (aquiferDictionary.ContainsKey(soil))
+ if (aquiferDictionary.ContainsKey(soil.Name))
{
- aquiferDictionary.Remove(soil);
+ aquiferDictionary.Remove(soil.Name);
}
}
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForDamProjectData.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForDamProjectData.cs (.../FactoryForDamProjectData.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.TestHelpers/Factories/FactoryForDamProjectData.cs (.../FactoryForDamProjectData.cs) (revision 3364)
@@ -198,7 +198,7 @@
for (int i = 0; i < soilList.Soils.Count; i++)
{
// All even indeces are set to true, all odd indices are set to false
- soilList.AquiferDictionary.Add(soilList.Soils[i], (i % 2) == 0);
+ soilList.AquiferDictionary.Add(soilList.Soils[i].Name, (i % 2) == 0);
}
}
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 3364)
@@ -217,16 +217,16 @@
}
}
- private static void TransferAquiferSoils(Dictionary aquiferDictionary, Input input)
+ private static void TransferAquiferSoils(Dictionary aquiferDictionary, Input input)
{
InputAquiferSoil[] aquiferSoils;
if (aquiferDictionary != null && aquiferDictionary.Count > 0)
{
aquiferSoils = new InputAquiferSoil[aquiferDictionary.Count];
int soilIndex = 0;
- foreach (KeyValuePair keyValuePair in aquiferDictionary)
+ foreach (KeyValuePair keyValuePair in aquiferDictionary)
{
- aquiferSoils[soilIndex] = new InputAquiferSoil() { Soilname = keyValuePair.Key.Name, IsAquifer = keyValuePair.Value };
+ aquiferSoils[soilIndex] = new InputAquiferSoil() { Soilname = keyValuePair.Key, IsAquifer = keyValuePair.Value };
soilIndex++;
}
}
Index: DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs
===================================================================
diff -u -r2708 -r3364
--- DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 2708)
+++ DamEngine/branches/DamEngine 19.1/src/Deltares.DamEngine.Interface/FillDamFromXmlInput.cs (.../FillDamFromXmlInput.cs) (revision 3364)
@@ -210,21 +210,21 @@
List validationMessages = new List();
if (inputAquiferSoils != null)
{
- soilList.AquiferDictionary = new Dictionary();
+ soilList.AquiferDictionary = new Dictionary();
foreach (InputAquiferSoil aquiferSoil in inputAquiferSoils)
{
var soil = soilList.GetSoilByName(aquiferSoil.Soilname);
- if (!soilList.AquiferDictionary.ContainsKey(soil))
+ if (!soilList.AquiferDictionary.ContainsKey(soil.Name))
{
- soilList.AquiferDictionary.Add(soil, aquiferSoil.IsAquifer);
+ soilList.AquiferDictionary.Add(soil.Name, aquiferSoil.IsAquifer);
}
else
{
// If a soil is (wrongly) in the list more than once, then prefer aquifer true.
if (aquiferSoil.IsAquifer)
{
validationMessages.Add(new LogMessage(LogMessageType.Warning, aquiferSoil, string.Format(Resources.DoubleAquiferSoil, aquiferSoil.Soilname)));
- soilList.AquiferDictionary[soil] = true;
+ soilList.AquiferDictionary[soil.Name] = true;
}
}
}