Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs
===================================================================
diff -u -rc0c4d914f97d3471b73898030db0066dced39331 -r512bebcd5570951b18657513c56843d9e2f8e969
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision c0c4d914f97d3471b73898030db0066dced39331)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresCalculationConfigurationImporter.cs (.../HeightStructuresCalculationConfigurationImporter.cs) (revision 512bebcd5570951b18657513c56843d9e2f8e969)
@@ -28,12 +28,12 @@
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.Common.Data.Structures;
-using Ringtoets.Common.IO;
using Ringtoets.Common.IO.Configurations;
using Ringtoets.Common.IO.Configurations.Helpers;
using Ringtoets.Common.IO.FileImporters;
using Ringtoets.Common.IO.Schema;
using Ringtoets.HeightStructures.Data;
+using Ringtoets.HeightStructures.IO.Properties;
using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources;
namespace Ringtoets.HeightStructures.IO
@@ -60,6 +60,7 @@
/// the imported objects contain the right foreshore profile.
/// The dike profiles used to check if
/// the imported objects contain the right profile.
+ /// Thrown when any parameter is null.
public HeightStructuresCalculationConfigurationImporter(
string xmlFilePath,
CalculationGroup importTarget,
@@ -190,15 +191,15 @@
/// The configuration of the stochast.
/// The function for obtaining the stochast to read.
/// The function to set the stochast with the read parameters.
- /// true if reading all required wave reduction parameters was successful,
+ /// true if reading all required stochast parameters was successful,
/// false otherwise.
private bool TryReadStandardDeviationStochast(
StructuresCalculation calculation,
string stochastName,
MeanStandardDeviationStochastConfiguration stochastConfiguration,
Func getStochast,
Action setStochast)
- where T : class, IDistribution
+ where T : IDistribution
{
if (stochastConfiguration == null)
{
@@ -224,15 +225,15 @@
/// The configuration of the stochast.
/// The function for obtaining the stochast to read.
/// The function to set the stochast with the read parameters.
- /// true if reading all required wave reduction parameters was successful,
+ /// true if reading all required stochast parameters was successful,
/// false otherwise.
private bool TryReadVariationCoefficientStochast(
StructuresCalculation calculation,
string stochastName,
MeanVariationCoefficientStochastConfiguration stochastConfiguration,
Func getStochast,
Action setStochast)
- where T : class, IVariationCoefficientDistribution
+ where T : IVariationCoefficientDistribution
{
if (stochastConfiguration == null)
{
@@ -264,7 +265,8 @@
if (calculation.InputParameters.Structure == null)
{
LogReadCalculationConversionError(
- "Er is geen kunstwerk opgegeven om de oriƫntatie aan toe te voegen.",
+ string.Format(RingtoetsCommonIOResources.CalculationConfigurationImporter_TryParameter_No_Structure_to_assign_Parameter_0_,
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_Orientation_DisplayName),
calculation.Name);
return false;
@@ -279,7 +281,9 @@
catch (ArgumentOutOfRangeException e)
{
LogOutOfRangeException(
- string.Format("Een waarde van '{0}' als oriƫntatie is ongeldig.", orientation),
+ string.Format(RingtoetsCommonIOResources.TryReadParameter_Value_0_ParameterName_1_is_invalid,
+ orientation,
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_Orientation_DisplayName),
calculation.Name,
e);
@@ -304,7 +308,8 @@
if (calculation.InputParameters.Structure == null)
{
LogReadCalculationConversionError(
- "Er is geen kunstwerk opgegeven om de faalkans gegeven erosie bodem aan toe te voegen.",
+ string.Format(RingtoetsCommonIOResources.CalculationConfigurationImporter_TryParameter_No_Structure_to_assign_Parameter_0_,
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_FailureProbabilityStructureWithErosion_DisplayName),
calculation.Name);
return false;
@@ -319,7 +324,10 @@
catch (ArgumentOutOfRangeException e)
{
LogOutOfRangeException(
- string.Format("Een waarde van '{0}' als faalkans gegeven erosie bodem is ongeldig.", failureProbability),
+ string.Format(
+ RingtoetsCommonIOResources.TryReadParameter_Value_0_ParameterName_1_is_invalid,
+ failureProbability,
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_FailureProbabilityStructureWithErosion_DisplayName),
calculation.Name,
e);
@@ -409,7 +417,7 @@
{
LogReadCalculationConversionError(
string.Format(
- "Het voorlandprofiel '{0}' bestaat niet.",
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_ReadForeshoreProfile_ForeshoreProfile_0_does_not_exist,
readCalculation.ForeshoreProfileName),
calculation.Name);
@@ -481,7 +489,7 @@
|| readCalculation.WaveReduction.BreakWaterType.HasValue))
{
LogReadCalculationConversionError(
- "Er is geen voorlandprofiel opgegeven om golfreductie parameters aan toe te voegen.",
+ RingtoetsCommonIOResources.CalculationConfigurationImporter_ValidateWaveReduction_No_foreshore_profile_provided,
calculation.Name);
return false;
@@ -493,7 +501,7 @@
{
LogReadCalculationConversionError(
string.Format(
- "Het opgegeven voorlandprofiel '{0}' heeft geen geometrie en kan daarom niet gebruikt worden.",
+ RingtoetsCommonIOResources.ReadForeshoreProfile_ForeshoreProfile_0_has_no_geometry_and_cannot_be_used,
readCalculation.ForeshoreProfileName),
calculation.Name);
return false;