Index: dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs =================================================================== diff -u -r508 -r540 --- dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 508) +++ dam engine/trunk/src/Deltares.DamEngine.Interface/FillXmlInputFromDam.cs (.../FillXmlInputFromDam.cs) (revision 540) @@ -27,6 +27,7 @@ using Input = Deltares.DamEngine.Io.XmlInput.Input; using Location = Deltares.DamEngine.Data.General.Location; using Soil = Deltares.DamEngine.Io.XmlInput.Soil; +using SoilProfile1D = Deltares.DamEngine.Data.Geotechnics.SoilProfile1D; namespace Deltares.DamEngine.Interface { @@ -48,6 +49,8 @@ TransferSurfaceLines(dike.SurfaceLines2, input.SurfaceLines); input.Soils = new Soil[dike.SoilList.Soils.Count]; TransferSoils(dike.SoilList.Soils, input.Soils); + input.SoilProfiles1D = new Io.XmlInput.SoilProfile1D[dike.SoilProfiles.Count]; + TransferSoilProfiles1D(dike.SoilProfiles, input.SoilProfiles1D); return input; } @@ -133,5 +136,39 @@ inputLocations[i] = inputLocation; } } + + private static void TransferSoilProfiles1D(IList dikeSoilProfiles, + Io.XmlInput.SoilProfile1D[] inputSoilProfiles1D) + { + var profilesCount = dikeSoilProfiles.Count; + for (int i = 0; i < profilesCount; i++) + { + var soilProfile1D = dikeSoilProfiles[i]; + var inputSoilProfile1D = new Io.XmlInput.SoilProfile1D + { + Name = soilProfile1D.Name, + BottomLevel = soilProfile1D.BottomLevel, + Layers = new SoilProfile1DLayer[soilProfile1D.LayerCount] + }; + AddLayers(soilProfile1D, inputSoilProfile1D); + } + } + + private static void AddLayers(SoilProfile1D soilProfile1D, Io.XmlInput.SoilProfile1D inputSoilProfile1D) + { + for (int i = 0; i < soilProfile1D.LayerCount; i++) + { + var layer = soilProfile1D.Layers[i]; + var inputLayer = new SoilProfile1DLayer + { + Name = layer.Name, + SoilName = layer.Soil.Name, + TopLevel = layer.TopLevel, + IsAquifer = layer.IsAquifer, + WaterpressureInterpolationModel = ConversionHelper.ConvertToInputWaterpressureInterpolationModel( + layer.WaterpressureInterpolationModel) + }; + } + } } }