Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs
===================================================================
diff -u -r642a4946d235601302d544697856fed3b5c7a2bd -r0f2cc55f2217e523d55eb173d3769f764ebc28a0
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs (.../PipingOutputContext.cs) (revision 642a4946d235601302d544697856fed3b5c7a2bd)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingOutputContext.cs (.../PipingOutputContext.cs) (revision 0f2cc55f2217e523d55eb173d3769f764ebc28a0)
@@ -21,35 +21,42 @@
using System;
using Core.Common.Controls.PresentationObjects;
+using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Piping.Data;
namespace Ringtoets.Piping.Forms.PresentationObjects
{
///
- /// A presentation layer object which wraps a and a .
+ /// A presentation layer object which wraps a .
///
public class PipingOutputContext : WrappedObjectContextBase
{
///
/// Creates a new instance of .
///
/// The object to wrap.
- /// The
- /// created from .
- public PipingOutputContext(PipingOutput pipingOutput, DerivedPipingOutput derivedOutput)
+ /// The failure mechanism that the output belongs to.
+ /// The assessment section that the output belongs to.
+ /// Thrown when any parameter is null.
+ public PipingOutputContext(PipingOutput pipingOutput, PipingFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
: base(pipingOutput)
{
- if (derivedOutput == null)
+ if (failureMechanism == null)
{
- throw new ArgumentNullException(nameof(derivedOutput));
+ throw new ArgumentNullException(nameof(failureMechanism));
}
- DerivedOutput = derivedOutput;
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ FailureMechanism = failureMechanism;
+ AssessmentSection = assessmentSection;
}
- ///
- /// Gets the derived output created from the piping output.
- ///
- public DerivedPipingOutput DerivedOutput { get; }
+ public PipingFailureMechanism FailureMechanism { get; }
+
+ public IAssessmentSection AssessmentSection { get; }
}
}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputProperties.cs
===================================================================
diff -u -r642a4946d235601302d544697856fed3b5c7a2bd -r0f2cc55f2217e523d55eb173d3769f764ebc28a0
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputProperties.cs (.../PipingOutputProperties.cs) (revision 642a4946d235601302d544697856fed3b5c7a2bd)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingOutputProperties.cs (.../PipingOutputProperties.cs) (revision 0f2cc55f2217e523d55eb173d3769f764ebc28a0)
@@ -24,6 +24,7 @@
using Core.Common.Gui.Attributes;
using Core.Common.Gui.PropertyBag;
using Core.Common.Util.Attributes;
+using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Piping.Data;
using Ringtoets.Piping.Forms.Properties;
@@ -35,7 +36,7 @@
///
public class PipingOutputProperties : ObjectProperties
{
- private readonly DerivedPipingOutput derivedOutput;
+ private DerivedPipingOutput derivedOutput;
///
/// Creates a new instance of .
@@ -44,20 +45,16 @@
/// The derived output to show properties for.
/// Thrown when any parameter
/// is null.
- public PipingOutputProperties(PipingOutput output, DerivedPipingOutput derivedOutput)
+ public PipingOutputProperties(PipingOutput output, PipingFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
{
- if (derivedOutput == null)
+ if (output == null)
{
- throw new ArgumentNullException(nameof(derivedOutput));
+ throw new ArgumentNullException(nameof(output));
}
- if (derivedOutput == null)
- {
- throw new ArgumentNullException(nameof(derivedOutput));
- }
-
Data = output;
- this.derivedOutput = derivedOutput;
+
+ CreateDerivedOutput(output, failureMechanism, assessmentSection);
}
[ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Uplift), 1, 4)]
@@ -287,5 +284,14 @@
return derivedOutput.PipingFactorOfSafety;
}
}
+
+ private void CreateDerivedOutput(PipingOutput output, PipingFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ {
+ derivedOutput = DerivedPipingOutputFactory.Create(output,
+ failureMechanism.PipingProbabilityAssessmentInput,
+ assessmentSection.FailureMechanismContribution.Norm,
+ failureMechanism.Contribution);
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs
===================================================================
diff -u -r642a4946d235601302d544697856fed3b5c7a2bd -r0f2cc55f2217e523d55eb173d3769f764ebc28a0
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 642a4946d235601302d544697856fed3b5c7a2bd)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 0f2cc55f2217e523d55eb173d3769f764ebc28a0)
@@ -78,7 +78,7 @@
};
yield return new PropertyInfo
{
- CreateInstance = context => new PipingOutputProperties(context.WrappedData, context.DerivedOutput)
+ CreateInstance = context => new PipingOutputProperties(context.WrappedData, context.FailureMechanism, context.AssessmentSection)
};
yield return new PropertyInfo
{
@@ -752,26 +752,27 @@
.Build();
}
- private static object[] PipingCalculationContextChildNodeObjects(PipingCalculationScenarioContext pipingCalculationScenarioContext)
+ private static object[] PipingCalculationContextChildNodeObjects(PipingCalculationScenarioContext context)
{
- PipingCalculationScenario pipingCalculationScenario = pipingCalculationScenarioContext.WrappedData;
+ PipingCalculationScenario pipingCalculationScenario = context.WrappedData;
var childNodes = new List