Index: DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs =================================================================== diff -u -r3189 -r3191 --- DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs (.../LayerCreator.cs) (revision 3189) +++ DamTools/LayerOnSlopeTool/trunk/src/Deltares.LayerOnSlopeTool.LayerCreator/LayerCreator.cs (.../LayerCreator.cs) (revision 3191) @@ -105,8 +105,8 @@ try { - Execute(true, loweredSurfaceLine, location); - Execute(false, surfaceLine, location); + CreateGeometryWithLoweredSurfaceLine(loweredSurfaceLine, location); + CreateGeometryWithOriginalSurfaceLine(surfaceLine, location); } catch (Exception e) { @@ -177,37 +177,37 @@ File.AppendAllLines(fullLogFilePath, linesToAdd); } - private void Execute(bool isForLoweredSurfaceLine, SurfaceLine surfaceLine, Location location) + private void CreateGeometryWithLoweredSurfaceLine(SurfaceLine surfaceLine, Location location) { - // for the original surface line, use offset = 0. Use the Interim file in output folder as input file. Save as original file in output folder. - var xOffset = 0.0; - var folderName = OutputFolderName; - var inputFileName = "Interim" + location.SoilGeometryName; - var outputFileName = location.SoilGeometryName; - if (isForLoweredSurfaceLine) + var stiFileCreatorInput = new StiFileCreatorInput { - // for the lowered surface line, use the given offset. Use the original input file from the input folder. Save as Interim file in output folder. - xOffset = location.XOffset; - folderName = InputFolderName; - inputFileName = location.SoilGeometryName; - outputFileName = "Interim" + location.SoilGeometryName; - } + XOffset = location.XOffset, + SurfaceLine = surfaceLine, + DikeMaterialName = location.LayerMaterial, + InputFilename = Path.Combine(InputFolderName, location.SoilGeometryName), + OutputFilename = Path.Combine(OutputFolderName, "Interim" + location.SoilGeometryName) + }; + StiFileCreator.StiFileCreator.ProcessFile(stiFileCreatorInput); + } + + private void CreateGeometryWithOriginalSurfaceLine(SurfaceLine surfaceLine, Location location) + { var stiFileCreatorInput = new StiFileCreatorInput { // Note that for second generation the offset MUST be 0 as any offset is already taken care of in the first generation. - XOffset = xOffset, + XOffset = 0, SurfaceLine = surfaceLine, DikeMaterialName = location.LayerMaterial, - InputFilename = Path.Combine(folderName, inputFileName), - OutputFilename = Path.Combine(OutputFolderName, outputFileName) + InputFilename = Path.Combine(OutputFolderName, "Interim" + location.SoilGeometryName), + OutputFilename = Path.Combine(OutputFolderName, location.SoilGeometryName) }; StiFileCreator.StiFileCreator.ProcessFile(stiFileCreatorInput); } private SurfaceLine DetermineSurfaceLineForGivenLayerData(SurfaceLine originalSurfaceLine, double layerThickness) { - var surfacelineProcessor = new SurfacelineProcessor(originalSurfaceLine); - return surfacelineProcessor.CreateLoweredSurfaceLine(layerThickness); + var surfaceLineProcessor = new SurfacelineProcessor(originalSurfaceLine); + return surfaceLineProcessor.CreateLoweredSurfaceLine(layerThickness); } }