Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx =================================================================== diff -u -r707 -r771 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 707) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 771) @@ -123,6 +123,12 @@ Geen invoer object gedefinieerd voor Macrostabiliteit + + Geen invoer object gedefinieerd voor Bligh + + + Geen uitvoer object gedefinieerd voor Bligh + Geen invoer object gedefinieerd voor Sellmeijer 4 Krachten Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs =================================================================== diff -u -r770 -r771 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 770) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapper.cs (.../DamPipingBlighKernelWrapper.cs) (revision 771) @@ -4,6 +4,7 @@ using Deltares.DamEngine.Calculators.General; using Deltares.DamEngine.Calculators.KernelWrappers.Common; using Deltares.DamEngine.Calculators.KernelWrappers.Interfaces; +using Deltares.DamEngine.Calculators.Properties; using Deltares.DamEngine.Calculators.Uplift; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; @@ -142,21 +143,25 @@ /// No input object defined for Bligh public void Execute(IKernelDataInput kernelDataInput, IKernelDataOutput kernelDataOutput, out List messages) { - DamPipingBlighOutput damPipingBlighOutput = (DamPipingBlighOutput) kernelDataOutput; + DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; + DamPipingBlighOutput damPipingBlighOutput = (DamPipingBlighOutput)kernelDataOutput; + if (damPipingBlighInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); + } + if (damPipingBlighOutput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh); + } damPipingBlighOutput.CalculationResult = CalculationResult.NoRun; damPipingBlighOutput.FoSp = defaultMaxReturnValue; messages = new List(); try { - DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; - if (damPipingBlighInput == null) - { - throw new NoNullAllowedException("No input object defined for Bligh"); - } if (damPipingBlighOutput.UpliftSituation.IsUplift) { - var calculatorBligh = CreatePipingCalculatorBligh(kernelDataInput); + var calculatorBligh = CreatePipingCalculatorBligh(damPipingBlighInput); calculatorBligh.Calculate(); damPipingBlighOutput.FoSp = calculatorBligh.FoSp; damPipingBlighOutput.Hc = calculatorBligh.Hc; @@ -181,7 +186,7 @@ DamPipingBlighInput damPipingBlighInput = kernelDataInput as DamPipingBlighInput; if (damPipingBlighInput == null) { - throw new NoNullAllowedException("No input object defined for Bligh"); + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); } var calculator = new PipingCalculatorBligh { @@ -206,9 +211,13 @@ public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, string resultMessage, out DesignResult designResult) { DamPipingBlighOutput damPipingBlighOutput = kernelDataOutput as DamPipingBlighOutput; + if (damKernelInput == null) + { + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh); + } if (damPipingBlighOutput == null) { - throw new NoNullAllowedException("No output object defined for Bligh"); + throw new NoNullAllowedException(Resources.DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh); } // TODO: for now this only works for 1D profiles Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx =================================================================== diff -u -r707 -r771 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 707) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 771) @@ -138,4 +138,10 @@ Validation failed for location '{0}', subsoil scenario '{1}', design scenario '{2}' + + No input object defined for Bligh + + + No output object defined for Bligh + \ No newline at end of file Index: dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs =================================================================== diff -u -r707 -r771 --- dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 707) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 771) @@ -81,6 +81,24 @@ } /// + /// Looks up a localized string similar to No input object defined for Bligh. + /// + internal static string DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh { + get { + return ResourceManager.GetString("DamPipingBlighKernelWrapper_NoInputObjectDefinedForBligh", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No output object defined for Bligh. + /// + internal static string DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh { + get { + return ResourceManager.GetString("DamPipingBlighKernelWrapper_NoOutputObjectDefinedForBligh", resourceCulture); + } + } + + /// /// Looks up a localized string similar to No input object defined for Sellmeijer 4 Forces. /// internal static string DamPipingSellmeijer4ForcesKernelWrapper_NoInputObjectDefinedForSellmeijer4Forces { Index: dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs =================================================================== diff -u -r768 -r771 --- dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 768) +++ dam engine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/DamPipingBligh/DamPipingBlighKernelWrapperTests.cs (.../DamPipingBlighKernelWrapperTests.cs) (revision 771) @@ -221,7 +221,6 @@ } [Test] - [Category(Categories.WorkInProgress)] [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen invoer object gedefinieerd voor Bligh")] [SetUICulture("nl-NL")] public void TestLanguageNLThrowsExceptionInExecuteWhenInputIsNull() @@ -232,7 +231,6 @@ } [Test] - [Category(Categories.WorkInProgress)] [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "No input object defined for Bligh")] [SetUICulture("en-US")] public void TestLanguageENThrowsExceptionInExecuteWhenInputIsNull() @@ -243,7 +241,6 @@ } [Test] - [Category(Categories.WorkInProgress)] [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen uitvoer object gedefinieerd voor Bligh")] [SetUICulture("nl-NL")] public void TestThrowsExceptionInPostProcessWhenOutputIsNull() @@ -254,7 +251,6 @@ } [Test] - [Category(Categories.WorkInProgress)] [ExpectedException(typeof(NoNullAllowedException), ExpectedMessage = "Geen invoer object gedefinieerd voor Bligh")] [SetUICulture("nl-NL")] public void TestThrowsExceptionInPostProcessWhenInputIsNull()