Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs
===================================================================
diff -u -r9e6869de553715aefe4752478334c3a6a3f83340 -r8588a6a0d9c1d11a496590ef3eaaccd5cf3a1108
--- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs) (revision 9e6869de553715aefe4752478334c3a6a3f83340)
+++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs) (revision 8588a6a0d9c1d11a496590ef3eaaccd5cf3a1108)
@@ -21,10 +21,13 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using Ringtoets.Common.Data.Calculation;
+using Ringtoets.Common.Data.Contribution;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Forms.Helpers;
+using Ringtoets.Revetment.Data;
using Ringtoets.WaveImpactAsphaltCover.Data;
namespace Ringtoets.WaveImpactAsphaltCover.Forms
@@ -36,43 +39,55 @@
{
///
/// Adds based on the
- /// in the .
+ /// in the and sets their initial category type input based on the .
///
/// Locations to base the calculation upon.
/// The list to update.
+ /// The to set the category type input for.
/// Throw when any input parameter is null.
+ /// Thrown when is an invalid value.
+ /// Thrown when is a valid value,
+ /// but unsupported.
public static void AddCalculationsFromLocations(IEnumerable locations,
- List calculations)
+ List calculations,
+ NormType normType)
{
if (locations == null)
{
throw new ArgumentNullException(nameof(locations));
}
+
if (calculations == null)
{
throw new ArgumentNullException(nameof(calculations));
}
- foreach (ICalculationBase calculation in locations.Select(location => CreateWaveImpactAsphaltCoverWaveConditionsCalculation(location, calculations)))
+
+ foreach (ICalculationBase calculation in locations.Select(location => CreateWaveImpactAsphaltCoverWaveConditionsCalculation(location,
+ calculations,
+ normType)))
{
calculations.Add(calculation);
}
}
private static ICalculationBase CreateWaveImpactAsphaltCoverWaveConditionsCalculation(
HydraulicBoundaryLocation hydraulicBoundaryLocation,
- IEnumerable calculations)
+ IEnumerable calculations,
+ NormType normType)
{
string nameBase = hydraulicBoundaryLocation.Name;
string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name);
- return new WaveImpactAsphaltCoverWaveConditionsCalculation
+ var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation
{
Name = name,
InputParameters =
{
HydraulicBoundaryLocation = hydraulicBoundaryLocation
}
};
+ WaveConditionsInputHelper.SetCategoryType(calculation.InputParameters, normType);
+ return calculation;
}
}
}
\ No newline at end of file