Index: Ringtoets.sln =================================================================== diff -u -racde3d5eaa5133dc7061cbf155670c68eddc969b -r8e2e40eeaf74a81592349e4ba75a14f45c9917e2 --- Ringtoets.sln (.../Ringtoets.sln) (revision acde3d5eaa5133dc7061cbf155670c68eddc969b) +++ Ringtoets.sln (.../Ringtoets.sln) (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -288,7 +288,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{88E04195-C43E-40D3-B5F2-3A25E1E79E03}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Data", "Ringtoets\Integration\src\Ringtoets.Integration.Data\Riskeer.Integration.Data.csproj", "{11F1F874-45AF-43E4-8AE5-15A5C9593E28}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Data", "Ringtoets\Integration\src\Riskeer.Integration.Data\Riskeer.Integration.Data.csproj", "{11F1F874-45AF-43E4-8AE5-15A5C9593E28}" ProjectSection(ProjectDependencies) = postProject {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} EndProjectSection Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Assembly/AssessmentSectionAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Assembly/AssessmentSectionHelper.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Assembly/CombinedAssemblyFailureMechanismSectionFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResultFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/AssessmentSection.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Merge/AssessmentSectionMergeData.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Merge/AssessmentSectionsOwner.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.Designer.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Properties/Resources.resx'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/RingtoetsProject.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/RingtoetsProjectFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/Riskeer.Integration.Data.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/MacroStabilityOutwardsFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/MicrostabilityFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/TechnicalInnovationFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/AssemblyFactories/WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/GrassCoverSlipOffInwardsFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/GrassCoverSlipOffOutwardsFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/Input/MacroStabilityOutwardsProbabilityAssessmentInput.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/MacroStabilityOutwardsFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/MicrostabilityFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacroStabilityOutwardsFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/StrengthStabilityLengthwiseConstructionFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/TechnicalInnovationFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8e2e40eeaf74a81592349e4ba75a14f45c9917e2 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/WaterPressureAsphaltCoverFailureMechanism.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,240 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.AssemblyFactories; + +namespace Riskeer.Integration.Data.Assembly +{ + /// + /// Factory for assembling the assembly results for an assessment section. + /// + public static class AssessmentSectionAssemblyFactory + { + /// + /// Assembles the results of the failure mechanisms with probability within the assessment sections. + /// + /// The assessment section which contains the failure mechanisms to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when cannot be created. + public static FailureMechanismAssembly AssembleFailureMechanismsWithProbability(AssessmentSection assessmentSection, + bool useManual) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + try + { + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IAssessmentSectionAssemblyCalculator calculator = + calculatorFactory.CreateAssessmentSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + FailureMechanismContribution failureMechanismContribution = assessmentSection.FailureMechanismContribution; + return calculator.AssembleFailureMechanisms(GetFailureMechanismWithProbabilityAssemblyResults(assessmentSection, useManual), + failureMechanismContribution.SignalingNorm, + failureMechanismContribution.LowerLimitNorm, + assessmentSection.FailureProbabilityMarginFactor); + } + catch (AssessmentSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(Resources.AssessmentSectionAssemblyFactory_Error_while_assembling_failureMechanims, e); + } + } + + /// + /// Assembles the results of failure mechanisms without probability within the assessment section. + /// + /// The assessment section which contains the failure mechanisms to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when cannot be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanismsWithoutProbability(AssessmentSection assessmentSection, + bool useManual) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + try + { + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IAssessmentSectionAssemblyCalculator calculator = + calculatorFactory.CreateAssessmentSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.AssembleFailureMechanisms(GetFailureMechanismsWithoutProbabilityAssemblyResults(assessmentSection, + useManual)); + } + catch (AssessmentSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(Resources.AssessmentSectionAssemblyFactory_Error_while_assembling_failureMechanims, e); + } + } + + /// + /// Assembles the assessment section. + /// + /// The assessment section which contains the failure mechanisms to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when cannot be created. + public static AssessmentSectionAssemblyCategoryGroup AssembleAssessmentSection(AssessmentSection assessmentSection, + bool useManual) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + try + { + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IAssessmentSectionAssemblyCalculator calculator = + calculatorFactory.CreateAssessmentSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.AssembleAssessmentSection(AssembleFailureMechanismsWithoutProbability(assessmentSection, useManual), + AssembleFailureMechanismsWithProbability(assessmentSection, useManual)); + } + catch (AssessmentSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined failure mechanism sections. + /// + /// The assessment section that contains all + /// the failure mechanism sections to assemble. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A collection of . + /// Thrown when + /// is null. + /// Thrown when a + /// cannot be created. + public static IEnumerable AssembleCombinedPerFailureMechanismSection(AssessmentSection assessmentSection, + bool useManual) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + try + { + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IAssessmentSectionAssemblyCalculator calculator = + calculatorFactory.CreateAssessmentSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + Dictionary relevantFailureMechanisms = assessmentSection.GetFailureMechanisms() + .Where(fm => fm.IsRelevant) + .Select((fm, i) => new + { + FailureMechanism = fm, + Index = i + }) + .ToDictionary(x => x.FailureMechanism, x => x.Index); + + IEnumerable output = calculator.AssembleCombinedFailureMechanismSections( + CombinedAssemblyFailureMechanismSectionFactory.CreateInput(assessmentSection, relevantFailureMechanisms.Keys, useManual), + assessmentSection.ReferenceLine.Length); + + return CombinedFailureMechanismSectionAssemblyResultFactory.Create(output, relevantFailureMechanisms, assessmentSection); + } + catch (AssessmentSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(Resources.AssessmentSectionAssemblyFactory_Error_while_assembling_failureMechanims, e); + } + } + + private static IEnumerable GetFailureMechanismWithProbabilityAssemblyResults(AssessmentSection assessmentSection, + bool useManual) + { + return new[] + { + GrassCoverErosionInwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.GrassCoverErosionInwards, assessmentSection, useManual), + HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.HeightStructures, assessmentSection, useManual), + ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.ClosingStructures, assessmentSection, useManual), + StabilityPointStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.StabilityPointStructures, assessmentSection, useManual), + PipingFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.Piping, assessmentSection, useManual), + MacroStabilityInwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.MacroStabilityInwards, assessmentSection, useManual) + }; + } + + private static IEnumerable GetFailureMechanismsWithoutProbabilityAssemblyResults(AssessmentSection assessmentSection, + bool useManual) + { + return new[] + { + StabilityStoneCoverFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.StabilityStoneCover, useManual), + WaveImpactAsphaltCoverFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.WaveImpactAsphaltCover, useManual), + GrassCoverErosionOutwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.GrassCoverErosionOutwards, useManual), + DuneErosionFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.DuneErosion, useManual), + MacroStabilityOutwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.MacroStabilityOutwards, assessmentSection, useManual), + MicrostabilityFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.Microstability, useManual), + WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.WaterPressureAsphaltCover, useManual), + GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.GrassCoverSlipOffOutwards, useManual), + GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.GrassCoverSlipOffInwards, useManual), + PipingStructureFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.PipingStructure, useManual), + StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.StrengthStabilityLengthwiseConstruction, useManual), + TechnicalInnovationFailureMechanismAssemblyFactory.AssembleFailureMechanism(assessmentSection.TechnicalInnovation, useManual) + }; + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionHelper.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionHelper.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/AssessmentSectionHelper.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,55 @@ +// Copyright (C) Stichting Deltares 2018. 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.Linq; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.FailureMechanism; + +namespace Riskeer.Integration.Data.Assembly +{ + /// + /// Class containing helper methods for . + /// + public static class AssessmentSectionHelper + { + /// + /// Determines whether the assessment section has section assembly results that are manually overwritten. + /// + /// The . + /// true if the assessment section contains section assembly results that are manually overwritten, + /// false otherwise. + /// Thrown when is null. + /// Thrown when contains failure mechanisms + /// that do not implement . + public static bool HasManualAssemblyResults(AssessmentSection assessmentSection) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + return assessmentSection.GetFailureMechanisms() + .Cast>() + .Any(fm => fm.IsRelevant && HasSectionResultsHelper.HasManualAssemblyResults(fm)); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedAssemblyFailureMechanismSectionFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedAssemblyFailureMechanismSectionFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedAssemblyFailureMechanismSectionFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,404 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Riskeer.AssemblyTool.Data; +using Riskeer.Integration.Data.StandAlone; +using Riskeer.Integration.Data.StandAlone.AssemblyFactories; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.Assembly +{ + /// + /// Factory that creates instances. + /// + internal static class CombinedAssemblyFailureMechanismSectionFactory + { + /// + /// Creates a collection of collections. + /// + /// The assessment section to use. + /// The failure mechanisms to build input for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A collection of collections. + /// Thrown when any parameter is null. + public static IEnumerable> CreateInput(AssessmentSection assessmentSection, + IEnumerable failureMechanisms, + bool useManual) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + if (failureMechanisms == null) + { + throw new ArgumentNullException(nameof(failureMechanisms)); + } + + var inputs = new List>(); + + PipingFailureMechanism pipingFailureMechanism = assessmentSection.Piping; + if (failureMechanisms.Contains(pipingFailureMechanism)) + { + inputs.Add(CreateCombinedSections(pipingFailureMechanism.SectionResults, + assessmentSection, PipingAssemblyFunc, useManual)); + } + + GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwardsFailureMechanism = assessmentSection.GrassCoverErosionInwards; + if (failureMechanisms.Contains(grassCoverErosionInwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(grassCoverErosionInwardsFailureMechanism.SectionResults, + assessmentSection, GrassCoverErosionInwardsAssemblyFunc, useManual)); + } + + MacroStabilityInwardsFailureMechanism macroStabilityInwardsFailureMechanism = assessmentSection.MacroStabilityInwards; + if (failureMechanisms.Contains(macroStabilityInwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(macroStabilityInwardsFailureMechanism.SectionResults, + assessmentSection, MacroStabilityInwardsAssemblyFunc, useManual)); + } + + MacroStabilityOutwardsFailureMechanism macroStabilityOutwardsFailureMechanism = assessmentSection.MacroStabilityOutwards; + if (failureMechanisms.Contains(macroStabilityOutwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(macroStabilityOutwardsFailureMechanism.SectionResults, + assessmentSection, MacroStabilityOutwardsAssemblyFunc, useManual)); + } + + MicrostabilityFailureMechanism microstabilityFailureMechanism = assessmentSection.Microstability; + if (failureMechanisms.Contains(microstabilityFailureMechanism)) + { + inputs.Add(CreateCombinedSections(microstabilityFailureMechanism.SectionResults, + MicrostabilityAssemblyFunc, useManual)); + } + + StabilityStoneCoverFailureMechanism stabilityStoneCoverFailureMechanism = assessmentSection.StabilityStoneCover; + if (failureMechanisms.Contains(stabilityStoneCoverFailureMechanism)) + { + inputs.Add(CreateCombinedSections(stabilityStoneCoverFailureMechanism.SectionResults, + StabilityStoneCoverAssemblyFunc, useManual)); + } + + WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCoverFailureMechanism = assessmentSection.WaveImpactAsphaltCover; + if (failureMechanisms.Contains(waveImpactAsphaltCoverFailureMechanism)) + { + inputs.Add(CreateCombinedSections(waveImpactAsphaltCoverFailureMechanism.SectionResults, + WaveImpactAsphaltCoverAssemblyFunc, useManual)); + } + + WaterPressureAsphaltCoverFailureMechanism waterPressureAsphaltCoverFailureMechanism = assessmentSection.WaterPressureAsphaltCover; + if (failureMechanisms.Contains(waterPressureAsphaltCoverFailureMechanism)) + { + inputs.Add(CreateCombinedSections(waterPressureAsphaltCoverFailureMechanism.SectionResults, + WaterPressureAsphaltCoverAssemblyFunc, useManual)); + } + + GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwardsFailureMechanism = assessmentSection.GrassCoverErosionOutwards; + if (failureMechanisms.Contains(grassCoverErosionOutwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(grassCoverErosionOutwardsFailureMechanism.SectionResults, + GrassCoverErosionOutwardsAssemblyFunc, useManual)); + } + + GrassCoverSlipOffOutwardsFailureMechanism grassCoverSlipOffOutwardsFailureMechanism = assessmentSection.GrassCoverSlipOffOutwards; + if (failureMechanisms.Contains(grassCoverSlipOffOutwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(grassCoverSlipOffOutwardsFailureMechanism.SectionResults, + GrassCoverSlipOffOutwardsAssemblyFunc, useManual)); + } + + GrassCoverSlipOffInwardsFailureMechanism grassCoverSlipOffInwardsFailureMechanism = assessmentSection.GrassCoverSlipOffInwards; + if (failureMechanisms.Contains(grassCoverSlipOffInwardsFailureMechanism)) + { + inputs.Add(CreateCombinedSections(grassCoverSlipOffInwardsFailureMechanism.SectionResults, + GrassCoverSlipOffInwardsAssemblyFunc, useManual)); + } + + HeightStructuresFailureMechanism heightStructuresFailureMechanism = assessmentSection.HeightStructures; + if (failureMechanisms.Contains(heightStructuresFailureMechanism)) + { + inputs.Add(CreateCombinedSections(heightStructuresFailureMechanism.SectionResults, + assessmentSection, HeightStructuresAssemblyFunc, useManual)); + } + + ClosingStructuresFailureMechanism closingStructuresFailureMechanism = assessmentSection.ClosingStructures; + if (failureMechanisms.Contains(closingStructuresFailureMechanism)) + { + inputs.Add(CreateCombinedSections(closingStructuresFailureMechanism.SectionResults, + assessmentSection, ClosingStructuresAssemblyFunc, useManual)); + } + + PipingStructureFailureMechanism pipingStructureFailureMechanism = assessmentSection.PipingStructure; + if (failureMechanisms.Contains(pipingStructureFailureMechanism)) + { + inputs.Add(CreateCombinedSections(pipingStructureFailureMechanism.SectionResults, + PipingStructureAssemblyFunc, useManual)); + } + + StabilityPointStructuresFailureMechanism stabilityPointStructuresFailureMechanism = assessmentSection.StabilityPointStructures; + if (failureMechanisms.Contains(stabilityPointStructuresFailureMechanism)) + { + inputs.Add(CreateCombinedSections(stabilityPointStructuresFailureMechanism.SectionResults, + assessmentSection, StabilityPointStructuresAssemblyFunc, useManual)); + } + + StrengthStabilityLengthwiseConstructionFailureMechanism strengthStabilityLengthwiseConstructionFailureMechanism = assessmentSection.StrengthStabilityLengthwiseConstruction; + if (failureMechanisms.Contains(strengthStabilityLengthwiseConstructionFailureMechanism)) + { + inputs.Add(CreateCombinedSections(strengthStabilityLengthwiseConstructionFailureMechanism.SectionResults, + StrengthStabilityLengthwiseConstructionAssemblyFunc, useManual)); + } + + DuneErosionFailureMechanism duneErosionFailureMechanism = assessmentSection.DuneErosion; + if (failureMechanisms.Contains(duneErosionFailureMechanism)) + { + inputs.Add(CreateCombinedSections(duneErosionFailureMechanism.SectionResults, + DuneErosionAssemblyFunc, useManual)); + } + + TechnicalInnovationFailureMechanism technicalInnovationFailureMechanism = assessmentSection.TechnicalInnovation; + if (failureMechanisms.Contains(technicalInnovationFailureMechanism)) + { + inputs.Add(CreateCombinedSections(technicalInnovationFailureMechanism.SectionResults, + TechnicalInnovationAssemblyFunc, useManual)); + } + + return inputs; + } + + private static IEnumerable CreateCombinedSections( + IEnumerable sectionResults, + AssessmentSection assessmentSection, + Func getAssemblyFunc, + bool useManual) + where TFailureMechanismSectionResult : FailureMechanismSectionResult + { + double totalSectionsLength = 0; + + return sectionResults.Select(sectionResult => + { + CombinedAssemblyFailureMechanismSection section = CreateSection(sectionResult, + getAssemblyFunc(sectionResult, + assessmentSection, + useManual), + totalSectionsLength); + totalSectionsLength = section.SectionEnd; + return section; + }) + .ToArray(); + } + + private static IEnumerable CreateCombinedSections( + IEnumerable sectionResults, + Func getAssemblyFunc, + bool useManual) + where TFailureMechanismSectionResult : FailureMechanismSectionResult + { + double totalSectionsLength = 0; + + return sectionResults.Select(sectionResult => + { + CombinedAssemblyFailureMechanismSection section = CreateSection(sectionResult, getAssemblyFunc(sectionResult, useManual), totalSectionsLength); + totalSectionsLength = section.SectionEnd; + return section; + }) + .ToArray(); + } + + private static CombinedAssemblyFailureMechanismSection CreateSection( + TFailureMechanismSectionResult sectionResult, FailureMechanismSectionAssemblyCategoryGroup assemblyCategoryGroup, + double sectionStart) + where TFailureMechanismSectionResult : FailureMechanismSectionResult + { + double sectionEnd = sectionResult.Section.Length + sectionStart; + return new CombinedAssemblyFailureMechanismSection(sectionStart, sectionEnd, assemblyCategoryGroup); + } + + #region Assembly Funcs + + private static Func PipingAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => PipingFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.Piping, assessmentSection, useManual); + } + } + + private static Func GrassCoverErosionInwardsAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => GrassCoverErosionInwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.GrassCoverErosionInwards, assessmentSection, useManual); + } + } + + private static Func MacroStabilityInwardsAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => MacroStabilityInwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.MacroStabilityInwards, assessmentSection, useManual); + } + } + + private static Func MacroStabilityOutwardsAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => MacroStabilityOutwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.MacroStabilityOutwards, assessmentSection, useManual); + } + } + + private static Func MicrostabilityAssemblyFunc + { + get + { + return MicrostabilityFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func StabilityStoneCoverAssemblyFunc + { + get + { + return StabilityStoneCoverFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func WaveImpactAsphaltCoverAssemblyFunc + { + get + { + return WaveImpactAsphaltCoverFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func WaterPressureAsphaltCoverAssemblyFunc + { + get + { + return WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func GrassCoverErosionOutwardsAssemblyFunc + { + get + { + return GrassCoverErosionOutwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func GrassCoverSlipOffOutwardsAssemblyFunc + { + get + { + return GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func GrassCoverSlipOffInwardsAssemblyFunc + { + get + { + return GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func HeightStructuresAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.HeightStructures, assessmentSection, useManual); + } + } + + private static Func ClosingStructuresAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.ClosingStructures, assessmentSection, useManual); + } + } + + private static Func PipingStructureAssemblyFunc + { + get + { + return PipingStructureFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func StabilityPointStructuresAssemblyFunc + { + get + { + return (sectionResult, assessmentSection, useManual) => StabilityPointStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, assessmentSection.StabilityPointStructures, assessmentSection, useManual); + } + } + + private static Func StrengthStabilityLengthwiseConstructionAssemblyFunc + { + get + { + return StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func DuneErosionAssemblyFunc + { + get + { + return DuneErosionFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + private static Func TechnicalInnovationAssemblyFunc + { + get + { + return TechnicalInnovationFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup; + } + } + + #endregion + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,311 @@ +// Copyright (C) Stichting Deltares 2018. 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 Riskeer.AssemblyTool.Data; + +namespace Riskeer.Integration.Data.Assembly +{ + /// + /// Assembly result for the combined failure mechanism section. + /// + public class CombinedFailureMechanismSectionAssemblyResult + { + /// + /// Creates a new instance of . + /// + /// The number of the section. + /// The start of the section from the beginning of the reference line + /// in meters. + /// The end of the section from the beginning of the reference line + /// in meters. + /// The total result of the section. + /// The container of the properties for the + /// . + /// Thrown when + /// is null. + public CombinedFailureMechanismSectionAssemblyResult(int sectionNumber, double sectionStart, double sectionEnd, + FailureMechanismSectionAssemblyCategoryGroup totalResult, + ConstructionProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + SectionNumber = sectionNumber; + SectionStart = sectionStart; + SectionEnd = sectionEnd; + TotalResult = totalResult; + Piping = properties.Piping; + GrassCoverErosionInwards = properties.GrassCoverErosionInwards; + MacroStabilityInwards = properties.MacroStabilityInwards; + MacroStabilityOutwards = properties.MacroStabilityOutwards; + Microstability = properties.Microstability; + StabilityStoneCover = properties.StabilityStoneCover; + WaveImpactAsphaltCover = properties.WaveImpactAsphaltCover; + WaterPressureAsphaltCover = properties.WaterPressureAsphaltCover; + GrassCoverErosionOutwards = properties.GrassCoverErosionOutwards; + GrassCoverSlipOffOutwards = properties.GrassCoverSlipOffOutwards; + GrassCoverSlipOffInwards = properties.GrassCoverSlipOffInwards; + HeightStructures = properties.HeightStructures; + ClosingStructures = properties.ClosingStructures; + PipingStructure = properties.PipingStructure; + StabilityPointStructures = properties.StabilityPointStructures; + StrengthStabilityLengthwiseConstruction = properties.StrengthStabilityLengthwiseConstruction; + DuneErosion = properties.DuneErosion; + TechnicalInnovation = properties.TechnicalInnovation; + } + + /// + /// Gets the number of the section. + /// + public int SectionNumber { get; } + + /// + /// Gets the start of the section from the beginning of the reference line. + /// [m] + /// + public double SectionStart { get; } + + /// + /// Gets the end of the section from the beginning of the reference line. + /// [m] + /// + public double SectionEnd { get; } + + /// + /// Gets the total assembly result. + /// + public FailureMechanismSectionAssemblyCategoryGroup TotalResult { get; } + + /// + /// Gets the assembly result for piping. + /// + public FailureMechanismSectionAssemblyCategoryGroup Piping { get; } + + /// + /// Gets the assembly result for grass cover erosion inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionInwards { get; } + + /// + /// Gets the assembly result for macro stability inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityInwards { get; } + + /// + /// Gets the assembly result for macro stability outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityOutwards { get; } + + /// + /// Gets the assembly result for microstability. + /// + public FailureMechanismSectionAssemblyCategoryGroup Microstability { get; } + + /// + /// Gets the assembly result for stability stone cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityStoneCover { get; } + + /// + /// Gets the assembly result for wave impact asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaveImpactAsphaltCover { get; } + + /// + /// Gets the assembly result for water pressure asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaterPressureAsphaltCover { get; } + + /// + /// Gets the assembly result for grass cover erosion outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionOutwards { get; } + + /// + /// Gets the assembly result for grass cover slip off outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffOutwards { get; } + + /// + /// Gets the assembly result for grass cover slip off inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffInwards { get; } + + /// + /// Gets the assembly result for height structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup HeightStructures { get; } + + /// + /// Gets the assembly result for closing structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup ClosingStructures { get; } + + /// + /// Gets the assembly result for piping structure. + /// + public FailureMechanismSectionAssemblyCategoryGroup PipingStructure { get; } + + /// + /// Gets the assembly result for stability point structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityPointStructures { get; } + + /// + /// Gets the assembly result for strength stability lengthwise construction. + /// + public FailureMechanismSectionAssemblyCategoryGroup StrengthStabilityLengthwiseConstruction { get; } + + /// + /// Gets the assembly result for dune erosion. + /// + public FailureMechanismSectionAssemblyCategoryGroup DuneErosion { get; } + + /// + /// Gets the assembly result for technical innovation. + /// + public FailureMechanismSectionAssemblyCategoryGroup TechnicalInnovation { get; } + + /// + /// Container for properties for constructing a . + /// s + public class ConstructionProperties + { + /// + /// Creates a new instance of . + /// + public ConstructionProperties() + { + Piping = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverErosionInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + MacroStabilityInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + MacroStabilityOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + Microstability = FailureMechanismSectionAssemblyCategoryGroup.None; + StabilityStoneCover = FailureMechanismSectionAssemblyCategoryGroup.None; + WaveImpactAsphaltCover = FailureMechanismSectionAssemblyCategoryGroup.None; + WaterPressureAsphaltCover = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverErosionOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverSlipOffOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverSlipOffInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + HeightStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + ClosingStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + PipingStructure = FailureMechanismSectionAssemblyCategoryGroup.None; + StabilityPointStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + StrengthStabilityLengthwiseConstruction = FailureMechanismSectionAssemblyCategoryGroup.None; + DuneErosion = FailureMechanismSectionAssemblyCategoryGroup.None; + TechnicalInnovation = FailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the assembly result for piping. + /// + public FailureMechanismSectionAssemblyCategoryGroup Piping { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover erosion inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for macro stability inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for macro stability outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for microstability. + /// + public FailureMechanismSectionAssemblyCategoryGroup Microstability { internal get; set; } + + /// + /// Gets or sets the assembly result for stability stone cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityStoneCover { internal get; set; } + + /// + /// Gets or sets the assembly result for wave impact asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaveImpactAsphaltCover { internal get; set; } + + /// + /// Gets or sets the assembly result for water pressure asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaterPressureAsphaltCover { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover erosion outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover slip off outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover slip off inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for height structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup HeightStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for closing structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup ClosingStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for piping structure. + /// + public FailureMechanismSectionAssemblyCategoryGroup PipingStructure { internal get; set; } + + /// + /// Gets or sets the assembly result for stability point structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityPointStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for strength stability lengthwise construction. + /// + public FailureMechanismSectionAssemblyCategoryGroup StrengthStabilityLengthwiseConstruction { internal get; set; } + + /// + /// Gets or sets the assembly result for dune erosion. + /// + public FailureMechanismSectionAssemblyCategoryGroup DuneErosion { internal get; set; } + + /// + /// Gets or sets the assembly result for technical innovation. + /// + public FailureMechanismSectionAssemblyCategoryGroup TechnicalInnovation { internal get; set; } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResultFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResultFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Assembly/CombinedFailureMechanismSectionAssemblyResultFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,112 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Riskeer.AssemblyTool.Data; + +namespace Riskeer.Integration.Data.Assembly +{ + /// + /// Factory that creates instances. + /// + internal static class CombinedFailureMechanismSectionAssemblyResultFactory + { + /// + /// Creates a collection of based + /// on the given and . + /// + /// The output to create the results for. + /// The failure mechanisms to create the results for. + /// The assessment section to use while creating the results. + /// A collection of . + /// Thrown when any parameter is null. + public static IEnumerable Create(IEnumerable output, + IDictionary failureMechanisms, + AssessmentSection assessmentSection) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (failureMechanisms == null) + { + throw new ArgumentNullException(nameof(failureMechanisms)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + return output.Select((assembly, sectionNumber) => new CombinedFailureMechanismSectionAssemblyResult( + sectionNumber + 1, + assembly.Section.SectionStart, + assembly.Section.SectionEnd, + assembly.Section.CategoryGroup, + CreateFailureMechanismResults(assembly.FailureMechanismResults, + failureMechanisms, assessmentSection))) + .ToArray(); + } + + private static CombinedFailureMechanismSectionAssemblyResult.ConstructionProperties CreateFailureMechanismResults( + IEnumerable failureMechanismResults, + IDictionary failureMechanisms, + AssessmentSection assessmentSection) + { + var constructionProperties = new CombinedFailureMechanismSectionAssemblyResult.ConstructionProperties + { + Piping = GetCategoryGroup(assessmentSection.Piping, failureMechanisms, failureMechanismResults), + GrassCoverErosionInwards = GetCategoryGroup(assessmentSection.GrassCoverErosionInwards, failureMechanisms, failureMechanismResults), + MacroStabilityInwards = GetCategoryGroup(assessmentSection.MacroStabilityInwards, failureMechanisms, failureMechanismResults), + MacroStabilityOutwards = GetCategoryGroup(assessmentSection.MacroStabilityOutwards, failureMechanisms, failureMechanismResults), + Microstability = GetCategoryGroup(assessmentSection.Microstability, failureMechanisms, failureMechanismResults), + StabilityStoneCover = GetCategoryGroup(assessmentSection.StabilityStoneCover, failureMechanisms, failureMechanismResults), + WaveImpactAsphaltCover = GetCategoryGroup(assessmentSection.WaveImpactAsphaltCover, failureMechanisms, failureMechanismResults), + WaterPressureAsphaltCover = GetCategoryGroup(assessmentSection.WaterPressureAsphaltCover, failureMechanisms, failureMechanismResults), + GrassCoverErosionOutwards = GetCategoryGroup(assessmentSection.GrassCoverErosionOutwards, failureMechanisms, failureMechanismResults), + GrassCoverSlipOffOutwards = GetCategoryGroup(assessmentSection.GrassCoverSlipOffOutwards, failureMechanisms, failureMechanismResults), + GrassCoverSlipOffInwards = GetCategoryGroup(assessmentSection.GrassCoverSlipOffInwards, failureMechanisms, failureMechanismResults), + HeightStructures = GetCategoryGroup(assessmentSection.HeightStructures, failureMechanisms, failureMechanismResults), + ClosingStructures = GetCategoryGroup(assessmentSection.ClosingStructures, failureMechanisms, failureMechanismResults), + PipingStructure = GetCategoryGroup(assessmentSection.PipingStructure, failureMechanisms, failureMechanismResults), + StabilityPointStructures = GetCategoryGroup(assessmentSection.StabilityPointStructures, failureMechanisms, failureMechanismResults), + StrengthStabilityLengthwiseConstruction = GetCategoryGroup(assessmentSection.StrengthStabilityLengthwiseConstruction, failureMechanisms, failureMechanismResults), + DuneErosion = GetCategoryGroup(assessmentSection.DuneErosion, failureMechanisms, failureMechanismResults), + TechnicalInnovation = GetCategoryGroup(assessmentSection.TechnicalInnovation, failureMechanisms, failureMechanismResults) + }; + + return constructionProperties; + } + + private static FailureMechanismSectionAssemblyCategoryGroup GetCategoryGroup(IFailureMechanism failureMechanism, + IDictionary failureMechanisms, + IEnumerable failureMechanismResults) + { + return failureMechanisms.ContainsKey(failureMechanism) + ? failureMechanismResults.ElementAt(failureMechanisms[failureMechanism]) + : FailureMechanismSectionAssemblyCategoryGroup.NotApplicable; + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/AssessmentSection.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/AssessmentSection.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/AssessmentSection.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,752 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using Core.Common.Base; +using Core.Common.Base.Data; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Contribution; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.DuneErosion.Data; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.HeightStructures.Data; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.Piping.Data; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityStoneCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone; + +namespace Riskeer.Integration.Data +{ + /// + /// The section to be assessed by the user for safety in regards of various failure mechanisms. + /// + public sealed class AssessmentSection : Observable, IAssessmentSection + { + private const double defaultNorm = 1.0 / 30000; + private const RingtoetsWellKnownTileSource defaultWellKnownTileSource = RingtoetsWellKnownTileSource.BingAerial; + + private readonly ObservableList waterLevelCalculationsForFactorizedSignalingNorm = new ObservableList(); + private readonly ObservableList waterLevelCalculationsForSignalingNorm = new ObservableList(); + private readonly ObservableList waterLevelCalculationsForLowerLimitNorm = new ObservableList(); + private readonly ObservableList waterLevelCalculationsForFactorizedLowerLimitNorm = new ObservableList(); + private readonly ObservableList waveHeightCalculationsForFactorizedSignalingNorm = new ObservableList(); + private readonly ObservableList waveHeightCalculationsForSignalingNorm = new ObservableList(); + private readonly ObservableList waveHeightCalculationsForLowerLimitNorm = new ObservableList(); + private readonly ObservableList waveHeightCalculationsForFactorizedLowerLimitNorm = new ObservableList(); + + private PipingFailureMechanism piping; + private GrassCoverErosionInwardsFailureMechanism grassCoverErosionInwards; + private MacroStabilityInwardsFailureMechanism macroStabilityInwards; + private MacroStabilityOutwardsFailureMechanism macroStabilityOutwards; + private MicrostabilityFailureMechanism microstability; + private StabilityStoneCoverFailureMechanism stabilityStoneCover; + private WaveImpactAsphaltCoverFailureMechanism waveImpactAsphaltCover; + private WaterPressureAsphaltCoverFailureMechanism waterPressureAsphaltCover; + private GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwards; + private GrassCoverSlipOffOutwardsFailureMechanism grassCoverSlipOffOutwards; + private GrassCoverSlipOffInwardsFailureMechanism grassCoverSlipOffInwards; + private HeightStructuresFailureMechanism heightStructures; + private ClosingStructuresFailureMechanism closingStructures; + private PipingStructureFailureMechanism pipingStructure; + private StabilityPointStructuresFailureMechanism stabilityPointStructures; + private StrengthStabilityLengthwiseConstructionFailureMechanism strengthStabilityLengthwiseConstruction; + private DuneErosionFailureMechanism duneErosion; + private TechnicalInnovationFailureMechanism technicalInnovation; + private RoundedDouble failureProbabilityMarginFactor; + + /// + /// Initializes a new instance of the class. + /// + /// The composition of the assessment section, e.g. what + /// type of elements can be found within the assessment section. + /// The lower limit norm of the assessment section. + /// The signaling norm which of the assessment section. + /// Thrown when: + /// + /// is not in the interval [0.000001, 0.1] or is ; + /// is not in the interval [0.000001, 0.1] or is ; + /// The is larger than . + /// + /// + /// Thrown when + /// is not a valid enum value of . + /// Thrown when + /// is not supported. + public AssessmentSection(AssessmentSectionComposition composition, + double lowerLimitNorm = defaultNorm, + double signalingNorm = defaultNorm) + { + Name = Resources.AssessmentSection_DisplayName; + Comments = new Comment(); + + BackgroundData = new BackgroundData(new WellKnownBackgroundDataConfiguration(defaultWellKnownTileSource)) + { + Name = defaultWellKnownTileSource.GetDisplayName() + }; + + ReferenceLine = new ReferenceLine(); + HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + + piping = new PipingFailureMechanism(); + grassCoverErosionInwards = new GrassCoverErosionInwardsFailureMechanism(); + macroStabilityInwards = new MacroStabilityInwardsFailureMechanism(); + macroStabilityOutwards = new MacroStabilityOutwardsFailureMechanism(); + microstability = new MicrostabilityFailureMechanism(); + stabilityStoneCover = new StabilityStoneCoverFailureMechanism(); + waveImpactAsphaltCover = new WaveImpactAsphaltCoverFailureMechanism(); + waterPressureAsphaltCover = new WaterPressureAsphaltCoverFailureMechanism(); + grassCoverErosionOutwards = new GrassCoverErosionOutwardsFailureMechanism(); + grassCoverSlipOffOutwards = new GrassCoverSlipOffOutwardsFailureMechanism(); + grassCoverSlipOffInwards = new GrassCoverSlipOffInwardsFailureMechanism(); + heightStructures = new HeightStructuresFailureMechanism(); + closingStructures = new ClosingStructuresFailureMechanism(); + stabilityPointStructures = new StabilityPointStructuresFailureMechanism(); + strengthStabilityLengthwiseConstruction = new StrengthStabilityLengthwiseConstructionFailureMechanism(); + pipingStructure = new PipingStructureFailureMechanism(); + duneErosion = new DuneErosionFailureMechanism(); + technicalInnovation = new TechnicalInnovationFailureMechanism(); + OtherFailureMechanism = new OtherFailureMechanism(); + + failureProbabilityMarginFactor = new RoundedDouble(2); + + FailureMechanismContribution = new FailureMechanismContribution(lowerLimitNorm, signalingNorm); + ChangeComposition(composition); + } + + /// + /// Gets or sets the "Dijken en dammen - Piping" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public PipingFailureMechanism Piping + { + get + { + return piping; + } + set + { + ValidateContribution(piping, value); + piping = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Grasbekleding erosie kruin en binnentalud" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public GrassCoverErosionInwardsFailureMechanism GrassCoverErosionInwards + { + get + { + return grassCoverErosionInwards; + } + set + { + ValidateContribution(grassCoverErosionInwards, value); + grassCoverErosionInwards = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Macrostabiliteit binnenwaarts" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public MacroStabilityInwardsFailureMechanism MacroStabilityInwards + { + get + { + return macroStabilityInwards; + } + set + { + ValidateContribution(macroStabilityInwards, value); + macroStabilityInwards = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Macrostabiliteit buitenwaarts" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public MacroStabilityOutwardsFailureMechanism MacroStabilityOutwards + { + get + { + return macroStabilityOutwards; + } + set + { + ValidateContribution(macroStabilityOutwards, value); + macroStabilityOutwards = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Microstabiliteit" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public MicrostabilityFailureMechanism Microstability + { + get + { + return microstability; + } + set + { + ValidateContribution(microstability, value); + microstability = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Stabiliteit steenzetting" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public StabilityStoneCoverFailureMechanism StabilityStoneCover + { + get + { + return stabilityStoneCover; + } + set + { + ValidateContribution(stabilityStoneCover, value); + stabilityStoneCover = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Golfklappen op asfaltbekledingen" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public WaveImpactAsphaltCoverFailureMechanism WaveImpactAsphaltCover + { + get + { + return waveImpactAsphaltCover; + } + set + { + ValidateContribution(waveImpactAsphaltCover, value); + waveImpactAsphaltCover = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Wateroverdruk bij asfaltbekleding" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public WaterPressureAsphaltCoverFailureMechanism WaterPressureAsphaltCover + { + get + { + return waterPressureAsphaltCover; + } + set + { + ValidateContribution(waterPressureAsphaltCover, value); + waterPressureAsphaltCover = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Grasbekleding erosie buitentalud" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public GrassCoverErosionOutwardsFailureMechanism GrassCoverErosionOutwards + { + get + { + return grassCoverErosionOutwards; + } + set + { + ValidateContribution(grassCoverErosionOutwards, value); + grassCoverErosionOutwards = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Grasbekleding afschuiven buitentalud" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public GrassCoverSlipOffOutwardsFailureMechanism GrassCoverSlipOffOutwards + { + get + { + return grassCoverSlipOffOutwards; + } + set + { + ValidateContribution(grassCoverSlipOffOutwards, value); + grassCoverSlipOffOutwards = value; + } + } + + /// + /// Gets or sets the "Dijken en dammen - Grasbekleding afschuiven binnentalud" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public GrassCoverSlipOffInwardsFailureMechanism GrassCoverSlipOffInwards + { + get + { + return grassCoverSlipOffInwards; + } + set + { + ValidateContribution(grassCoverSlipOffInwards, value); + grassCoverSlipOffInwards = value; + } + } + + /// + /// Gets or sets the "Kunstwerken - Hoogte kunstwerk" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public HeightStructuresFailureMechanism HeightStructures + { + get + { + return heightStructures; + } + set + { + ValidateContribution(heightStructures, value); + heightStructures = value; + } + } + + /// + /// Gets or sets the "Kunstwerken - Betrouwbaarheid sluiting kunstwerk" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public ClosingStructuresFailureMechanism ClosingStructures + { + get + { + return closingStructures; + } + set + { + ValidateContribution(closingStructures, value); + closingStructures = value; + } + } + + /// + /// Gets or sets the "Kunstwerken - Piping bij kunstwerk" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public PipingStructureFailureMechanism PipingStructure + { + get + { + return pipingStructure; + } + set + { + ValidateContribution(pipingStructure, value); + pipingStructure = value; + } + } + + /// + /// Gets or sets the "Kunstwerken - Sterkte en stabiliteit puntconstructies" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public StabilityPointStructuresFailureMechanism StabilityPointStructures + { + get + { + return stabilityPointStructures; + } + set + { + ValidateContribution(stabilityPointStructures, value); + stabilityPointStructures = value; + } + } + + /// + /// Gets or sets the "Kunstwerken - Sterkte en stabiliteit langsconstructies" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public StrengthStabilityLengthwiseConstructionFailureMechanism StrengthStabilityLengthwiseConstruction + { + get + { + return strengthStabilityLengthwiseConstruction; + } + set + { + ValidateContribution(strengthStabilityLengthwiseConstruction, value); + strengthStabilityLengthwiseConstruction = value; + } + } + + /// + /// Gets or sets the "Duinwaterkering - Duinafslag" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public DuneErosionFailureMechanism DuneErosion + { + get + { + return duneErosion; + } + set + { + ValidateContribution(duneErosion, value); + duneErosion = value; + } + } + + /// + /// Gets or sets the "Technische innovaties - Technische innovaties" failure mechanism. + /// + /// Thrown when the contribution of + /// is not equal to the contribution of the current failure mechanism. + public TechnicalInnovationFailureMechanism TechnicalInnovation + { + get + { + return technicalInnovation; + } + set + { + ValidateContribution(technicalInnovation, value); + technicalInnovation = value; + } + } + + /// + /// Gets the "Overige" category failure mechanism. + /// + public OtherFailureMechanism OtherFailureMechanism { get; } + + /// + /// Gets the failure probability margin factor. + /// + public RoundedDouble FailureProbabilityMarginFactor + { + get + { + return failureProbabilityMarginFactor; + } + private set + { + failureProbabilityMarginFactor = value.ToPrecision(failureProbabilityMarginFactor.NumberOfDecimalPlaces); + } + } + + public IObservableEnumerable WaterLevelCalculationsForFactorizedSignalingNorm + { + get + { + return waterLevelCalculationsForFactorizedSignalingNorm; + } + } + + public IObservableEnumerable WaterLevelCalculationsForSignalingNorm + { + get + { + return waterLevelCalculationsForSignalingNorm; + } + } + + public IObservableEnumerable WaterLevelCalculationsForLowerLimitNorm + { + get + { + return waterLevelCalculationsForLowerLimitNorm; + } + } + + public IObservableEnumerable WaterLevelCalculationsForFactorizedLowerLimitNorm + { + get + { + return waterLevelCalculationsForFactorizedLowerLimitNorm; + } + } + + public IObservableEnumerable WaveHeightCalculationsForFactorizedSignalingNorm + { + get + { + return waveHeightCalculationsForFactorizedSignalingNorm; + } + } + + public IObservableEnumerable WaveHeightCalculationsForSignalingNorm + { + get + { + return waveHeightCalculationsForSignalingNorm; + } + } + + public IObservableEnumerable WaveHeightCalculationsForLowerLimitNorm + { + get + { + return waveHeightCalculationsForLowerLimitNorm; + } + } + + public IObservableEnumerable WaveHeightCalculationsForFactorizedLowerLimitNorm + { + get + { + return waveHeightCalculationsForFactorizedLowerLimitNorm; + } + } + + public string Id { get; set; } + + public string Name { get; set; } + + public Comment Comments { get; } + + public AssessmentSectionComposition Composition { get; private set; } + + public ReferenceLine ReferenceLine { get; } + + public FailureMechanismContribution FailureMechanismContribution { get; } + + public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; } + + public BackgroundData BackgroundData { get; } + + /// + /// Sets hydraulic boundary location calculations for . + /// + /// The hydraulic boundary locations to add calculations for. + /// Thrown when is null. + public void SetHydraulicBoundaryLocationCalculations(IEnumerable hydraulicBoundaryLocations) + { + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + + ClearHydraulicBoundaryLocationCalculations(); + + foreach (HydraulicBoundaryLocation hydraulicBoundaryLocation in hydraulicBoundaryLocations) + { + AddHydraulicBoundaryLocationCalculations(hydraulicBoundaryLocation); + } + } + + public IEnumerable GetFailureMechanisms() + { + yield return Piping; + yield return GrassCoverErosionInwards; + yield return MacroStabilityInwards; + yield return MacroStabilityOutwards; + yield return Microstability; + yield return StabilityStoneCover; + yield return WaveImpactAsphaltCover; + yield return WaterPressureAsphaltCover; + yield return GrassCoverErosionOutwards; + yield return GrassCoverSlipOffOutwards; + yield return GrassCoverSlipOffInwards; + yield return HeightStructures; + yield return ClosingStructures; + yield return PipingStructure; + yield return StabilityPointStructures; + yield return StrengthStabilityLengthwiseConstruction; + yield return DuneErosion; + yield return TechnicalInnovation; + } + + public IEnumerable GetContributingFailureMechanisms() + { + yield return Piping; + yield return GrassCoverErosionInwards; + yield return MacroStabilityInwards; + yield return StabilityStoneCover; + yield return WaveImpactAsphaltCover; + yield return GrassCoverErosionOutwards; + yield return HeightStructures; + yield return ClosingStructures; + yield return PipingStructure; + yield return StabilityPointStructures; + yield return DuneErosion; + yield return OtherFailureMechanism; + } + + /// + /// Thrown when + /// is not a valid enum value of . + /// Thrown when + /// is not supported. + public void ChangeComposition(AssessmentSectionComposition newComposition) + { + if (!Enum.IsDefined(typeof(AssessmentSectionComposition), newComposition)) + { + throw new InvalidEnumArgumentException(nameof(newComposition), + (int) newComposition, + typeof(AssessmentSectionComposition)); + } + + switch (newComposition) + { + case AssessmentSectionComposition.Dike: + Piping.Contribution = 24; + GrassCoverErosionInwards.Contribution = 24; + MacroStabilityInwards.Contribution = 4; + MacroStabilityOutwards.Contribution = 4; + StabilityStoneCover.Contribution = 5; + WaveImpactAsphaltCover.Contribution = 5; + GrassCoverErosionOutwards.Contribution = 5; + HeightStructures.Contribution = 24; + ClosingStructures.Contribution = 4; + PipingStructure.Contribution = 2; + StabilityPointStructures.Contribution = 2; + DuneErosion.Contribution = 0; + OtherFailureMechanism.Contribution = 30; + FailureProbabilityMarginFactor = (RoundedDouble) 0.58; + break; + case AssessmentSectionComposition.Dune: + Piping.Contribution = 0; + GrassCoverErosionInwards.Contribution = 0; + MacroStabilityInwards.Contribution = 0; + MacroStabilityOutwards.Contribution = 4; + StabilityStoneCover.Contribution = 0; + WaveImpactAsphaltCover.Contribution = 0; + GrassCoverErosionOutwards.Contribution = 0; + HeightStructures.Contribution = 0; + ClosingStructures.Contribution = 0; + PipingStructure.Contribution = 0; + StabilityPointStructures.Contribution = 0; + DuneErosion.Contribution = 70; + OtherFailureMechanism.Contribution = 30; + FailureProbabilityMarginFactor = (RoundedDouble) 0; + break; + case AssessmentSectionComposition.DikeAndDune: + Piping.Contribution = 24; + GrassCoverErosionInwards.Contribution = 24; + MacroStabilityInwards.Contribution = 4; + MacroStabilityOutwards.Contribution = 4; + StabilityStoneCover.Contribution = 5; + WaveImpactAsphaltCover.Contribution = 5; + GrassCoverErosionOutwards.Contribution = 5; + HeightStructures.Contribution = 24; + ClosingStructures.Contribution = 4; + PipingStructure.Contribution = 2; + StabilityPointStructures.Contribution = 2; + DuneErosion.Contribution = 10; + OtherFailureMechanism.Contribution = 20; + FailureProbabilityMarginFactor = (RoundedDouble) 0.58; + break; + default: + throw new NotSupportedException(); + } + + Composition = newComposition; + SetFailureMechanismRelevancy(); + } + + /// + /// Validates whether the contribution of + /// is equal to the contribution of . + /// + /// The old failure mechanism value. + /// The new failure mechanism value. + /// Thrown when the contribution of + /// is not equal to the contribution of . + private static void ValidateContribution(IFailureMechanism oldFailureMechanism, IFailureMechanism newFailureMechanism) + { + if (Math.Abs(oldFailureMechanism.Contribution - newFailureMechanism.Contribution) >= double.Epsilon) + { + throw new ArgumentException(Resources.AssessmentSection_ValidateContribution_Contribution_new_FailureMechanism_must_be_equal_to_old_FailureMechanism); + } + } + + private void ClearHydraulicBoundaryLocationCalculations() + { + waterLevelCalculationsForFactorizedSignalingNorm.Clear(); + waterLevelCalculationsForSignalingNorm.Clear(); + waterLevelCalculationsForLowerLimitNorm.Clear(); + waterLevelCalculationsForFactorizedLowerLimitNorm.Clear(); + waveHeightCalculationsForFactorizedSignalingNorm.Clear(); + waveHeightCalculationsForSignalingNorm.Clear(); + waveHeightCalculationsForLowerLimitNorm.Clear(); + waveHeightCalculationsForFactorizedLowerLimitNorm.Clear(); + } + + private void AddHydraulicBoundaryLocationCalculations(HydraulicBoundaryLocation hydraulicBoundaryLocation) + { + waterLevelCalculationsForFactorizedSignalingNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waterLevelCalculationsForSignalingNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waterLevelCalculationsForLowerLimitNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waterLevelCalculationsForFactorizedLowerLimitNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waveHeightCalculationsForFactorizedSignalingNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waveHeightCalculationsForSignalingNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waveHeightCalculationsForLowerLimitNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + waveHeightCalculationsForFactorizedLowerLimitNorm.Add(new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)); + } + + private void SetFailureMechanismRelevancy() + { + Piping.IsRelevant = Composition != AssessmentSectionComposition.Dune; + GrassCoverErosionInwards.IsRelevant = Composition != AssessmentSectionComposition.Dune; + MacroStabilityInwards.IsRelevant = Composition != AssessmentSectionComposition.Dune; + StabilityStoneCover.IsRelevant = Composition != AssessmentSectionComposition.Dune; + WaveImpactAsphaltCover.IsRelevant = Composition != AssessmentSectionComposition.Dune; + GrassCoverErosionOutwards.IsRelevant = Composition != AssessmentSectionComposition.Dune; + HeightStructures.IsRelevant = Composition != AssessmentSectionComposition.Dune; + ClosingStructures.IsRelevant = Composition != AssessmentSectionComposition.Dune; + StabilityPointStructures.IsRelevant = Composition != AssessmentSectionComposition.Dune; + PipingStructure.IsRelevant = Composition != AssessmentSectionComposition.Dune; + DuneErosion.IsRelevant = Composition != AssessmentSectionComposition.Dike; + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionMergeData.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionMergeData.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionMergeData.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,264 @@ +// Copyright (C) Stichting Deltares 2018. 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; + +namespace Riskeer.Integration.Data.Merge +{ + /// + /// Class that holds the merge data. + /// + public class AssessmentSectionMergeData + { + /// + /// Creates a new instance of . + /// + /// The assessment section to merge. + /// The container of the properties for the + /// . + /// Thrown when any parameter is null. + public AssessmentSectionMergeData(AssessmentSection assessmentSection, + ConstructionProperties properties) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + AssessmentSection = assessmentSection; + + MergePiping = properties.MergePiping; + MergeGrassCoverErosionInwards = properties.MergeGrassCoverErosionInwards; + MergeMacroStabilityInwards = properties.MergeMacroStabilityInwards; + MergeMacroStabilityOutwards = properties.MergeMacroStabilityOutwards; + MergeMicrostability = properties.MergeMicrostability; + MergeStabilityStoneCover = properties.MergeStabilityStoneCover; + MergeWaveImpactAsphaltCover = properties.MergeWaveImpactAsphaltCover; + MergeWaterPressureAsphaltCover = properties.MergeWaterPressureAsphaltCover; + MergeGrassCoverErosionOutwards = properties.MergeGrassCoverErosionOutwards; + MergeGrassCoverSlipOffOutwards = properties.MergeGrassCoverSlipOffOutwards; + MergeGrassCoverSlipOffInwards = properties.MergeGrassCoverSlipOffInwards; + MergeHeightStructures = properties.MergeHeightStructures; + MergeClosingStructures = properties.MergeClosingStructures; + MergePipingStructure = properties.MergePipingStructure; + MergeStabilityPointStructures = properties.MergeStabilityPointStructures; + MergeStrengthStabilityLengthwiseConstruction = properties.MergeStrengthStabilityLengthwiseConstruction; + MergeDuneErosion = properties.MergeDuneErosion; + MergeTechnicalInnovation = properties.MergeTechnicalInnovation; + } + + /// + /// Gets the assessment section to merge. + /// + public AssessmentSection AssessmentSection { get; } + + /// + /// Gets the indicator whether piping should be merged. + /// + public bool MergePiping { get; } + + /// + /// Gets the indicator whether grass cover erosion inwards should be merged. + /// + public bool MergeGrassCoverErosionInwards { get; } + + /// + /// Gets the indicator whether macro stability inwards should be merged. + /// + public bool MergeMacroStabilityInwards { get; } + + /// + /// Gets the indicator whether macro stability outwards should be merged. + /// + public bool MergeMacroStabilityOutwards { get; } + + /// + /// Gets the indicator whether microstability should be merged. + /// + public bool MergeMicrostability { get; } + + /// + /// Gets the indicator whether stability stone cover should be merged. + /// + public bool MergeStabilityStoneCover { get; } + + /// + /// Gets the indicator whether wave impact asphalt cover should be merged. + /// + public bool MergeWaveImpactAsphaltCover { get; } + + /// + /// Gets the indicator whether water pressure asphalt cover should be merged. + /// + public bool MergeWaterPressureAsphaltCover { get; } + + /// + /// Gets the indicator whether grass cover erosion outwards should be merged. + /// + public bool MergeGrassCoverErosionOutwards { get; } + + /// + /// Gets the indicator whether grass cover slip off outwards should be merged. + /// + public bool MergeGrassCoverSlipOffOutwards { get; } + + /// + /// Gets the indicator whether grass cover slip off inwards should be merged. + /// + public bool MergeGrassCoverSlipOffInwards { get; } + + /// + /// Gets the indicator whether height structures should be merged. + /// + public bool MergeHeightStructures { get; } + + /// + /// Gets the indicator whether closing structures should be merged. + /// + public bool MergeClosingStructures { get; } + + /// + /// Gets the indicator whether piping structure should be merged. + /// + public bool MergePipingStructure { get; } + + /// + /// Gets the indicator whether stability point structures should be merged. + /// + public bool MergeStabilityPointStructures { get; } + + /// + /// Gets the indicator whether strength stability lengthwise construction should be merged. + /// + public bool MergeStrengthStabilityLengthwiseConstruction { get; } + + /// + /// Gets the indicator whether dune erosion should be merged. + /// + public bool MergeDuneErosion { get; } + + /// + /// Gets the indicator whether technical innovation should be merged. + /// + public bool MergeTechnicalInnovation { get; } + + /// + /// Container for properties for constructing an . + /// + public class ConstructionProperties + { + /// + /// Gets or sets the indicator whether piping should be merged. + /// + public bool MergePiping { internal get; set; } + + /// + /// Gets or sets the indicator whether grass cover erosion inwards should be merged. + /// + public bool MergeGrassCoverErosionInwards { internal get; set; } + + /// + /// Gets or sets the indicator whether macro stability inwards should be merged. + /// + public bool MergeMacroStabilityInwards { internal get; set; } + + /// + /// Gets or sets the indicator whether macro stability outwards should be merged. + /// + public bool MergeMacroStabilityOutwards { internal get; set; } + + /// + /// Gets or sets the indicator whether microstability should be merged. + /// + public bool MergeMicrostability { internal get; set; } + + /// + /// Gets or sets the indicator whether stability stone cover should be merged. + /// + public bool MergeStabilityStoneCover { internal get; set; } + + /// + /// Gets or sets the indicator whether wave impact asphalt cover should be merged. + /// + public bool MergeWaveImpactAsphaltCover { internal get; set; } + + /// + /// Gets or sets the indicator whether water pressure asphalt cover should be merged. + /// + public bool MergeWaterPressureAsphaltCover { internal get; set; } + + /// + /// Gets or sets the indicator whether grass cover erosion outwards should be merged. + /// + public bool MergeGrassCoverErosionOutwards { internal get; set; } + + /// + /// Gets or sets the indicator whether grass cover slip off outwards should be merged. + /// + public bool MergeGrassCoverSlipOffOutwards { internal get; set; } + + /// + /// Gets or sets the indicator whether grass cover slip off inwards should be merged. + /// + public bool MergeGrassCoverSlipOffInwards { internal get; set; } + + /// + /// Gets or sets the indicator whether height structures should be merged. + /// + public bool MergeHeightStructures { internal get; set; } + + /// + /// Gets or sets the indicator whether closing structures should be merged. + /// + public bool MergeClosingStructures { internal get; set; } + + /// + /// Gets or sets the indicator whether piping structure should be merged. + /// + public bool MergePipingStructure { internal get; set; } + + /// + /// Gets or sets the indicator whether stability point structures should be merged. + /// + public bool MergeStabilityPointStructures { internal get; set; } + + /// + /// Gets or sets the indicator whether strength stability lengthwise construction should be merged. + /// + public bool MergeStrengthStabilityLengthwiseConstruction { internal get; set; } + + /// + /// Gets or sets the indicator whether dune erosion should be merged. + /// + public bool MergeDuneErosion { internal get; set; } + + /// + /// Gets or sets the indicator whether technical innovation should be merged. + /// + public bool MergeTechnicalInnovation { internal get; set; } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionsOwner.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionsOwner.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Merge/AssessmentSectionsOwner.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,36 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; + +namespace Riskeer.Integration.Data.Merge +{ + /// + /// Class that holds a collection of . + /// + public class AssessmentSectionsOwner + { + /// + /// Gets or sets the collection of . + /// + public IEnumerable AssessmentSections { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/AssemblyInfo.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/AssemblyInfo.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/AssemblyInfo.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,27 @@ +// Copyright (C) Stichting Deltares 2018. 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.Reflection; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("Riskeer.Integration.Data")] +[assembly: AssemblyProduct("Riskeer.Integration.Data")] +[assembly: InternalsVisibleTo("Ringtoets.Integration.Data.Test")] \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.Designer.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,274 @@ +// Copyright (C) Stichting Deltares 2018. 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. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Riskeer.Integration.Data.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Riskeer.Integration.Data.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Traject. + /// + public static string AssessmentSection_DisplayName { + get { + return ResourceManager.GetString("AssessmentSection_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Traject {0}. + /// + public static string AssessmentSection_Id_0 { + get { + return ResourceManager.GetString("AssessmentSection_Id_0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to De contributie van het nieuwe toetsspoor moet gelijk zijn aan het oude toetsspoor.. + /// + public static string AssessmentSection_ValidateContribution_Contribution_new_FailureMechanism_must_be_equal_to_old_FailureMechanism { + get { + return ResourceManager.GetString("AssessmentSection_ValidateContribution_Contribution_new_FailureMechanism_must_be_" + + "equal_to_old_FailureMechanism", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Voor een of meerdere toetssporen kan geen oordeel worden bepaald.. + /// + public static string AssessmentSectionAssemblyFactory_Error_while_assembling_failureMechanims { + get { + return ResourceManager.GetString("AssessmentSectionAssemblyFactory_Error_while_assembling_failureMechanims", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Faalkansbegroting. + /// + public static string FailureMechanismContribution_DisplayName { + get { + return ResourceManager.GetString("FailureMechanismContribution_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GABI. + /// + public static string GrassCoverSlipOffInwardsFailureMechanism_Code { + get { + return ResourceManager.GetString("GrassCoverSlipOffInwardsFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken en dammen - Grasbekleding afschuiven binnentalud. + /// + public static string GrassCoverSlipOffInwardsFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("GrassCoverSlipOffInwardsFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to GABU. + /// + public static string GrassCoverSlipOffOutwardsFailureMechanism_Code { + get { + return ResourceManager.GetString("GrassCoverSlipOffOutwardsFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken en dammen - Grasbekleding afschuiven buitentalud. + /// + public static string GrassCoverSlipOffOutwardsFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("GrassCoverSlipOffOutwardsFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to STBU. + /// + public static string MacroStabilityOutwardsFailureMechanism_Code { + get { + return ResourceManager.GetString("MacroStabilityOutwardsFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken en dammen - Macrostabiliteit buitenwaarts. + /// + public static string MacroStabilityOutwardsFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("MacroStabilityOutwardsFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to STMI. + /// + public static string MicrostabilityFailureMechanism_Code { + get { + return ResourceManager.GetString("MicrostabilityFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken en dammen - Microstabiliteit. + /// + public static string MicrostabilityFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("MicrostabilityFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PKW. + /// + public static string PipingStructureFailureMechanism_Code { + get { + return ResourceManager.GetString("PipingStructureFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kunstwerken - Piping bij kunstwerk. + /// + public static string PipingStructureFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("PipingStructureFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to STKWl. + /// + public static string StrengthStabilityLengthwiseConstructionFailureMechanism_Code { + get { + return ResourceManager.GetString("StrengthStabilityLengthwiseConstructionFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Kunstwerken - Sterkte en stabiliteit langsconstructies. + /// + public static string StrengthStabilityLengthwiseConstructionFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("StrengthStabilityLengthwiseConstructionFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to INN. + /// + public static string TechnicalInnovationFailureMechanism_Code { + get { + return ResourceManager.GetString("TechnicalInnovationFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Technische innovaties - Technische innovaties. + /// + public static string TechnicalInnovationFailureMechanismFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("TechnicalInnovationFailureMechanismFailureMechanism_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AWO. + /// + public static string WaterPressureAsphaltCoverFailureMechanism_Code { + get { + return ResourceManager.GetString("WaterPressureAsphaltCoverFailureMechanism_Code", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Dijken en dammen - Wateroverdruk bij asfaltbekleding. + /// + public static string WaterPressureAsphaltCoverFailureMechanism_DisplayName { + get { + return ResourceManager.GetString("WaterPressureAsphaltCoverFailureMechanism_DisplayName", resourceCulture); + } + } + } +} Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.resx (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Properties/Resources.resx (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Faalkansbegroting + + + Traject + + + Dijken en dammen - Grasbekleding afschuiven buitentalud + + + Kunstwerken - Piping bij kunstwerk + + + GABU + + + PKW + + + GABI + + + Dijken en dammen - Grasbekleding afschuiven binnentalud + + + STBU + + + Dijken en dammen - Macrostabiliteit buitenwaarts + + + STMI + + + Dijken en dammen - Microstabiliteit + + + STKWl + + + INN + + + Technische innovaties - Technische innovaties + + + AWO + + + Dijken en dammen - Wateroverdruk bij asfaltbekleding + + + Traject {0} + + + Kunstwerken - Sterkte en stabiliteit langsconstructies + + + Voor een of meerdere toetssporen kan geen oordeel worden bepaald. + + + De contributie van het nieuwe toetsspoor moet gelijk zijn aan het oude toetsspoor. + + \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProject.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProject.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProject.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,102 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using System.Linq; +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Base.Properties; + +namespace Riskeer.Integration.Data +{ + public class RingtoetsProject : Observable, IProject + { + /// + /// Constructs a new . + /// + public RingtoetsProject() : this(Resources.Project_Constructor_Default_name) {} + + /// + /// Constructs a new . + /// + /// The name of the . + public RingtoetsProject(string name) + { + Name = name; + Description = ""; + + AssessmentSections = new List(); + } + + /// + /// Gets or sets the assessmentSections of the . + /// + public List AssessmentSections { get; } + + /// + /// Gets or sets the name of the . + /// + public string Name { get; set; } + + /// + /// Gets or sets the description of the . + /// + public string Description { get; set; } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + + return Equals((RingtoetsProject) obj); + } + + public override int GetHashCode() + { + return 0; + } + + private bool Equals(IProject other) + { + var otherProject = other as RingtoetsProject; + if (otherProject == null) + { + return false; + } + + return string.Equals(Name, otherProject.Name) && + string.Equals(Description, otherProject.Description) && + AssessmentSections.SequenceEqual(otherProject.AssessmentSections); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProjectFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProjectFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/RingtoetsProjectFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,33 @@ +// Copyright (C) Stichting Deltares 2018. 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 Core.Common.Base.Data; + +namespace Riskeer.Integration.Data +{ + public class RingtoetsProjectFactory : IProjectFactory + { + public IProject CreateNewProject() + { + return new RingtoetsProject(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/Riskeer.Integration.Data.csproj =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/Riskeer.Integration.Data.csproj (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/Riskeer.Integration.Data.csproj (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,145 @@ + + + + {11F1F874-45AF-43E4-8AE5-15A5C9593E28} + Riskeer.Integration.Data + Riskeer.Integration.Data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + False + + + {420ED9C3-0C33-47EA-B893-121A9C0DB4F1} + Riskeer.AssemblyTool.Data + False + + + {358b6da2-a1df-477f-b6ac-c30204265cb0} + Riskeer.AssemblyTool.KernelWrapper + False + + + {C6309704-D67B-434C-BC98-9F8910BC1D10} + Ringtoets.ClosingStructures.Data + False + + + {78AA56F5-431D-465C-AC50-3173D7E90AC1} + Ringtoets.Common.Primitives + False + + + {d1068432-c172-4aa6-847b-d9deb4c6de26} + Ringtoets.DuneErosion.Data + False + + + {83D6B73E-91D5-46B0-9218-955DA1F75F7C} + Ringtoets.MacroStabilityInwards.Data + False + + + {3D4B9740-8348-4434-8D77-B611FC6EE57F} + Ringtoets.StabilityPointStructures.Data + False + + + {567E0B69-5280-41CE-ADD6-443725A61C86} + Ringtoets.WaveImpactAsphaltCover.Data + False + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + False + + + {90DE728E-48EF-4665-AB38-3D88E41D9F4D} + Ringtoets.GrassCoverErosionInwards.Data + False + + + {E7225477-577F-4A17-B7EC-6721158E1543} + Ringtoets.GrassCoverErosionOutwards.Data + False + + + {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99} + Ringtoets.HeightStructures.Data + False + + + {ce994cc9-6f6a-48ac-b4be-02c30a21f4db} + Ringtoets.Piping.Data + False + + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + False + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + Copying.licenseheader + + + \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,257 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a grass cover slip off inwards failure mechanism. + /// + public static class GrassCoverSlipOffInwardsFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the detailed assessment result. + /// + /// The failure mechanism section result to + /// assemble the detailed assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleDetailedAssessment( + GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleDetailedAssessment( + failureMechanismSectionResult.DetailedAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleDetailedAssessment(failureMechanismSectionResult), + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + GrassCoverSlipOffInwardsFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(GrassCoverSlipOffInwardsFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,257 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a grass cover slip off outwards failure mechanism. + /// + public static class GrassCoverSlipOffOutwardsFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the detailed assessment result. + /// + /// The failure mechanism section result to + /// assemble the detailed assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleDetailedAssessment( + GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleDetailedAssessment( + failureMechanismSectionResult.DetailedAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleDetailedAssessment(failureMechanismSectionResult), + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + GrassCoverSlipOffOutwardsFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(GrassCoverSlipOffOutwardsFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MacroStabilityOutwardsFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MacroStabilityOutwardsFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MacroStabilityOutwardsFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,339 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Data.Probability; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a macro stability outwards failure mechanism. + /// + public static class MacroStabilityOutwardsFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + MacroStabilityOutwardsFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the detailed assessment result. + /// + /// The failure mechanism section result to + /// assemble the detailed assembly for. + /// The failure mechanism this section belongs to. + /// The this section belongs to. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleDetailedAssessment( + MacroStabilityOutwardsFailureMechanismSectionResult failureMechanismSectionResult, + MacroStabilityOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + double n = failureMechanism.MacroStabilityOutwardsProbabilityAssessmentInput.GetN( + assessmentSection.ReferenceLine.Length); + + return calculator.AssembleDetailedAssessment( + failureMechanismSectionResult.DetailedAssessmentResult, + failureMechanismSectionResult.DetailedAssessmentProbability, + assessmentSection.FailureMechanismContribution.Norm, + n, + failureMechanism.Contribution / 100).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// The failure mechanism this section belongs to. + /// The this section belongs to. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + MacroStabilityOutwardsFailureMechanismSectionResult failureMechanismSectionResult, + MacroStabilityOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + double n = failureMechanism.MacroStabilityOutwardsProbabilityAssessmentInput.GetN( + assessmentSection.ReferenceLine.Length); + + return calculator.AssembleTailorMadeAssessment( + failureMechanismSectionResult.TailorMadeAssessmentResult, + failureMechanismSectionResult.TailorMadeAssessmentProbability, + assessmentSection.FailureMechanismContribution.Norm, + n, + failureMechanism.Contribution / 100).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// The failure mechanism this section belongs to. + /// The this section belongs to. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + MacroStabilityOutwardsFailureMechanismSectionResult failureMechanismSectionResult, + MacroStabilityOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleDetailedAssessment(failureMechanismSectionResult, failureMechanism, assessmentSection), + AssembleTailorMadeAssessment(failureMechanismSectionResult, failureMechanism, assessmentSection)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// The failure mechanism this section belongs to. + /// The this section belongs to. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + MacroStabilityOutwardsFailureMechanismSectionResult failureMechanismSectionResult, + MacroStabilityOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult, + failureMechanism, + assessmentSection); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// The the failure mechanism belongs to. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when any parameter is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism( + MacroStabilityOutwardsFailureMechanism failureMechanism, + IAssessmentSection assessmentSection, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(sectionResult => GetSectionAssemblyCategoryGroup(sectionResult, + failureMechanism, + assessmentSection, + useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MicrostabilityFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MicrostabilityFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/MicrostabilityFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,257 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a microstability failure mechanism. + /// + public static class MicrostabilityFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the detailed assessment result. + /// + /// The failure mechanism section result to + /// assemble the detailed assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleDetailedAssessment( + MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleDetailedAssessment( + failureMechanismSectionResult.DetailedAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleDetailedAssessment(failureMechanismSectionResult), + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + MicrostabilityFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(MicrostabilityFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,257 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a piping structure failure mechanism. + /// + public static class PipingStructureFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + PipingStructureFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the detailed assessment result. + /// + /// The failure mechanism section result to + /// assemble the detailed assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleDetailedAssessment( + PipingStructureFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleDetailedAssessment( + failureMechanismSectionResult.DetailedAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + PipingStructureFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + PipingStructureFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleDetailedAssessment(failureMechanismSectionResult), + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + PipingStructureFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(PipingStructureFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,223 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a strength stability lengthwise construction failure mechanism. + /// + public static class StrengthStabilityLengthwiseConstructionFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(StrengthStabilityLengthwiseConstructionFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/TechnicalInnovationFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/TechnicalInnovationFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/TechnicalInnovationFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,223 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a technical innovation failure mechanism. + /// + public static class TechnicalInnovationFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + TechnicalInnovationFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + TechnicalInnovationFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + TechnicalInnovationFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + TechnicalInnovationFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(TechnicalInnovationFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/AssemblyFactories/WaterPressureAsphaltCoverFailureMechanismAssemblyFactory.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,223 @@ +// Copyright (C) Stichting Deltares 2018. 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.ComponentModel; +using System.Linq; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.Exceptions; +using Ringtoets.Common.Primitives; +using Riskeer.AssemblyTool.Data; +using Riskeer.AssemblyTool.KernelWrapper.Calculators; +using Riskeer.AssemblyTool.KernelWrapper.Calculators.Assembly; +using Riskeer.AssemblyTool.KernelWrapper.Kernels; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.AssemblyFactories +{ + /// + /// Factory for creating assembly results for a water pressure asphalt cover failure mechanism. + /// + public static class WaterPressureAsphaltCoverFailureMechanismAssemblyFactory + { + /// + /// Assembles the simple assessment results. + /// + /// The failure mechanism section result to assemble the + /// simple assembly results for. + /// A based on the . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleSimpleAssessment( + WaterPressureAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleSimpleAssessment(failureMechanismSectionResult.SimpleAssessmentResult).Group; + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the tailor made assessment result. + /// + /// The failure mechanism section result to + /// assemble the tailor made assembly for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleTailorMadeAssessment( + WaterPressureAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + return calculator.AssembleTailorMadeAssessment(failureMechanismSectionResult.TailorMadeAssessmentResult); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the combined assembly. + /// + /// The failure mechanism section result to + /// combine the assemblies for. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup AssembleCombinedAssessment( + WaterPressureAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismSectionAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismSectionAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + try + { + FailureMechanismSectionAssemblyCategoryGroup simpleAssembly = AssembleSimpleAssessment(failureMechanismSectionResult); + + if (failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.NotApplicable + || failureMechanismSectionResult.SimpleAssessmentResult == SimpleAssessmentResultType.ProbabilityNegligible) + { + return calculator.AssembleCombined(simpleAssembly); + } + + return calculator.AssembleCombined( + simpleAssembly, + AssembleTailorMadeAssessment(failureMechanismSectionResult)); + } + catch (FailureMechanismSectionAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Gets the assembly category group of the given . + /// + /// The failure mechanism section result to get the assembly category group for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismSectionAssemblyCategoryGroup GetSectionAssemblyCategoryGroup( + WaterPressureAsphaltCoverFailureMechanismSectionResult failureMechanismSectionResult, + bool useManual) + { + if (failureMechanismSectionResult == null) + { + throw new ArgumentNullException(nameof(failureMechanismSectionResult)); + } + + try + { + return failureMechanismSectionResult.UseManualAssembly && useManual + ? ManualFailureMechanismSectionAssemblyCategoryGroupConverter.Convert(failureMechanismSectionResult.ManualAssemblyCategoryGroup) + : AssembleCombinedAssessment(failureMechanismSectionResult); + } + catch (Exception e) when (e is NotSupportedException || e is InvalidEnumArgumentException) + { + throw new AssemblyException(e.Message, e); + } + } + + /// + /// Assembles the failure mechanism assembly. + /// + /// The failure mechanism to assemble for. + /// Indicator that determines whether the manual assembly should be considered when assembling the result. + /// A . + /// Thrown when + /// is null. + /// Thrown when the + /// could not be created. + public static FailureMechanismAssemblyCategoryGroup AssembleFailureMechanism(WaterPressureAsphaltCoverFailureMechanism failureMechanism, + bool useManual) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (!failureMechanism.IsRelevant) + { + return FailureMechanismAssemblyResultFactory.CreateNotApplicableCategory(); + } + + try + { + IEnumerable sectionAssemblies = + failureMechanism.SectionResults.Select(result => GetSectionAssemblyCategoryGroup(result, useManual)).ToArray(); + + IAssemblyToolCalculatorFactory calculatorFactory = AssemblyToolCalculatorFactory.Instance; + IFailureMechanismAssemblyCalculator calculator = + calculatorFactory.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + + return calculator.Assemble(sectionAssemblies); + } + catch (FailureMechanismAssemblyCalculatorException e) + { + throw new AssemblyException(e.Message, e); + } + catch (AssemblyException e) + { + throw new AssemblyException(RingtoetsCommonDataResources.FailureMechanismAssemblyFactory_Error_while_assembling_failureMechanism, e); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffInwardsFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffInwardsFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffInwardsFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Grass Cover Slip Off Inwards failure mechanism. + /// + public class GrassCoverSlipOffInwardsFailureMechanism : FailureMechanismBase, + IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public GrassCoverSlipOffInwardsFailureMechanism() + : base(Resources.GrassCoverSlipOffInwardsFailureMechanism_DisplayName, Resources.GrassCoverSlipOffInwardsFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffOutwardsFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffOutwardsFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/GrassCoverSlipOffOutwardsFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Grass Cover Slip Off Outwards failure mechanism. + /// + public class GrassCoverSlipOffOutwardsFailureMechanism : FailureMechanismBase, + IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public GrassCoverSlipOffOutwardsFailureMechanism() + : base(Resources.GrassCoverSlipOffOutwardsFailureMechanism_DisplayName, Resources.GrassCoverSlipOffOutwardsFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/Input/MacroStabilityOutwardsProbabilityAssessmentInput.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/Input/MacroStabilityOutwardsProbabilityAssessmentInput.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/Input/MacroStabilityOutwardsProbabilityAssessmentInput.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,36 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.Probability; + +namespace Riskeer.Integration.Data.StandAlone.Input +{ + /// + /// This class holds parameters which influence the probability estimate for a macro stability outwards assessment. + /// + public class MacroStabilityOutwardsProbabilityAssessmentInput : ProbabilityAssessmentInput + { + /// + /// Creates a new instance of . + /// + public MacroStabilityOutwardsProbabilityAssessmentInput() : base(0.033, 50.0) {} + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MacroStabilityOutwardsFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MacroStabilityOutwardsFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MacroStabilityOutwardsFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,84 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.StandAlone.Input; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// macro stability outwards failure mechanism. + /// + public class MacroStabilityOutwardsFailureMechanism : FailureMechanismBase, + IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public MacroStabilityOutwardsFailureMechanism() + : base(Resources.MacroStabilityOutwardsFailureMechanism_DisplayName, Resources.MacroStabilityOutwardsFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + MacroStabilityOutwardsProbabilityAssessmentInput = new MacroStabilityOutwardsProbabilityAssessmentInput(); + } + + /// + /// Gets the general probabilistic assessment input parameters that apply to each calculation + /// in a semi-probabilistic assessment. + /// + public MacroStabilityOutwardsProbabilityAssessmentInput MacroStabilityOutwardsProbabilityAssessmentInput { get; } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new MacroStabilityOutwardsFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MicrostabilityFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MicrostabilityFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/MicrostabilityFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,75 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Microstability failure mechanism. + /// + public class MicrostabilityFailureMechanism : FailureMechanismBase, IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public MicrostabilityFailureMechanism() + : base(Resources.MicrostabilityFailureMechanism_DisplayName, Resources.MicrostabilityFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new MicrostabilityFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/PipingStructureFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,109 @@ +// Copyright (C) Stichting Deltares 2018. 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 Core.Common.Base; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Piping Structure failure mechanism. + /// + public class PipingStructureFailureMechanism : FailureMechanismBase, IHasSectionResults + { + private const int numberOfDecimalPlacesN = 2; + + private static readonly Range validityRangeN = new Range(new RoundedDouble(numberOfDecimalPlacesN, 1), + new RoundedDouble(numberOfDecimalPlacesN, 20)); + + private readonly ObservableList sectionResults; + private RoundedDouble n; + + /// + /// Initializes a new instance of the class. + /// + public PipingStructureFailureMechanism() + : base(Resources.PipingStructureFailureMechanism_DisplayName, Resources.PipingStructureFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + n = new RoundedDouble(numberOfDecimalPlacesN, 1.0); + } + + /// + /// Gets the 'N' parameter used to factor in the 'length effect'. + /// + /// Thrown when the value of + /// is not in the range [1, 20]. + public RoundedDouble N + { + get + { + return n; + } + set + { + RoundedDouble newValue = value.ToPrecision(n.NumberOfDecimalPlaces); + if (!validityRangeN.InRange(newValue)) + { + throw new ArgumentOutOfRangeException(nameof(value), string.Format(RingtoetsCommonDataResources.N_Value_should_be_in_Range_0_, + validityRangeN)); + } + + n = newValue; + } + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new PipingStructureFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Grass Cover Slip Off Inwards failure mechanism. + /// + public class GrassCoverSlipOffInwardsFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public GrassCoverSlipOffInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + DetailedAssessmentResult = DetailedAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the detailed assessment result. + /// + public DetailedAssessmentResultType DetailedAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Grass Cover Slip Off Outwards failure mechanism. + /// + public class GrassCoverSlipOffOutwardsFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public GrassCoverSlipOffOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + DetailedAssessmentResult = DetailedAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the detailed assessment result. + /// + public DetailedAssessmentResultType DetailedAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MacroStabilityOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MacroStabilityOutwardsFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MacroStabilityOutwardsFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,111 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.Probability; +using Ringtoets.Common.Primitives; +using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// macro stability outwards failure mechanism. + /// + public class MacroStabilityOutwardsFailureMechanismSectionResult : FailureMechanismSectionResult + { + private double detailedAssessmentProbability; + private double tailorMadeAssessmentProbability; + + /// + /// + /// Creates a new instance of . + /// + public MacroStabilityOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + DetailedAssessmentResult = DetailedAssessmentProbabilityOnlyResultType.Probability; + DetailedAssessmentProbability = double.NaN; + TailorMadeAssessmentResult = TailorMadeAssessmentProbabilityAndDetailedCalculationResultType.None; + TailorMadeAssessmentProbability = double.NaN; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the detailed assessment result. + /// + public DetailedAssessmentProbabilityOnlyResultType DetailedAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentProbabilityAndDetailedCalculationResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the value for the detailed assessment of safety per failure mechanism section as a probability. + /// + /// Thrown when is not in range [0,1]. + public double DetailedAssessmentProbability + { + get + { + return detailedAssessmentProbability; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, + RingtoetsCommonDataResources.ArbitraryProbabilityFailureMechanismSectionResult_AssessmentProbability_Value_needs_to_be_in_Range_0_, + true); + detailedAssessmentProbability = value; + } + } + + /// + /// Gets or sets the value of the tailor made assessment of safety per failure mechanism section as a probability. + /// + /// Thrown when is not in range [0,1]. + public double TailorMadeAssessmentProbability + { + get + { + return tailorMadeAssessmentProbability; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, + RingtoetsCommonDataResources.ArbitraryProbabilityFailureMechanismSectionResult_AssessmentProbability_Value_needs_to_be_in_Range_0_, + true); + tailorMadeAssessmentProbability = value; + } + } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Microstability failure mechanism. + /// + public class MicrostabilityFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public MicrostabilityFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + DetailedAssessmentResult = DetailedAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the detailed assessment result. + /// + public DetailedAssessmentResultType DetailedAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Piping Structure failure mechanism. + /// + public class PipingStructureFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public PipingStructureFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + DetailedAssessmentResult = DetailedAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the detailed assessment result. + /// + public DetailedAssessmentResultType DetailedAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Strength and Stability of Lengthwise Constructions failure mechanism. + /// + public class StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Technical Innovations failure mechanism. + /// + public class TechnicalInnovationFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) + : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2018. 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 Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Primitives; + +namespace Riskeer.Integration.Data.StandAlone.SectionResults +{ + /// + /// This class holds information about the result of a calculation on section level for the + /// Water Pressure on Asphalt failure mechanism. + /// + public class WaterPressureAsphaltCoverFailureMechanismSectionResult : FailureMechanismSectionResult + { + /// + /// + /// Creates a new instance of . + /// + public WaterPressureAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) + : base(section) + { + SimpleAssessmentResult = SimpleAssessmentResultType.None; + TailorMadeAssessmentResult = TailorMadeAssessmentResultType.None; + ManualAssemblyCategoryGroup = ManualFailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the simple assessment result. + /// + public SimpleAssessmentResultType SimpleAssessmentResult { get; set; } + + /// + /// Gets or sets the tailor made assessment result. + /// + public TailorMadeAssessmentResultType TailorMadeAssessmentResult { get; set; } + + /// + /// Gets or sets the manually selected assembly category group. + /// + public ManualFailureMechanismSectionAssemblyCategoryGroup ManualAssemblyCategoryGroup { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/StrengthStabilityLengthwiseConstructionFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/StrengthStabilityLengthwiseConstructionFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/StrengthStabilityLengthwiseConstructionFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,78 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Strength and Stability of Lengthwise Constructions failure mechanism. + /// + public class StrengthStabilityLengthwiseConstructionFailureMechanism : FailureMechanismBase, + IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public StrengthStabilityLengthwiseConstructionFailureMechanism() + : base(Resources.StrengthStabilityLengthwiseConstructionFailureMechanism_DisplayName, + Resources.StrengthStabilityLengthwiseConstructionFailureMechanism_Code, + 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/TechnicalInnovationFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/TechnicalInnovationFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/TechnicalInnovationFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,77 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Technical Innovations failure mechanism. + /// + public class TechnicalInnovationFailureMechanism : FailureMechanismBase, IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public TechnicalInnovationFailureMechanism() + : base(Resources.TechnicalInnovationFailureMechanismFailureMechanism_DisplayName, + Resources.TechnicalInnovationFailureMechanism_Code, + 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new TechnicalInnovationFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/WaterPressureAsphaltCoverFailureMechanism.cs =================================================================== diff -u --- Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/WaterPressureAsphaltCoverFailureMechanism.cs (revision 0) +++ Ringtoets/Integration/src/Riskeer.Integration.Data/StandAlone/WaterPressureAsphaltCoverFailureMechanism.cs (revision 8e2e40eeaf74a81592349e4ba75a14f45c9917e2) @@ -0,0 +1,76 @@ +// Copyright (C) Stichting Deltares 2018. 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.Collections.Generic; +using Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.FailureMechanism; +using Riskeer.Integration.Data.Properties; +using Riskeer.Integration.Data.StandAlone.SectionResults; + +namespace Riskeer.Integration.Data.StandAlone +{ + /// + /// Model containing input and output needed to perform different levels of the + /// Water Pressure on Asphalt failure mechanism. + /// + public class WaterPressureAsphaltCoverFailureMechanism : FailureMechanismBase, + IHasSectionResults + { + private readonly ObservableList sectionResults; + + /// + /// Initializes a new instance of the class. + /// + public WaterPressureAsphaltCoverFailureMechanism() + : base(Resources.WaterPressureAsphaltCoverFailureMechanism_DisplayName, Resources.WaterPressureAsphaltCoverFailureMechanism_Code, 4) + { + sectionResults = new ObservableList(); + } + + public override IEnumerable Calculations + { + get + { + yield break; + } + } + + public IObservableEnumerable SectionResults + { + get + { + return sectionResults; + } + } + + protected override void AddSectionResult(FailureMechanismSection section) + { + base.AddSectionResult(section); + sectionResults.Add(new WaterPressureAsphaltCoverFailureMechanismSectionResult(section)); + } + + protected override void ClearSectionResults() + { + sectionResults.Clear(); + } + } +} \ No newline at end of file