Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs
===================================================================
diff -u -r87bd836d55d336e37e3d80f9a1521feb83ddc475 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs (.../GrassCoverErosionOutwardsWaveConditionsExporter.cs) (revision 87bd836d55d336e37e3d80f9a1521feb83ddc475)
+++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.IO/Exporters/GrassCoverErosionOutwardsWaveConditionsExporter.cs (.../GrassCoverErosionOutwardsWaveConditionsExporter.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -24,6 +24,7 @@
using System.Linq;
using Core.Common.IO.Exceptions;
using Riskeer.GrassCoverErosionOutwards.Data;
+using Riskeer.Revetment.Data;
using Riskeer.Revetment.IO.WaveConditions;
namespace Riskeer.GrassCoverErosionOutwards.IO.Exporters
@@ -38,13 +39,14 @@
///
/// The objects to export.
/// The file path to export to.
+ /// for getting the target probability to use.
/// Thrown when any parameter is null.
/// Thrown when is invalid.
/// Thrown when the file could not be written.
- public GrassCoverErosionOutwardsWaveConditionsExporter(IEnumerable calculations, string filePath)
- : base(CreateExportableWaveConditionsCollection(calculations), filePath) {}
+ public GrassCoverErosionOutwardsWaveConditionsExporter(IEnumerable calculations, string filePath, Func getTargetProbabilityFunc)
+ : base(CreateExportableWaveConditionsCollection(calculations, getTargetProbabilityFunc), filePath) {}
- private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations)
+ private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations, Func getTargetProbabilityFunc)
{
if (calculations == null)
{
@@ -67,7 +69,7 @@
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.WaveRunUpOutput, CoverType.GrassWaveRunUp));
+ calculation.Name, calculation.InputParameters, calculation.Output.WaveRunUpOutput, CoverType.GrassWaveRunUp, getTargetProbabilityFunc));
}
if (calculationType == GrassCoverErosionOutwardsWaveConditionsCalculationType.WaveRunUpAndWaveImpact
@@ -76,7 +78,7 @@
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.WaveImpactOutput, CoverType.GrassWaveImpact));
+ calculation.Name, calculation.InputParameters, calculation.Output.WaveImpactOutput, CoverType.GrassWaveImpact, getTargetProbabilityFunc));
}
if (calculationType == GrassCoverErosionOutwardsWaveConditionsCalculationType.TailorMadeWaveImpact
@@ -85,7 +87,7 @@
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.TailorMadeWaveImpactOutput, CoverType.GrassTailorMadeWaveImpact));
+ calculation.Name, calculation.InputParameters, calculation.Output.TailorMadeWaveImpactOutput, CoverType.GrassTailorMadeWaveImpact, getTargetProbabilityFunc));
}
}
Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs
===================================================================
diff -u -r16ba3eb172ac01be401442389ba665fe86ce7970 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 16ba3eb172ac01be401442389ba665fe86ce7970)
+++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -41,6 +41,7 @@
using Riskeer.Common.Forms.ImportInfos;
using Riskeer.Common.Forms.PresentationObjects;
using Riskeer.Common.Forms.TreeNodeInfos;
+using Riskeer.Common.Forms.TypeConverters;
using Riskeer.Common.Forms.UpdateInfos;
using Riskeer.Common.Plugin;
using Riskeer.Common.Service;
@@ -67,6 +68,8 @@
///
public class GrassCoverErosionOutwardsPlugin : PluginBase
{
+ private static readonly NoProbabilityValueDoubleConverter noProbabilityValueDoubleConverter = new NoProbabilityValueDoubleConverter();
+
public override IEnumerable GetPropertyInfos()
{
yield return new PropertyInfo
@@ -221,7 +224,7 @@
CreateFileExporter = (context, filePath) =>
{
IEnumerable calculations = context.WrappedData.GetCalculations().Cast();
- return new GrassCoverErosionOutwardsWaveConditionsExporter(calculations, filePath);
+ return new GrassCoverErosionOutwardsWaveConditionsExporter(calculations, filePath, input => noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection)));
},
IsEnabled = context => context.WrappedData.GetCalculations().Any(c => c.HasOutput),
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), new FileFilterGenerator(RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
@@ -233,9 +236,11 @@
Name = context => RiskeerCommonFormsResources.WaveConditionsExporter_DisplayName,
Extension = RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
CreateFileExporter = (context, filePath) => new GrassCoverErosionOutwardsWaveConditionsExporter(new[]
- {
- context.WrappedData
- }, filePath),
+ {
+ context.WrappedData
+ }, filePath,
+ input =>
+ noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection))),
IsEnabled = context => context.WrappedData.HasOutput,
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), new FileFilterGenerator(RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Description))
Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -refbef825cfaef36b9e55b209daa46b82858b08bf -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision efbef825cfaef36b9e55b209daa46b82858b08bf)
+++ Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -353,7 +353,7 @@
}
///
- /// Looks up a localized string similar to Naam berekening, Naam HB locatie, X HB locatie (RD) [m], Y HB locatie (RD) [m], Naam voorlandprofiel, Dam gebruikt, Voorlandgeometrie gebruikt, Type bekleding, Categoriegrens, Waterstand [m+NAP], Golfhoogte (Hs) [m], Golfperiode (Tp) [s], Golfrichting t.o.v. dijknormaal [°], Golfrichting t.o.v. Noord [°].
+ /// Looks up a localized string similar to Naam berekening, Naam HB locatie, X HB locatie (RD) [m], Y HB locatie (RD) [m], Naam voorlandprofiel, Dam gebruikt, Voorlandgeometrie gebruikt, Type bekleding, Doelkans, Waterstand [m+NAP], Golfhoogte (Hs) [m], Golfperiode (Tp) [s], Golfrichting t.o.v. dijknormaal [°], Golfrichting t.o.v. Noord [°].
///
public static string WaveConditionsWriter_HeaderLine {
get {
Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.resx
===================================================================
diff -u -refbef825cfaef36b9e55b209daa46b82858b08bf -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.resx (.../Resources.resx) (revision efbef825cfaef36b9e55b209daa46b82858b08bf)
+++ Riskeer/Revetment/src/Riskeer.Revetment.IO/Properties/Resources.resx (.../Resources.resx) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -1,187 +1,210 @@
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
Steen (blokken)
-
+
Steen (zuilen)
-
+
{0} Er zijn geen golfcondities geëxporteerd.
-
- Naam berekening, Naam HB locatie, X HB locatie (RD) [m], Y HB locatie (RD) [m], Naam voorlandprofiel, Dam gebruikt, Voorlandgeometrie gebruikt, Type bekleding, Categoriegrens, Waterstand [m+NAP], Golfhoogte (Hs) [m], Golfperiode (Tp) [s], Golfrichting t.o.v. dijknormaal [°], Golfrichting t.o.v. Noord [°]
+
+ Naam berekening, Naam HB locatie, X HB locatie (RD) [m], Y HB locatie (RD) [m], Naam voorlandprofiel, Dam gebruikt, Voorlandgeometrie gebruikt, Type bekleding, Doelkans, Waterstand [m+NAP], Golfhoogte (Hs) [m], Golfperiode (Tp) [s], Golfrichting t.o.v. dijknormaal [°], Golfrichting t.o.v. Noord [°]
-
+
ja
-
+
nee
-
+
Asfalt
-
+
Gras (golfoploop)
-
-
- ..\Resources\BekledingenConfiguratieBasisSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
-
-
+
+
+ ..\Resources\BekledingenConfiguratieBasisSchema.xsd;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+
+
+
bovengrens bekledingen
-
+
ondergrens bekledingen
-
+
bovengrens van de waterstanden
-
+
ondergrens van de waterstanden
-
- ..\resources\BekledingenConfiguratieSchema_1.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
-
-
+
+ ..\resources\BekledingenConfiguratieSchema_1.xsd;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
+
Gras (golfklap)
-
+
Gras (golfklap voor toets op maat)
-
- ..\resources\bekledingenconfiguratiebasisschema0to1.xslt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1
-
-
- ..\resources\bekledingenconfiguratiebasisschema1to2.xslt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1
-
-
- ..\resources\bekledingenconfiguratiebasisschema_0.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
-
-
- ..\resources\bekledingenconfiguratiebasisschema_1.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
-
-
- ..\resources\bekledingenconfiguratieschema_0.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
-
-
+
+ ..\resources\bekledingenconfiguratiebasisschema0to1.xslt;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1
+
+
+
+ ..\resources\bekledingenconfiguratiebasisschema1to2.xslt;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1
+
+
+
+ ..\resources\bekledingenconfiguratiebasisschema_0.xsd;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+
+
+
+ ..\resources\bekledingenconfiguratiebasisschema_1.xsd;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+
+
+
+ ..\resources\bekledingenconfiguratieschema_0.xsd;System.String, mscorlib, Version=4.0.0.0,
+ Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
+
+
+
De doelkans '{0}' kan niet worden gevonden en kan daarom niet gebruikt worden.
\ No newline at end of file
Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditions.cs
===================================================================
diff -u -r009170d4ac40a46b308e398765ff33c1a037fad1 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditions.cs (.../ExportableWaveConditions.cs) (revision 009170d4ac40a46b308e398765ff33c1a037fad1)
+++ Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditions.cs (.../ExportableWaveConditions.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -38,14 +38,16 @@
/// The output parameters of the parent calculation.
/// The type of dike cover.
/// The name of the category boundary.
+ /// for getting the target probability to use.
/// Thrown when any parameter is null.
/// Thrown when
/// is null in .
public ExportableWaveConditions(string name,
WaveConditionsInput waveConditionsInput,
WaveConditionsOutput waveConditionsOutput,
CoverType coverType,
- string categoryBoundaryName)
+ string categoryBoundaryName,
+ Func getTargetProbabilityFunc)
{
if (name == null)
{
@@ -89,7 +91,7 @@
UseForeshore = waveConditionsInput.UseForeshore;
UseBreakWater = waveConditionsInput.UseBreakWater;
CoverType = coverType;
- CategoryBoundaryName = categoryBoundaryName;
+ TargetProbability = getTargetProbabilityFunc(waveConditionsInput);
WaterLevel = waveConditionsOutput.WaterLevel;
WaveHeight = waveConditionsOutput.WaveHeight;
WavePeriod = waveConditionsOutput.WavePeakPeriod;
@@ -133,6 +135,11 @@
public string CategoryBoundaryName { get; }
///
+ /// Gets the target probability.
+ ///
+ public string TargetProbability { get; }
+
+ ///
/// Gets the id of the foreshore.
///
public string ForeshoreId { get; }
Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs
===================================================================
diff -u -r7491928192a7ecf23958f85fbd4669ec17085c95 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs (.../ExportableWaveConditionsFactory.cs) (revision 7491928192a7ecf23958f85fbd4669ec17085c95)
+++ Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/ExportableWaveConditionsFactory.cs (.../ExportableWaveConditionsFactory.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -39,6 +39,7 @@
/// The used in the calculations.
/// The resulting from the calculations.
/// The that the represents.
+ /// for getting the target probability to use.
/// A collection of .
/// Thrown when any parameter is null.
/// Thrown when
@@ -47,7 +48,8 @@
string name,
FailureMechanismCategoryWaveConditionsInput waveConditionsInput,
IEnumerable output,
- CoverType coverType)
+ CoverType coverType,
+ Func getTargetProbabilityFunc)
{
if (waveConditionsInput == null)
{
@@ -60,7 +62,7 @@
}
return CreateExportableWaveConditionsCollection(name, waveConditionsInput, output, coverType,
- GetCategoryBoundaryName(waveConditionsInput.CategoryType));
+ GetCategoryBoundaryName(waveConditionsInput.CategoryType), getTargetProbabilityFunc);
}
///
@@ -70,15 +72,16 @@
/// The used in the calculations.
/// The resulting from the calculations.
/// The that the represents.
+ ///
/// A collection of .
/// Thrown when any parameter is null.
/// Thrown when
/// is null in .
- public static IEnumerable CreateExportableWaveConditionsCollection(
- string name,
- AssessmentSectionCategoryWaveConditionsInput waveConditionsInput,
- IEnumerable output,
- CoverType coverType)
+ public static IEnumerable CreateExportableWaveConditionsCollection(string name,
+ AssessmentSectionCategoryWaveConditionsInput waveConditionsInput,
+ IEnumerable output,
+ CoverType coverType,
+ Func getTargetProbabilityFunc)
{
if (waveConditionsInput == null)
{
@@ -91,7 +94,7 @@
}
return CreateExportableWaveConditionsCollection(name, waveConditionsInput, output, coverType,
- GetCategoryBoundaryName(waveConditionsInput.CategoryType));
+ GetCategoryBoundaryName(waveConditionsInput.CategoryType), getTargetProbabilityFunc);
}
///
@@ -102,6 +105,7 @@
/// The resulting from the calculations.
/// The type of cover.
/// The name of the category boundary.
+ /// for getting the target probability to use.
/// A collection of .
/// Thrown when any parameter is null.
/// Thrown when
@@ -111,7 +115,8 @@
WaveConditionsInput waveConditionsInput,
IEnumerable output,
CoverType coverType,
- string categoryBoundaryName)
+ string categoryBoundaryName,
+ Func getTargetProbabilityFunc)
{
if (name == null)
{
@@ -124,7 +129,7 @@
}
return output.Select(waveConditionsOutput => new ExportableWaveConditions(name, waveConditionsInput, waveConditionsOutput,
- coverType, categoryBoundaryName)).ToArray();
+ coverType, categoryBoundaryName, getTargetProbabilityFunc)).ToArray();
}
private static string GetCategoryBoundaryName(T enumValue)
Index: Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/WaveConditionsWriter.cs
===================================================================
diff -u -r7491928192a7ecf23958f85fbd4669ec17085c95 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/WaveConditionsWriter.cs (.../WaveConditionsWriter.cs) (revision 7491928192a7ecf23958f85fbd4669ec17085c95)
+++ Riskeer/Revetment/src/Riskeer.Revetment.IO/WaveConditions/WaveConditionsWriter.cs (.../WaveConditionsWriter.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -87,7 +87,7 @@
exportableWaveConditions.UseBreakWater ? Resources.Yes : Resources.No,
exportableWaveConditions.UseForeshore ? Resources.Yes : Resources.No,
exportableWaveConditions.CoverType.Name,
- exportableWaveConditions.CategoryBoundaryName,
+ exportableWaveConditions.TargetProbability,
new RoundedDouble(2, exportableWaveConditions.WaterLevel).ToString(null, CultureInfo.InvariantCulture),
new RoundedDouble(2, exportableWaveConditions.WaveHeight).ToString(null, CultureInfo.InvariantCulture),
new RoundedDouble(2, exportableWaveConditions.WavePeriod).ToString(null, CultureInfo.InvariantCulture),
Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.IO/Exporters/StabilityStoneCoverWaveConditionsExporter.cs
===================================================================
diff -u -r2ef21b0f4d85a5c9689720d539254a1d5c907be7 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.IO/Exporters/StabilityStoneCoverWaveConditionsExporter.cs (.../StabilityStoneCoverWaveConditionsExporter.cs) (revision 2ef21b0f4d85a5c9689720d539254a1d5c907be7)
+++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.IO/Exporters/StabilityStoneCoverWaveConditionsExporter.cs (.../StabilityStoneCoverWaveConditionsExporter.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -23,13 +23,14 @@
using System.Collections.Generic;
using System.Linq;
using Core.Common.IO.Exceptions;
+using Riskeer.Revetment.Data;
using Riskeer.Revetment.IO.WaveConditions;
using Riskeer.StabilityStoneCover.Data;
namespace Riskeer.StabilityStoneCover.IO.Exporters
{
///
- /// Exports stability stone cover wave conditions and stores then as a csv file.
+ /// Exports stability stone cover wave conditions and stores them as a csv file.
///
public class StabilityStoneCoverWaveConditionsExporter : WaveConditionsExporterBase
{
@@ -38,14 +39,16 @@
///
///
/// The file path to export to.
+ /// for getting the target probability to use.
/// Thrown when or
/// is null.
/// Thrown when is invalid.
/// Thrown when the file could not be written.
- public StabilityStoneCoverWaveConditionsExporter(IEnumerable calculations, string filePath)
- : base(CreateExportableWaveConditionsCollection(calculations), filePath) {}
+ public StabilityStoneCoverWaveConditionsExporter(IEnumerable calculations, string filePath,
+ Func getTargetProbabilityFunc)
+ : base(CreateExportableWaveConditionsCollection(calculations, getTargetProbabilityFunc), filePath) {}
- private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations)
+ private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations, Func getTargetProbabilityFunc)
{
if (calculations == null)
{
@@ -55,10 +58,10 @@
IEnumerable exportableCalculations =
calculations.Where(c => c.HasOutput && c.InputParameters.HydraulicBoundaryLocation != null);
- return CreateExportableWaveConditions(exportableCalculations);
+ return CreateExportableWaveConditions(exportableCalculations, getTargetProbabilityFunc);
}
- private static IEnumerable CreateExportableWaveConditions(IEnumerable exportableCalculations)
+ private static IEnumerable CreateExportableWaveConditions(IEnumerable exportableCalculations, Func getTargetProbabilityFunc)
{
var exportableWaveConditions = new List();
foreach (StabilityStoneCoverWaveConditionsCalculation calculation in exportableCalculations)
@@ -69,15 +72,15 @@
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.BlocksOutput, CoverType.StoneCoverBlocks));
+ calculation.Name, calculation.InputParameters, calculation.Output.BlocksOutput, CoverType.StoneCoverBlocks, getTargetProbabilityFunc));
}
if (calculationType == StabilityStoneCoverWaveConditionsCalculationType.Both
|| calculationType == StabilityStoneCoverWaveConditionsCalculationType.Columns)
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.ColumnsOutput, CoverType.StoneCoverColumns));
+ calculation.Name, calculation.InputParameters, calculation.Output.ColumnsOutput, CoverType.StoneCoverColumns, getTargetProbabilityFunc));
}
}
Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs
===================================================================
diff -u -r16ba3eb172ac01be401442389ba665fe86ce7970 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 16ba3eb172ac01be401442389ba665fe86ce7970)
+++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -41,6 +41,7 @@
using Riskeer.Common.Forms.ImportInfos;
using Riskeer.Common.Forms.PresentationObjects;
using Riskeer.Common.Forms.TreeNodeInfos;
+using Riskeer.Common.Forms.TypeConverters;
using Riskeer.Common.Forms.UpdateInfos;
using Riskeer.Common.Plugin;
using Riskeer.Common.Service;
@@ -66,6 +67,8 @@
///
public class StabilityStoneCoverPlugin : PluginBase
{
+ private static readonly NoProbabilityValueDoubleConverter noProbabilityValueDoubleConverter = new NoProbabilityValueDoubleConverter();
+
public override IEnumerable GetPropertyInfos()
{
yield return new PropertyInfo
@@ -212,7 +215,9 @@
{
Name = context => RiskeerCommonFormsResources.WaveConditionsExporter_DisplayName,
Extension = RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
- CreateFileExporter = (context, filePath) => new StabilityStoneCoverWaveConditionsExporter(context.WrappedData.GetCalculations().Cast(), filePath),
+ CreateFileExporter = (context, filePath) =>
+ new StabilityStoneCoverWaveConditionsExporter(context.WrappedData.GetCalculations().Cast(), filePath,
+ input => noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection))),
IsEnabled = context => context.WrappedData.GetCalculations().Cast().Any(c => c.HasOutput),
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), GetWaveConditionsFileFilterGenerator())
};
@@ -222,9 +227,10 @@
Name = context => RiskeerCommonFormsResources.WaveConditionsExporter_DisplayName,
Extension = RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
CreateFileExporter = (context, filePath) => new StabilityStoneCoverWaveConditionsExporter(new[]
- {
- context.WrappedData
- }, filePath),
+ {
+ context.WrappedData
+ }, filePath,
+ input => noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection))),
IsEnabled = context => context.WrappedData.HasOutput,
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), GetWaveConditionsFileFilterGenerator())
};
Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.IO/Exporters/WaveImpactAsphaltCoverWaveConditionsExporter.cs
===================================================================
diff -u -r4f4daebe59ab925c98cef039101ec70544530bbe -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.IO/Exporters/WaveImpactAsphaltCoverWaveConditionsExporter.cs (.../WaveImpactAsphaltCoverWaveConditionsExporter.cs) (revision 4f4daebe59ab925c98cef039101ec70544530bbe)
+++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.IO/Exporters/WaveImpactAsphaltCoverWaveConditionsExporter.cs (.../WaveImpactAsphaltCoverWaveConditionsExporter.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -23,6 +23,7 @@
using System.Collections.Generic;
using System.Linq;
using Core.Common.IO.Exceptions;
+using Riskeer.Revetment.Data;
using Riskeer.Revetment.IO.WaveConditions;
using Riskeer.WaveImpactAsphaltCover.Data;
@@ -38,12 +39,13 @@
///
/// The objects to export.
/// The file path to export to.
+ /// for getting the target probability to use.
/// Thrown when any parameter is null.
/// Thrown when the file could not be written.
- public WaveImpactAsphaltCoverWaveConditionsExporter(IEnumerable calculations, string filePath)
- : base(CreateExportableWaveConditionsCollection(calculations), filePath) {}
+ public WaveImpactAsphaltCoverWaveConditionsExporter(IEnumerable calculations, string filePath, Func getTargetProbabilityFunc)
+ : base(CreateExportableWaveConditionsCollection(calculations, getTargetProbabilityFunc), filePath) {}
- private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations)
+ private static IEnumerable CreateExportableWaveConditionsCollection(IEnumerable calculations, Func getTargetProbabilityFunc)
{
if (calculations == null)
{
@@ -59,7 +61,7 @@
{
exportableWaveConditions.AddRange(
ExportableWaveConditionsFactory.CreateExportableWaveConditionsCollection(
- calculation.Name, calculation.InputParameters, calculation.Output.Items, CoverType.Asphalt));
+ calculation.Name, calculation.InputParameters, calculation.Output.Items, CoverType.Asphalt, getTargetProbabilityFunc));
}
return exportableWaveConditions;
Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs
===================================================================
diff -u -r16ba3eb172ac01be401442389ba665fe86ce7970 -rd8abf0bc87b96f09e34f2d7a45248cf124b782fa
--- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 16ba3eb172ac01be401442389ba665fe86ce7970)
+++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision d8abf0bc87b96f09e34f2d7a45248cf124b782fa)
@@ -41,6 +41,7 @@
using Riskeer.Common.Forms.ImportInfos;
using Riskeer.Common.Forms.PresentationObjects;
using Riskeer.Common.Forms.TreeNodeInfos;
+using Riskeer.Common.Forms.TypeConverters;
using Riskeer.Common.Forms.UpdateInfos;
using Riskeer.Common.Plugin;
using Riskeer.Common.Service;
@@ -66,6 +67,8 @@
///
public class WaveImpactAsphaltCoverPlugin : PluginBase
{
+ private static readonly NoProbabilityValueDoubleConverter noProbabilityValueDoubleConverter = new NoProbabilityValueDoubleConverter();
+
public override IEnumerable GetPropertyInfos()
{
yield return new PropertyInfo
@@ -212,7 +215,7 @@
CreateFileExporter = (context, filePath) =>
{
IEnumerable calculations = context.WrappedData.GetCalculations().Cast();
- return new WaveImpactAsphaltCoverWaveConditionsExporter(calculations, filePath);
+ return new WaveImpactAsphaltCoverWaveConditionsExporter(calculations, filePath, input => noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection)));
},
IsEnabled = context => context.WrappedData.GetCalculations().Cast().Any(c => c.HasOutput),
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), GetWaveConditionsFileFilterGenerator())
@@ -223,9 +226,11 @@
Name = context => RiskeerCommonFormsResources.WaveConditionsExporter_DisplayName,
Extension = RiskeerCommonFormsResources.DataTypeDisplayName_csv_file_filter_Extension,
CreateFileExporter = (context, filePath) => new WaveImpactAsphaltCoverWaveConditionsExporter(new[]
- {
- context.WrappedData
- }, filePath),
+ {
+ context.WrappedData
+ }, filePath,
+ input =>
+ noProbabilityValueDoubleConverter.ConvertToString(WaveConditionsInputHelper.GetTargetProbability(input, context.AssessmentSection))),
IsEnabled = context => context.WrappedData.HasOutput,
GetExportPath = () => ExportHelper.GetFilePath(GetInquiryHelper(), GetWaveConditionsFileFilterGenerator())
};