Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs
===================================================================
diff -u -r1174 -r1200
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1174)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1200)
@@ -98,6 +98,16 @@
}
///
+ /// Looks up a localized string similar to No Dam input object defined for Macro Stability.
+ ///
+ internal static string DamMacroStabilityKernelWrapper_StabilityCalculator_NoDamInputObjectDefinedForMacroStability {
+ get {
+ return ResourceManager.GetString("DamMacroStabilityKernelWrapper_StabilityCalculator_NoDamInputObjectDefinedForMacr" +
+ "oStability", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to No input object defined for Macro Stability.
///
internal static string DamMacroStabilityKernelWrapper_StabilityCalculator_NoInputObjectDefinedForMacroStability {
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx
===================================================================
diff -u -r1174 -r1200
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1174)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.nl-NL.resx (.../Resources.nl-NL.resx) (revision 1200)
@@ -129,6 +129,9 @@
Geen uitvoer object gedefinieerd voor Macrostabiliteit
+
+ Geen Dam invoer object gedefinieerd voor Macrostabiliteit
+
Geen invoer object gedefinieerd voor Macrostabiliteit
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx
===================================================================
diff -u -r1174 -r1200
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1174)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Properties/Resources.resx (.../Resources.resx) (revision 1200)
@@ -252,4 +252,7 @@
Not all required data is available
+
+ No Dam input object defined for Macro Stability
+
\ No newline at end of file
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs
===================================================================
diff -u -r1175 -r1200
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1175)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityInwards/DamMacroStabilityInwardsKernelWrapper.cs (.../DamMacroStabilityInwardsKernelWrapper.cs) (revision 1200)
@@ -343,10 +343,7 @@
internal static StabilityCalculator StabilityCalculator(IKernelDataInput kernelDataInput)
{
DamMacroStabilityInput damMacroStabilityInput = kernelDataInput as DamMacroStabilityInput;
- if (damMacroStabilityInput == null)
- {
- throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_StabilityCalculator_NoInputObjectDefinedForMacroStability);
- }
+ DamMacroStabilityUtils.ThrowWhenMacroStabilityKernelInputNull(damMacroStabilityInput);
var calculator = new StabilityCalculator
{
ProjectName = damMacroStabilityInput.DGeoStabilityInputFileName,
@@ -366,15 +363,9 @@
public void PostProcess(DamKernelInput damKernelInput, IKernelDataOutput kernelDataOutput, DesignScenario designScenario,
string resultMessage, out List designResults)
{
- if (damKernelInput == null)
- {
- throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_StabilityCalculator_NoInputObjectDefinedForMacroStability);
- }
+ DamMacroStabilityUtils.ThrowWhenMacroStabilityDamKernelInputNull(damKernelInput);
DamMacroStabilityOutput damMacroStabilityOutput = kernelDataOutput as DamMacroStabilityOutput;
- if (damMacroStabilityOutput == null)
- {
- throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_PostProcess_NoOutputObjectDefinedForMacroStability);
- }
+ DamMacroStabilityUtils.ThrowWhenMacroStabilityKernelOutputNull(damMacroStabilityOutput);
designResults = new List();
if (damMacroStabilityOutput.StabilityOutputItems.Count > 0)
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs
===================================================================
diff -u -r1137 -r1200
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 1137)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/DamMacroStabilityCommon/DamMacroStabilityUtils.cs (.../DamMacroStabilityUtils.cs) (revision 1200)
@@ -20,9 +20,11 @@
// All rights reserved.
using System;
+using System.Data;
using System.IO;
using System.Text.RegularExpressions;
using Deltares.DamEngine.Calculators.KernelWrappers.Common;
+using Deltares.DamEngine.Calculators.Properties;
using Deltares.DamEngine.Data.General;
namespace Deltares.DamEngine.Calculators.KernelWrappers.DamMacroStabilityCommon
@@ -93,5 +95,42 @@
Directory.CreateDirectory(stabilityDirectory);
return stabilityDirectory;
}
+ ///
+ /// Throws the when macro stability kernel input is not assigned.
+ ///
+ /// The dam macro stability input.
+ ///
+ public static void ThrowWhenMacroStabilityKernelInputNull(DamMacroStabilityInput damMacroStabilityInput)
+ {
+ if (damMacroStabilityInput == null)
+ {
+ throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_StabilityCalculator_NoInputObjectDefinedForMacroStability);
+ }
+ }
+ ///
+ /// Throws the when macro stability kernel output is not assigned.
+ ///
+ /// The dam macro stability output.
+ ///
+ public static void ThrowWhenMacroStabilityKernelOutputNull(DamMacroStabilityOutput damMacroStabilityOutput)
+ {
+ if (damMacroStabilityOutput == null)
+ {
+ throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_PostProcess_NoOutputObjectDefinedForMacroStability);
+ }
+ }
+
+ ///
+ /// Throws the when macro stability dam kernel input is not assigned.
+ ///
+ /// The dam kernel input.
+ ///
+ public static void ThrowWhenMacroStabilityDamKernelInputNull(DamKernelInput damKernelInput)
+ {
+ if (damKernelInput == null)
+ {
+ throw new NoNullAllowedException(Resources.DamMacroStabilityKernelWrapper_StabilityCalculator_NoDamInputObjectDefinedForMacroStability);
+ }
+ }
}
}