Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs =================================================================== diff -u -r1007 -r1017 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1007) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesDesign/DesignCalculator.cs (.../DesignCalculator.cs) (revision 1017) @@ -72,7 +72,7 @@ damKernelInput.DesignScenario = location.Scenarios[designScenarioIndex]; damKernelInput.DamFailureMechanismeCalculationSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification; AnalysisType analysisType = DamProjectCalculationSpecification.SelectedAnalysisType; - + SynchronizeScenarioDataWithLocationData(damKernelInput); IKernelDataInput kernelDataInput; IKernelDataOutput kernelDataOutput; PrepareResult prepareResult = kernelWrapper.Prepare(damKernelInput, 0, out kernelDataInput, out kernelDataOutput); @@ -120,6 +120,57 @@ return calculationMessages; } + /// + /// Synchronizes the scenario data with location data. + /// Note that scenario data is leading when available. + /// + /// The dam kernel input. + private void SynchronizeScenarioDataWithLocationData(DamKernelInput damKernelInput) + { + var scenario = damKernelInput.DesignScenario; + + if (scenario.PlLineOffsetBelowDikeToeAtPolder.HasValue) + { + scenario.Location.PlLineOffsetBelowDikeToeAtPolder = scenario.PlLineOffsetBelowDikeToeAtPolder.Value; + } + if (scenario.PlLineOffsetBelowDikeTopAtPolder.HasValue) + { + scenario.Location.PlLineOffsetBelowDikeTopAtPolder = scenario.PlLineOffsetBelowDikeTopAtPolder.Value; + } + if (scenario.PlLineOffsetBelowDikeTopAtRiver.HasValue) + { + scenario.Location.PlLineOffsetBelowDikeTopAtRiver = scenario.PlLineOffsetBelowDikeTopAtRiver.Value; + } + if (scenario.PlLineOffsetBelowShoulderBaseInside.HasValue) + { + scenario.Location.PlLineOffsetBelowShoulderBaseInside = scenario.PlLineOffsetBelowShoulderBaseInside.Value; + } + if (scenario.PlLineOffsetBelowDikeCrestMiddle.HasValue) + { + scenario.Location.PlLineOffsetBelowDikeCrestMiddle = scenario.PlLineOffsetBelowDikeCrestMiddle; + } + if (scenario.PlLineOffsetFactorBelowShoulderCrest.HasValue) + { + scenario.Location.PlLineOffsetFactorBelowShoulderCrest = scenario.PlLineOffsetFactorBelowShoulderCrest; + } + if (scenario.UsePlLineOffsetBelowDikeCrestMiddle.HasValue) + { + scenario.Location.UsePlLineOffsetBelowDikeCrestMiddle = scenario.UsePlLineOffsetBelowDikeCrestMiddle; + } + if (scenario.UsePlLineOffsetFactorBelowShoulderCrest.HasValue) + { + scenario.Location.UsePlLineOffsetFactorBelowShoulderCrest = scenario.UsePlLineOffsetFactorBelowShoulderCrest; + } + if (scenario.HeadPl3.HasValue) + { + scenario.Location.HeadPl3 = scenario.HeadPl3.Value; + } + if (scenario.HeadPl4.HasValue) + { + scenario.Location.HeadPl4 = scenario.HeadPl4.Value; + } + } + private static void PerformSingleCalculation(IKernelWrapper kernelWrapper, IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, DamKernelInput damKernelInput, List calculationMessages, List designCalculations) {