Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj
===================================================================
diff -u -rc840995eaf5d4c4564b7edfa56d964ea55ebbec0 -rf5f01babec40dab6b5e8ac50fdb9f34e7a75b395
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision c840995eaf5d4c4564b7edfa56d964ea55ebbec0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Ringtoets.Integration.Plugin.csproj (.../Ringtoets.Integration.Plugin.csproj) (revision f5f01babec40dab6b5e8ac50fdb9f34e7a75b395)
@@ -84,6 +84,10 @@
Core.Components.Gis
False
+
+ {420ED9C3-0C33-47EA-B893-121A9C0DB4F1}
+ Ringtoets.AssemblyTool.Data
+
{C6309704-D67B-434C-BC98-9F8910BC1D10}
Ringtoets.ClosingStructures.Data
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r317545a48353ace4c99d35bf5fd527c1731698dd -rf5f01babec40dab6b5e8ac50fdb9f34e7a75b395
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 317545a48353ace4c99d35bf5fd527c1731698dd)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision f5f01babec40dab6b5e8ac50fdb9f34e7a75b395)
@@ -37,9 +37,11 @@
using Core.Common.Util.Extensions;
using Core.Components.Gis.Data;
using log4net;
+using Ringtoets.AssemblyTool.Data;
using Ringtoets.ClosingStructures.Data;
using Ringtoets.ClosingStructures.Forms.PresentationObjects;
using Ringtoets.Common.Data;
+using Ringtoets.Common.Data.AssemblyTool;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.Contribution;
@@ -1916,62 +1918,93 @@
private static object[] DesignWaterLevelLocationsGroupContextChildNodeObjects(DesignWaterLevelLocationsGroupContext context)
{
- Func getNormFunc = () => context.AssessmentSection.FailureMechanismContribution.Norm;
-
return new object[]
{
new DesignWaterLevelLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetFirstHydraulicBoundary(context.AssessmentSection),
hbl => hbl.DesignWaterLevelCalculation1,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_1),
new DesignWaterLevelLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetSecondHydraulicBoundary(context.AssessmentSection),
hbl => hbl.DesignWaterLevelCalculation2,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_2),
new DesignWaterLevelLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetThirdHydraulicBoundary(context.AssessmentSection),
hbl => hbl.DesignWaterLevelCalculation3,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_3),
new DesignWaterLevelLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetFourthHydraulicBoundary(context.AssessmentSection),
hbl => hbl.DesignWaterLevelCalculation4,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_4)
};
}
private static object[] WaveHeightLocationsGroupContextChildNodeObjects(WaveHeightLocationsGroupContext context)
{
- Func getNormFunc = () => context.AssessmentSection.FailureMechanismContribution.Norm;
-
return new object[]
{
new WaveHeightLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetFirstHydraulicBoundary(context.AssessmentSection),
hbl => hbl.WaveHeightCalculation1,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_1),
new WaveHeightLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetSecondHydraulicBoundary(context.AssessmentSection),
hbl => hbl.WaveHeightCalculation2,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_2),
new WaveHeightLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetThirdHydraulicBoundary(context.AssessmentSection),
hbl => hbl.WaveHeightCalculation3,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_3),
new WaveHeightLocationsContext(context.WrappedData,
context.AssessmentSection,
- getNormFunc,
+ () => GetFourthHydraulicBoundary(context.AssessmentSection),
hbl => hbl.WaveHeightCalculation4,
RingtoetsIntegrationPluginResources.Hydraulic_category_boundary_name_4)
};
}
+ private static double GetFirstHydraulicBoundary(IAssessmentSection assessmentSection)
+ {
+ return CreateAssessmentSectionAssemblyCategories(assessmentSection)
+ .First(c => c.Group == AssessmentSectionAssemblyCategoryGroup.A)
+ .LowerBoundary;
+ }
+
+ private static double GetSecondHydraulicBoundary(IAssessmentSection assessmentSection)
+ {
+ return CreateAssessmentSectionAssemblyCategories(assessmentSection)
+ .First(c => c.Group == AssessmentSectionAssemblyCategoryGroup.B)
+ .LowerBoundary;
+ }
+
+ private static double GetThirdHydraulicBoundary(IAssessmentSection assessmentSection)
+ {
+ return CreateAssessmentSectionAssemblyCategories(assessmentSection)
+ .First(c => c.Group == AssessmentSectionAssemblyCategoryGroup.C)
+ .LowerBoundary;
+ }
+
+ private static double GetFourthHydraulicBoundary(IAssessmentSection assessmentSection)
+ {
+ return CreateAssessmentSectionAssemblyCategories(assessmentSection)
+ .First(c => c.Group == AssessmentSectionAssemblyCategoryGroup.D)
+ .LowerBoundary;
+ }
+
+ private static IEnumerable CreateAssessmentSectionAssemblyCategories(IAssessmentSection assessmentSection)
+ {
+ return AssemblyToolCategoriesFactory.CreateAssessmentSectionAssemblyCategories(
+ assessmentSection.FailureMechanismContribution.SignalingNorm,
+ assessmentSection.FailureMechanismContribution.LowerLimitNorm);
+ }
+
#endregion
#endregion
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs
===================================================================
diff -u -r9404b317374284d0e3fe8bb370f2bd7bd06241b9 -rf5f01babec40dab6b5e8ac50fdb9f34e7a75b395
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs) (revision 9404b317374284d0e3fe8bb370f2bd7bd06241b9)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs) (revision f5f01babec40dab6b5e8ac50fdb9f34e7a75b395)
@@ -28,6 +28,8 @@
using NUnit.Framework;
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Contribution;
+using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Integration.Forms.PresentationObjects;
@@ -104,8 +106,19 @@
public void ChildNodeObjects_Always_ReturnsChildrenOfData()
{
// Setup
+ const double signalingNorm = 0.002;
+ const double lowerLimitNorm = 0.005;
+
var mocks = new MockRepository();
var assessmentSection = mocks.StrictMock();
+ assessmentSection.Expect(a => a.FailureMechanismContribution)
+ .Return(new FailureMechanismContribution(
+ Enumerable.Empty(),
+ 10,
+ lowerLimitNorm,
+ signalingNorm))
+ .Repeat.Any();
+
mocks.ReplayAll();
var locations = new ObservableList();
@@ -131,15 +144,19 @@
Assert.AreEqual("A+->A", locationsContexts[0].CategoryBoundaryName);
Assert.AreSame(testLocation.DesignWaterLevelCalculation1, locationsContexts[0].GetCalculationFunc(testLocation));
+ Assert.AreEqual(signalingNorm / 30, locationsContexts[0].GetNormFunc());
Assert.AreEqual("A->B", locationsContexts[1].CategoryBoundaryName);
Assert.AreSame(testLocation.DesignWaterLevelCalculation2, locationsContexts[1].GetCalculationFunc(testLocation));
+ Assert.AreEqual(signalingNorm, locationsContexts[1].GetNormFunc());
Assert.AreEqual("B->C", locationsContexts[2].CategoryBoundaryName);
Assert.AreSame(testLocation.DesignWaterLevelCalculation3, locationsContexts[2].GetCalculationFunc(testLocation));
+ Assert.AreEqual(lowerLimitNorm, locationsContexts[2].GetNormFunc());
Assert.AreEqual("C->D", locationsContexts[3].CategoryBoundaryName);
Assert.AreSame(testLocation.DesignWaterLevelCalculation4, locationsContexts[3].GetCalculationFunc(testLocation));
+ Assert.AreEqual(lowerLimitNorm * 30, locationsContexts[3].GetNormFunc());
}
mocks.VerifyAll();
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs
===================================================================
diff -u -r9404b317374284d0e3fe8bb370f2bd7bd06241b9 -rf5f01babec40dab6b5e8ac50fdb9f34e7a75b395
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs (.../WaveHeightLocationsGroupContextTreeNodeInfoTest.cs) (revision 9404b317374284d0e3fe8bb370f2bd7bd06241b9)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs (.../WaveHeightLocationsGroupContextTreeNodeInfoTest.cs) (revision f5f01babec40dab6b5e8ac50fdb9f34e7a75b395)
@@ -28,6 +28,8 @@
using NUnit.Framework;
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Contribution;
+using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Integration.Forms.PresentationObjects;
@@ -105,8 +107,19 @@
public void ChildNodeObjects_Always_ReturnsChildrenOfData()
{
// Setup
+ const double signalingNorm = 0.002;
+ const double lowerLimitNorm = 0.005;
+
var mocks = new MockRepository();
var assessmentSection = mocks.StrictMock();
+ assessmentSection.Expect(a => a.FailureMechanismContribution)
+ .Return(new FailureMechanismContribution(
+ Enumerable.Empty(),
+ 10,
+ lowerLimitNorm,
+ signalingNorm))
+ .Repeat.Any();
+
mocks.ReplayAll();
var locations = new ObservableList();
@@ -132,15 +145,19 @@
Assert.AreEqual("A+->A", locationsContexts[0].CategoryBoundaryName);
Assert.AreSame(testLocation.WaveHeightCalculation1, locationsContexts[0].GetCalculationFunc(testLocation));
+ Assert.AreEqual(signalingNorm / 30, locationsContexts[0].GetNormFunc());
Assert.AreEqual("A->B", locationsContexts[1].CategoryBoundaryName);
Assert.AreSame(testLocation.WaveHeightCalculation2, locationsContexts[1].GetCalculationFunc(testLocation));
+ Assert.AreEqual(signalingNorm, locationsContexts[1].GetNormFunc());
Assert.AreEqual("B->C", locationsContexts[2].CategoryBoundaryName);
Assert.AreSame(testLocation.WaveHeightCalculation3, locationsContexts[2].GetCalculationFunc(testLocation));
+ Assert.AreEqual(lowerLimitNorm, locationsContexts[2].GetNormFunc());
Assert.AreEqual("C->D", locationsContexts[3].CategoryBoundaryName);
Assert.AreSame(testLocation.WaveHeightCalculation4, locationsContexts[3].GetCalculationFunc(testLocation));
+ Assert.AreEqual(lowerLimitNorm * 30, locationsContexts[3].GetNormFunc());
}
mocks.VerifyAll();