Index: Ringtoets.sln
===================================================================
diff -u -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f -rdcfb3bff66ae6101fef3d8f46ffde3e67b11cef5
--- Ringtoets.sln (.../Ringtoets.sln) (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
+++ Ringtoets.sln (.../Ringtoets.sln) (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -676,7 +676,7 @@
{C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Service", "Ringtoets\Integration\src\Ringtoets.Integration.Service\Riskeer.Integration.Service.csproj", "{28811C4A-6C18-42C1-88B2-A03A3784E2D0}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Service", "Ringtoets\Integration\src\Riskeer.Integration.Service\Riskeer.Integration.Service.csproj", "{28811C4A-6C18-42C1-88B2-A03A3784E2D0}"
ProjectSection(ProjectDependencies) = postProject
{C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC}
EndProjectSection
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/AssessmentSectionCalculationActivityFactory.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Comparers/AssessmentSectionMergeComparer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Comparers/IAssessmentSectionMergeComparer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Exceptions/LoadAssessmentSectionException.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Merge/ILoadAssessmentSectionService.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Merge/LoadAssessmentSectionService.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Merge/LoadAssessmentSectionsActivity.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Merge/LoadAssessmentSectionsActivityFactory.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/AssemblyInfo.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.Designer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.resx'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/Riskeer.Integration.Service.csproj'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Service/packages.config'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionCalculationActivityFactory.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,115 @@
+// 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 Ringtoets.ClosingStructures.Service;
+using Ringtoets.Common.Service;
+using Ringtoets.DuneErosion.Service;
+using Ringtoets.GrassCoverErosionInwards.Service;
+using Ringtoets.GrassCoverErosionOutwards.Service;
+using Ringtoets.HeightStructures.Service;
+using Ringtoets.MacroStabilityInwards.Service;
+using Ringtoets.Piping.Service;
+using Ringtoets.StabilityPointStructures.Service;
+using Ringtoets.StabilityStoneCover.Service;
+using Ringtoets.WaveImpactAsphaltCover.Service;
+using Riskeer.Integration.Data;
+
+namespace Riskeer.Integration.Service
+{
+ ///
+ /// This class defines factory methods that can be used to create instances of for
+ /// all calculations in an .
+ ///
+ public static class AssessmentSectionCalculationActivityFactory
+ {
+ ///
+ /// Creates a collection of for all relevant calculations
+ /// in the given .
+ ///
+ /// The assessment section to create the activities for.
+ /// A collection of .
+ /// Thrown when is null.
+ public static IEnumerable CreateActivities(AssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var activities = new List();
+ activities.AddRange(AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory.CreateHydraulicBoundaryLocationCalculationActivities(assessmentSection));
+
+ if (assessmentSection.Piping.IsRelevant)
+ {
+ activities.AddRange(PipingCalculationActivityFactory.CreateCalculationActivities(assessmentSection.Piping, assessmentSection));
+ }
+
+ if (assessmentSection.GrassCoverErosionInwards.IsRelevant)
+ {
+ activities.AddRange(GrassCoverErosionInwardsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.GrassCoverErosionInwards, assessmentSection));
+ }
+
+ if (assessmentSection.MacroStabilityInwards.IsRelevant)
+ {
+ activities.AddRange(MacroStabilityInwardsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.MacroStabilityInwards, assessmentSection));
+ }
+
+ if (assessmentSection.StabilityStoneCover.IsRelevant)
+ {
+ activities.AddRange(StabilityStoneCoverWaveConditionsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.StabilityStoneCover, assessmentSection));
+ }
+
+ if (assessmentSection.WaveImpactAsphaltCover.IsRelevant)
+ {
+ activities.AddRange(WaveImpactAsphaltCoverWaveConditionsCalculationActivityFactory.CreateCalculationActivities(assessmentSection.WaveImpactAsphaltCover, assessmentSection));
+ }
+
+ if (assessmentSection.GrassCoverErosionOutwards.IsRelevant)
+ {
+ activities.AddRange(GrassCoverErosionOutwardsCalculationActivityFactory.CreateCalculationActivitiesWithoutAssessmentSectionCalculations(assessmentSection.GrassCoverErosionOutwards, assessmentSection));
+ }
+
+ if (assessmentSection.HeightStructures.IsRelevant)
+ {
+ activities.AddRange(HeightStructuresCalculationActivityFactory.CreateCalculationActivities(assessmentSection.HeightStructures, assessmentSection));
+ }
+
+ if (assessmentSection.ClosingStructures.IsRelevant)
+ {
+ activities.AddRange(ClosingStructuresCalculationActivityFactory.CreateCalculationActivities(assessmentSection.ClosingStructures, assessmentSection));
+ }
+
+ if (assessmentSection.StabilityPointStructures.IsRelevant)
+ {
+ activities.AddRange(StabilityPointStructuresCalculationActivityFactory.CreateCalculationActivities(assessmentSection.StabilityPointStructures, assessmentSection));
+ }
+
+ if (assessmentSection.DuneErosion.IsRelevant)
+ {
+ activities.AddRange(DuneLocationCalculationActivityFactory.CreateCalculationActivities(assessmentSection.DuneErosion, assessmentSection));
+ }
+
+ return activities;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,142 @@
+// 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 Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Service;
+using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources;
+
+namespace Riskeer.Integration.Service
+{
+ ///
+ /// This class defines factory methods that can be used to create instances of for
+ /// hydraulic boundary location calculations on assessment section level.
+ ///
+ public static class AssessmentSectionHydraulicBoundaryLocationCalculationActivityFactory
+ {
+ ///
+ /// Creates a collection of for all hydraulic boundary location calculations
+ /// in the given .
+ ///
+ /// The assessment section to create the activities for.
+ /// A collection of .
+ /// Thrown when is null.
+ public static IEnumerable CreateHydraulicBoundaryLocationCalculationActivities(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var activities = new List();
+ activities.AddRange(CreateDesignWaterLevelCalculationActivities(assessmentSection));
+ activities.AddRange(CreateWaveHeightCalculationActivities(assessmentSection));
+ return activities;
+ }
+
+ ///
+ /// Creates a collection of for wave height calculations
+ /// based on the given .
+ ///
+ /// The assessment section to create the activities for.
+ /// A collection of .
+ /// Thrown when is null.
+ public static IEnumerable CreateWaveHeightCalculationActivities(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var activities = new List();
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
+ assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedSignalingNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedSignalingNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
+ assessmentSection.WaveHeightCalculationsForSignalingNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.SignalingNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_SignalingNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
+ assessmentSection.WaveHeightCalculationsForLowerLimitNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.LowerLimitNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_LowerLimitNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateWaveHeightCalculationActivities(
+ assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedLowerLimitNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedLowerLimitNorm_DisplayName));
+
+ return activities;
+ }
+
+ ///
+ /// Creates a collection of for design water level calculations
+ /// based on the given .
+ ///
+ /// The assessment section to create the activities for.
+ /// A collection of .
+ /// Thrown when is null.
+ public static IEnumerable CreateDesignWaterLevelCalculationActivities(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var activities = new List();
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
+ assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedSignalingNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedSignalingNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
+ assessmentSection.WaterLevelCalculationsForSignalingNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.SignalingNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_SignalingNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
+ assessmentSection.WaterLevelCalculationsForLowerLimitNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.LowerLimitNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_LowerLimitNorm_DisplayName));
+
+ activities.AddRange(HydraulicBoundaryLocationCalculationActivityFactory.CreateDesignWaterLevelCalculationActivities(
+ assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm,
+ assessmentSection,
+ assessmentSection.GetNorm(AssessmentSectionCategoryType.FactorizedLowerLimitNorm),
+ RingtoetsCommonDataResources.AssessmentSectionCategoryType_FactorizedLowerLimitNorm_DisplayName));
+
+ return activities;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/AssessmentSectionMergeComparer.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/AssessmentSectionMergeComparer.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/AssessmentSectionMergeComparer.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,99 @@
+// 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 Core.Common.Base.Geometry;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Contribution;
+using Ringtoets.Common.Data.Hydraulics;
+using Riskeer.Integration.Data;
+
+namespace Riskeer.Integration.Service.Comparers
+{
+ ///
+ /// Class which compares to
+ /// determine whether they are equal and can be used to merged.
+ ///
+ public class AssessmentSectionMergeComparer : IAssessmentSectionMergeComparer
+ {
+ public bool Compare(AssessmentSection assessmentSection, AssessmentSection otherAssessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ if (otherAssessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(otherAssessmentSection));
+ }
+
+ return assessmentSection.Id == otherAssessmentSection.Id
+ && assessmentSection.Composition == otherAssessmentSection.Composition
+ && AreReferenceLinesEquivalent(assessmentSection.ReferenceLine, otherAssessmentSection.ReferenceLine)
+ && AreHydraulicBoundaryDatabasesEquivalent(assessmentSection.HydraulicBoundaryDatabase, otherAssessmentSection.HydraulicBoundaryDatabase)
+ && AreFailureMechanismContributionsEquivalent(assessmentSection.FailureMechanismContribution, otherAssessmentSection.FailureMechanismContribution);
+ }
+
+ private static bool AreReferenceLinesEquivalent(ReferenceLine referenceLine, ReferenceLine otherReferenceLine)
+ {
+ IEnumerable referenceLineGeometry = referenceLine.Points;
+ IEnumerable otherReferenceLineGeometry = otherReferenceLine.Points;
+
+ int nrOfPoints = referenceLineGeometry.Count();
+ if (otherReferenceLineGeometry.Count() != nrOfPoints)
+ {
+ return false;
+ }
+
+ for (var i = 0; i < nrOfPoints; i++)
+ {
+ if (!referenceLineGeometry.ElementAt(i).Equals(otherReferenceLineGeometry.ElementAt(i)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private static bool AreHydraulicBoundaryDatabasesEquivalent(HydraulicBoundaryDatabase hydraulicBoundaryDatabase,
+ HydraulicBoundaryDatabase otherHydraulicBoundaryDatabase)
+ {
+ return hydraulicBoundaryDatabase.Version == otherHydraulicBoundaryDatabase.Version;
+ }
+
+ private static bool AreFailureMechanismContributionsEquivalent(FailureMechanismContribution failureMechanismContribution,
+ FailureMechanismContribution otherFailureMechanismContribution)
+ {
+ return AreNormsEquivalent(failureMechanismContribution.LowerLimitNorm, otherFailureMechanismContribution.LowerLimitNorm)
+ && AreNormsEquivalent(failureMechanismContribution.SignalingNorm, otherFailureMechanismContribution.SignalingNorm)
+ && failureMechanismContribution.NormativeNorm == otherFailureMechanismContribution.NormativeNorm;
+ }
+
+ private static bool AreNormsEquivalent(double norm, double otherNorm)
+ {
+ return Math.Abs(norm - otherNorm) < double.Epsilon;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/IAssessmentSectionMergeComparer.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/IAssessmentSectionMergeComparer.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Comparers/IAssessmentSectionMergeComparer.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,44 @@
+// 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.Integration.Data;
+
+namespace Riskeer.Integration.Service.Comparers
+{
+ ///
+ /// Specifies the interface for defining classes that can be used to compare assessment sections
+ /// which can then be used for merging operations.
+ ///
+ public interface IAssessmentSectionMergeComparer
+ {
+ ///
+ /// Compares and determines whether they are equal and thus
+ /// suitable for merge operations.
+ ///
+ /// The to compare against.
+ /// The to compare.
+ /// true when is equal to
+ /// and suitable to merge, false if otherwise.
+ /// Thrown when any parameter is null.
+ bool Compare(AssessmentSection assessmentSection, AssessmentSection otherAssessmentSection);
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Exceptions/LoadAssessmentSectionException.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Exceptions/LoadAssessmentSectionException.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Exceptions/LoadAssessmentSectionException.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,68 @@
+// 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.Runtime.Serialization;
+
+namespace Riskeer.Integration.Service.Exceptions
+{
+ ///
+ /// The exception that is thrown when something went wrong while loading assessment sections.
+ ///
+ [Serializable]
+ public class LoadAssessmentSectionException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public LoadAssessmentSectionException() {}
+
+ ///
+ /// Initializes a new instance of the class
+ /// with a specified error message.
+ ///
+ /// The message that describes the error.
+ public LoadAssessmentSectionException(string message)
+ : base(message) {}
+
+ ///
+ /// Initializes a new instance of the class with a specified error message
+ /// and a reference to the inner exception that is the cause of this exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// The exception that is the cause of the current exception,
+ /// or null if no inner exception is specified.
+ public LoadAssessmentSectionException(string message, Exception innerException) : base(message, innerException) {}
+
+ ///
+ /// Initializes a new instance of with
+ /// serialized data.
+ /// The that holds the serialized
+ /// object data about the exception being thrown.
+ /// The that contains contextual
+ /// information about the source or destination.
+ /// The parameter is
+ /// null.
+ /// The class name is null or
+ /// is zero (0).
+ protected LoadAssessmentSectionException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/ILoadAssessmentSectionService.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/ILoadAssessmentSectionService.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/ILoadAssessmentSectionService.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,42 @@
+// 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 Riskeer.Integration.Data;
+using Riskeer.Integration.Service.Exceptions;
+
+namespace Riskeer.Integration.Service.Merge
+{
+ ///
+ /// Interface for reading and providing instances.
+ ///
+ public interface ILoadAssessmentSectionService
+ {
+ ///
+ /// Loads the assessment sections from the given .
+ ///
+ /// The file path to read the assessment sections from.
+ /// A collection of .
+ /// Thrown when something went wrong
+ /// while loading the assessment sections.
+ IEnumerable LoadAssessmentSections(string filePath);
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionService.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionService.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionService.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -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;
+using System.Collections.Generic;
+using Core.Common.Base.Storage;
+using log4net;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.Service.Exceptions;
+
+namespace Riskeer.Integration.Service.Merge
+{
+ ///
+ /// Service to load a from a file.
+ ///
+ public class LoadAssessmentSectionService : ILoadAssessmentSectionService
+ {
+ private readonly ILog log = LogManager.GetLogger(typeof(LoadAssessmentSectionService));
+ private readonly IStoreProject storage;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// Class responsible for loading the project.
+ /// Thrown when is null.
+ public LoadAssessmentSectionService(IStoreProject projectStorage)
+ {
+ if (projectStorage == null)
+ {
+ throw new ArgumentNullException(nameof(projectStorage));
+ }
+
+ storage = projectStorage;
+ }
+
+ public IEnumerable LoadAssessmentSections(string filePath)
+ {
+ RingtoetsProject openedProject;
+ try
+ {
+ openedProject = (RingtoetsProject) storage.LoadProject(filePath);
+ }
+ catch (StorageException e)
+ {
+ string exceptionMessage = e.Message;
+ log.Error(exceptionMessage, e.InnerException);
+
+ throw new LoadAssessmentSectionException(exceptionMessage, e);
+ }
+
+ if (openedProject == null)
+ {
+ throw new LoadAssessmentSectionException();
+ }
+
+ return openedProject.AssessmentSections;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivity.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivity.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivity.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,95 @@
+// 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 Core.Common.Base.Service;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.Data.Merge;
+using Riskeer.Integration.Service.Properties;
+
+namespace Riskeer.Integration.Service.Merge
+{
+ ///
+ /// Activity to load a collection of from a file.
+ ///
+ internal class LoadAssessmentSectionsActivity : Activity
+ {
+ private readonly AssessmentSectionsOwner assessmentSectionsOwner;
+ private readonly ILoadAssessmentSectionService loadAssessmentSectionService;
+ private readonly string filePath;
+
+ private bool canceled;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The owner to set the retrieved collection
+ /// of on.
+ /// The service defining how to
+ /// retrieve the collection of from a file.
+ /// The file path to retrieve the collection of
+ /// from.
+ /// Thrown when any of the arguments is null.
+ public LoadAssessmentSectionsActivity(AssessmentSectionsOwner assessmentSectionsOwner,
+ ILoadAssessmentSectionService loadAssessmentSectionService,
+ string filePath)
+ {
+ if (assessmentSectionsOwner == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSectionsOwner));
+ }
+
+ if (loadAssessmentSectionService == null)
+ {
+ throw new ArgumentNullException(nameof(loadAssessmentSectionService));
+ }
+
+ if (filePath == null)
+ {
+ throw new ArgumentNullException(nameof(filePath));
+ }
+
+ this.assessmentSectionsOwner = assessmentSectionsOwner;
+ this.loadAssessmentSectionService = loadAssessmentSectionService;
+ this.filePath = filePath;
+
+ Description = Resources.LoadAssessmentSectionsActivity_Description;
+ }
+
+ protected override void OnRun()
+ {
+ assessmentSectionsOwner.AssessmentSections = loadAssessmentSectionService.LoadAssessmentSections(filePath);
+ }
+
+ protected override void OnCancel()
+ {
+ canceled = true;
+ }
+
+ protected override void OnFinish()
+ {
+ if (canceled)
+ {
+ assessmentSectionsOwner.AssessmentSections = null;
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivityFactory.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivityFactory.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Merge/LoadAssessmentSectionsActivityFactory.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,66 @@
+// 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 Core.Common.Base.Service;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.Data.Merge;
+
+namespace Riskeer.Integration.Service.Merge
+{
+ ///
+ /// This class defines factory methods that can be used to create instance of
+ /// to load .
+ ///
+ public static class LoadAssessmentSectionsActivityFactory
+ {
+ ///
+ /// Creates an activity to load collections of from a file.
+ ///
+ /// The owner to set the retrieved collection of on.
+ /// The service for retrieving the collection of
+ /// from a file.
+ /// The file path to retrieve the collection of from.
+ /// The to load from a file.
+ /// Thrown when any of the arguments is null.
+ public static Activity CreateLoadAssessmentSectionsActivity(AssessmentSectionsOwner owner,
+ ILoadAssessmentSectionService loadAssessmentSectionService,
+ string filePath)
+ {
+ if (owner == null)
+ {
+ throw new ArgumentNullException(nameof(owner));
+ }
+
+ if (loadAssessmentSectionService == null)
+ {
+ throw new ArgumentNullException(nameof(loadAssessmentSectionService));
+ }
+
+ if (filePath == null)
+ {
+ throw new ArgumentNullException(nameof(filePath));
+ }
+
+ return new LoadAssessmentSectionsActivity(owner, loadAssessmentSectionService, filePath);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/AssemblyInfo.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/AssemblyInfo.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/AssemblyInfo.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -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.Service")]
+[assembly: AssemblyProduct("Riskeer.Integration.Service")]
+[assembly: InternalsVisibleTo("Ringtoets.Integration.Service.Test")]
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.Designer.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.Designer.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.Designer.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,93 @@
+// 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.Service.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()]
+ internal 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)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Riskeer.Integration.Service.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)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Inlezen van project.
+ ///
+ internal static string LoadAssessmentSectionsActivity_Description {
+ get {
+ return ResourceManager.GetString("LoadAssessmentSectionsActivity_Description", resourceCulture);
+ }
+ }
+ }
+}
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.resx
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.resx (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/Properties/Resources.resx (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ Inlezen van project
+
+
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Service/RingtoetsDataSynchronizationService.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Service/RingtoetsDataSynchronizationService.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Service/RingtoetsDataSynchronizationService.cs (revision dcfb3bff66ae6101fef3d8f46ffde3e67b11cef5)
@@ -0,0 +1,730 @@
+// 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 Core.Common.Base;
+using Ringtoets.ClosingStructures.Data;
+using Ringtoets.ClosingStructures.Service;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Calculation;
+using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.Structures;
+using Ringtoets.Common.Service;
+using Ringtoets.DuneErosion.Data;
+using Ringtoets.DuneErosion.Service;
+using Ringtoets.GrassCoverErosionInwards.Data;
+using Ringtoets.GrassCoverErosionInwards.Service;
+using Ringtoets.GrassCoverErosionInwards.Util;
+using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.GrassCoverErosionOutwards.Service;
+using Ringtoets.HeightStructures.Data;
+using Ringtoets.HeightStructures.Service;
+using Ringtoets.MacroStabilityInwards.Data;
+using Ringtoets.MacroStabilityInwards.Service;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Service;
+using Ringtoets.Revetment.Data;
+using Ringtoets.StabilityPointStructures.Data;
+using Ringtoets.StabilityPointStructures.Service;
+using Ringtoets.StabilityStoneCover.Data;
+using Ringtoets.StabilityStoneCover.Service;
+using Ringtoets.WaveImpactAsphaltCover.Data;
+using Ringtoets.WaveImpactAsphaltCover.Service;
+
+namespace Riskeer.Integration.Service
+{
+ ///
+ /// Service for synchronizing ringtoets.
+ ///
+ public static class RingtoetsDataSynchronizationService
+ {
+ ///
+ /// Clears all the output data and hydraulic boundary locations within the .
+ ///
+ /// The to clear the data for.
+ /// An of calculations which are affected by
+ /// removing data.
+ /// /// Thrown when is null.
+ public static IEnumerable ClearAllCalculationOutputAndHydraulicBoundaryLocations(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var changedObservables = new List();
+
+ foreach (IFailureMechanism failureMechanism in assessmentSection.GetFailureMechanisms())
+ {
+ var pipingFailureMechanism = failureMechanism as PipingFailureMechanism;
+ var grassCoverErosionInwardsFailureMechanism = failureMechanism as GrassCoverErosionInwardsFailureMechanism;
+ var stabilityStoneCoverFailureMechanism = failureMechanism as StabilityStoneCoverFailureMechanism;
+ var heightStructuresFailureMechanism = failureMechanism as HeightStructuresFailureMechanism;
+ var closingStructuresFailureMechanism = failureMechanism as ClosingStructuresFailureMechanism;
+ var stabilityPointStructuresFailureMechanism = failureMechanism as StabilityPointStructuresFailureMechanism;
+ var grassCoverErosionOutwardsFailureMechanism = failureMechanism as GrassCoverErosionOutwardsFailureMechanism;
+ var waveImpactAsphaltCoverFailureMechanism = failureMechanism as WaveImpactAsphaltCoverFailureMechanism;
+ var macroStabilityInwardsFailureMechanism = failureMechanism as MacroStabilityInwardsFailureMechanism;
+
+ if (pipingFailureMechanism != null)
+ {
+ changedObservables.AddRange(PipingDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(pipingFailureMechanism));
+ }
+
+ if (grassCoverErosionInwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(GrassCoverErosionInwardsDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(grassCoverErosionInwardsFailureMechanism));
+ }
+
+ if (stabilityStoneCoverFailureMechanism != null)
+ {
+ changedObservables.AddRange(StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(stabilityStoneCoverFailureMechanism));
+ }
+
+ if (waveImpactAsphaltCoverFailureMechanism != null)
+ {
+ changedObservables.AddRange(WaveImpactAsphaltCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(waveImpactAsphaltCoverFailureMechanism));
+ }
+
+ if (grassCoverErosionOutwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutputAndHydraulicBoundaryLocations(grassCoverErosionOutwardsFailureMechanism));
+ }
+
+ if (heightStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(HeightStructuresDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(heightStructuresFailureMechanism));
+ }
+
+ if (closingStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(ClosingStructuresDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(closingStructuresFailureMechanism));
+ }
+
+ if (stabilityPointStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(StabilityPointStructuresDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(stabilityPointStructuresFailureMechanism));
+ }
+
+ if (macroStabilityInwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(MacroStabilityInwardsDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(macroStabilityInwardsFailureMechanism));
+ }
+ }
+
+ return changedObservables;
+ }
+
+ ///
+ /// Clears the output of all calculations in the .
+ ///
+ /// The which contains the calculations.
+ /// An of calculations which are affected by clearing the output.
+ /// Thrown when is null.
+ public static IEnumerable ClearFailureMechanismCalculationOutputs(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ return ClearFailureMechanismCalculationOutputs(assessmentSection.GetFailureMechanisms());
+ }
+
+ ///
+ /// Clears the output of all calculations of the given .
+ ///
+ /// The failure mechanisms that contain the calculations.
+ /// An of calculations that are affected by clearing the output.
+ /// Thrown when is null.
+ public static IEnumerable ClearFailureMechanismCalculationOutputs(IEnumerable failureMechanisms)
+ {
+ if (failureMechanisms == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanisms));
+ }
+
+ var changedObservables = new List();
+
+ foreach (IFailureMechanism failureMechanism in failureMechanisms)
+ {
+ var pipingFailureMechanism = failureMechanism as PipingFailureMechanism;
+ var grassCoverErosionInwardsFailureMechanism = failureMechanism as GrassCoverErosionInwardsFailureMechanism;
+ var stabilityStoneCoverFailureMechanism = failureMechanism as StabilityStoneCoverFailureMechanism;
+ var heightStructuresFailureMechanism = failureMechanism as HeightStructuresFailureMechanism;
+ var closingStructuresFailureMechanism = failureMechanism as ClosingStructuresFailureMechanism;
+ var stabilityPointStructuresFailureMechanism = failureMechanism as StabilityPointStructuresFailureMechanism;
+ var grassCoverErosionOutwardsFailureMechanism = failureMechanism as GrassCoverErosionOutwardsFailureMechanism;
+ var waveImpactAsphaltCoverFailureMechanism = failureMechanism as WaveImpactAsphaltCoverFailureMechanism;
+ var macroStabilityInwardsFailureMechanism = failureMechanism as MacroStabilityInwardsFailureMechanism;
+
+ if (pipingFailureMechanism != null)
+ {
+ changedObservables.AddRange(PipingDataSynchronizationService.ClearAllCalculationOutput(pipingFailureMechanism));
+ }
+
+ if (grassCoverErosionInwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(GrassCoverErosionInwardsDataSynchronizationService.ClearAllCalculationOutput(grassCoverErosionInwardsFailureMechanism));
+ }
+
+ if (stabilityStoneCoverFailureMechanism != null)
+ {
+ changedObservables.AddRange(StabilityStoneCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutput(stabilityStoneCoverFailureMechanism));
+ }
+
+ if (waveImpactAsphaltCoverFailureMechanism != null)
+ {
+ changedObservables.AddRange(WaveImpactAsphaltCoverDataSynchronizationService.ClearAllWaveConditionsCalculationOutput(waveImpactAsphaltCoverFailureMechanism));
+ }
+
+ if (grassCoverErosionOutwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(GrassCoverErosionOutwardsDataSynchronizationService.ClearAllWaveConditionsCalculationOutput(grassCoverErosionOutwardsFailureMechanism));
+ }
+
+ if (heightStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(HeightStructuresDataSynchronizationService.ClearAllCalculationOutput(heightStructuresFailureMechanism));
+ }
+
+ if (closingStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(ClosingStructuresDataSynchronizationService.ClearAllCalculationOutput(closingStructuresFailureMechanism));
+ }
+
+ if (stabilityPointStructuresFailureMechanism != null)
+ {
+ changedObservables.AddRange(StabilityPointStructuresDataSynchronizationService.ClearAllCalculationOutput(stabilityPointStructuresFailureMechanism));
+ }
+
+ if (macroStabilityInwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(MacroStabilityInwardsDataSynchronizationService.ClearAllCalculationOutput(macroStabilityInwardsFailureMechanism));
+ }
+ }
+
+ return changedObservables;
+ }
+
+ ///
+ /// Clears the hydraulic boundary location calculation output that is contained
+ /// within specific failure mechanisms of the .
+ ///
+ /// The which contains the hydraulic boundary
+ /// location calculations and failure mechanisms at stake.
+ /// All objects affected by the operation.
+ /// Thrown when is null.
+ public static IEnumerable ClearHydraulicBoundaryLocationCalculationOutput(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var affectedObjects = new List();
+
+ affectedObjects.AddRange(ClearHydraulicBoundaryLocationCalculationOutputOfFailureMechanisms(assessmentSection));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaterLevelCalculationsForSignalingNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaterLevelCalculationsForLowerLimitNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaveHeightCalculationsForSignalingNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaveHeightCalculationsForLowerLimitNorm));
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm));
+
+ return affectedObjects.ToArray();
+ }
+
+ ///
+ /// Clears the hydraulic boundary location calculation output that is contained within specific failure mechanisms
+ /// of the .
+ ///
+ /// The which contains the failure mechanisms.
+ /// All objects affected by the operation.
+ /// Thrown when is null.
+ public static IEnumerable ClearHydraulicBoundaryLocationCalculationOutputOfFailureMechanisms(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ return ClearHydraulicBoundaryLocationCalculationOutputOfFailureMechanisms(assessmentSection.GetFailureMechanisms());
+ }
+
+ ///
+ /// Clears the hydraulic boundary location calculation output that is contained within .
+ ///
+ /// The failure mechanisms to clear the hydraulic boundary location calculation output for.
+ /// All objects affected by the operation.
+ /// Thrown when is null.
+ public static IEnumerable ClearHydraulicBoundaryLocationCalculationOutputOfFailureMechanisms(IEnumerable failureMechanisms)
+ {
+ if (failureMechanisms == null)
+ {
+ throw new ArgumentNullException(nameof(failureMechanisms));
+ }
+
+ var changedObservables = new List();
+
+ foreach (IFailureMechanism failureMechanism in failureMechanisms)
+ {
+ var grassCoverErosionOutwardsFailureMechanism = failureMechanism as GrassCoverErosionOutwardsFailureMechanism;
+ if (grassCoverErosionOutwardsFailureMechanism != null)
+ {
+ changedObservables.AddRange(GrassCoverErosionOutwardsDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(grassCoverErosionOutwardsFailureMechanism));
+ }
+
+ var duneErosionFailureMechanism = failureMechanism as DuneErosionFailureMechanism;
+ if (duneErosionFailureMechanism != null)
+ {
+ changedObservables.AddRange(DuneErosionDataSynchronizationService.ClearDuneLocationCalculationOutput(duneErosionFailureMechanism));
+ }
+ }
+
+ return changedObservables;
+ }
+
+ ///
+ /// Clears the reference line and all data that depends on it, either directly or indirectly.
+ ///
+ /// The assessment section.
+ /// The results of the clear action.
+ /// Thrown when
+ /// is null.
+ public static ClearResults ClearReferenceLineDependentData(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ var changedObjects = new List();
+ var removedObjects = new List