Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs
===================================================================
diff -u -r35408ec0912670519b01cff44a19a3e2fb12d8d6 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs (.../FailureMechanismBaseCreateExtensions.cs) (revision 35408ec0912670519b01cff44a19a3e2fb12d8d6)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/FailureMechanismBaseCreateExtensions.cs (.../FailureMechanismBaseCreateExtensions.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -42,7 +42,7 @@
/// - is null
///
///
- internal static void AddEntitiesForFailureMechanismSections(this FailureMechanismBase mechanism, CreateConversionCollector collector, FailureMechanismEntity entity)
+ internal static void AddEntitiesForFailureMechanismSections(this IFailureMechanism mechanism, CreateConversionCollector collector, FailureMechanismEntity entity)
{
if (collector == null)
{
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs
===================================================================
diff -u -r60f9f8cfadfe1b22e5989aa92ab9839c4623338d -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 60f9f8cfadfe1b22e5989aa92ab9839c4623338d)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/FailureMechanismEntityReadExtensions.cs (.../FailureMechanismEntityReadExtensions.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -98,7 +98,7 @@
return failureMechanism;
}
- private static void ReadFailureMechanismSections(this FailureMechanismEntity entity, FailureMechanismBase failureMechanism)
+ private static void ReadFailureMechanismSections(this FailureMechanismEntity entity, IFailureMechanism failureMechanism)
{
foreach (var failureMechanismSectionEntity in entity.FailureMechanismSectionEntities)
{
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Update/FailureMechanismBaseUpdateExtensions.cs
===================================================================
diff -u -r35408ec0912670519b01cff44a19a3e2fb12d8d6 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Update/FailureMechanismBaseUpdateExtensions.cs (.../FailureMechanismBaseUpdateExtensions.cs) (revision 35408ec0912670519b01cff44a19a3e2fb12d8d6)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Update/FailureMechanismBaseUpdateExtensions.cs (.../FailureMechanismBaseUpdateExtensions.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -46,7 +46,7 @@
/// - is null
///
///
- internal static void UpdateFailureMechanismSections(this FailureMechanismBase mechanism, UpdateConversionCollector collector, FailureMechanismEntity entity, IRingtoetsEntities context)
+ internal static void UpdateFailureMechanismSections(this IFailureMechanism mechanism, UpdateConversionCollector collector, FailureMechanismEntity entity, IRingtoetsEntities context)
{
if (collector == null)
{
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/ProjectUpdateExtensionsTest.cs
===================================================================
diff -u -r246ebb0ea665a568e9073717d4211816220ff0fc -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/ProjectUpdateExtensionsTest.cs (.../ProjectUpdateExtensionsTest.cs) (revision 246ebb0ea665a568e9073717d4211816220ff0fc)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Update/ProjectUpdateExtensionsTest.cs (.../ProjectUpdateExtensionsTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -200,7 +200,6 @@
mocks.ReplayAll();
- var newDescription = "newDescription";
var project = new Project
{
StorageId = 1,
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsEntitiesHelper.cs
===================================================================
diff -u -r4bb55feac151da4010e81849de3103327f7f40ae -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsEntitiesHelper.cs (.../RingtoetsEntitiesHelper.cs) (revision 4bb55feac151da4010e81849de3103327f7f40ae)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsEntitiesHelper.cs (.../RingtoetsEntitiesHelper.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -20,7 +20,6 @@
// All rights reserved.
using System.Collections.ObjectModel;
-using System.Data.Entity;
using Application.Ringtoets.Storage.DbContext;
using Rhino.Mocks;
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/SqLiteDatabaseHelper.cs
===================================================================
diff -u -rbc9552772d4e6a6bd786dfcaef808da1964e8c53 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/SqLiteDatabaseHelper.cs (.../SqLiteDatabaseHelper.cs) (revision bc9552772d4e6a6bd786dfcaef808da1964e8c53)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/SqLiteDatabaseHelper.cs (.../SqLiteDatabaseHelper.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -20,10 +20,8 @@
// All rights reserved.
using System;
-using System.Data.Entity.Core.EntityClient;
using System.Data.SQLite;
using Core.Common.Base.Data;
-using Core.Common.Base.Properties;
using NUnit.Framework;
namespace Application.Ringtoets.Storage.TestUtil
Index: Core/Common/src/Core.Common.Base/IO/IFileImporter.cs
===================================================================
diff -u -re04155c0cc0efa8bbd13e0a82cb8643711a2dfd6 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Common/src/Core.Common.Base/IO/IFileImporter.cs (.../IFileImporter.cs) (revision e04155c0cc0efa8bbd13e0a82cb8643711a2dfd6)
+++ Core/Common/src/Core.Common.Base/IO/IFileImporter.cs (.../IFileImporter.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
using System.Drawing;
namespace Core.Common.Base.IO
Index: Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs
===================================================================
diff -u -ref1c61d94f2aec3b4ff32fcf03253d7ad386c8e5 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs (.../IProjectCommands.cs) (revision ef1c61d94f2aec3b4ff32fcf03253d7ad386c8e5)
+++ Core/Common/src/Core.Common.Gui/Commands/IProjectCommands.cs (.../IProjectCommands.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -19,9 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
-using System.Collections.Generic;
-
using Core.Common.Base.Data;
namespace Core.Common.Gui.Commands
Index: Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs
===================================================================
diff -u -rfc38d18fc6ff1749476da0ea43281d5d80568283 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs (.../MessageWindowLogAppenderTest.cs) (revision fc38d18fc6ff1749476da0ea43281d5d80568283)
+++ Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowLogAppenderTest.cs (.../MessageWindowLogAppenderTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,7 +1,6 @@
using System;
using System.Globalization;
using Core.Common.Gui.Forms.MessageWindow;
-using Core.Common.Gui.TestUtil;
using Core.Common.TestUtil;
using log4net.Core;
using log4net.Util;
Index: Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiImportHandlerTest.cs
===================================================================
diff -u -re8b38c279ab010c360bd6589c8600e9cf387b11f -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiImportHandlerTest.cs (.../GuiImportHandlerTest.cs) (revision e8b38c279ab010c360bd6589c8600e9cf387b11f)
+++ Core/Common/test/Core.Common.Integration.Test/Ringtoets/Application.Ringtoets/GuiImportHandlerTest.cs (.../GuiImportHandlerTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,6 +1,5 @@
using System;
using Core.Common.Base.Plugin;
-using Core.Common.Gui;
using Core.Common.Gui.Commands;
using Core.Common.Gui.Forms.MainWindow;
using NUnit.Extensions.Forms;
Index: Core/Components/test/Core.Components.DotSpatial.Forms.Test/Properties/AssemblyInfo.cs
===================================================================
diff -u -rae34e25064174cb82307bbd514ef3d37bf49586b -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Components/test/Core.Components.DotSpatial.Forms.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision ae34e25064174cb82307bbd514ef3d37bf49586b)
+++ Core/Components/test/Core.Components.DotSpatial.Forms.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
Index: Core/Components/test/Core.Components.Gis.Test/Properties/AssemblyInfo.cs
===================================================================
diff -u -rf612f81e3d6435ddd1a9c571738aab54e6048a9e -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Components/test/Core.Components.Gis.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision f612f81e3d6435ddd1a9c571738aab54e6048a9e)
+++ Core/Components/test/Core.Components.Gis.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
Index: Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendController.cs
===================================================================
diff -u -r6a644d66b282d1c0cb1625cf2322f1e67148556d -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendController.cs (.../LegendController.cs) (revision 6a644d66b282d1c0cb1625cf2322f1e67148556d)
+++ Core/Plugins/src/Core.Plugins.OxyPlot/Legend/LegendController.cs (.../LegendController.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -23,7 +23,6 @@
using Core.Common.Controls.Views;
using Core.Common.Gui;
using Core.Components.Charting.Data;
-using Core.Components.OxyPlot.Forms;
namespace Core.Plugins.OxyPlot.Legend
{
Index: Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs
===================================================================
diff -u -rf4a633bf7b75c0e25f0c5bcd600df6def184962c -r64d5609bb2912cd52dc74deffdd189222e240599
--- Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs (.../UrlPropertiesTest.cs) (revision f4a633bf7b75c0e25f0c5bcd600df6def184962c)
+++ Core/Plugins/test/Core.Plugins.CommonTools.Test/Property/UrlPropertiesTest.cs (.../UrlPropertiesTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
-using Core.Common.Gui;
using Core.Common.Gui.PropertyBag;
using Core.Common.Utils;
using Core.Plugins.CommonTools.Property;
Index: Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs
===================================================================
diff -u -r0c64d8a6c718c0aa67403a16c94dd0c10f862455 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs (.../DemoProjectGuiPlugin.cs) (revision 0c64d8a6c718c0aa67403a16c94dd0c10f862455)
+++ Demo/Ringtoets/src/Demo.Ringtoets/GUIs/DemoProjectGuiPlugin.cs (.../DemoProjectGuiPlugin.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,5 +1,4 @@
-using Core.Common.Gui;
-using Core.Common.Gui.Forms;
+using Core.Common.Gui.Forms;
using Core.Common.Gui.Plugin;
namespace Demo.Ringtoets.GUIs
Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs
===================================================================
diff -u -r0a94ed42cb943659d68be2ce6fb430f8f29fc3f3 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 0a94ed42cb943659d68be2ce6fb430f8f29fc3f3)
+++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using System.IO;
using System.Linq;
using Core.Common.Base;
@@ -11,7 +10,6 @@
using NUnit.Framework;
using Rhino.Mocks;
using Ringtoets.Common.Data.Calculation;
-using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.HydraRing.Data;
using Ringtoets.Integration.Data;
@@ -96,7 +94,7 @@
mocks.VerifyAll();
}
- private void AssertCalculationInFailureMechanismSectionResult(PipingCalculationScenario calculation, FailureMechanismSectionResult[] sectionResults)
+ private void AssertCalculationInFailureMechanismSectionResult(PipingCalculationScenario calculation, PipingFailureMechanismSectionResult[] sectionResults)
{
Assert.AreEqual(283, sectionResults.Length);
var sectionResultWithCalculation = sectionResults[22];
Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs
===================================================================
diff -u -r0c64d8a6c718c0aa67403a16c94dd0c10f862455 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs (.../DemoProjectGuiPluginTest.cs) (revision 0c64d8a6c718c0aa67403a16c94dd0c10f862455)
+++ Demo/Ringtoets/test/Demo.Ringtoets.Test/GUIs/DemoProjectGuiPluginTest.cs (.../DemoProjectGuiPluginTest.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,5 +1,4 @@
-using Core.Common.Gui;
-using Core.Common.Gui.Forms;
+using Core.Common.Gui.Forms;
using Core.Common.Gui.Plugin;
using Demo.Ringtoets.GUIs;
Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs
===================================================================
diff -u -r266b001fc7fcb405383d2411a970efa735e3c66d -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision 266b001fc7fcb405383d2411a970efa735e3c66d)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismBase.cs (.../FailureMechanismBase.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -37,6 +37,7 @@
{
private readonly List sections;
private double contribution;
+ private readonly IList sectionResults;
///
/// Creates a new instance of the class.
@@ -56,7 +57,7 @@
Name = failureMechanismName;
Code = failureMechanismCode;
sections = new List();
- SectionResults = new List();
+ sectionResults = new List();
IsRelevant = true;
}
@@ -93,7 +94,13 @@
///
/// Gets the failure mechanism section results.
///
- public IList SectionResults { get; private set; }
+ public IEnumerable SectionResults
+ {
+ get
+ {
+ return sectionResults;
+ }
+ }
public long StorageId { get; set; }
@@ -117,15 +124,15 @@
InsertSectionWhileMaintainingConnectivityOrder(section);
}
- SectionResults.Add(CreateFailureMechanismSectionResult(section));
+ sectionResults.Add(CreateFailureMechanismSectionResult(section));
}
protected abstract T CreateFailureMechanismSectionResult(FailureMechanismSection section);
public void ClearAllSections()
{
sections.Clear();
- SectionResults.Clear();
+ sectionResults.Clear();
}
private static void ValidateParameters(string failureMechanismName, string failureMechanismCode)
Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs
===================================================================
diff -u -rb1c2f3f896147de67d46fde3bce9098d94054037 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision b1c2f3f896147de67d46fde3bce9098d94054037)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -1,30 +1,5 @@
-// Copyright (C) Stichting Deltares 2016. All rights reserved.
-//
-// This file is part of Ringtoets.
-//
-// Ringtoets is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see .
-//
-// All names, logos, and references to "Deltares" are registered trademarks of
-// Stichting Deltares and remain full property of Stichting Deltares at all times.
-// All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
+using System;
using Core.Common.Base;
-using Core.Common.Base.Data;
-using Ringtoets.Common.Data.Calculation;
namespace Ringtoets.Common.Data.FailureMechanism
{
@@ -33,8 +8,6 @@
///
public class FailureMechanismSectionResult : Observable
{
- private readonly FailureMechanismSection section;
-
///
/// Creates a new instance of .
///
@@ -46,108 +19,12 @@
{
throw new ArgumentNullException("section");
}
- this.section = section;
- CalculationScenarios = new List();
+ Section = section;
}
///
/// Gets the encapsulated .
///
- public FailureMechanismSection Section
- {
- get
- {
- return section;
- }
- }
-
- ///
- /// Gets or sets the state of the assessment layer one.
- ///
- public bool AssessmentLayerOne { get; set; }
-
- ///
- /// Gets the value of assessment layer two a.
- ///
- public RoundedDouble AssessmentLayerTwoA
- {
- get
- {
- return CalculationScenarios.Where(cs => cs.IsRelevant && cs.CalculationScenarioStatus == CalculationScenarioStatus.Done)
- .Aggregate((RoundedDouble) 0.0, (current, scenario) => (current + scenario.Contribution * scenario.Probability));
- }
- }
-
- ///
- /// Gets or sets the value of assessment layer two b.
- ///
- public RoundedDouble AssessmentLayerTwoB { get; set; }
-
- ///
- /// Gets or sets the value of assessment layer three.
- ///
- public RoundedDouble AssessmentLayerThree { get; set; }
-
- ///
- /// Gets the contribution of all relevant together.
- ///
- public RoundedDouble TotalContribution
- {
- get
- {
- return (RoundedDouble) CalculationScenarios.Where(cs => cs.IsRelevant)
- .Aggregate(0, (current, calculationScenario) => current + calculationScenario.Contribution);
- }
- }
-
- ///
- /// Gets a list of .
- ///
- public List CalculationScenarios { get; private set; }
-
- ///
- /// Gets the status of the section result depending on the calculation scenarios.
- ///
- public CalculationScenarioStatus CalculationScenarioStatus
- {
- get
- {
- return GetCalculationStatus();
- }
- }
-
- private CalculationScenarioStatus GetCalculationStatus()
- {
- bool failed = false;
- bool notCalculated = false;
- foreach (var calculationScenario in CalculationScenarios.Where(cs => cs.IsRelevant))
- {
- switch (calculationScenario.CalculationScenarioStatus)
- {
- case CalculationScenarioStatus.Failed:
- failed = true;
- break;
- case CalculationScenarioStatus.NotCalculated:
- notCalculated = true;
- break;
- case CalculationScenarioStatus.Done:
- continue;
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- if (failed)
- {
- return CalculationScenarioStatus.Failed;
- }
-
- if (notCalculated)
- {
- return CalculationScenarioStatus.NotCalculated;
- }
-
- return CalculationScenarioStatus.Done;
- }
+ public FailureMechanismSection Section { get; private set; }
}
}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/PipingFailureMechanismSectionResult.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/PipingFailureMechanismSectionResult.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/PipingFailureMechanismSectionResult.cs (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -0,0 +1,135 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Core.Common.Base.Data;
+using Ringtoets.Common.Data.Calculation;
+
+namespace Ringtoets.Common.Data.FailureMechanism
+{
+ ///
+ /// This class holds the information of the result of the
+ /// for a piping assessment.
+ ///
+ public class PipingFailureMechanismSectionResult : FailureMechanismSectionResult
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The to get the result from.
+ /// Thrown when is null.
+ public PipingFailureMechanismSectionResult(FailureMechanismSection section) : base(section)
+ {
+ CalculationScenarios = new List();
+ }
+
+ ///
+ /// Gets or sets the state of the assessment layer one.
+ ///
+ public bool AssessmentLayerOne { get; set; }
+
+ ///
+ /// Gets the value of assessment layer two a.
+ ///
+ public RoundedDouble AssessmentLayerTwoA
+ {
+ get
+ {
+ return CalculationScenarios.Where(cs => cs.IsRelevant && cs.CalculationScenarioStatus == CalculationScenarioStatus.Done)
+ .Aggregate((RoundedDouble) 0.0, (current, scenario) => (current + scenario.Contribution * scenario.Probability));
+ }
+ }
+
+ ///
+ /// Gets or sets the value of assessment layer two b.
+ ///
+ public RoundedDouble AssessmentLayerTwoB { get; set; }
+
+ ///
+ /// Gets or sets the value of assessment layer three.
+ ///
+ public RoundedDouble AssessmentLayerThree { get; set; }
+
+ ///
+ /// Gets the contribution of all relevant together.
+ ///
+ public RoundedDouble TotalContribution
+ {
+ get
+ {
+ return (RoundedDouble) CalculationScenarios.Where(cs => cs.IsRelevant)
+ .Aggregate(0, (current, calculationScenario) => current + calculationScenario.Contribution);
+ }
+ }
+
+ ///
+ /// Gets a list of .
+ ///
+ public List CalculationScenarios { get; private set; }
+
+ ///
+ /// Gets the status of the section result depending on the calculation scenarios.
+ ///
+ public CalculationScenarioStatus CalculationScenarioStatus
+ {
+ get
+ {
+ return GetCalculationStatus();
+ }
+ }
+
+ private CalculationScenarioStatus GetCalculationStatus()
+ {
+ bool failed = false;
+ bool notCalculated = false;
+ foreach (var calculationScenario in CalculationScenarios.Where(cs => cs.IsRelevant))
+ {
+ switch (calculationScenario.CalculationScenarioStatus)
+ {
+ case CalculationScenarioStatus.Failed:
+ failed = true;
+ break;
+ case CalculationScenarioStatus.NotCalculated:
+ notCalculated = true;
+ break;
+ case CalculationScenarioStatus.Done:
+ continue;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+ }
+
+ if (failed)
+ {
+ return CalculationScenarioStatus.Failed;
+ }
+
+ if (notCalculated)
+ {
+ return CalculationScenarioStatus.NotCalculated;
+ }
+
+ return CalculationScenarioStatus.Done;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj
===================================================================
diff -u -r0a94ed42cb943659d68be2ce6fb430f8f29fc3f3 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 0a94ed42cb943659d68be2ce6fb430f8f29fc3f3)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -49,10 +49,10 @@
+
-
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs
===================================================================
diff -u -r266b001fc7fcb405383d2411a970efa735e3c66d -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision 266b001fc7fcb405383d2411a970efa735e3c66d)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/FailureMechanismSectionResultContext.cs (.../FailureMechanismSectionResultContext.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -33,7 +33,7 @@
///
/// Creates a new instance of .
///
- /// The of to wrap.
+ /// The of to wrap.
/// The belongs to.
/// Thrown when or is null.
public FailureMechanismSectionResultContext(IEnumerable sectionResults, IFailureMechanism failureMechanism)
@@ -51,7 +51,7 @@
}
///
- /// Gets the wrapped of .
+ /// Gets the wrapped of .
///
public IEnumerable SectionResults { get; private set; }
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs
===================================================================
diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision a9aafffab97152303562110b1d789bacb465ce24)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/ReferenceLineContext.cs (.../ReferenceLineContext.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -21,7 +21,6 @@
using System;
using Core.Common.Base;
-using Ringtoets.Common.Data;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Forms.Properties;
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs
===================================================================
diff -u -rd49b0c7df08ca616edb5c3945adbb22eab479bf7 -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision d49b0c7df08ca616edb5c3945adbb22eab479bf7)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -33,7 +33,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.dataGridView);
- this.Name = "FailureMechanismResultView";
+ this.Name = "PipingFailureMechanismResultView";
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs
===================================================================
diff -u -r266b001fc7fcb405383d2411a970efa735e3c66d -r64d5609bb2912cd52dc74deffdd189222e240599
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 266b001fc7fcb405383d2411a970efa735e3c66d)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599)
@@ -21,40 +21,30 @@
using System;
using System.Collections.Generic;
-using System.Drawing;
-using System.Globalization;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
-using Core.Common.Base.Data;
using Core.Common.Controls.Views;
-using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Forms.Properties;
using CoreCommonResources = Core.Common.Base.Properties.Resources;
namespace Ringtoets.Common.Forms.Views
{
///
- /// The view for the .
+ /// The view for the .
///
public partial class FailureMechanismResultView : UserControl, IView
{
private const double tolerance = 1e-6;
private readonly Observer failureMechanismObserver;
private readonly RecursiveObserver, FailureMechanismSectionResult> failureMechanismSectionResultObserver;
- private readonly RecursiveObserver calculationInputObserver;
- private readonly RecursiveObserver calculationOutputObserver;
- private readonly RecursiveObserver calculationGroupObserver;
private IEnumerable failureMechanismSectionResult;
private FailureMechanismBase failureMechanism;
- private DataGridViewTextBoxColumn assessmentLayerTwoA;
- private DataGridViewTextBoxColumn assessmentLayerTwoB;
- private DataGridViewTextBoxColumn assessmentLayerThree;
///
- /// Creates a new instance of .
+ /// Creates a new instance of .
///
public FailureMechanismResultView()
{
@@ -63,11 +53,6 @@
failureMechanismObserver = new Observer(UpdataDataGridViewDataSource);
failureMechanismSectionResultObserver = new RecursiveObserver, FailureMechanismSectionResult>(RefreshDataGridView, mechanism => mechanism.SectionResults);
- // The concat is needed to observe the input of calculations in child groups.
- calculationInputObserver = new RecursiveObserver(UpdataDataGridViewDataSource, cg => cg.Children.Concat