Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs =================================================================== diff -u -r900 -r909 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 900) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityOutwards/DamMacroStabilityOutwardsKernelWrapper.cs (.../DamMacroStabilityOutwardsKernelWrapper.cs) (revision 909) @@ -22,7 +22,6 @@ using System; using System.Collections.Generic; using System.Data; -using System.IO; using System.Xml.Linq; using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityCommon; @@ -44,8 +43,6 @@ /// public class DamMacroStabilityOutwardsKernelWrapper : IKernelWrapper { - private const string damMacroStabilityFolder = @".\KernelWrappers\DamMacroStability"; - private const string dGeoStabilityExe = "DGeoStability.exe"; /// /// Gets or sets the failure mechanisme paramaters for mstab. @@ -88,7 +85,7 @@ var damMacroStabilityInput = new DamMacroStabilityInput() { - DGeoStabilityExePath = Path.Combine(damMacroStabilityFolder, dGeoStabilityExe), + DGeoStabilityExePath = FailureMechanismParametersMStab.DGeoStabilityExePath, DGeoStabilityInputFileName = DamMacroStabilityUtils.GetStabilityInputFileName(damKernelInput, iterationIndex, FailureMechanismParametersMStab.MStabParameters.Model, FailureMechanismParametersMStab.ProjectWorkingPath), FailureMechanismParametersMStab = FailureMechanismParametersMStab @@ -182,7 +179,7 @@ var requiredSafetyFactor = scenario.RequiredSafetyFactorStabilityOuterSlope?? scenario.Location.ModelFactors.RequiredSafetyFactorStabilityOuterSlope; if (requiredSafetyFactor == null) { - throw new MacroStabilityException("Required safety factor must be specified"); + throw new MacroStabilityException(Resources.DamMacroStabilityOutwardsKernelWrapper_Prepare_NoRequiredSafetyFactor); } List errorMessages; @@ -231,21 +228,21 @@ public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out List designResults) { DamMacroStabilityOutput damMacroStabilityOutput = kernelDataOutput as DamMacroStabilityOutput; + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_StabilityCalculator_NoInputObjectDefinedForMacroStability); + } if (damMacroStabilityOutput == null) { throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_PostProcess_NoOutputObjectDefinedForMacroStability); } - // TODO: this is just fake data - string soilProfile2DName = "soilProfile2DName"; - var d = new DamFailureMechanismeCalculationSpecification(); - var s = new DesignScenario - { - Location = new Location() - }; - var p = new SoilProfile1D(); + string soilProfile2DName = damKernelInput.SubSoilScenario.ToString(); + designResults = new List(); - var designResult = new DesignResult(d, s, p, soilProfile2DName, AnalysisType.NoAdaption) + var designResult = new DesignResult(damKernelInput.DamFailureMechanismeCalculationSpecification, + damKernelInput.DesignScenario, damKernelInput.SubSoilScenario.SoilProfile1D, soilProfile2DName, + DamProjectCalculationSpecification.SelectedAnalysisType) { CalculationResult = damMacroStabilityOutput.CalculationResult };