Index: Ringtoets.sln
===================================================================
diff -u -r457970572d405d707ca5a96836d6a48babffc3a7 -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f
--- Ringtoets.sln (.../Ringtoets.sln) (revision 457970572d405d707ca5a96836d6a48babffc3a7)
+++ Ringtoets.sln (.../Ringtoets.sln) (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -298,7 +298,7 @@
{C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Plugin", "Ringtoets\Integration\src\Ringtoets.Integration.Plugin\Riskeer.Integration.Plugin.csproj", "{C8383B76-B3F1-4E6E-B56C-527B469FA20A}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Riskeer.Integration.Plugin", "Ringtoets\Integration\src\Riskeer.Integration.Plugin\Riskeer.Integration.Plugin.csproj", "{C8383B76-B3F1-4E6E-B56C-527B469FA20A}"
ProjectSection(ProjectDependencies) = postProject
{C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC}
EndProjectSection
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/GrassCoverSlipOffInwardsFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/MacroStabilityOutwardsFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/MicrostabilityFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/PipingStructureFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/TechnicalInnovationFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/WaterPressureAsphaltCoverFailureMechanismSectionResultUpdateStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicBoundaryDatabaseUpdateHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseImportHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Helpers/HydraulicLocationConfigurationSettingsConstants.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Helpers/HydraulicLocationConfigurationSettingsUpdateHelper.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMerger.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionProvider.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionProviderException.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/IAssessmentSectionMergeHandler.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/IAssessmentSectionProvider.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/AssemblyInfo.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Resources/AssemblyResultPerSection.png
===================================================================
diff -u -r9dbf7bccb39f8f0516c34a816cdec5ad669d440f -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f
Binary files differ
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Resources/AssemblyResultPerSectionMap.png
===================================================================
diff -u -ra6d8f7c8868a573cb4026770119c5f997039ca2a -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f
Binary files differ
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Resources/AssemblyResultTotal.png
===================================================================
diff -u -r9dbf7bccb39f8f0516c34a816cdec5ad669d440f -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f
Binary files differ
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Resources/Foreshore.png
===================================================================
diff -u -r1dddcf22e6d496a00dcfe85cf8d1302a8df121cd -rc3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f
Binary files differ
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsRibbon.xaml'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsRibbon.xaml.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Riskeer.Integration.Plugin.csproj'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Plugin/packages.config'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileReplaceDataStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,70 @@
+// 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.Common.Data.Calculation;
+using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.UpdateDataStrategies;
+using Ringtoets.Common.IO.FileImporters;
+using Riskeer.Integration.Service;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// A
+ /// to replace foreshore profiles with imported foreshore profiles.
+ ///
+ public class ForeshoreProfileReplaceDataStrategy : ReplaceDataStrategyBase,
+ IForeshoreProfileUpdateDataStrategy
+ {
+ private readonly ForeshoreProfileCollection foreshoreProfileCollection;
+
+ ///
+ /// Initializes a .
+ ///
+ /// The failure mechanism in which the foreshore
+ /// profiles are updated.
+ /// The collection containing the foreshore profiles.
+ /// Thrown when any parameter
+ /// is null.
+ public ForeshoreProfileReplaceDataStrategy(IFailureMechanism failureMechanism, ForeshoreProfileCollection foreshoreProfiles)
+ : base(failureMechanism, foreshoreProfiles)
+ {
+ foreshoreProfileCollection = foreshoreProfiles;
+ }
+
+ public IEnumerable UpdateForeshoreProfilesWithImportedData(IEnumerable importedDataCollection, string sourceFilePath)
+ {
+ return ReplaceTargetCollectionWithImportedData(importedDataCollection, sourceFilePath);
+ }
+
+ protected override IEnumerable ClearData()
+ {
+ IEnumerable> calculations = FailureMechanism.Calculations
+ .Cast>();
+ return RingtoetsDataSynchronizationService.RemoveAllForeshoreProfiles(calculations, foreshoreProfileCollection);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/ForeshoreProfileUpdateDataStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,119 @@
+// 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.Common.Data.Calculation;
+using Ringtoets.Common.Data.DikeProfiles;
+using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.UpdateDataStrategies;
+using Ringtoets.Common.IO.FileImporters;
+using Ringtoets.Common.Service;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An for
+ /// updating surface lines based on imported data.
+ ///
+ public class ForeshoreProfileUpdateDataStrategy : UpdateDataStrategyBase,
+ IForeshoreProfileUpdateDataStrategy
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism in which the
+ /// are updated.
+ /// The foreshore profiles which will be updated.
+ /// Thrown when any input parameter is null.
+ public ForeshoreProfileUpdateDataStrategy(IFailureMechanism failureMechanism, ForeshoreProfileCollection foreshoreProfiles)
+ : base(failureMechanism, foreshoreProfiles, new ForeshoreProfileEqualityComparer()) {}
+
+ public IEnumerable UpdateForeshoreProfilesWithImportedData(IEnumerable importedDataCollection, string sourceFilePath)
+ {
+ return UpdateTargetCollectionData(importedDataCollection, sourceFilePath);
+ }
+
+ protected override IEnumerable RemoveObjectAndDependentData(ForeshoreProfile removedObject)
+ {
+ IEnumerable> affectedCalculations = GetAffectedCalculationWithForeshoreProfiles(removedObject);
+
+ var affectedObjects = new List();
+ foreach (ICalculation calculation in affectedCalculations)
+ {
+ ((IHasForeshoreProfile) calculation.InputParameters).ForeshoreProfile = null;
+ affectedObjects.Add(calculation.InputParameters);
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation));
+ }
+
+ return affectedObjects;
+ }
+
+ protected override IEnumerable UpdateObjectAndDependentData(ForeshoreProfile objectToUpdate, ForeshoreProfile objectToUpdateFrom)
+ {
+ objectToUpdate.CopyProperties(objectToUpdateFrom);
+
+ var affectedObjects = new List();
+
+ IEnumerable> affectedCalculations = GetAffectedCalculationWithForeshoreProfiles(objectToUpdate);
+
+ foreach (ICalculation calculation in affectedCalculations)
+ {
+ affectedObjects.Add(calculation.InputParameters);
+ affectedObjects.AddRange(RingtoetsCommonDataSynchronizationService.ClearCalculationOutput(calculation));
+
+ if (!objectToUpdate.Geometry.Any())
+ {
+ ((IUseForeshore) calculation.InputParameters).UseForeshore = false;
+ }
+ }
+
+ return affectedObjects;
+ }
+
+ private IEnumerable> GetAffectedCalculationWithForeshoreProfiles(ForeshoreProfile foreshoreProfile)
+ {
+ IEnumerable> calculations = FailureMechanism.Calculations.Cast>();
+ IEnumerable> affectedCalculations =
+ calculations.Where(calc => ReferenceEquals(
+ ((IHasForeshoreProfile) calc.InputParameters).ForeshoreProfile, foreshoreProfile));
+ return affectedCalculations;
+ }
+
+ ///
+ /// Class for comparing he only by ID.
+ ///
+ private class ForeshoreProfileEqualityComparer : IEqualityComparer
+ {
+ public bool Equals(ForeshoreProfile x, ForeshoreProfile y)
+ {
+ return x.Id.Equals(y.Id);
+ }
+
+ public int GetHashCode(ForeshoreProfile obj)
+ {
+ return obj.Id.GetHashCode();
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffInwardsFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffInwardsFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffInwardsFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,54 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class GrassCoverSlipOffInwardsFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(GrassCoverSlipOffInwardsFailureMechanismSectionResult origin, GrassCoverSlipOffInwardsFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.DetailedAssessmentResult = origin.DetailedAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,54 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class GrassCoverSlipOffOutwardsFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(GrassCoverSlipOffOutwardsFailureMechanismSectionResult origin, GrassCoverSlipOffOutwardsFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.DetailedAssessmentResult = origin.DetailedAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MacroStabilityOutwardsFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MacroStabilityOutwardsFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MacroStabilityOutwardsFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,56 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class MacroStabilityOutwardsFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(MacroStabilityOutwardsFailureMechanismSectionResult origin, MacroStabilityOutwardsFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.DetailedAssessmentResult = origin.DetailedAssessmentResult;
+ target.DetailedAssessmentProbability = origin.DetailedAssessmentProbability;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.TailorMadeAssessmentProbability = origin.TailorMadeAssessmentProbability;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MicrostabilityFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MicrostabilityFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/MicrostabilityFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,54 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class MicrostabilityFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(MicrostabilityFailureMechanismSectionResult origin, MicrostabilityFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.DetailedAssessmentResult = origin.DetailedAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/PipingStructureFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/PipingStructureFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/PipingStructureFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,54 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class PipingStructureFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(PipingStructureFailureMechanismSectionResult origin, PipingStructureFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.DetailedAssessmentResult = origin.DetailedAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,53 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult origin, StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/TechnicalInnovationFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/TechnicalInnovationFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/TechnicalInnovationFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,53 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class TechnicalInnovationFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(TechnicalInnovationFailureMechanismSectionResult origin, TechnicalInnovationFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/WaterPressureAsphaltCoverFailureMechanismSectionResultUpdateStrategy.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/WaterPressureAsphaltCoverFailureMechanismSectionResultUpdateStrategy.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/FileImporters/WaterPressureAsphaltCoverFailureMechanismSectionResultUpdateStrategy.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,53 @@
+// 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.IO.FileImporters;
+using Riskeer.Integration.Data.StandAlone.SectionResults;
+
+namespace Riskeer.Integration.Plugin.FileImporters
+{
+ ///
+ /// An update strategy that can be used to update a instance with data
+ /// from an old instance.
+ ///
+ public class WaterPressureAsphaltCoverFailureMechanismSectionResultUpdateStrategy
+ : IFailureMechanismSectionResultUpdateStrategy
+ {
+ public void UpdateSectionResult(WaterPressureAsphaltCoverFailureMechanismSectionResult origin, WaterPressureAsphaltCoverFailureMechanismSectionResult target)
+ {
+ if (origin == null)
+ {
+ throw new ArgumentNullException(nameof(origin));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target));
+ }
+
+ target.SimpleAssessmentResult = origin.SimpleAssessmentResult;
+ target.TailorMadeAssessmentResult = origin.TailorMadeAssessmentResult;
+ target.UseManualAssembly = origin.UseManualAssembly;
+ target.ManualAssemblyCategoryGroup = origin.ManualAssemblyCategoryGroup;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/AssessmentSectionCompositionChangeHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,170 @@
+// 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 System.Windows.Forms;
+using Core.Common.Base;
+using Core.Common.Gui.Commands;
+using Core.Common.Util;
+using log4net;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Calculation;
+using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.DuneErosion.Data;
+using Ringtoets.StabilityStoneCover.Data;
+using Ringtoets.WaveImpactAsphaltCover.Data;
+using Riskeer.Integration.Forms.PropertyClasses;
+using Riskeer.Integration.Plugin.Properties;
+using Riskeer.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class responsible for changing the
+ /// value clearing all data dependent on the original composition value.
+ ///
+ public class AssessmentSectionCompositionChangeHandler : IAssessmentSectionCompositionChangeHandler
+ {
+ private readonly IViewCommands viewCommands;
+ private readonly ILog log = LogManager.GetLogger(typeof(AssessmentSectionCompositionChangeHandler));
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The view commands used to close views for irrelevant
+ /// failure mechanisms.
+ /// Thrown when
+ /// is null.
+ public AssessmentSectionCompositionChangeHandler(IViewCommands viewCommands)
+ {
+ if (viewCommands == null)
+ {
+ throw new ArgumentNullException(nameof(viewCommands));
+ }
+
+ this.viewCommands = viewCommands;
+ }
+
+ public bool ConfirmCompositionChange()
+ {
+ DialogResult result = MessageBox.Show(Resources.AssessmentSectionCompositionChangeHandler_Confirm_change_composition_and_clear_dependent_data,
+ CoreCommonBaseResources.Confirm,
+ MessageBoxButtons.OKCancel);
+ return result == DialogResult.OK;
+ }
+
+ public IEnumerable ChangeComposition(IAssessmentSection assessmentSection, AssessmentSectionComposition newComposition)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ Dictionary oldFailureMechanismContributions = assessmentSection.GetFailureMechanisms().ToDictionary(f => f, f => f.Contribution, new ReferenceEqualityComparer());
+ Dictionary oldFailureMechanismRelevancies = assessmentSection.GetFailureMechanisms().ToDictionary(f => f, f => f.IsRelevant, new ReferenceEqualityComparer());
+
+ var affectedObjects = new List();
+ if (assessmentSection.Composition != newComposition)
+ {
+ assessmentSection.ChangeComposition(newComposition);
+
+ affectedObjects.Add(assessmentSection);
+ affectedObjects.AddRange(assessmentSection.GetFailureMechanisms());
+
+ IFailureMechanism[] failureMechanismsToClearOutputFor = GetFailureMechanismsToClearOutputFor(assessmentSection, oldFailureMechanismContributions).ToArray();
+
+ IObservable[] affectedCalculations =
+ RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(failureMechanismsToClearOutputFor).ToArray();
+
+ if (affectedCalculations.Length > 0)
+ {
+ affectedObjects.AddRange(affectedCalculations);
+ log.InfoFormat(Resources.ChangeHandler_Results_of_NumberOfCalculations_0_calculations_cleared,
+ affectedObjects.OfType().Count());
+ }
+
+ affectedObjects.AddRange(ClearHydraulicBoundaryLocationCalculationOutput(failureMechanismsToClearOutputFor));
+
+ CloseViewsForIrrelevantFailureMechanisms(GetFailureMechanismsWithRelevancyUpdated(oldFailureMechanismRelevancies));
+ }
+
+ return affectedObjects;
+ }
+
+ private void CloseViewsForIrrelevantFailureMechanisms(IEnumerable failureMechanisms)
+ {
+ foreach (IFailureMechanism failureMechanism in failureMechanisms.Where(fm => !fm.IsRelevant))
+ {
+ viewCommands.RemoveAllViewsForItem(failureMechanism);
+ }
+ }
+
+ private static IEnumerable GetFailureMechanismsWithRelevancyUpdated(IDictionary oldFailureMechanismRelevancies)
+ {
+ return oldFailureMechanismRelevancies.Where(fmr => fmr.Value != fmr.Key.IsRelevant).Select(fmr => fmr.Key);
+ }
+
+ private static IEnumerable GetFailureMechanismsToClearOutputFor(IAssessmentSection assessmentSection,
+ IDictionary oldFailureMechanismContributions)
+ {
+ var failureMechanismsToClearOutputFor = new List();
+ foreach (IFailureMechanism failureMechanism in assessmentSection.GetFailureMechanisms())
+ {
+ if (failureMechanism is StabilityStoneCoverFailureMechanism || failureMechanism is WaveImpactAsphaltCoverFailureMechanism)
+ {
+ continue;
+ }
+
+ if (failureMechanism is DuneErosionFailureMechanism)
+ {
+ failureMechanismsToClearOutputFor.Add(failureMechanism);
+ }
+
+ if (oldFailureMechanismContributions.ContainsKey(failureMechanism))
+ {
+ double oldContribution = oldFailureMechanismContributions[failureMechanism];
+ if (Math.Abs(oldContribution) > 1e-6 && Math.Abs(oldContribution - failureMechanism.Contribution) > 1e-6)
+ {
+ failureMechanismsToClearOutputFor.Add(failureMechanism);
+ }
+ }
+ }
+
+ return failureMechanismsToClearOutputFor;
+ }
+
+ private IEnumerable ClearHydraulicBoundaryLocationCalculationOutput(IEnumerable failureMechanismsToClearOutputFor)
+ {
+ IEnumerable affectedObjects =
+ RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutputOfFailureMechanisms(failureMechanismsToClearOutputFor);
+ if (affectedObjects.Any())
+ {
+ log.Info(Resources.AssessmentSectionCompositionChangeHandler_Waveheight_and_design_water_level_results_cleared);
+ return affectedObjects;
+ }
+
+ return Enumerable.Empty();
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,120 @@
+// 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 System.Windows.Forms;
+using Core.Common.Base;
+using log4net;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Data.Calculation;
+using Ringtoets.Common.Data.Contribution;
+using Ringtoets.Common.Forms.PropertyClasses;
+using Riskeer.Integration.Plugin.Properties;
+using Riskeer.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class responsible for changing the
+ /// value of the of an
+ /// and clearing all data dependent on the original norm value.
+ ///
+ public class FailureMechanismContributionNormChangeHandler : IObservablePropertyChangeHandler
+ {
+ private readonly IAssessmentSection assessmentSection;
+ private readonly ILog log = LogManager.GetLogger(typeof(FailureMechanismContributionNormChangeHandler));
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The assessment section to change the contribution norm for.
+ /// Thrown when
+ /// is null.
+ public FailureMechanismContributionNormChangeHandler(IAssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ this.assessmentSection = assessmentSection;
+ }
+
+ public IEnumerable SetPropertyValueAfterConfirmation(SetObservablePropertyValueDelegate setValue)
+ {
+ if (setValue == null)
+ {
+ throw new ArgumentNullException(nameof(setValue));
+ }
+
+ var affectedObjects = new List();
+
+ if (ConfirmPropertyChange())
+ {
+ setValue();
+
+ affectedObjects.AddRange(ClearAllNormDependentCalculationOutput());
+ affectedObjects.Add(assessmentSection.FailureMechanismContribution);
+ affectedObjects.AddRange(assessmentSection.GetFailureMechanisms());
+ }
+
+ return affectedObjects;
+ }
+
+ private static bool ConfirmPropertyChange()
+ {
+ DialogResult result = MessageBox.Show(Resources.FailureMechanismContributionNormChangeHandler_Confirm_change_norm_and_clear_dependent_data,
+ CoreCommonBaseResources.Confirm,
+ MessageBoxButtons.OKCancel);
+ return result == DialogResult.OK;
+ }
+
+ private IEnumerable ClearAllNormDependentCalculationOutput()
+ {
+ List affectedObjects = RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(assessmentSection).ToList();
+ if (affectedObjects.Count > 0)
+ {
+ log.InfoFormat(Resources.ChangeHandler_Results_of_NumberOfCalculations_0_calculations_cleared,
+ affectedObjects.OfType().Count());
+ }
+
+ affectedObjects.AddRange(ClearAllHydraulicBoundaryLocationCalculationOutput());
+
+ return affectedObjects;
+ }
+
+ private IEnumerable ClearAllHydraulicBoundaryLocationCalculationOutput()
+ {
+ IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection);
+
+ if (affectedObjects.Any())
+ {
+ log.Info(Resources.FailureMechanismContributionNormChangeHandler_Waveheight_and_design_water_level_results_cleared);
+ return affectedObjects;
+ }
+
+ return Enumerable.Empty();
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicBoundaryDatabaseUpdateHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicBoundaryDatabaseUpdateHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicBoundaryDatabaseUpdateHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,241 @@
+// 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 System.Windows.Forms;
+using Core.Common.Base;
+using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.DuneErosion.Plugin.Handlers;
+using Riskeer.HydraRing.IO.HydraulicBoundaryDatabase;
+using Riskeer.HydraRing.IO.HydraulicLocationConfigurationDatabase;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.IO.Handlers;
+using Riskeer.Integration.Plugin.Helpers;
+using Riskeer.Integration.Plugin.Properties;
+using Riskeer.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class that can properly update a .
+ ///
+ public class HydraulicBoundaryDatabaseUpdateHandler : IHydraulicBoundaryDatabaseUpdateHandler
+ {
+ private readonly AssessmentSection assessmentSection;
+ private readonly IDuneLocationsReplacementHandler duneLocationsReplacementHandler;
+ private bool updateLocations;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The assessment section to update for.
+ /// The handler to replace dune locations.
+ /// Thrown when any parameter is null.
+ public HydraulicBoundaryDatabaseUpdateHandler(AssessmentSection assessmentSection,
+ IDuneLocationsReplacementHandler duneLocationsReplacementHandler)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ if (duneLocationsReplacementHandler == null)
+ {
+ throw new ArgumentNullException(nameof(duneLocationsReplacementHandler));
+ }
+
+ this.assessmentSection = assessmentSection;
+ this.duneLocationsReplacementHandler = duneLocationsReplacementHandler;
+ }
+
+ public bool IsConfirmationRequired(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, ReadHydraulicBoundaryDatabase readHydraulicBoundaryDatabase)
+ {
+ if (hydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase));
+ }
+
+ if (readHydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(readHydraulicBoundaryDatabase));
+ }
+
+ return hydraulicBoundaryDatabase.IsLinked() && hydraulicBoundaryDatabase.Version != readHydraulicBoundaryDatabase.Version;
+ }
+
+ public bool InquireConfirmation()
+ {
+ DialogResult result = MessageBox.Show(Resources.HydraulicBoundaryDatabaseUpdateHandler_Confirm_clear_hydraulicBoundaryDatabase_dependent_data,
+ CoreCommonBaseResources.Confirm,
+ MessageBoxButtons.OKCancel);
+ return result == DialogResult.OK;
+ }
+
+ public IEnumerable Update(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, ReadHydraulicBoundaryDatabase readHydraulicBoundaryDatabase,
+ ReadHydraulicLocationConfigurationDatabase readHydraulicLocationConfigurationDatabase,
+ IEnumerable excludedLocationIds, string hydraulicBoundaryDatabaseFilePath, string hlcdFilePath)
+ {
+ if (hydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase));
+ }
+
+ if (readHydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(readHydraulicBoundaryDatabase));
+ }
+
+ if (readHydraulicLocationConfigurationDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(readHydraulicLocationConfigurationDatabase));
+ }
+
+ if (excludedLocationIds == null)
+ {
+ throw new ArgumentNullException(nameof(excludedLocationIds));
+ }
+
+ if (hydraulicBoundaryDatabaseFilePath == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabaseFilePath));
+ }
+
+ if (hlcdFilePath == null)
+ {
+ throw new ArgumentNullException(nameof(hlcdFilePath));
+ }
+
+ if (!IsValidReadHydraulicLocationConfigurationDatabase(readHydraulicLocationConfigurationDatabase))
+ {
+ string errorMessage = $"{nameof(readHydraulicLocationConfigurationDatabase)} must be null or contain exactly one item for " +
+ "the collection of hydraulic location configuration database settings.";
+ throw new ArgumentException(errorMessage);
+ }
+
+ var changedObjects = new List();
+
+ updateLocations = !hydraulicBoundaryDatabase.IsLinked() || hydraulicBoundaryDatabase.Version != readHydraulicBoundaryDatabase.Version;
+
+ if (updateLocations)
+ {
+ hydraulicBoundaryDatabase.FilePath = hydraulicBoundaryDatabaseFilePath;
+ hydraulicBoundaryDatabase.Version = readHydraulicBoundaryDatabase.Version;
+
+ SetLocations(hydraulicBoundaryDatabase, readHydraulicBoundaryDatabase.Locations,
+ readHydraulicLocationConfigurationDatabase.LocationIdMappings,
+ excludedLocationIds.ToArray());
+
+ assessmentSection.SetHydraulicBoundaryLocationCalculations(hydraulicBoundaryDatabase.Locations);
+ assessmentSection.GrassCoverErosionOutwards.SetHydraulicBoundaryLocationCalculations(hydraulicBoundaryDatabase.Locations);
+
+ duneLocationsReplacementHandler.Replace(hydraulicBoundaryDatabase.Locations);
+
+ changedObjects.AddRange(GetLocationsAndCalculationsObservables(hydraulicBoundaryDatabase));
+ changedObjects.AddRange(RingtoetsDataSynchronizationService.ClearAllCalculationOutputAndHydraulicBoundaryLocations(assessmentSection));
+ }
+ else
+ {
+ if (hydraulicBoundaryDatabase.FilePath != hydraulicBoundaryDatabaseFilePath)
+ {
+ hydraulicBoundaryDatabase.FilePath = hydraulicBoundaryDatabaseFilePath;
+ }
+ }
+
+ HydraulicLocationConfigurationSettingsUpdateHelper.SetHydraulicLocationConfigurationSettings(hydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings,
+ readHydraulicLocationConfigurationDatabase.ReadHydraulicLocationConfigurationDatabaseSettings?.Single(),
+ hlcdFilePath);
+
+ return changedObjects;
+ }
+
+ public void DoPostUpdateActions()
+ {
+ if (updateLocations)
+ {
+ duneLocationsReplacementHandler.DoPostReplacementUpdates();
+ }
+ }
+
+ private static bool IsValidReadHydraulicLocationConfigurationDatabase(ReadHydraulicLocationConfigurationDatabase readHydraulicLocationConfigurationDatabase)
+ {
+ return readHydraulicLocationConfigurationDatabase.ReadHydraulicLocationConfigurationDatabaseSettings == null
+ || readHydraulicLocationConfigurationDatabase.ReadHydraulicLocationConfigurationDatabaseSettings.Count() == 1;
+ }
+
+ private IEnumerable GetLocationsAndCalculationsObservables(HydraulicBoundaryDatabase hydraulicBoundaryDatabase)
+ {
+ return new IObservable[]
+ {
+ hydraulicBoundaryDatabase.Locations,
+ assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm,
+ assessmentSection.WaterLevelCalculationsForSignalingNorm,
+ assessmentSection.WaterLevelCalculationsForLowerLimitNorm,
+ assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm,
+ assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm,
+ assessmentSection.WaveHeightCalculationsForSignalingNorm,
+ assessmentSection.WaveHeightCalculationsForLowerLimitNorm,
+ assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaterLevelCalculationsForMechanismSpecificSignalingNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaterLevelCalculationsForMechanismSpecificLowerLimitNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaveHeightCalculationsForMechanismSpecificFactorizedSignalingNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaveHeightCalculationsForMechanismSpecificSignalingNorm,
+ assessmentSection.GrassCoverErosionOutwards.WaveHeightCalculationsForMechanismSpecificLowerLimitNorm,
+ assessmentSection.DuneErosion.DuneLocations,
+ assessmentSection.DuneErosion.CalculationsForMechanismSpecificFactorizedSignalingNorm,
+ assessmentSection.DuneErosion.CalculationsForMechanismSpecificSignalingNorm,
+ assessmentSection.DuneErosion.CalculationsForMechanismSpecificLowerLimitNorm,
+ assessmentSection.DuneErosion.CalculationsForLowerLimitNorm,
+ assessmentSection.DuneErosion.CalculationsForFactorizedLowerLimitNorm
+ };
+ }
+
+ private static void SetLocations(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, IEnumerable readLocations,
+ IEnumerable locationIdMappings, long[] excludedLocationIds)
+ {
+ hydraulicBoundaryDatabase.Locations.Clear();
+
+ Array.Sort(excludedLocationIds);
+
+ foreach (ReadHydraulicBoundaryLocation readLocation in readLocations)
+ {
+ long locationConfigurationId = locationIdMappings.Where(m => m.HrdLocationId == readLocation.Id)
+ .Select(m => m.HlcdLocationId)
+ .SingleOrDefault();
+
+ if (locationConfigurationId != 0 && ShouldInclude(excludedLocationIds, locationConfigurationId))
+ {
+ hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(locationConfigurationId, readLocation.Name,
+ readLocation.CoordinateX, readLocation.CoordinateY));
+ }
+ }
+ }
+
+ private static bool ShouldInclude(long[] excludedLocationIds, long locationId)
+ {
+ int matchingIndex = Array.BinarySearch(excludedLocationIds, locationId);
+ return matchingIndex < 0;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseImportHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseImportHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseImportHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -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 System.Windows.Forms;
+using Core.Common.Base.Service;
+using Core.Common.Gui.Forms.ProgressDialog;
+using Ringtoets.Common.Data.Hydraulics;
+using Riskeer.Integration.Forms.PropertyClasses;
+using Riskeer.Integration.IO.Handlers;
+using Riskeer.Integration.IO.Importers;
+using Riskeer.Integration.Plugin.Properties;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class that can properly import .
+ ///
+ public class HydraulicLocationConfigurationDatabaseImportHandler : IHydraulicLocationConfigurationDatabaseImportHandler
+ {
+ private readonly IWin32Window viewParent;
+ private readonly IHydraulicLocationConfigurationDatabaseUpdateHandler updateHandler;
+ private readonly HydraulicBoundaryDatabase hydraulicBoundaryDatabase;
+
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The parent of the view.
+ /// The object responsible for updating the .
+ /// The hydraulic boundary database to import the data to.
+ /// Thrown when any argument is null.
+ public HydraulicLocationConfigurationDatabaseImportHandler(IWin32Window viewParent,
+ IHydraulicLocationConfigurationDatabaseUpdateHandler updateHandler,
+ HydraulicBoundaryDatabase hydraulicBoundaryDatabase)
+ {
+ if (viewParent == null)
+ {
+ throw new ArgumentNullException(nameof(viewParent));
+ }
+
+ if (updateHandler == null)
+ {
+ throw new ArgumentNullException(nameof(updateHandler));
+ }
+
+ if (hydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase));
+ }
+
+ this.viewParent = viewParent;
+ this.updateHandler = updateHandler;
+ this.hydraulicBoundaryDatabase = hydraulicBoundaryDatabase;
+ }
+
+ public void ImportHydraulicLocationConfigurationSettings(HydraulicLocationConfigurationSettings hydraulicLocationConfigurationSettings, string hlcdFilePath)
+ {
+ if (hydraulicLocationConfigurationSettings == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicLocationConfigurationSettings));
+ }
+
+ if (hlcdFilePath == null)
+ {
+ throw new ArgumentNullException(nameof(hlcdFilePath));
+ }
+
+ var importSettingsActivity = new FileImportActivity(
+ new HydraulicLocationConfigurationDatabaseImporter(hydraulicLocationConfigurationSettings,
+ updateHandler,
+ hydraulicBoundaryDatabase,
+ hlcdFilePath),
+ Resources.HydraulicLocationConfigurationDatabaseImportHandler_ImportHydraulicLocationConfigurationSettings_Description);
+ ActivityProgressDialogRunner.Run(viewParent, importSettingsActivity);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,97 @@
+// 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.Windows.Forms;
+using Core.Common.Base;
+using Ringtoets.Common.Data.Hydraulics;
+using Riskeer.HydraRing.IO.HydraulicLocationConfigurationDatabase;
+using Riskeer.Integration.Data;
+using Riskeer.Integration.IO.Handlers;
+using Riskeer.Integration.Plugin.Helpers;
+using Riskeer.Integration.Plugin.Properties;
+using Riskeer.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class that can properly update a .
+ ///
+ public class HydraulicLocationConfigurationDatabaseUpdateHandler : IHydraulicLocationConfigurationDatabaseUpdateHandler
+ {
+ private readonly AssessmentSection assessmentSection;
+
+ ///
+ /// Creates a new instance of
+ ///
+ /// The assessment section to use for clearing data.
+ /// Thrown when
+ /// is null.
+ public HydraulicLocationConfigurationDatabaseUpdateHandler(AssessmentSection assessmentSection)
+ {
+ if (assessmentSection == null)
+ {
+ throw new ArgumentNullException(nameof(assessmentSection));
+ }
+
+ this.assessmentSection = assessmentSection;
+ }
+
+ public bool InquireConfirmation()
+ {
+ DialogResult result = MessageBox.Show(Resources.HydraulicLocationConfigurationDatabaseUpdateHandler_Confirm_clear_hydraulicLocationConfigurationDatabase_dependent_data,
+ CoreCommonBaseResources.Confirm,
+ MessageBoxButtons.OKCancel);
+ return result == DialogResult.OK;
+ }
+
+ public IEnumerable Update(HydraulicBoundaryDatabase hydraulicBoundaryDatabase,
+ ReadHydraulicLocationConfigurationDatabaseSettings readHydraulicLocationConfigurationDatabaseSettings,
+ string hlcdFilePath)
+ {
+ if (hydraulicBoundaryDatabase == null)
+ {
+ throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase));
+ }
+
+ if (hlcdFilePath == null)
+ {
+ throw new ArgumentNullException(nameof(hlcdFilePath));
+ }
+
+ HydraulicLocationConfigurationSettingsUpdateHelper.SetHydraulicLocationConfigurationSettings(
+ hydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings,
+ readHydraulicLocationConfigurationDatabaseSettings, hlcdFilePath);
+
+ var changedObjects = new List
+ {
+ hydraulicBoundaryDatabase
+ };
+
+ changedObjects.AddRange(RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationCalculationOutput(assessmentSection));
+ changedObjects.AddRange(RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(assessmentSection));
+
+ return changedObjects;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (revision 0)
+++ Ringtoets/Integration/src/Riskeer.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (revision c3c7ffbc66ae3cf26bc0c086593ceec3f1173f3f)
@@ -0,0 +1,107 @@
+// 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.Windows.Forms;
+using Core.Common.Base;
+using Core.Common.Gui.Commands;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.IO.ReferenceLines;
+using Ringtoets.Common.Service;
+using Riskeer.Integration.Plugin.Properties;
+using Riskeer.Integration.Service;
+using CoreCommonBaseResources = Core.Common.Base.Properties.Resources;
+
+namespace Riskeer.Integration.Plugin.Handlers
+{
+ ///
+ /// Class responsible for updating a .
+ ///
+ public class ReferenceLineUpdateHandler : IReferenceLineUpdateHandler
+ {
+ private readonly IAssessmentSection assessmentSection;
+ private readonly IViewCommands viewCommands;
+ private readonly Queue