Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj
===================================================================
diff -u -r4ad65cef966ec4b0e6f36b7a612aef4bdd088837 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision 4ad65cef966ec4b0e6f36b7a612aef4bdd088837)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -426,8 +426,8 @@
-
-
+
+
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/PersistenceRegistry.cs (.../PersistenceRegistry.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -32,7 +32,7 @@
using Ringtoets.DuneErosion.Data;
using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.HeightStructures.Data;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
@@ -58,13 +58,13 @@
private readonly Dictionary grassCoverErosionInwardsCalculations =
CreateDictionary();
- private readonly Dictionary stochasticSoilModels =
- CreateDictionary();
+ private readonly Dictionary pipingStochasticSoilModels =
+ CreateDictionary();
- private readonly Dictionary stochasticSoilProfiles =
- CreateDictionary();
+ private readonly Dictionary pipingStochasticSoilProfiles =
+ CreateDictionary();
- private readonly Dictionary soilProfiles =
+ private readonly Dictionary pipingSoilProfiles =
CreateDictionary();
private readonly Dictionary surfaceLines =
@@ -254,31 +254,31 @@
/// that was constructed with the information.
///
/// The to be registered.
- /// The to be registered.
+ /// The to be registered.
/// Thrown when either:
///
/// - is null
/// - is null
///
- internal void Register(StochasticSoilModelEntity entity, StochasticSoilModel model)
+ internal void Register(StochasticSoilModelEntity entity, PipingStochasticSoilModel model)
{
- Register(stochasticSoilModels, entity, model);
+ Register(pipingStochasticSoilModels, entity, model);
}
///
/// Registers a create operation for and the
/// that was constructed with the information.
///
/// The to be registered.
- /// The to be registered.
+ /// The to be registered.
/// Thrown when either:
///
/// - is null
/// - is null
///
- internal void Register(StochasticSoilProfileEntity entity, StochasticSoilProfile model)
+ internal void Register(StochasticSoilProfileEntity entity, PipingStochasticSoilProfile model)
{
- Register(stochasticSoilProfiles, entity, model);
+ Register(pipingStochasticSoilProfiles, entity, model);
}
///
@@ -294,7 +294,7 @@
///
internal void Register(SoilProfileEntity entity, PipingSoilProfile model)
{
- Register(soilProfiles, entity, model);
+ Register(pipingSoilProfiles, entity, model);
}
///
@@ -410,23 +410,23 @@
///
/// Checks whether a create operations has been registered for the given .
///
- /// The to check for.
+ /// The to check for.
/// true if the was registered before, false otherwise.
/// Thrown when is null.
- internal bool Contains(StochasticSoilModel model)
+ internal bool Contains(PipingStochasticSoilModel model)
{
- return ContainsValue(stochasticSoilModels, model);
+ return ContainsValue(pipingStochasticSoilModels, model);
}
///
/// Checks whether a create operations has been registered for the given .
///
- /// The to check for.
+ /// The to check for.
/// true if the was registered before, false otherwise.
/// Thrown when is null.
- internal bool Contains(StochasticSoilProfile model)
+ internal bool Contains(PipingStochasticSoilProfile model)
{
- return ContainsValue(stochasticSoilProfiles, model);
+ return ContainsValue(pipingStochasticSoilProfiles, model);
}
///
@@ -437,7 +437,7 @@
/// Thrown when is null.
internal bool Contains(PipingSoilProfile model)
{
- return ContainsValue(soilProfiles, model);
+ return ContainsValue(pipingSoilProfiles, model);
}
///
@@ -608,34 +608,34 @@
/// Obtains the which was registered for
/// the given .
///
- /// The for which a create
+ /// The for which a create
/// operation has been registered.
/// The created .
/// Thrown when is null.
/// Thrown when no create operation
/// has been registered for .
- /// Use to find out whether
+ /// Use to find out whether
/// a create operation has been registered for .
- internal StochasticSoilModelEntity Get(StochasticSoilModel model)
+ internal StochasticSoilModelEntity Get(PipingStochasticSoilModel model)
{
- return Get(stochasticSoilModels, model);
+ return Get(pipingStochasticSoilModels, model);
}
///
/// Obtains the which was registered for
/// the given .
///
- /// The for which a create
+ /// The for which a create
/// operation has been registered.
/// The created .
/// Thrown when is null.
/// Thrown when no create operation
/// has been registered for .
- /// Use to find out whether
+ /// Use to find out whether
/// a create/create operation has been registered for .
- internal StochasticSoilProfileEntity Get(StochasticSoilProfile model)
+ internal StochasticSoilProfileEntity Get(PipingStochasticSoilProfile model)
{
- return Get(stochasticSoilProfiles, model);
+ return Get(pipingStochasticSoilProfiles, model);
}
///
@@ -652,7 +652,7 @@
/// create operation has been registered for .
internal SoilProfileEntity Get(PipingSoilProfile model)
{
- return Get(soilProfiles, model);
+ return Get(pipingSoilProfiles, model);
}
///
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs (.../PipingFailureMechanismCreateExtensions.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingFailureMechanismCreateExtensions.cs (.../PipingFailureMechanismCreateExtensions.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -24,6 +24,7 @@
using Application.Ringtoets.Storage.DbContext;
using Core.Common.Utils.Extensions;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Application.Ringtoets.Storage.Create.Piping
@@ -82,7 +83,7 @@
private static void AddEntitiesForStochasticSoilModels(PipingFailureMechanism mechanism, PersistenceRegistry registry, FailureMechanismEntity entity)
{
var index = 0;
- foreach (StochasticSoilModel stochasticSoilModel in mechanism.StochasticSoilModels)
+ foreach (PipingStochasticSoilModel stochasticSoilModel in mechanism.StochasticSoilModels)
{
entity.StochasticSoilModelEntities.Add(stochasticSoilModel.Create(registry, index++));
}
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs
===================================================================
diff -u
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs (revision 0)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilModelCreateExtensions.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,81 @@
+// Copyright (C) Stichting Deltares 2017. 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 Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.Serializers;
+using Core.Common.Utils.Extensions;
+using Ringtoets.Piping.Data.SoilProfile;
+
+namespace Application.Ringtoets.Storage.Create.Piping
+{
+ ///
+ /// Extension methods for related to creating
+ /// a .
+ ///
+ internal static class PipingStochasticSoilModelCreateExtensions
+ {
+ ///
+ /// Creates a based on the information of the .
+ ///
+ /// The model to create a database entity for.
+ /// The object keeping track of create operations.
+ /// Index at which this instance resides inside its parent container.
+ /// A new .
+ /// Thrown when is null.
+ internal static StochasticSoilModelEntity Create(this PipingStochasticSoilModel model,
+ PersistenceRegistry registry,
+ int order)
+ {
+ if (registry == null)
+ {
+ throw new ArgumentNullException(nameof(registry));
+ }
+ if (registry.Contains(model))
+ {
+ return registry.Get(model);
+ }
+
+ var entity = new StochasticSoilModelEntity
+ {
+ Name = model.Name.DeepClone(),
+ StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(model.Geometry),
+ Order = order
+ };
+
+ AddEntitiesForStochasticSoilProfiles(model, registry, entity);
+
+ registry.Register(entity, model);
+ return entity;
+ }
+
+ private static void AddEntitiesForStochasticSoilProfiles(PipingStochasticSoilModel model,
+ PersistenceRegistry registry,
+ StochasticSoilModelEntity entity)
+ {
+ for (var i = 0; i < model.StochasticSoilProfiles.Count; i++)
+ {
+ PipingStochasticSoilProfile stochasticSoilProfile = model.StochasticSoilProfiles[i];
+ entity.StochasticSoilProfileEntities.Add(stochasticSoilProfile.Create(registry, i));
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs
===================================================================
diff -u
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs (revision 0)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/PipingStochasticSoilProfileCreateExtensions.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,62 @@
+// Copyright (C) Stichting Deltares 2017. 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 Application.Ringtoets.Storage.DbContext;
+using Ringtoets.Piping.Data.SoilProfile;
+
+namespace Application.Ringtoets.Storage.Create.Piping
+{
+ ///
+ /// Extension methods for related to creating
+ /// a .
+ ///
+ internal static class PipingStochasticSoilProfileCreateExtensions
+ {
+ ///
+ /// Creates a based on the information of the
+ /// .
+ ///
+ /// The profile to create a database entity for.
+ /// The object keeping track of create operations.
+ /// Index at which this instance resides inside its parent container.
+ /// A new .
+ /// Thrown when is null.
+ internal static StochasticSoilProfileEntity Create(this PipingStochasticSoilProfile profile,
+ PersistenceRegistry registry,
+ int order)
+ {
+ var entity = new StochasticSoilProfileEntity
+ {
+ Probability = profile.Probability,
+ SoilProfileEntity = profile.SoilProfile.Create(registry),
+ Order = order
+ };
+ if (registry.Contains(profile))
+ {
+ return registry.Get(profile);
+ }
+
+ registry.Register(entity, profile);
+ return entity;
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilModelCreateExtensions.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/Create/Piping/StochasticSoilProfileCreateExtensions.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationEntityReadExtensions.cs
===================================================================
diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationEntityReadExtensions.cs (.../PipingCalculationEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/PipingCalculationEntityReadExtensions.cs (.../PipingCalculationEntityReadExtensions.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -27,6 +27,10 @@
namespace Application.Ringtoets.Storage.Read.Piping
{
+ ///
+ /// This class defines extension methods for read operations for a
+ /// based on the .
+ ///
internal static class PipingCalculationEntityReadExtensions
{
///
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilModelEntityReadExtensions.cs
===================================================================
diff -u -r16df8541528639fd1e8d9f2584fae28808b63fad -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilModelEntityReadExtensions.cs (.../StochasticSoilModelEntityReadExtensions.cs) (revision 16df8541528639fd1e8d9f2584fae28808b63fad)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilModelEntityReadExtensions.cs (.../StochasticSoilModelEntityReadExtensions.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -23,26 +23,28 @@
using System.Linq;
using Application.Ringtoets.Storage.DbContext;
using Application.Ringtoets.Storage.Serializers;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
namespace Application.Ringtoets.Storage.Read.Piping
{
///
- /// This class defines extension methods for read operations for a based on the
- /// .
+ /// This class defines extension methods for read operations for a
+ /// based on the .
///
internal static class StochasticSoilModelEntityReadExtensions
{
///
- /// Reads the and use the information to construct a .
+ /// Reads the and use the information to construct
+ /// a .
///
- /// The to create for.
+ /// The to create for.
/// The object keeping track of read operations.
- /// A new .
+ /// A new .
/// Thrown when is null.
/// Thrown when
/// of is null or empty.
- internal static StochasticSoilModel Read(this StochasticSoilModelEntity entity, ReadConversionCollector collector)
+ internal static PipingStochasticSoilModel Read(this StochasticSoilModelEntity entity,
+ ReadConversionCollector collector)
{
if (collector == null)
{
@@ -53,7 +55,7 @@
return collector.Get(entity);
}
- var model = new StochasticSoilModel(entity.Name);
+ var model = new PipingStochasticSoilModel(entity.Name);
entity.ReadStochasticSoilProfiles(model, collector);
entity.ReadSegmentPoints(model);
@@ -62,15 +64,18 @@
return model;
}
- private static void ReadStochasticSoilProfiles(this StochasticSoilModelEntity entity, StochasticSoilModel model, ReadConversionCollector collector)
+ private static void ReadStochasticSoilProfiles(this StochasticSoilModelEntity entity,
+ PipingStochasticSoilModel model,
+ ReadConversionCollector collector)
{
foreach (StochasticSoilProfileEntity stochasticSoilProfileEntity in entity.StochasticSoilProfileEntities.OrderBy(ssp => ssp.Order))
{
model.StochasticSoilProfiles.Add(stochasticSoilProfileEntity.Read(collector));
}
}
- private static void ReadSegmentPoints(this StochasticSoilModelEntity entity, StochasticSoilModel model)
+ private static void ReadSegmentPoints(this StochasticSoilModelEntity entity,
+ PipingStochasticSoilModel model)
{
model.Geometry.AddRange(new Point2DXmlSerializer().FromXml(entity.StochasticSoilModelSegmentPointXml));
}
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilProfileEntityReadExtensions.cs
===================================================================
diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilProfileEntityReadExtensions.cs (.../StochasticSoilProfileEntityReadExtensions.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/Piping/StochasticSoilProfileEntityReadExtensions.cs (.../StochasticSoilProfileEntityReadExtensions.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -21,25 +21,27 @@
using System;
using Application.Ringtoets.Storage.DbContext;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Application.Ringtoets.Storage.Read.Piping
{
///
- /// This class defines extension methods for read operations for a based on the
- /// .
+ /// This class defines extension methods for read operations for a
+ /// based on the .
///
internal static class StochasticSoilProfileEntityReadExtensions
{
///
- /// Reads the and use the information to construct a .
+ /// Reads the and use the information to construct
+ /// a .
///
- /// The to create for.
+ /// The to create for.
/// The object keeping track of read operations.
- /// A new .
+ /// A new .
/// Thrown when is null.
- internal static StochasticSoilProfile Read(this StochasticSoilProfileEntity entity, ReadConversionCollector collector)
+ internal static PipingStochasticSoilProfile Read(this StochasticSoilProfileEntity entity,
+ ReadConversionCollector collector)
{
if (collector == null)
{
@@ -50,17 +52,18 @@
return collector.Get(entity);
}
- var profile = new StochasticSoilProfile(entity.Probability, (SoilProfileType) entity.Type, -1);
- entity.ReadSoilProfile(profile, collector);
+ PipingSoilProfile soilProfile = entity.ReadSoilProfile(collector);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(entity.Probability, soilProfile);
- collector.Read(entity, profile);
+ collector.Read(entity, stochasticSoilProfile);
- return profile;
+ return stochasticSoilProfile;
}
- private static void ReadSoilProfile(this StochasticSoilProfileEntity entity, StochasticSoilProfile profile, ReadConversionCollector collector)
+ private static PipingSoilProfile ReadSoilProfile(this StochasticSoilProfileEntity entity,
+ ReadConversionCollector collector)
{
- profile.SoilProfile = entity.SoilProfileEntity.Read(collector);
+ return entity.SoilProfileEntity.Read(collector);
}
}
}
\ No newline at end of file
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/ReadConversionCollector.cs (.../ReadConversionCollector.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -31,7 +31,7 @@
using Ringtoets.DuneErosion.Data;
using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.HeightStructures.Data;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
@@ -43,13 +43,13 @@
///
internal class ReadConversionCollector
{
- private readonly Dictionary stochasticSoilModels =
- CreateDictionary();
+ private readonly Dictionary pipingStochasticSoilModels =
+ CreateDictionary();
- private readonly Dictionary stochasticSoilProfiles =
- CreateDictionary();
+ private readonly Dictionary pipingStochasticSoilProfiles =
+ CreateDictionary();
- private readonly Dictionary soilProfiles =
+ private readonly Dictionary pipingSoilProfiles =
CreateDictionary();
private readonly Dictionary surfaceLines =
@@ -103,16 +103,16 @@
///
/// Registers a read operation for and the
- /// that was constructed with the information.
+ /// that was constructed with the information.
///
/// The that was read.
- /// The that was constructed.
+ /// The that was constructed.
/// Thrown when either:
///
/// - is null
/// - is null
///
- internal void Read(StochasticSoilModelEntity entity, StochasticSoilModel model)
+ internal void Read(StochasticSoilModelEntity entity, PipingStochasticSoilModel model)
{
if (entity == null)
{
@@ -123,7 +123,7 @@
throw new ArgumentNullException(nameof(model));
}
- stochasticSoilModels[entity] = model;
+ pipingStochasticSoilModels[entity] = model;
}
///
@@ -138,29 +138,29 @@
{
throw new ArgumentNullException(nameof(entity));
}
- return stochasticSoilModels.ContainsKey(entity);
+ return pipingStochasticSoilModels.ContainsKey(entity);
}
///
- /// Obtains the which was read for the given .
+ /// Obtains the which was read for the given .
///
/// The for which a
/// read operation has been registered.
- /// The constructed .
+ /// The constructed .
/// Thrown when is null.
/// Thrown when no read operation has been registered for
/// .
/// Use to find out
/// whether a read operation has been registered for .
- internal StochasticSoilModel Get(StochasticSoilModelEntity entity)
+ internal PipingStochasticSoilModel Get(StochasticSoilModelEntity entity)
{
if (entity == null)
{
throw new ArgumentNullException(nameof(entity));
}
try
{
- return stochasticSoilModels[entity];
+ return pipingStochasticSoilModels[entity];
}
catch (KeyNotFoundException e)
{
@@ -174,16 +174,16 @@
///
/// Registers a read operation for and
- /// the that was constructed with the information.
+ /// the that was constructed with the information.
///
/// The that was read.
- /// The that was constructed.
+ /// The that was constructed.
/// Thrown when either:
///
/// - is null
/// - is null
///
- internal void Read(StochasticSoilProfileEntity entity, StochasticSoilProfile model)
+ internal void Read(StochasticSoilProfileEntity entity, PipingStochasticSoilProfile model)
{
if (entity == null)
{
@@ -194,7 +194,7 @@
throw new ArgumentNullException(nameof(model));
}
- stochasticSoilProfiles[entity] = model;
+ pipingStochasticSoilProfiles[entity] = model;
}
///
@@ -209,30 +209,30 @@
{
throw new ArgumentNullException(nameof(entity));
}
- return stochasticSoilProfiles.ContainsKey(entity);
+ return pipingStochasticSoilProfiles.ContainsKey(entity);
}
///
- /// Obtains the which was read for the given
+ /// Obtains the which was read for the given
/// .
///
/// The for which
/// a read operation has been registered.
- /// The constructed .
+ /// The constructed .
/// Thrown when is null.
/// Thrown when no read operation has been registered for
/// .
/// Use to find out whether a read operation has been registered for
/// .
- internal StochasticSoilProfile Get(StochasticSoilProfileEntity entity)
+ internal PipingStochasticSoilProfile Get(StochasticSoilProfileEntity entity)
{
if (entity == null)
{
throw new ArgumentNullException(nameof(entity));
}
try
{
- return stochasticSoilProfiles[entity];
+ return pipingStochasticSoilProfiles[entity];
}
catch (KeyNotFoundException e)
{
@@ -266,7 +266,7 @@
throw new ArgumentNullException(nameof(model));
}
- soilProfiles[entity] = model;
+ pipingSoilProfiles[entity] = model;
}
///
@@ -281,7 +281,7 @@
{
throw new ArgumentNullException(nameof(entity));
}
- return soilProfiles.ContainsKey(entity);
+ return pipingSoilProfiles.ContainsKey(entity);
}
///
@@ -302,7 +302,7 @@
}
try
{
- return soilProfiles[entity];
+ return pipingSoilProfiles[entity];
}
catch (KeyNotFoundException e)
{
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj
===================================================================
diff -u -r4ad65cef966ec4b0e6f36b7a612aef4bdd088837 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 4ad65cef966ec4b0e6f36b7a612aef4bdd088837)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -189,8 +189,8 @@
-
-
+
+
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -37,8 +37,7 @@
using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.HeightStructures.Data;
using Ringtoets.HeightStructures.Data.TestUtil;
-using Ringtoets.Piping.Data;
-using Ringtoets.Piping.Data.TestUtil;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.KernelWrapper.TestUtil;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
@@ -303,25 +302,25 @@
}
[Test]
- public void Contains_WithoutStochasticSoilModel_ThrowsArgumentNullException()
+ public void Contains_WithoutPipingStochasticSoilModel_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Contains((StochasticSoilModel) null);
+ TestDelegate test = () => registry.Contains((PipingStochasticSoilModel) null);
// Assert
string paramName = Assert.Throws(test).ParamName;
Assert.AreEqual("model", paramName);
}
[Test]
- public void Contains_StochasticSoilModelAdded_ReturnsTrue()
+ public void Contains_PipingStochasticSoilModelAdded_ReturnsTrue()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("A");
+ var soilModel = new PipingStochasticSoilModel("A");
registry.Register(new StochasticSoilModelEntity(), soilModel);
// Call
@@ -332,11 +331,11 @@
}
[Test]
- public void Contains_NoStochasticSoilModelAdded_ReturnsFalse()
+ public void Contains_NoPipingStochasticSoilModelAdded_ReturnsFalse()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("A");
+ var soilModel = new PipingStochasticSoilModel("A");
// Call
bool result = registry.Contains(soilModel);
@@ -346,12 +345,12 @@
}
[Test]
- public void Contains_OtherStochasticSoilModelAdded_ReturnsFalse()
+ public void Contains_OtherPipingPipingStochasticSoilModelAdded_ReturnsFalse()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("A");
- registry.Register(new StochasticSoilModelEntity(), new StochasticSoilModel("B"));
+ var soilModel = new PipingStochasticSoilModel("A");
+ registry.Register(new StochasticSoilModelEntity(), new PipingStochasticSoilModel("B"));
// Call
bool result = registry.Contains(soilModel);
@@ -361,13 +360,13 @@
}
[Test]
- public void Contains_WithoutStochasticSoilProfile_ThrowsArgumentNullException()
+ public void Contains_WithoutPipingStochasticSoilProfile_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Contains((StochasticSoilProfile) null);
+ TestDelegate test = () => registry.Contains((PipingStochasticSoilProfile) null);
// Assert
string paramName = Assert.Throws(test).ParamName;
@@ -379,7 +378,7 @@
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.4, SoilProfileType.SoilProfile1D, 1);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile());
registry.Register(new StochasticSoilProfileEntity(), stochasticSoilProfile);
// Call
@@ -390,11 +389,11 @@
}
[Test]
- public void Contains_NoStochasticSoilProfileAdded_ReturnsFalse()
+ public void Contains_NoPipingStochasticSoilProfileAdded_ReturnsFalse()
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.4, SoilProfileType.SoilProfile1D, 1);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile());
// Call
bool result = registry.Contains(stochasticSoilProfile);
@@ -404,12 +403,12 @@
}
[Test]
- public void Contains_OtherStochasticSoilProfileAdded_ReturnsFalse()
+ public void Contains_OtherPipingStochasticSoilProfileAdded_ReturnsFalse()
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.4, SoilProfileType.SoilProfile1D, 1);
- registry.Register(new StochasticSoilProfileEntity(), new StochasticSoilProfile(0.7, SoilProfileType.SoilProfile1D, 3));
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile());
+ registry.Register(new StochasticSoilProfileEntity(), new PipingStochasticSoilProfile(0.7, new TestPipingSoilProfile()));
// Call
bool result = registry.Contains(stochasticSoilProfile);
@@ -1250,25 +1249,25 @@
}
[Test]
- public void Get_WithoutStochasticSoilModel_ThrowsArgumentNullException()
+ public void Get_WithoutPipingStochasticSoilModel_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Get((StochasticSoilModel) null);
+ TestDelegate test = () => registry.Get((PipingStochasticSoilModel) null);
// Assert
string paramName = Assert.Throws(test).ParamName;
Assert.AreEqual("model", paramName);
}
[Test]
- public void Get_StochasticSoilModelAdded_ReturnsEntity()
+ public void Get_PipingStochasticSoilModelAdded_ReturnsEntity()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("6");
+ var soilModel = new PipingStochasticSoilModel("6");
var entity = new StochasticSoilModelEntity();
registry.Register(entity, soilModel);
@@ -1280,11 +1279,11 @@
}
[Test]
- public void Get_NoStochasticSoilModelAdded_ThrowsInvalidOperationException()
+ public void Get_NoPipingStochasticSoilModelAdded_ThrowsInvalidOperationException()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("6");
+ var soilModel = new PipingStochasticSoilModel("6");
// Call
TestDelegate test = () => registry.Get(soilModel);
@@ -1294,12 +1293,12 @@
}
[Test]
- public void Get_OtherStochasticSoilModelAdded_ThrowsInvalidOperationException()
+ public void Get_OtherPipingStochasticSoilModelAdded_ThrowsInvalidOperationException()
{
// Setup
var registry = new PersistenceRegistry();
- var soilModel = new StochasticSoilModel("6");
- registry.Register(new StochasticSoilModelEntity(), new StochasticSoilModel("2"));
+ var soilModel = new PipingStochasticSoilModel("6");
+ registry.Register(new StochasticSoilModelEntity(), new PipingStochasticSoilModel("2"));
// Call
TestDelegate test = () => registry.Get(soilModel);
@@ -1309,25 +1308,25 @@
}
[Test]
- public void Get_WithoutStochasticSoilProfileEntity_ThrowsArgumentNullException()
+ public void Get_WithoutPipingStochasticSoilProfileEntity_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Get((StochasticSoilProfile) null);
+ TestDelegate test = () => registry.Get((PipingStochasticSoilProfile) null);
// Assert
string paramName = Assert.Throws(test).ParamName;
Assert.AreEqual("model", paramName);
}
[Test]
- public void Get_StochasticSoilProfileAdded_ReturnsEntity()
+ public void Get_PipingStochasticSoilProfileAdded_ReturnsEntity()
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.2, SoilProfileType.SoilProfile1D, 1);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.2, new TestPipingSoilProfile());
var entity = new StochasticSoilProfileEntity();
registry.Register(entity, stochasticSoilProfile);
@@ -1339,11 +1338,11 @@
}
[Test]
- public void Get_NoStochasticSoilProfileAdded_ThrowsInvalidOperationException()
+ public void Get_NoPipingStochasticSoilProfileAdded_ThrowsInvalidOperationException()
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.2, SoilProfileType.SoilProfile1D, 1);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.2, new TestPipingSoilProfile());
// Call
TestDelegate test = () => registry.Get(stochasticSoilProfile);
@@ -1353,12 +1352,12 @@
}
[Test]
- public void Get_OtherStochasticSoilProfileAdded_ThrowsInvalidOperationException()
+ public void Get_OtherPipingStochasticSoilProfileAdded_ThrowsInvalidOperationException()
{
// Setup
var registry = new PersistenceRegistry();
- var stochasticSoilProfile = new StochasticSoilProfile(0.2, SoilProfileType.SoilProfile1D, 1);
- registry.Register(new StochasticSoilProfileEntity(), new StochasticSoilProfile(0.4, SoilProfileType.SoilProfile1D, 2));
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.2, new TestPipingSoilProfile());
+ registry.Register(new StochasticSoilProfileEntity(), new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile()));
// Call
TestDelegate test = () => registry.Get(stochasticSoilProfile);
@@ -2103,21 +2102,21 @@
}
[Test]
- public void Register_WithNullStochasticSoilModelEntity_ThrowsArgumentNullException()
+ public void Register_WithNullPipingStochasticSoilModelEntity_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Register(null, new TestStochasticSoilModel());
+ TestDelegate test = () => registry.Register(null, new PipingStochasticSoilModel("some name"));
// Assert
string paramName = Assert.Throws(test).ParamName;
Assert.AreEqual("entity", paramName);
}
[Test]
- public void Register_WithNullStochasticSoilModel_ThrowsArgumentNullException()
+ public void Register_WithNullPipingStochasticSoilModel_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
@@ -2131,21 +2130,21 @@
}
[Test]
- public void Register_WithNullStochasticSoilProfileEntity_ThrowsArgumentNullException()
+ public void Register_WithNullPipingStochasticSoilProfileEntity_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
// Call
- TestDelegate test = () => registry.Register(null, new StochasticSoilProfile(1, SoilProfileType.SoilProfile1D, -1));
+ TestDelegate test = () => registry.Register(null, new PipingStochasticSoilProfile(1, new TestPipingSoilProfile()));
// Assert
string paramName = Assert.Throws(test).ParamName;
Assert.AreEqual("entity", paramName);
}
[Test]
- public void Register_WithNullStochasticSoilProfile_ThrowsArgumentNullException()
+ public void Register_WithNullPipingStochasticSoilProfile_ThrowsArgumentNullException()
{
// Setup
var registry = new PersistenceRegistry();
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -30,6 +30,7 @@
using NUnit.Framework;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.KernelWrapper.TestUtil;
using Ringtoets.Piping.Primitives;
@@ -240,12 +241,9 @@
{
// Setup
var soilProfile = new TestPipingSoilProfile();
- var stochasticSoilProfile = new StochasticSoilProfile(0.6, SoilProfileType.SoilProfile1D, 1)
- {
- SoilProfile = soilProfile
- };
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.6, soilProfile);
- var soilModel = new StochasticSoilModel("A");
+ var soilModel = new PipingStochasticSoilModel("A");
soilModel.StochasticSoilProfiles.Add(stochasticSoilProfile);
var registry = new PersistenceRegistry();
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs (.../PipingFailureMechanismCreateExtensionsTest.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingFailureMechanismCreateExtensionsTest.cs (.../PipingFailureMechanismCreateExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -30,6 +30,7 @@
using NUnit.Framework;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Application.Ringtoets.Storage.Test.Create.Piping
@@ -149,8 +150,8 @@
const string somePath = "some/path/to/file";
failureMechanism.StochasticSoilModels.AddRange(new[]
{
- new StochasticSoilModel("name"),
- new StochasticSoilModel("name2")
+ new PipingStochasticSoilModel("name"),
+ new PipingStochasticSoilModel("name2")
}, somePath);
var registry = new PersistenceRegistry();
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilModelCreateExtensionsTest.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilModelCreateExtensionsTest.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilModelCreateExtensionsTest.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,147 @@
+// Copyright (C) Stichting Deltares 2017. 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 Application.Ringtoets.Storage.Create;
+using Application.Ringtoets.Storage.Create.Piping;
+using Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.Serializers;
+using Core.Common.Base.Geometry;
+using NUnit.Framework;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Data.TestUtil;
+using Ringtoets.Piping.KernelWrapper.TestUtil;
+
+namespace Application.Ringtoets.Storage.Test.Create.Piping
+{
+ [TestFixture]
+ public class PipingStochasticSoilModelCreateExtensionsTest
+ {
+ [Test]
+ public void Create_WithoutPersistenceRegistry_ThrowsArgumentNullException()
+ {
+ // Setup
+ PipingStochasticSoilModel stochasticSoilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel();
+
+ // Call
+ TestDelegate test = () => stochasticSoilModel.Create(null, 0);
+
+ // Assert
+ string parameterName = Assert.Throws(test).ParamName;
+ Assert.AreEqual("registry", parameterName);
+ }
+
+ [Test]
+ public void Create_WithCollector_ReturnsStochasticSoilModelEntityWithPropertiesSet()
+ {
+ // Setup
+ int order = new Random(1).Next();
+ const string testName = "testName";
+ var stochasticSoilModel = new PipingStochasticSoilModel(testName);
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilModelEntity entity = stochasticSoilModel.Create(registry, order);
+
+ // Assert
+ Assert.IsNotNull(entity);
+ Assert.AreEqual(testName, entity.Name);
+ Assert.AreEqual(order, entity.Order);
+ CollectionAssert.IsEmpty(entity.StochasticSoilProfileEntities);
+ }
+
+ [Test]
+ public void Create_StringPropertiesDoNotShareReference()
+ {
+ // Setup
+ const string testName = "testName";
+ PipingStochasticSoilModel stochasticSoilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel(testName);
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilModelEntity entity = stochasticSoilModel.Create(registry, 0);
+
+ // Assert
+ Assert.AreNotSame(testName, entity.Name,
+ "To create stable binary representations/fingerprints, it's really important that strings are not shared.");
+ Assert.AreEqual(testName, entity.Name);
+ }
+
+ [Test]
+ public void Create_WithStochasticSoilProfiles_ReturnsStochasticSoilModelEntityWithPropertiesAndStochasticSoilProfileEntitiesSet()
+ {
+ // Setup
+ var stochasticSoilModel = new PipingStochasticSoilModel("testName")
+ {
+ StochasticSoilProfiles =
+ {
+ new PipingStochasticSoilProfile(0.5, new TestPipingSoilProfile()),
+ new PipingStochasticSoilProfile(0.5, new TestPipingSoilProfile())
+ }
+ };
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilModelEntity entity = stochasticSoilModel.Create(registry, 0);
+
+ // Assert
+ Assert.IsNotNull(entity);
+ Assert.AreEqual(2, entity.StochasticSoilProfileEntities.Count);
+ }
+
+ [Test]
+ public void Create_WithGeometryPoints_ReturnsStochasticSoilModelEntityWithPropertiesAndStochasticSoilModelSegmentPointEntitiesSet()
+ {
+ // Setup
+ PipingStochasticSoilModel stochasticSoilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("testName");
+ stochasticSoilModel.Geometry.AddRange(new[]
+ {
+ new Point2D(-12.34, 56.78),
+ new Point2D(91.23, -34.56)
+ });
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilModelEntity entity = stochasticSoilModel.Create(registry, 0);
+
+ // Assert
+ Assert.IsNotNull(entity);
+ string expectedXml = new Point2DXmlSerializer().ToXml(stochasticSoilModel.Geometry);
+ Assert.AreEqual(expectedXml, entity.StochasticSoilModelSegmentPointXml);
+ }
+
+ [Test]
+ public void Create_SameModelCreatedMultipleTimes_ReturnSameEntity()
+ {
+ // Setup
+ PipingStochasticSoilModel soilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("A");
+
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilModelEntity entity1 = soilModel.Create(registry, 0);
+ StochasticSoilModelEntity entity2 = soilModel.Create(registry, 0);
+
+ // Assert
+ Assert.AreSame(entity1, entity2);
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilProfileCreateExtensionsTest.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilProfileCreateExtensionsTest.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingStochasticSoilProfileCreateExtensionsTest.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,101 @@
+// Copyright (C) Stichting Deltares 2017. 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 Application.Ringtoets.Storage.Create;
+using Application.Ringtoets.Storage.Create.Piping;
+using Application.Ringtoets.Storage.DbContext;
+using NUnit.Framework;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.KernelWrapper.TestUtil;
+
+namespace Application.Ringtoets.Storage.Test.Create.Piping
+{
+ [TestFixture]
+ public class PipingStochasticSoilProfileCreateExtensionsTest
+ {
+ [Test]
+ public void Create_WithoutPersistenceRegistry_ThrowsArgumentNullException()
+ {
+ // Setup
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile());
+
+ // Call
+ TestDelegate test = () => stochasticSoilProfile.Create(null, 0);
+
+ // Assert
+ string parameterName = Assert.Throws(test).ParamName;
+ Assert.AreEqual("registry", parameterName);
+ }
+
+ [Test]
+ public void Create_WithCollector_ReturnsStochasticSoilProfileEntityWithPropertiesSet()
+ {
+ // Setup
+ var random = new Random(21);
+ double probability = random.NextDouble();
+ int order = random.Next();
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(probability, new TestPipingSoilProfile());
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilProfileEntity entity = stochasticSoilProfile.Create(registry, order);
+
+ // Assert
+ Assert.IsNotNull(entity);
+ Assert.AreEqual(probability, entity.Probability);
+ Assert.AreEqual(order, entity.Order);
+ }
+
+ [Test]
+ public void Create_DifferentStochasticSoilProfilesWithSamePipingSoilProfile_ReturnsStochasticSoilProfileEntityWithSameSoilProfileEntitySet()
+ {
+ // Setup
+ var testPipingSoilProfile = new TestPipingSoilProfile();
+ var firstStochasticSoilProfile = new PipingStochasticSoilProfile(new Random(21).NextDouble(), testPipingSoilProfile);
+ var secondStochasticSoilProfile = new PipingStochasticSoilProfile(new Random(21).NextDouble(), testPipingSoilProfile);
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilProfileEntity firstEntity = firstStochasticSoilProfile.Create(registry, 0);
+ StochasticSoilProfileEntity secondEntity = secondStochasticSoilProfile.Create(registry, 0);
+
+ // Assert
+ Assert.AreSame(firstEntity.SoilProfileEntity, secondEntity.SoilProfileEntity);
+ }
+
+ [Test]
+ public void Create_SameStochasticSoilProfileMultipleTimes_ReturnSameEntity()
+ {
+ // Setup
+ var soilProfile = new TestPipingSoilProfile();
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(0.4, soilProfile);
+ var registry = new PersistenceRegistry();
+
+ // Call
+ StochasticSoilProfileEntity entity1 = stochasticSoilProfile.Create(registry, 0);
+ StochasticSoilProfileEntity entity2 = stochasticSoilProfile.Create(registry, 0);
+
+ // Assert
+ Assert.AreSame(entity1, entity2);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilModelCreateExtensionsTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/StochasticSoilProfileCreateExtensionsTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs
===================================================================
diff -u -rafa720a0da947ce7179500fefc71203d773de21e -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision afa720a0da947ce7179500fefc71203d773de21e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -54,13 +54,12 @@
using Ringtoets.Integration.Data.StandAlone.SectionResults;
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.Revetment.Data;
using Ringtoets.StabilityPointStructures.Data;
using Ringtoets.StabilityStoneCover.Data;
using Ringtoets.WaveImpactAsphaltCover.Data;
-using StochasticSoilModelCollection = Ringtoets.Piping.Data.StochasticSoilModelCollection;
-using StochasticSoilProfile = Ringtoets.Piping.Data.StochasticSoilProfile;
namespace Application.Ringtoets.Storage.Test.IntegrationTests
{
@@ -500,8 +499,8 @@
CollectionAssert.AreEqual(expectedReferenceLine.Points, actualReferenceLine.Points);
}
- private static void AssertStochasticSoilModels(StochasticSoilModelCollection expectedModels,
- StochasticSoilModelCollection actualModels)
+ private static void AssertStochasticSoilModels(PipingStochasticSoilModelCollection expectedModels,
+ PipingStochasticSoilModelCollection actualModels)
{
Assert.Less(0, actualModels.Count);
@@ -522,8 +521,8 @@
CollectionAssert.AreEqual(expectedSoilModelSegmentPoints, actualSoilModelSegmentPoints);
}
- private static void AssertStochasticSoilProfiles(IEnumerable expectedStochasticSoilProfiles,
- IEnumerable actualStochasticSoilProfiles)
+ private static void AssertStochasticSoilProfiles(IEnumerable expectedStochasticSoilProfiles,
+ IEnumerable actualStochasticSoilProfiles)
{
Assert.Less(0, actualStochasticSoilProfiles.Count());
@@ -532,7 +531,7 @@
AssertPipingSoilProfile);
}
- private static void AssertPipingSoilProfile(StochasticSoilProfile expectedProfile, StochasticSoilProfile actualProfile)
+ private static void AssertPipingSoilProfile(PipingStochasticSoilProfile expectedProfile, PipingStochasticSoilProfile actualProfile)
{
Assert.AreEqual(expectedProfile.Probability, actualProfile.Probability);
Assert.AreEqual(expectedProfile.SoilProfile.Bottom, actualProfile.SoilProfile.Bottom);
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs
===================================================================
diff -u -rfe90a6d174a01975381e6cda55ed1f7f4e831a51 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision fe90a6d174a01975381e6cda55ed1f7f4e831a51)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -39,6 +39,7 @@
using Ringtoets.GrassCoverErosionOutwards.Data;
using Ringtoets.HeightStructures.Data;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.StabilityPointStructures.Data;
using Ringtoets.StabilityStoneCover.Data;
using Ringtoets.WaveImpactAsphaltCover.Data;
@@ -321,7 +322,7 @@
entity.ReadAsPipingFailureMechanism(failureMechanism, collector);
// Assert
- StochasticSoilModelCollection stochasticSoilModels = failureMechanism.StochasticSoilModels;
+ PipingStochasticSoilModelCollection stochasticSoilModels = failureMechanism.StochasticSoilModels;
Assert.AreEqual(sourcePath, stochasticSoilModels.SourcePath);
CollectionAssert.IsEmpty(stochasticSoilModels);
}
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs (.../PipingCalculationEntityReadExtensionsTest.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs (.../PipingCalculationEntityReadExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -30,6 +30,8 @@
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.KernelWrapper.TestUtil;
using Ringtoets.Piping.Primitives;
namespace Application.Ringtoets.Storage.Test.Read.Piping
@@ -245,10 +247,10 @@
public void Read_EntityWithStochasticSoilModelEntityInCollector_CalculationHasAlreadyReadStochasticSoilModel()
{
// Setup
- var stochasticSoilModel = new StochasticSoilModel("A");
+ var stochasticSoilModel = new PipingStochasticSoilModel("A");
var stochasticSoilModelEntity = new StochasticSoilModelEntity();
- var stochasticSoilProfile = new StochasticSoilProfile(1, SoilProfileType.SoilProfile1D, 1);
+ var stochasticSoilProfile = new PipingStochasticSoilProfile(1, new TestPipingSoilProfile());
var stochasticSoilProfileEntity = new StochasticSoilProfileEntity
{
StochasticSoilModelEntity = stochasticSoilModelEntity
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilModelEntityReadExtensionsTest.cs
===================================================================
diff -u -r8a0dd3cd494c23f4801327565ddf5d774949e077 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision 8a0dd3cd494c23f4801327565ddf5d774949e077)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -27,7 +27,7 @@
using Application.Ringtoets.Storage.Serializers;
using Core.Common.Base.Geometry;
using NUnit.Framework;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
namespace Application.Ringtoets.Storage.Test.Read.Piping
{
@@ -81,7 +81,7 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilModel model = entity.Read(collector);
+ PipingStochasticSoilModel model = entity.Read(collector);
// Assert
Assert.IsNotNull(model);
@@ -127,7 +127,7 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilModel model = entity.Read(collector);
+ PipingStochasticSoilModel model = entity.Read(collector);
// Assert
Assert.AreEqual(2, model.StochasticSoilProfiles.Count);
@@ -155,7 +155,7 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilModel model = entity.Read(collector);
+ PipingStochasticSoilModel model = entity.Read(collector);
// Assert
CollectionAssert.AreEqual(segmentPoints, model.Geometry);
@@ -173,8 +173,8 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilModel soilModel1 = entity.Read(collector);
- StochasticSoilModel soilModel2 = entity.Read(collector);
+ PipingStochasticSoilModel soilModel1 = entity.Read(collector);
+ PipingStochasticSoilModel soilModel2 = entity.Read(collector);
// Assert
Assert.AreSame(soilModel1, soilModel2);
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs
===================================================================
diff -u -r3fb0df0ed6e64657154700ee7706e035d5bf99f5 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs (.../StochasticSoilProfileEntityReadExtensionsTest.cs) (revision 3fb0df0ed6e64657154700ee7706e035d5bf99f5)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/Piping/StochasticSoilProfileEntityReadExtensionsTest.cs (.../StochasticSoilProfileEntityReadExtensionsTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -24,8 +24,7 @@
using Application.Ringtoets.Storage.Read;
using Application.Ringtoets.Storage.Read.Piping;
using NUnit.Framework;
-using Ringtoets.Piping.Data;
-using Ringtoets.Piping.Primitives;
+using Ringtoets.Piping.Data.SoilProfile;
namespace Application.Ringtoets.Storage.Test.Read.Piping
{
@@ -69,12 +68,11 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilProfile profile = entity.Read(collector);
+ PipingStochasticSoilProfile profile = entity.Read(collector);
// Assert
Assert.IsNotNull(profile);
Assert.AreEqual(probability, profile.Probability, 1e-6);
- Assert.AreEqual((SoilProfileType) soilProfileType, profile.SoilProfileType);
Assert.IsTrue(collector.Contains(entity));
}
@@ -102,10 +100,10 @@
};
var collector = new ReadConversionCollector();
- StochasticSoilProfile firstProfile = firstEntity.Read(collector);
+ PipingStochasticSoilProfile firstProfile = firstEntity.Read(collector);
// Call
- StochasticSoilProfile secondProfile = secondEntity.Read(collector);
+ PipingStochasticSoilProfile secondProfile = secondEntity.Read(collector);
// Assert
Assert.AreNotSame(firstProfile, secondProfile);
@@ -130,8 +128,8 @@
var collector = new ReadConversionCollector();
// Call
- StochasticSoilProfile profile1 = entity.Read(collector);
- StochasticSoilProfile profile2 = entity.Read(collector);
+ PipingStochasticSoilProfile profile1 = entity.Read(collector);
+ PipingStochasticSoilProfile profile2 = entity.Read(collector);
// Assert
Assert.AreSame(profile1, profile2);
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -36,7 +36,7 @@
using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.HeightStructures.Data;
using Ringtoets.HeightStructures.Data.TestUtil;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.KernelWrapper.TestUtil;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
@@ -69,7 +69,7 @@
// Setup
var collector = new ReadConversionCollector();
var entity = new StochasticSoilProfileEntity();
- collector.Read(entity, new StochasticSoilProfile(1, SoilProfileType.SoilProfile1D, 1));
+ collector.Read(entity, new PipingStochasticSoilProfile(1, new TestPipingSoilProfile()));
// Call
bool result = collector.Contains(entity);
@@ -98,7 +98,7 @@
// Setup
var collector = new ReadConversionCollector();
var entity = new StochasticSoilProfileEntity();
- collector.Read(new StochasticSoilProfileEntity(), new StochasticSoilProfile(0.4, SoilProfileType.SoilProfile2D, 2));
+ collector.Read(new StochasticSoilProfileEntity(), new PipingStochasticSoilProfile(0.4, new TestPipingSoilProfile()));
// Call
bool result = collector.Contains(entity);
@@ -126,12 +126,12 @@
{
// Setup
var collector = new ReadConversionCollector();
- var profile = new StochasticSoilProfile(0.5, SoilProfileType.SoilProfile2D, 2);
+ var profile = new PipingStochasticSoilProfile(0.5, new TestPipingSoilProfile());
var entity = new StochasticSoilProfileEntity();
collector.Read(entity, profile);
// Call
- StochasticSoilProfile result = collector.Get(entity);
+ PipingStochasticSoilProfile result = collector.Get(entity);
// Assert
Assert.AreSame(profile, result);
@@ -157,7 +157,7 @@
// Setup
var collector = new ReadConversionCollector();
var entity = new StochasticSoilProfileEntity();
- collector.Read(new StochasticSoilProfileEntity(), new StochasticSoilProfile(0.7, SoilProfileType.SoilProfile1D, 6));
+ collector.Read(new StochasticSoilProfileEntity(), new PipingStochasticSoilProfile(0.7, new TestPipingSoilProfile()));
// Call
TestDelegate test = () => collector.Get(entity);
@@ -173,7 +173,7 @@
var collector = new ReadConversionCollector();
// Call
- TestDelegate test = () => collector.Read(null, new StochasticSoilProfile(0.7, SoilProfileType.SoilProfile1D, 6));
+ TestDelegate test = () => collector.Read(null, new PipingStochasticSoilProfile(0.7, new TestPipingSoilProfile()));
// Assert
string paramName = Assert.Throws(test).ParamName;
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs
===================================================================
diff -u -rafa720a0da947ce7179500fefc71203d773de21e -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision afa720a0da947ce7179500fefc71203d773de21e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -35,6 +35,7 @@
using Ringtoets.HeightStructures.Data;
using Ringtoets.Integration.Data;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
using Ringtoets.StabilityStoneCover.Data;
@@ -90,17 +91,13 @@
PipingFailureMechanism failureMechanism = assessmentSection.PipingFailureMechanism;
Assert.AreEqual("some/path/to/stochasticSoilModelFile", failureMechanism.StochasticSoilModels.SourcePath);
Assert.AreEqual(1, failureMechanism.StochasticSoilModels.Count);
- StochasticSoilModel soilModel = failureMechanism.StochasticSoilModels[0];
+ PipingStochasticSoilModel soilModel = failureMechanism.StochasticSoilModels[0];
Assert.AreEqual("modelName", soilModel.Name);
Assert.AreEqual(2, soilModel.StochasticSoilProfiles.Count);
- StochasticSoilProfile stochasticSoilProfile1 = soilModel.StochasticSoilProfiles[0];
+ PipingStochasticSoilProfile stochasticSoilProfile1 = soilModel.StochasticSoilProfiles[0];
Assert.AreEqual(0.2, stochasticSoilProfile1.Probability);
- Assert.AreEqual(SoilProfileType.SoilProfile1D, stochasticSoilProfile1.SoilProfileType);
- Assert.AreEqual(-1, stochasticSoilProfile1.SoilProfileId);
- StochasticSoilProfile stochasticSoilProfile2 = soilModel.StochasticSoilProfiles[1];
+ PipingStochasticSoilProfile stochasticSoilProfile2 = soilModel.StochasticSoilProfiles[1];
Assert.AreEqual(0.8, stochasticSoilProfile2.Probability);
- Assert.AreEqual(SoilProfileType.SoilProfile2D, stochasticSoilProfile2.SoilProfileType);
- Assert.AreEqual(-1, stochasticSoilProfile2.SoilProfileId);
Assert.AreEqual("some/path/to/surfaceLineFile", failureMechanism.SurfaceLines.SourcePath);
Assert.AreEqual(1, failureMechanism.SurfaceLines.Count);
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs
===================================================================
diff -u -rafa720a0da947ce7179500fefc71203d773de21e -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision afa720a0da947ce7179500fefc71203d773de21e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -46,15 +46,14 @@
using Ringtoets.Integration.Data.StandAlone.SectionResults;
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.KernelWrapper.TestUtil;
using Ringtoets.Piping.Primitives;
using Ringtoets.Revetment.Data;
using Ringtoets.StabilityPointStructures.Data;
using Ringtoets.StabilityPointStructures.Data.TestUtil;
using Ringtoets.StabilityStoneCover.Data;
using Ringtoets.WaveImpactAsphaltCover.Data;
-using StochasticSoilModel = Ringtoets.Piping.Data.StochasticSoilModel;
-using StochasticSoilProfile = Ringtoets.Piping.Data.StochasticSoilProfile;
namespace Application.Ringtoets.Storage.TestUtil
{
@@ -874,7 +873,7 @@
pipingFailureMechanism.StochasticSoilModels.AddRange(new[]
{
- new StochasticSoilModel("modelName")
+ new PipingStochasticSoilModel("modelName")
{
Geometry =
{
@@ -884,14 +883,8 @@
},
StochasticSoilProfiles =
{
- new StochasticSoilProfile(0.2, SoilProfileType.SoilProfile1D, -1)
- {
- SoilProfile = pipingSoilProfile
- },
- new StochasticSoilProfile(0.8, SoilProfileType.SoilProfile2D, -1)
- {
- SoilProfile = new TestPipingSoilProfile()
- }
+ new PipingStochasticSoilProfile(0.2, pipingSoilProfile),
+ new PipingStochasticSoilProfile(0.8, new TestPipingSoilProfile())
}
}
}, "some/path/to/stochasticSoilModelFile");
Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs
===================================================================
diff -u -re6671f07e31bef1e5617d8998ce01be60cc648d2 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision e6671f07e31bef1e5617d8998ce01be60cc648d2)
+++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -39,14 +39,15 @@
using Ringtoets.Common.IO.FileImporters;
using Ringtoets.Common.IO.FileImporters.MessageProviders;
using Ringtoets.Common.IO.ReferenceLines;
+using Ringtoets.Common.IO.SoilProfile;
using Ringtoets.Common.IO.SurfaceLines;
using Ringtoets.GrassCoverErosionInwards.Data;
using Ringtoets.GrassCoverErosionOutwards.Data;
using Ringtoets.HeightStructures.Data;
using Ringtoets.Integration.Data;
using Ringtoets.Integration.Plugin.Handlers;
using Ringtoets.Piping.Data;
-using Ringtoets.Piping.IO.Importers;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Plugin.FileImporter;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
@@ -590,11 +591,12 @@
using (var embeddedResourceFileWriter = new EmbeddedResourceFileWriter(GetType().Assembly, true, "DR6.soil"))
{
- var soilProfilesImporter = new StochasticSoilModelImporter(pipingFailureMechanism.StochasticSoilModels,
- Path.Combine(embeddedResourceFileWriter.TargetFolderPath,
- "DR6.soil"),
- new ImportMessageProvider(),
- new StochasticSoilModelReplaceDataStrategy(pipingFailureMechanism));
+ var soilProfilesImporter =
+ new StochasticSoilModelImporter(
+ pipingFailureMechanism.StochasticSoilModels,
+ Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6.soil"),
+ new ImportMessageProvider(),
+ StochasticSoilModelImporterConfigurationFactory.CreateReplaceStrategyConfiguration(pipingFailureMechanism));
soilProfilesImporter.Import();
}
@@ -608,7 +610,7 @@
};
calculation.InputParameters.SurfaceLine = pipingFailureMechanism.SurfaceLines.First(sl => sl.Name == "PK001_0001");
- StochasticSoilModel stochasticSoilModel = pipingFailureMechanism.StochasticSoilModels.First(sm => sm.Name == "PK001_0001_Piping");
+ PipingStochasticSoilModel stochasticSoilModel = pipingFailureMechanism.StochasticSoilModels.First(sm => sm.Name == "PK001_0001_Piping");
calculation.InputParameters.StochasticSoilModel = stochasticSoilModel;
calculation.InputParameters.StochasticSoilProfile = stochasticSoilModel.StochasticSoilProfiles.First(sp => sp.SoilProfile.Name == "W1-6_0_1D1");
calculation.InputParameters.HydraulicBoundaryLocation = demoAssessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001);
Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs
===================================================================
diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf)
+++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -43,6 +43,7 @@
using Ringtoets.HeightStructures.Data;
using Ringtoets.Integration.Data;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.Piping.Service;
using Ringtoets.Revetment.Data;
@@ -374,7 +375,7 @@
private static void AssertPipingFailureMechanism(AssessmentSection demoAssessmentSection)
{
- StochasticSoilModel[] soilModels = demoAssessmentSection.PipingFailureMechanism.StochasticSoilModels.ToArray();
+ PipingStochasticSoilModel[] soilModels = demoAssessmentSection.PipingFailureMechanism.StochasticSoilModels.ToArray();
Assert.AreEqual(4, soilModels.Length);
PipingSurfaceLine[] surfaceLines = demoAssessmentSection.PipingFailureMechanism.SurfaceLines.ToArray();
Assert.AreEqual(4, surfaceLines.Length);
Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs
===================================================================
diff -u -r4fc96d31a69029557095247c8ff890d06239b65a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision 4fc96d31a69029557095247c8ff890d06239b65a)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilModelImporter.cs (.../StochasticSoilModelImporter.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -241,10 +241,7 @@
return new ReadResult(false);
}
- if (!ValidateStochasticSoilModel(stochasticSoilModel))
- {
- return new ReadResult(true);
- }
+ ValidateStochasticSoilModel(stochasticSoilModel);
transformedStochasticSoilModels.Add(transformer.Transform(stochasticSoilModel));
}
@@ -255,21 +252,13 @@
};
}
- ///
- /// Validate the definition of a .
- ///
- /// The to validate.
- /// false when the sum of the stochastic soil profiles in the stochastic
- /// soil model does add up to 100%, true otherwise.
- private bool ValidateStochasticSoilModel(StochasticSoilModel stochasticSoilModel)
+ private void ValidateStochasticSoilModel(StochasticSoilModel stochasticSoilModel)
{
if (!IsSumOfAllProbabilitiesEqualToOne(stochasticSoilModel))
{
- Log.ErrorFormat(Resources.StochasticSoilModelImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct,
- stochasticSoilModel.Name);
- return false;
+ Log.WarnFormat(Resources.StochasticSoilModelImporter_ValidateStochasticSoilModel_Sum_of_probabilities_of_stochastic_soil_model_0_is_not_correct,
+ stochasticSoilModel.Name);
}
- return true;
}
private static bool IsSumOfAllProbabilitiesEqualToOne(StochasticSoilModel stochasticSoilModel)
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs
===================================================================
diff -u -r4fc96d31a69029557095247c8ff890d06239b65a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs (.../StochasticSoilModelImporterTest.cs) (revision 4fc96d31a69029557095247c8ff890d06239b65a)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilModelImporterTest.cs (.../StochasticSoilModelImporterTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -719,8 +719,17 @@
public void Import_IncorrectProbability_LogAndImportSoilModelToCollection()
{
// Setup
+ string validFilePath = Path.Combine(testDataPath, "incorrectProbability.soil");
+ const string expectedAddDataProgressText = "Adding data...";
+
+ var stochasticSoilModelCollection = new TestStochasticSoilModelCollection();
+
var messageProvider = mocks.StrictMock();
+ messageProvider.Expect(mp => mp.GetAddDataToModelProgressText())
+ .Return(expectedAddDataProgressText);
var updateStrategy = mocks.StrictMock>();
+ updateStrategy.Expect(u => u.UpdateModelWithImportedData(Arg.List.ContainsAll(stochasticSoilModelCollection),
+ Arg.Is.Equal(validFilePath)));
var filter = mocks.StrictMock();
filter.Expect(f => f.IsValidForFailureMechanism(null))
.IgnoreArguments()
@@ -729,10 +738,8 @@
.AtLeastOnce();
mocks.ReplayAll();
- string validFilePath = Path.Combine(testDataPath, "incorrectProbability.soil");
-
var importer = new StochasticSoilModelImporter(
- new TestStochasticSoilModelCollection(),
+ stochasticSoilModelCollection,
validFilePath,
messageProvider,
new StochasticSoilModelImporterConfiguration(
@@ -747,9 +754,9 @@
// Assert
const string expectedLogMessage = "De som van de kansen van voorkomen in het stochastich ondergrondmodel 'Name' is niet gelijk aan 100%.";
- Tuple expectedLogMessageAndLevel = Tuple.Create(expectedLogMessage, LogLevelConstant.Error);
+ Tuple expectedLogMessageAndLevel = Tuple.Create(expectedLogMessage, LogLevelConstant.Warn);
TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedLogMessageAndLevel, 1);
- Assert.IsFalse(importResult);
+ Assert.IsTrue(importResult);
}
[Test]
Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs
===================================================================
diff -u -r902fc625ae4a0c3344e9e50d5e1560c060728e12 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 902fc625ae4a0c3344e9e50d5e1560c060728e12)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -45,11 +45,11 @@
using Ringtoets.MacroStabilityInwards.Data;
using Ringtoets.MacroStabilityInwards.Primitives;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using Ringtoets.StabilityPointStructures.Data;
using Ringtoets.StabilityStoneCover.Data;
using Ringtoets.WaveImpactAsphaltCover.Data;
-using PipingStochasticSoilModel = Ringtoets.Piping.Data.StochasticSoilModel;
using MacroStabilityInwardsStochasticSoilModel = Ringtoets.MacroStabilityInwards.Data.StochasticSoilModel;
namespace Ringtoets.Integration.Service.Test
Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs
===================================================================
diff -u -rcd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision cd90ebf744fb74f0d4b0dd6ee06f9c39b5faf213)
+++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataImportHelper.cs (.../DataImportHelper.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -33,13 +33,16 @@
using Ringtoets.Common.IO.FileImporters;
using Ringtoets.Common.IO.FileImporters.MessageProviders;
using Ringtoets.Common.IO.ReferenceLines;
+using Ringtoets.Common.IO.SoilProfile;
using Ringtoets.Common.IO.SurfaceLines;
using Ringtoets.Integration.Data;
using Ringtoets.Integration.Plugin.Handlers;
using Ringtoets.MacroStabilityInwards.Data;
+using Ringtoets.MacroStabilityInwards.IO.Importers;
+using Ringtoets.MacroStabilityInwards.Plugin.FileImporter;
using Ringtoets.MacroStabilityInwards.Primitives;
using Ringtoets.Piping.Data;
-using Ringtoets.Piping.IO.Importers;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Plugin.FileImporter;
using Ringtoets.Piping.Primitives;
using PipingSurfaceLinesCsvImporterConfigurationFactory = Ringtoets.Piping.Plugin.FileImporter.SurfaceLinesCsvImporterConfigurationFactory;
@@ -204,7 +207,7 @@
}
///
- /// Imports the data for the
+ /// Imports the data for the
/// of the given .
///
/// The to import on.
@@ -216,12 +219,13 @@
"DR6.soil"))
{
string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6.soil");
- var activity = new FileImportActivity(new StochasticSoilModelImporter(
- assessmentSection.PipingFailureMechanism.StochasticSoilModels,
- filePath,
- new ImportMessageProvider(),
- new StochasticSoilModelReplaceDataStrategy(assessmentSection.PipingFailureMechanism)),
- "StochasticSoilModelImporter");
+ var activity = new FileImportActivity(
+ new StochasticSoilModelImporter(
+ assessmentSection.PipingFailureMechanism.StochasticSoilModels,
+ filePath,
+ new ImportMessageProvider(),
+ StochasticSoilModelImporterConfigurationFactory.CreateReplaceStrategyConfiguration(assessmentSection.PipingFailureMechanism)),
+ "StochasticSoilModelImporter");
activity.Run();
activity.Finish();
}
@@ -269,11 +273,11 @@
"DR6.soil"))
{
string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6.soil");
- var activity = new FileImportActivity(new MacroStabilityInwards.IO.Importers.StochasticSoilModelImporter(
+ var activity = new FileImportActivity(new StochasticSoilModelImporter(
assessmentSection.MacroStabilityInwards.StochasticSoilModels,
filePath,
new ImportMessageProvider(),
- new MacroStabilityInwards.Plugin.FileImporter.StochasticSoilModelReplaceDataStrategy(assessmentSection.MacroStabilityInwards)),
+ new StochasticSoilModelReplaceDataStrategy(assessmentSection.MacroStabilityInwards)),
"StochasticSoilModelImporter");
activity.Run();
activity.Finish();
Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs
===================================================================
diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs (.../DataUpdateHelper.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9)
+++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs (.../DataUpdateHelper.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -24,9 +24,12 @@
using Core.Common.Utils.IO;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.IO.FileImporters.MessageProviders;
+using Ringtoets.Common.IO.SoilProfile;
using Ringtoets.Integration.Data;
+using Ringtoets.MacroStabilityInwards.IO.Importers;
+using Ringtoets.MacroStabilityInwards.Plugin.FileImporter;
using Ringtoets.Piping.Data;
-using Ringtoets.Piping.IO.Importers;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Plugin.FileImporter;
namespace Ringtoets.Integration.TestUtils
@@ -37,7 +40,7 @@
public static class DataUpdateHelper
{
///
- /// Imports the data for the
+ /// Imports the data for the
/// of the given and updates existing data based upon the imported
/// data.
///
@@ -52,12 +55,13 @@
"DR6_updated.soil"))
{
string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6_updated.soil");
- var activity = new FileImportActivity(new StochasticSoilModelImporter(
- assessmentSection.PipingFailureMechanism.StochasticSoilModels,
- filePath,
- new UpdateMessageProvider(),
- new StochasticSoilModelUpdateDataStrategy(assessmentSection.PipingFailureMechanism)),
- "StochasticSoilModelUpdater");
+ var activity = new FileImportActivity(
+ new StochasticSoilModelImporter(
+ assessmentSection.PipingFailureMechanism.StochasticSoilModels,
+ filePath,
+ new UpdateMessageProvider(),
+ StochasticSoilModelImporterConfigurationFactory.CreateUpdateStrategyConfiguration(assessmentSection.PipingFailureMechanism)),
+ "StochasticSoilModelUpdater");
activity.Run();
activity.Finish();
}
@@ -79,11 +83,11 @@
"DR6_updated.soil"))
{
string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6_updated.soil");
- var activity = new FileImportActivity(new MacroStabilityInwards.IO.Importers.StochasticSoilModelImporter(
+ var activity = new FileImportActivity(new StochasticSoilModelImporter(
assessmentSection.MacroStabilityInwards.StochasticSoilModels,
filePath,
new UpdateMessageProvider(),
- new MacroStabilityInwards.Plugin.FileImporter.StochasticSoilModelUpdateDataStrategy(assessmentSection.MacroStabilityInwards)),
+ new StochasticSoilModelUpdateDataStrategy(assessmentSection.MacroStabilityInwards)),
"StochasticSoilModelUpdater");
activity.Run();
activity.Finish();
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs
===================================================================
diff -u -rfc7fef209ce94b913bf4bfb974abd71242b4769d -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision fc7fef209ce94b913bf4bfb974abd71242b4769d)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -25,6 +25,7 @@
using Core.Common.Base.Data;
using Ringtoets.Common.Data.Exceptions;
using Ringtoets.Common.Data.Probabilistics;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.InputParameterCalculation;
using Ringtoets.Piping.Primitives;
@@ -204,7 +205,7 @@
private void UpdateThicknessAquiferLayerMean(LogNormalDistribution thicknessAquiferLayer)
{
- StochasticSoilProfile stochasticSoilProfile = input.StochasticSoilProfile;
+ PipingStochasticSoilProfile stochasticSoilProfile = input.StochasticSoilProfile;
PipingSurfaceLine surfaceLine = input.SurfaceLine;
RoundedDouble exitPointL = input.ExitPointL;
@@ -222,7 +223,7 @@
private void UpdateThicknessCoverageLayerMean(LogNormalDistribution thicknessCoverageLayerDistribution)
{
- StochasticSoilProfile stochasticSoilProfile = input.StochasticSoilProfile;
+ PipingStochasticSoilProfile stochasticSoilProfile = input.StochasticSoilProfile;
PipingSurfaceLine surfaceLine = input.SurfaceLine;
RoundedDouble exitPointL = input.ExitPointL;
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanism.cs (.../PipingFailureMechanism.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -22,6 +22,7 @@
using System.Collections.Generic;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Piping.Data.SoilProfile;
using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources;
using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources;
@@ -43,7 +44,7 @@
PipingProbabilityAssessmentInput = new PipingProbabilityAssessmentInput();
GeneralInput = new GeneralPipingInput();
SurfaceLines = new PipingSurfaceLineCollection();
- StochasticSoilModels = new StochasticSoilModelCollection();
+ StochasticSoilModels = new PipingStochasticSoilModelCollection();
CalculationsGroup = new CalculationGroup(RingtoetsCommonDataResources.FailureMechanism_Calculations_DisplayName, false);
sectionResults = new List();
@@ -65,7 +66,7 @@
///
/// Gets the available stochastic soil models within the scope of the piping failure mechanism.
///
- public StochasticSoilModelCollection StochasticSoilModels { get; }
+ public PipingStochasticSoilModelCollection StochasticSoilModels { get; }
///
/// Gets the general piping calculation input parameters that apply to each piping calculation.
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -29,6 +29,7 @@
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.Piping.Data.Properties;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Data
@@ -176,14 +177,14 @@
}
///
- /// Gets or sets the stochastic soil model which is linked to the .
+ /// Gets or sets the stochastic soil model which is linked to the .
///
- public StochasticSoilModel StochasticSoilModel { get; set; }
+ public PipingStochasticSoilModel StochasticSoilModel { get; set; }
///
/// Gets or sets the profile which contains a 1 dimensional definition of soil layers with properties.
///
- public StochasticSoilProfile StochasticSoilProfile { get; set; }
+ public PipingStochasticSoilProfile StochasticSoilProfile { get; set; }
///
/// Gets or sets the hydraulic boundary location from which to use the assessment level.
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj
===================================================================
diff -u -r94ce658a9488c346f114446f0e37dabab7acaa38 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 94ce658a9488c346f114446f0e37dabab7acaa38)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -61,12 +61,10 @@
+
+
+
-
-
-
-
-
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs
===================================================================
diff -u -rb78437864e9677d66dc309d766b0e706c8af0c1f -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision b78437864e9677d66dc309d766b0e706c8af0c1f)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -19,10 +19,13 @@
// 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 Core.Common.Base.Geometry;
using Ringtoets.Common.Data;
+using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Data.SoilProfile
{
@@ -47,7 +50,7 @@
///
/// Gets the name of the soil model.
///
- public string Name { get; }
+ public string Name { get; private set; }
///
/// Gets the list of geometry points.
@@ -59,9 +62,81 @@
///
public List StochasticSoilProfiles { get; }
+ ///
+ /// Updates the with the properties from .
+ ///
+ /// The to
+ /// obtain the property values from.
+ /// The differences summed up in an instance of .
+ /// Thrown when
+ /// is null.
+ /// Thrown when
+ /// contains multiple profiles with the same name, and also contains a
+ /// profile with the same name.
+ ///
+ public PipingStochasticSoilModelProfileDifference Update(PipingStochasticSoilModel fromModel)
+ {
+ if (fromModel == null)
+ {
+ throw new ArgumentNullException(nameof(fromModel));
+ }
+
+ Name = fromModel.Name;
+ Geometry.Clear();
+ foreach (Point2D point in fromModel.Geometry)
+ {
+ Geometry.Add(point);
+ }
+
+ var newSoilProfiles = new List();
+ var updatedProfiles = new List();
+ var addedProfiles = new List();
+ var removedProfiles = new List();
+
+ foreach (PipingStochasticSoilProfile fromProfile in fromModel.StochasticSoilProfiles)
+ {
+ PipingStochasticSoilProfile sameProfile = StochasticSoilProfiles.SingleOrDefault(
+ sp => IsSame(sp, fromProfile)
+ );
+ if (sameProfile != null)
+ {
+ if (sameProfile.Update(fromProfile))
+ {
+ updatedProfiles.Add(sameProfile);
+ }
+ }
+ else
+ {
+ StochasticSoilProfiles.Add(fromProfile);
+ addedProfiles.Add(fromProfile);
+ }
+ newSoilProfiles.Add(fromProfile.SoilProfile);
+ }
+
+ foreach (PipingStochasticSoilProfile profileToRemove in StochasticSoilProfiles.Where(
+ sp => !newSoilProfiles.Any(newSp => IsSame(newSp, sp.SoilProfile))).ToArray())
+ {
+ StochasticSoilProfiles.Remove(profileToRemove);
+ removedProfiles.Add(profileToRemove);
+ }
+
+ return new PipingStochasticSoilModelProfileDifference(addedProfiles, updatedProfiles, removedProfiles);
+ }
+
public override string ToString()
{
return Name;
}
+
+ private static bool IsSame(PipingSoilProfile pipingSoilProfile, PipingSoilProfile otherPipingSoilProfile)
+ {
+ return pipingSoilProfile.Name.Equals(otherPipingSoilProfile.Name)
+ && pipingSoilProfile.SoilProfileType.Equals(otherPipingSoilProfile.SoilProfileType);
+ }
+
+ private static bool IsSame(PipingStochasticSoilProfile stochasticSoilProfile, PipingStochasticSoilProfile otherStochasticSoilProfile)
+ {
+ return IsSame(stochasticSoilProfile.SoilProfile, otherStochasticSoilProfile.SoilProfile);
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelCollection.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelCollection.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelCollection.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,39 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Core.Common.Base;
+using Ringtoets.Piping.Data.Properties;
+using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources;
+
+namespace Ringtoets.Piping.Data.SoilProfile
+{
+ ///
+ /// A collection of . The names of the elements are
+ /// unique within the collection.
+ ///
+ public class PipingStochasticSoilModelCollection : ObservableUniqueItemCollectionWithSourcePath
+ {
+ public PipingStochasticSoilModelCollection() : base(model => model.Name,
+ RingtoetsCommonDataResources.StochasticSoilModelCollection_TypeDescriptor,
+ Resources.UniqueFeature_Name_FeatureDescription)
+ { }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelExtensions.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelExtensions.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelExtensions.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,78 @@
+// Copyright (C) Stichting Deltares 2017. 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;
+using Ringtoets.Piping.Primitives;
+
+namespace Ringtoets.Piping.Data.SoilProfile
+{
+ ///
+ /// Extension methods dealing with instances.
+ ///
+ public static class PipingStochasticSoilModelExtensions
+ {
+ ///
+ /// Indicates whether a stochastic soil model intersects with a surface line.
+ ///
+ /// The stochastic soil model used to match a surface line.
+ /// The surface line used to match a stochastic soil model.
+ /// true when the intersects with the ;
+ /// false otherwise.
+ /// Thrown when any input parameter is null.
+ public static bool IntersectsWithSurfaceLineGeometry(this PipingStochasticSoilModel stochasticSoilModel,
+ PipingSurfaceLine surfaceLine)
+ {
+ if (stochasticSoilModel == null)
+ {
+ throw new ArgumentNullException(nameof(stochasticSoilModel));
+ }
+ if (surfaceLine == null)
+ {
+ throw new ArgumentNullException(nameof(surfaceLine));
+ }
+
+ Segment2D[] surfaceLineSegments = Math2D.ConvertLinePointsToLineSegments(GetSurfaceLine2DGeometry(surfaceLine)).ToArray();
+ return DoesSoilModelGeometryIntersectWithSurfaceLineGeometry(stochasticSoilModel, surfaceLineSegments);
+ }
+
+ private static IEnumerable GetSurfaceLine2DGeometry(MechanismSurfaceLineBase surfaceLine)
+ {
+ return surfaceLine.Points.Select(p => new Point2D(p.X, p.Y));
+ }
+
+ private static bool DoesSoilModelGeometryIntersectWithSurfaceLineGeometry(PipingStochasticSoilModel stochasticSoilModel,
+ Segment2D[] surfaceLineSegments)
+ {
+ IEnumerable soilProfileGeometrySegments = Math2D.ConvertLinePointsToLineSegments(stochasticSoilModel.Geometry);
+ return soilProfileGeometrySegments.Any(s => DoesSegmentIntersectWithSegmentArray(s, surfaceLineSegments));
+ }
+
+ private static bool DoesSegmentIntersectWithSegmentArray(Segment2D segment, Segment2D[] segmentArray)
+ {
+ // Consider intersections and overlaps similarly
+ return segmentArray.Any(sls => Math2D.GetIntersectionBetweenSegments(segment, sls).IntersectionType != Intersection2DType.DoesNotIntersect);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelProfileDifference.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelProfileDifference.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModelProfileDifference.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,63 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Collections.Generic;
+
+namespace Ringtoets.Piping.Data.SoilProfile
+{
+ ///
+ /// Container for the differences of the collection of contained
+ /// by a .
+ ///
+ public class PipingStochasticSoilModelProfileDifference
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// Profiles that were added to the model.
+ /// Profiles that were updated.
+ /// Profiles that were removed from the model.
+ public PipingStochasticSoilModelProfileDifference(
+ IEnumerable addedProfiles,
+ IEnumerable updatedProfiles,
+ IEnumerable removedProfiles)
+ {
+ AddedProfiles = addedProfiles;
+ UpdatedProfiles = updatedProfiles;
+ RemovedProfiles = removedProfiles;
+ }
+
+ ///
+ /// Gets the profiles that were updated.
+ ///
+ public IEnumerable UpdatedProfiles { get; }
+
+ ///
+ /// Gets the profiles that were removed from the model.
+ ///
+ public IEnumerable RemovedProfiles { get; }
+
+ ///
+ /// Gets the profiles that were added to the model.
+ ///
+ public IEnumerable AddedProfiles { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilProfile.cs
===================================================================
diff -u -r94ce658a9488c346f114446f0e37dabab7acaa38 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilProfile.cs (.../PipingStochasticSoilProfile.cs) (revision 94ce658a9488c346f114446f0e37dabab7acaa38)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilProfile.cs (.../PipingStochasticSoilProfile.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -34,6 +34,7 @@
public class PipingStochasticSoilProfile : Observable
{
private static readonly Range probabilityValidityRange = new Range(0, 1);
+ private double probability;
///
/// Creates a new instance of .
@@ -49,23 +50,66 @@
{
throw new ArgumentNullException(nameof(soilProfile));
}
-
- ValidateProbability(probability);
-
+
Probability = probability;
SoilProfile = soilProfile;
}
///
/// Gets the probability of the stochastic soil profile.
///
- public double Probability { get; }
+ /// Thrown when the is outside the range
+ /// [0, 1].
+ public double Probability
+ {
+ get
+ {
+ return probability;
+ }
+ private set
+ {
+ if (!probabilityValidityRange.InRange(value))
+ {
+ throw new ArgumentOutOfRangeException(
+ nameof(value),
+ string.Format(
+ Resources.StochasticSoilProfile_Probability_Should_be_in_range_0_,
+ probabilityValidityRange.ToString(FormattableConstants.ShowAtLeastOneDecimal, CultureInfo.CurrentCulture)));
+ }
+ probability = value;
+ }
+ }
///
/// Gets the .
///
- public PipingSoilProfile SoilProfile { get; }
+ public PipingSoilProfile SoilProfile { get; private set; }
+ ///
+ /// Updates the with the properties
+ /// from .
+ ///
+ /// The to
+ /// obtain the property values from.
+ /// Thrown when
+ /// is null.
+ /// true if the profile has been updated; false otherwise.
+ public bool Update(PipingStochasticSoilProfile fromProfile)
+ {
+ if (fromProfile == null)
+ {
+ throw new ArgumentNullException(nameof(fromProfile));
+ }
+ if (Equals(fromProfile))
+ {
+ return false;
+ }
+
+ SoilProfile = fromProfile.SoilProfile;
+ Probability = fromProfile.Probability;
+ return true;
+ }
+
public override string ToString()
{
return SoilProfile.ToString();
@@ -95,24 +139,6 @@
}
}
- ///
- /// Checks that is valid.
- ///
- /// Probability of the stochastic soil profile.
- /// Thrown when the
- /// is outside the range [0, 1].
- private static void ValidateProbability(double probability)
- {
- if (!probabilityValidityRange.InRange(probability))
- {
- throw new ArgumentOutOfRangeException(
- nameof(probability),
- string.Format(
- Resources.StochasticSoilProfile_Probability_Should_be_in_range_0_,
- probabilityValidityRange.ToString(FormattableConstants.ShowAtLeastOneDecimal, CultureInfo.CurrentCulture)));
- }
- }
-
private bool Equals(PipingStochasticSoilProfile other)
{
return Probability.Equals(other.Probability)
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModel.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelCollection.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelExtensions.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilModelProfileDifference.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFactory.cs
===================================================================
diff -u -r513400f1ec7b01dd0e4d3ce2681af3c1e8bf2e0e -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFactory.cs (.../PipingMapDataFactory.cs) (revision 513400f1ec7b01dd0e4d3ce2681af3c1e8bf2e0e)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFactory.cs (.../PipingMapDataFactory.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -22,7 +22,7 @@
using System.Drawing;
using Core.Components.Gis.Data;
using Core.Components.Gis.Style;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
@@ -53,7 +53,7 @@
}
///
- /// Create with default styling for collections of .
+ /// Create with default styling for collections of .
///
/// The created .
public static MapLineData CreateStochasticSoilModelsMapData()
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFeaturesFactory.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFeaturesFactory.cs (.../PipingMapDataFeaturesFactory.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Factories/PipingMapDataFeaturesFactory.cs (.../PipingMapDataFeaturesFactory.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -27,6 +27,7 @@
using Ringtoets.Common.Forms.Factories;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
@@ -68,17 +69,17 @@
///
/// Create stochastic soil model features based on the provided .
///
- /// The collection of to create the stochastic soil model features for.
+ /// The collection of to create the stochastic soil model features for.
/// An array of features or an empty array when is null or empty.
- public static MapFeature[] CreateStochasticSoilModelFeatures(StochasticSoilModel[] stochasticSoilModels)
+ public static MapFeature[] CreateStochasticSoilModelFeatures(PipingStochasticSoilModel[] stochasticSoilModels)
{
if (stochasticSoilModels != null && stochasticSoilModels.Any())
{
var features = new MapFeature[stochasticSoilModels.Length];
for (var i = 0; i < stochasticSoilModels.Length; i++)
{
- StochasticSoilModel stochasticSoilModel = stochasticSoilModels[i];
+ PipingStochasticSoilModel stochasticSoilModel = stochasticSoilModels[i];
MapFeature feature = RingtoetsMapDataFeaturesFactory.CreateSingleLineMapFeature(GetWorldPoints(stochasticSoilModel));
feature.MetaData[RingtoetsCommonFormsResources.MetaData_Name] = stochasticSoilModel.Name;
@@ -125,7 +126,7 @@
return surfaceLine.Points.Select(p => new Point2D(p.X, p.Y));
}
- private static IEnumerable GetWorldPoints(StochasticSoilModel stochasticSoilModel)
+ private static IEnumerable GetWorldPoints(PipingStochasticSoilModel stochasticSoilModel)
{
return stochasticSoilModel.Geometry.Select(p => new Point2D(p));
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs (.../PipingCalculationConfigurationHelper.cs) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PipingCalculationConfigurationHelper.cs (.../PipingCalculationConfigurationHelper.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -27,6 +27,7 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.Properties;
using Ringtoets.Piping.Primitives;
@@ -55,7 +56,9 @@
/// - is null
/// - is null
///
- public static IEnumerable GenerateCalculationItemsStructure(IEnumerable surfaceLines, IEnumerable soilModels, GeneralPipingInput generalInput)
+ public static IEnumerable GenerateCalculationItemsStructure(IEnumerable surfaceLines,
+ IEnumerable soilModels,
+ GeneralPipingInput generalInput)
{
if (surfaceLines == null)
{
@@ -91,30 +94,33 @@
///
/// Gets the stochastic soil models matching the input of a calculation.
///
- /// The surface line used to match a .
+ /// The surface line used to match a .
/// The available stochastic soil models.
/// The (sub)set of stochastic soil models from
- /// or empty if no matching instances can be found
+ /// or empty if no matching instances can be found
/// or when there is not enough information to associate soil profiles to the calculation.
- public static IEnumerable GetStochasticSoilModelsForSurfaceLine(PipingSurfaceLine surfaceLine, IEnumerable availableSoilModels)
+ public static IEnumerable GetStochasticSoilModelsForSurfaceLine(PipingSurfaceLine surfaceLine,
+ IEnumerable availableSoilModels)
{
if (surfaceLine == null)
{
- return Enumerable.Empty();
+ return Enumerable.Empty();
}
return availableSoilModels.Where(stochasticSoilModel => stochasticSoilModel.StochasticSoilProfiles.Any() &&
stochasticSoilModel.IntersectsWithSurfaceLineGeometry(surfaceLine))
.ToList();
}
- private static CalculationGroup CreateCalculationGroup(PipingSurfaceLine surfaceLine, IEnumerable soilModels, GeneralPipingInput generalInput)
+ private static CalculationGroup CreateCalculationGroup(PipingSurfaceLine surfaceLine,
+ IEnumerable soilModels,
+ GeneralPipingInput generalInput)
{
var calculationGroup = new CalculationGroup(surfaceLine.Name, true);
- IEnumerable stochasticSoilModels = GetStochasticSoilModelsForSurfaceLine(surfaceLine, soilModels);
- foreach (StochasticSoilModel stochasticSoilModel in stochasticSoilModels)
+ IEnumerable stochasticSoilModels = GetStochasticSoilModelsForSurfaceLine(surfaceLine, soilModels);
+ foreach (PipingStochasticSoilModel stochasticSoilModel in stochasticSoilModels)
{
- foreach (StochasticSoilProfile soilProfile in stochasticSoilModel.StochasticSoilProfiles)
+ foreach (PipingStochasticSoilProfile soilProfile in stochasticSoilModel.StochasticSoilProfiles)
{
calculationGroup.Children.Add(CreatePipingCalculation(surfaceLine, stochasticSoilModel, soilProfile, calculationGroup.Children, generalInput));
}
@@ -123,7 +129,11 @@
return calculationGroup;
}
- private static ICalculationBase CreatePipingCalculation(PipingSurfaceLine surfaceLine, StochasticSoilModel stochasticSoilModel, StochasticSoilProfile stochasticSoilProfile, IEnumerable calculations, GeneralPipingInput generalInput)
+ private static ICalculationBase CreatePipingCalculation(PipingSurfaceLine surfaceLine,
+ PipingStochasticSoilModel stochasticSoilModel,
+ PipingStochasticSoilProfile stochasticSoilProfile,
+ IEnumerable calculations,
+ GeneralPipingInput generalInput)
{
string nameBase = $"{surfaceLine.Name} {stochasticSoilProfile}";
string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name);
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs
===================================================================
diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs (.../PipingCalculationGroupContext.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationGroupContext.cs (.../PipingCalculationGroupContext.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -25,6 +25,7 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.PresentationObjects
@@ -49,7 +50,7 @@
public PipingCalculationGroupContext(CalculationGroup calculationGroup,
CalculationGroup parent,
IEnumerable surfaceLines,
- IEnumerable stochasticSoilModels,
+ IEnumerable stochasticSoilModels,
PipingFailureMechanism pipingFailureMechanism,
IAssessmentSection assessmentSection)
: base(calculationGroup, surfaceLines, stochasticSoilModels, pipingFailureMechanism, assessmentSection)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs
===================================================================
diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs (.../PipingCalculationScenarioContext.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingCalculationScenarioContext.cs (.../PipingCalculationScenarioContext.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -25,6 +25,7 @@
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.PresentationObjects
@@ -49,7 +50,7 @@
public PipingCalculationScenarioContext(PipingCalculationScenario calculation,
CalculationGroup parent,
IEnumerable surfaceLines,
- IEnumerable stochasticSoilModels,
+ IEnumerable stochasticSoilModels,
PipingFailureMechanism pipingFailureMechanism,
IAssessmentSection assessmentSection)
: base(calculation, surfaceLines, stochasticSoilModels, pipingFailureMechanism, assessmentSection)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs (.../PipingContext.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingContext.cs (.../PipingContext.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -27,6 +27,7 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.PresentationObjects
@@ -49,7 +50,7 @@
protected PipingContext(
T wrappedData,
IEnumerable surfaceLines,
- IEnumerable stochasticSoilModels,
+ IEnumerable stochasticSoilModels,
PipingFailureMechanism pipingFailureMechanism,
IAssessmentSection assessmentSection) : base(wrappedData)
{
@@ -68,10 +69,10 @@
public IEnumerable AvailablePipingSurfaceLines { get; private set; }
///
- /// Gets the available stochastic soil models in order for the user to select a and
+ /// Gets the available stochastic soil models in order for the user to select a and
/// to set and .
///
- public IEnumerable AvailableStochasticSoilModels { get; private set; }
+ public IEnumerable AvailableStochasticSoilModels { get; private set; }
///
/// Gets the available hydraulic boundary locations in order for the user to select one to
@@ -108,7 +109,7 @@
/// The assessment section.
/// Thrown when any input parameter is null.
private static void AssertInputsAreNotNull(IEnumerable surfaceLines,
- IEnumerable stochasticSoilModels,
+ IEnumerable stochasticSoilModels,
PipingFailureMechanism pipingFailureMechanism,
IAssessmentSection assessmentSection)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs (.../PipingInputContext.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingInputContext.cs (.../PipingInputContext.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -23,6 +23,7 @@
using System.Collections.Generic;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.PresentationObjects
@@ -47,7 +48,7 @@
public PipingInputContext(PipingInput pipingInput,
PipingCalculationScenario calculation,
IEnumerable surfaceLines,
- IEnumerable stochasticSoilModels,
+ IEnumerable stochasticSoilModels,
PipingFailureMechanism pipingFailureMechanism,
IAssessmentSection assessmentSection)
: base(pipingInput, surfaceLines, stochasticSoilModels, pipingFailureMechanism, assessmentSection)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelCollectionContext.cs
===================================================================
diff -u -r81fa8a9bf3bd503cbd280e88b8f6037a840cff12 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelCollectionContext.cs (.../StochasticSoilModelCollectionContext.cs) (revision 81fa8a9bf3bd503cbd280e88b8f6037a840cff12)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/StochasticSoilModelCollectionContext.cs (.../StochasticSoilModelCollectionContext.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -23,13 +23,14 @@
using Core.Common.Controls.PresentationObjects;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
namespace Ringtoets.Piping.Forms.PresentationObjects
{
///
/// The presentation object for .
///
- public class StochasticSoilModelCollectionContext : ObservableWrappedObjectContextBase
+ public class StochasticSoilModelCollectionContext : ObservableWrappedObjectContextBase
{
///
/// Creates a new instance of .
@@ -38,7 +39,7 @@
/// The failure mechanism.
/// The assessment section.
/// Thrown when any input argument is null.
- public StochasticSoilModelCollectionContext(StochasticSoilModelCollection wrappedStochasticSoilModels,
+ public StochasticSoilModelCollectionContext(PipingStochasticSoilModelCollection wrappedStochasticSoilModels,
PipingFailureMechanism failureMechanism,
IAssessmentSection assessmentSection)
: base(wrappedStochasticSoilModels)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs
===================================================================
diff -u -rd6fe8399e8398224cf1bda9259052232d85b85a4 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision d6fe8399e8398224cf1bda9259052232d85b85a4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -34,6 +34,7 @@
using Ringtoets.Common.Forms.PropertyClasses;
using Ringtoets.Common.Forms.UITypeEditors;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.PresentationObjects;
using Ringtoets.Piping.Forms.Properties;
using Ringtoets.Piping.Forms.UITypeEditors;
@@ -103,21 +104,24 @@
///
/// Gets the available stochastic soil models on .
///
- public IEnumerable GetAvailableStochasticSoilModels()
+ public IEnumerable GetAvailableStochasticSoilModels()
{
if (data.WrappedData.SurfaceLine == null)
{
return data.AvailableStochasticSoilModels;
}
- return PipingCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(data.WrappedData.SurfaceLine, data.AvailableStochasticSoilModels);
+ return PipingCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(data.WrappedData.SurfaceLine,
+ data.AvailableStochasticSoilModels);
}
///
/// Gets the available stochastic soil profiles on .
///
- public IEnumerable GetAvailableStochasticSoilProfiles()
+ public IEnumerable GetAvailableStochasticSoilProfiles()
{
- return data.WrappedData.StochasticSoilModel != null ? data.WrappedData.StochasticSoilModel.StochasticSoilProfiles : new List();
+ return data.WrappedData.StochasticSoilModel != null
+ ? data.WrappedData.StochasticSoilModel.StochasticSoilProfiles
+ : new List();
}
[DynamicReadOnlyValidationMethod]
@@ -289,7 +293,7 @@
[ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))]
[ResourcesDisplayName(typeof(Resources), nameof(Resources.PipingInput_StochasticSoilModel_DisplayName))]
[ResourcesDescription(typeof(Resources), nameof(Resources.PipingInput_StochasticSoilModel_Description))]
- public StochasticSoilModel StochasticSoilModel
+ public PipingStochasticSoilModel StochasticSoilModel
{
get
{
@@ -313,7 +317,7 @@
[ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Schematization))]
[ResourcesDisplayName(typeof(Resources), nameof(Resources.PipingInput_StochasticSoilProfile_DisplayName))]
[ResourcesDescription(typeof(Resources), nameof(Resources.PipingInput_StochasticSoilProfile_Description))]
- public StochasticSoilProfile StochasticSoilProfile
+ public PipingStochasticSoilProfile StochasticSoilProfile
{
get
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelCollectionProperties.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelCollectionProperties.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelCollectionProperties.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,62 @@
+// Copyright (C) Stichting Deltares 2017. 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.Gui.PropertyBag;
+using Core.Common.Utils.Attributes;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Forms.Properties;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of for properties panel.
+ ///
+ public class PipingStochasticSoilModelCollectionProperties : ObjectProperties
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The collection for which the properties are shown.
+ /// Thrown when
+ /// is null.
+ public PipingStochasticSoilModelCollectionProperties(PipingStochasticSoilModelCollection collection)
+ {
+ if (collection == null)
+ {
+ throw new ArgumentNullException(nameof(collection));
+ }
+ data = collection;
+ }
+
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ObservableCollectionWithSourcePath_SourcePath_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilModelCollection_SourcePath_Description))]
+ public string SourcePath
+ {
+ get
+ {
+ return data.SourcePath;
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelProperties.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelProperties.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilModelProperties.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,96 @@
+// Copyright (C) Stichting Deltares 2017. 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.ComponentModel;
+using System.Linq;
+using Core.Common.Base.Geometry;
+using Core.Common.Gui.Attributes;
+using Core.Common.Gui.Converters;
+using Core.Common.Gui.PropertyBag;
+using Core.Common.Utils.Attributes;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Forms.Properties;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of for properties panel.
+ ///
+ public class PipingStochasticSoilModelProperties : ObjectProperties
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The stochastic soil model for which the properties are shown.
+ /// Thrown when
+ /// is null.
+ public PipingStochasticSoilModelProperties(PipingStochasticSoilModel stochasticSoilModel)
+ {
+ if (stochasticSoilModel == null)
+ {
+ throw new ArgumentNullException(nameof(stochasticSoilModel));
+ }
+ data = stochasticSoilModel;
+ }
+
+ [PropertyOrder(1)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilModel_Name_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilModel_Name_Description))]
+ public string Name
+ {
+ get
+ {
+ return data.Name;
+ }
+ }
+
+ [PropertyOrder(2)]
+ [TypeConverter(typeof(ExpandableArrayConverter))]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilModel_Geometry_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilModel_Geometry_Description))]
+ public Point2D[] Geometry
+ {
+ get
+ {
+ return data.Geometry.ToArray();
+ }
+ }
+
+ [PropertyOrder(3)]
+ [TypeConverter(typeof(ExpandableArrayConverter))]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilModel_StochasticSoilProfiles_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilModel_StochasticSoilProfiles_Description))]
+ public PipingStochasticSoilProfileProperties[] StochasticSoilProfiles
+ {
+ get
+ {
+ return data.StochasticSoilProfiles.Count > 0
+ ? data.StochasticSoilProfiles.Select(ssp => new PipingStochasticSoilProfileProperties(ssp)).ToArray()
+ : new PipingStochasticSoilProfileProperties[0];
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilProfileProperties.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilProfileProperties.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingStochasticSoilProfileProperties.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,127 @@
+// Copyright (C) Stichting Deltares 2017. 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.ComponentModel;
+using System.Globalization;
+using System.Linq;
+using Core.Common.Base.Data;
+using Core.Common.Gui.Attributes;
+using Core.Common.Gui.Converters;
+using Core.Common.Gui.PropertyBag;
+using Core.Common.Utils.Attributes;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Forms.Properties;
+using Ringtoets.Piping.Primitives;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of for properties panel.
+ ///
+ [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.StochasticSoilProfileProperties_DisplayName))]
+ [TypeConverter(typeof(ExpandableObjectConverter))]
+ public class PipingStochasticSoilProfileProperties : ObjectProperties
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The stochastic soil profile for which the properties are shown.
+ /// Thrown when
+ /// is null.
+ public PipingStochasticSoilProfileProperties(PipingStochasticSoilProfile stochasticSoilProfile)
+ {
+ if (stochasticSoilProfile == null)
+ {
+ throw new ArgumentNullException(nameof(stochasticSoilProfile));
+ }
+
+ Data = stochasticSoilProfile;
+ }
+
+ [PropertyOrder(1)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilProfile_Name_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilProfile_Name_Description))]
+ public string Name
+ {
+ get
+ {
+ return data.SoilProfile.Name;
+ }
+ }
+
+ [PropertyOrder(2)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilProfile_Probability_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilProfile_Probability_Description))]
+ public string Probability
+ {
+ get
+ {
+ return new RoundedDouble(3, data.Probability * 100).Value.ToString(CultureInfo.CurrentCulture);
+ }
+ }
+
+ [PropertyOrder(3)]
+ [TypeConverter(typeof(ExpandableReadOnlyArrayConverter))]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilProfile_Tops_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilProfile_Tops_Description))]
+ public double[] TopLevels
+ {
+ get
+ {
+ return data.SoilProfile.Layers.Select(l => l.Top).ToArray();
+ }
+ }
+
+ [PropertyOrder(4)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilProfile_Bottom_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilProfile_Bottom_Description))]
+ public double Bottom
+ {
+ get
+ {
+ return data.SoilProfile.Bottom;
+ }
+ }
+
+ [PropertyOrder(5)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))]
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.StochasticSoilProfile_Type_DisplayName))]
+ [ResourcesDescription(typeof(Resources), nameof(Resources.StochasticSoilProfile_Type_Description))]
+ public string Type
+ {
+ get
+ {
+ return data.SoilProfile.SoilProfileType == SoilProfileType.SoilProfile1D ? "1D profiel" : "2D profiel";
+ }
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelCollectionProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilModelProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/StochasticSoilProfileProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -75,10 +75,10 @@
-
-
+
+
-
+
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditor.cs
===================================================================
diff -u -r81fa8a9bf3bd503cbd280e88b8f6037a840cff12 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditor.cs (.../PipingInputContextStochasticSoilModelSelectionEditor.cs) (revision 81fa8a9bf3bd503cbd280e88b8f6037a840cff12)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditor.cs (.../PipingInputContextStochasticSoilModelSelectionEditor.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -22,31 +22,31 @@
using System.Collections.Generic;
using System.ComponentModel;
using Core.Common.Gui.UITypeEditors;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.PropertyClasses;
namespace Ringtoets.Piping.Forms.UITypeEditors
{
///
/// This class defines a drop down list edit-control from which the user can select a
- /// from a collection.
+ /// from a collection.
///
- public class PipingInputContextStochasticSoilModelSelectionEditor : SelectionEditor
+ public class PipingInputContextStochasticSoilModelSelectionEditor : SelectionEditor
{
///
/// Creates a new instance of .
///
public PipingInputContextStochasticSoilModelSelectionEditor()
{
- DisplayMember = nameof(StochasticSoilModel.Name);
+ DisplayMember = nameof(PipingStochasticSoilModel.Name);
}
- protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context)
+ protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context)
{
return GetPropertiesObject(context).GetAvailableStochasticSoilModels();
}
- protected override StochasticSoilModel GetCurrentOption(ITypeDescriptorContext context)
+ protected override PipingStochasticSoilModel GetCurrentOption(ITypeDescriptorContext context)
{
return GetPropertiesObject(context).StochasticSoilModel;
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs
===================================================================
diff -u -r81fa8a9bf3bd503cbd280e88b8f6037a840cff12 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs (.../PipingInputContextStochasticSoilProfileSelectionEditor.cs) (revision 81fa8a9bf3bd503cbd280e88b8f6037a840cff12)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditor.cs (.../PipingInputContextStochasticSoilProfileSelectionEditor.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -22,17 +22,17 @@
using System.Collections.Generic;
using System.ComponentModel;
using Core.Common.Gui.UITypeEditors;
-using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.PropertyClasses;
using Ringtoets.Piping.Primitives;
namespace Ringtoets.Piping.Forms.UITypeEditors
{
///
/// This class defines a drop down list edit-control from which the user can select a
- /// from a collection.
+ /// from a collection.
///
- public class PipingInputContextStochasticSoilProfileSelectionEditor : SelectionEditor
+ public class PipingInputContextStochasticSoilProfileSelectionEditor : SelectionEditor
{
///
/// Creates a new instance of .
@@ -42,12 +42,12 @@
DisplayMember = nameof(PipingSoilProfile.Name);
}
- protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context)
+ protected override IEnumerable GetAvailableOptions(ITypeDescriptorContext context)
{
return GetPropertiesObject(context).GetAvailableStochasticSoilProfiles();
}
- protected override StochasticSoilProfile GetCurrentOption(ITypeDescriptorContext context)
+ protected override PipingStochasticSoilProfile GetCurrentOption(ITypeDescriptorContext context)
{
return GetPropertiesObject(context).StochasticSoilProfile;
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationRow.cs
===================================================================
diff -u -r81fa8a9bf3bd503cbd280e88b8f6037a840cff12 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationRow.cs (.../PipingCalculationRow.cs) (revision 81fa8a9bf3bd503cbd280e88b8f6037a840cff12)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationRow.cs (.../PipingCalculationRow.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -28,6 +28,7 @@
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.PropertyClasses;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
namespace Ringtoets.Piping.Forms.Views
{
@@ -85,15 +86,15 @@
///
/// Gets or sets the stochastic soil model of the .
///
- public DataGridViewComboBoxItemWrapper StochasticSoilModel
+ public DataGridViewComboBoxItemWrapper StochasticSoilModel
{
get
{
- return new DataGridViewComboBoxItemWrapper(PipingCalculation.InputParameters.StochasticSoilModel);
+ return new DataGridViewComboBoxItemWrapper(PipingCalculation.InputParameters.StochasticSoilModel);
}
set
{
- StochasticSoilModel valueToSet = value?.WrappedObject;
+ PipingStochasticSoilModel valueToSet = value?.WrappedObject;
if (!ReferenceEquals(PipingCalculation.InputParameters.StochasticSoilModel, valueToSet))
{
PropertyChangeHelper.ChangePropertyAndNotify(() => PipingCalculation.InputParameters.StochasticSoilModel = valueToSet, propertyChangeHandler);
@@ -104,15 +105,15 @@
///
/// Gets or sets the stochastic soil profile of the .
///
- public DataGridViewComboBoxItemWrapper StochasticSoilProfile
+ public DataGridViewComboBoxItemWrapper StochasticSoilProfile
{
get
{
- return new DataGridViewComboBoxItemWrapper(PipingCalculation.InputParameters.StochasticSoilProfile);
+ return new DataGridViewComboBoxItemWrapper(PipingCalculation.InputParameters.StochasticSoilProfile);
}
set
{
- StochasticSoilProfile valueToSet = value?.WrappedObject;
+ PipingStochasticSoilProfile valueToSet = value?.WrappedObject;
if (!ReferenceEquals(PipingCalculation.InputParameters.StochasticSoilProfile, valueToSet))
{
PropertyChangeHelper.ChangePropertyAndNotify(() => PipingCalculation.InputParameters.StochasticSoilProfile = valueToSet, propertyChangeHandler);
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs
===================================================================
diff -u -r721c0d4f72803e74398f903d86fa9c1cb0d9ced8 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision 721c0d4f72803e74398f903d86fa9c1cb0d9ced8)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -35,6 +35,7 @@
using Ringtoets.Common.Forms.Helpers;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.PresentationObjects;
using Ringtoets.Piping.Forms.Properties;
using Ringtoets.Piping.Primitives;
@@ -58,7 +59,7 @@
private readonly Observer pipingFailureMechanismObserver;
private readonly RecursiveObserver pipingSurfaceLineObserver;
private readonly Observer pipingStochasticSoilModelsObserver;
- private readonly RecursiveObserver stochasticSoilProfileObserver;
+ private readonly RecursiveObserver stochasticSoilProfileObserver;
private IAssessmentSection assessmentSection;
private CalculationGroup calculationGroup;
private PipingFailureMechanism pipingFailureMechanism;
@@ -84,7 +85,7 @@
pipingSurfaceLineObserver = new RecursiveObserver(UpdateDataGridViewDataSource, rpslc => rpslc);
pipingStochasticSoilModelsObserver = new Observer(OnStochasticSoilModelsUpdate);
- stochasticSoilProfileObserver = new RecursiveObserver(dataGridViewControl.RefreshDataGridView, ssmc => ssmc.SelectMany(ssm => ssm.StochasticSoilProfiles));
+ stochasticSoilProfileObserver = new RecursiveObserver(dataGridViewControl.RefreshDataGridView, ssmc => ssmc.SelectMany(ssm => ssm.StochasticSoilProfiles));
}
///
@@ -204,19 +205,19 @@
nameof(PipingCalculationRow.Name),
Resources.PipingCalculation_Name_DisplayName);
- dataGridViewControl.AddComboBoxColumn>(
+ dataGridViewControl.AddComboBoxColumn>(
nameof(PipingCalculationRow.StochasticSoilModel),
Resources.PipingInput_StochasticSoilModel_DisplayName,
null,
- nameof(DataGridViewComboBoxItemWrapper.This),
- nameof(DataGridViewComboBoxItemWrapper.DisplayName));
+ nameof(DataGridViewComboBoxItemWrapper.This),
+ nameof(DataGridViewComboBoxItemWrapper.DisplayName));
- dataGridViewControl.AddComboBoxColumn>(
+ dataGridViewControl.AddComboBoxColumn>(
nameof(PipingCalculationRow.StochasticSoilProfile),
Resources.PipingInput_StochasticSoilProfile_DisplayName,
null,
- nameof(DataGridViewComboBoxItemWrapper.This),
- nameof(DataGridViewComboBoxItemWrapper.DisplayName));
+ nameof(DataGridViewComboBoxItemWrapper.This),
+ nameof(DataGridViewComboBoxItemWrapper.DisplayName));
dataGridViewControl.AddTextBoxColumn(
nameof(PipingCalculationRow.StochasticSoilProfileProbability),
@@ -340,53 +341,58 @@
UpdateSelectableHydraulicBoundaryLocationsColumn();
}
- private static IEnumerable> GetPrefillStochasticSoilModelsDataSource(IEnumerable stochasticSoilModels)
+ private static IEnumerable> GetPrefillStochasticSoilModelsDataSource(
+ IEnumerable stochasticSoilModels)
{
- yield return new DataGridViewComboBoxItemWrapper(null);
+ yield return new DataGridViewComboBoxItemWrapper(null);
- foreach (StochasticSoilModel stochasticSoilModel in stochasticSoilModels)
+ foreach (PipingStochasticSoilModel stochasticSoilModel in stochasticSoilModels)
{
- yield return new DataGridViewComboBoxItemWrapper(stochasticSoilModel);
+ yield return new DataGridViewComboBoxItemWrapper(stochasticSoilModel);
}
}
- private static IEnumerable> GetStochasticSoilModelsDataSource(IEnumerable stochasticSoilModels)
+ private static IEnumerable> GetStochasticSoilModelsDataSource(
+ IEnumerable stochasticSoilModels)
{
- StochasticSoilModel[] stochasticSoilModelsArray = stochasticSoilModels.ToArray();
+ PipingStochasticSoilModel[] stochasticSoilModelsArray = stochasticSoilModels.ToArray();
if (stochasticSoilModelsArray.Length != 1)
{
- yield return new DataGridViewComboBoxItemWrapper(null);
+ yield return new DataGridViewComboBoxItemWrapper(null);
}
- foreach (StochasticSoilModel stochasticSoilModel in stochasticSoilModelsArray)
+ foreach (PipingStochasticSoilModel stochasticSoilModel in stochasticSoilModelsArray)
{
- yield return new DataGridViewComboBoxItemWrapper(stochasticSoilModel);
+ yield return new DataGridViewComboBoxItemWrapper(stochasticSoilModel);
}
}
- private static IEnumerable> GetPrefillSoilProfilesDataSource(IEnumerable stochasticSoilProfiles)
+ private static IEnumerable> GetPrefillSoilProfilesDataSource(
+ IEnumerable stochasticSoilProfiles)
{
- yield return new DataGridViewComboBoxItemWrapper(null);
+ yield return new DataGridViewComboBoxItemWrapper(null);
- foreach (StochasticSoilProfile stochasticSoilProfile in stochasticSoilProfiles)
+ foreach (PipingStochasticSoilProfile stochasticSoilProfile in stochasticSoilProfiles)
{
- yield return new DataGridViewComboBoxItemWrapper(stochasticSoilProfile);
+ yield return new DataGridViewComboBoxItemWrapper(stochasticSoilProfile);
}
}
- private static IEnumerable> GetSoilProfilesDataSource(IEnumerable stochasticSoilProfiles)
+ private static IEnumerable> GetSoilProfilesDataSource(
+ IEnumerable stochasticSoilProfiles)
{
- StochasticSoilProfile[] stochasticSoilProfilesArray = stochasticSoilProfiles.ToArray();
+ PipingStochasticSoilProfile[] stochasticSoilProfilesArray = stochasticSoilProfiles.ToArray();
if (stochasticSoilProfilesArray.Length != 1)
{
- yield return new DataGridViewComboBoxItemWrapper(null);
+ yield return new DataGridViewComboBoxItemWrapper(null);
}
- foreach (StochasticSoilProfile stochasticSoilProfile in stochasticSoilProfilesArray)
+ foreach (PipingStochasticSoilProfile stochasticSoilProfile in stochasticSoilProfilesArray)
{
- yield return new DataGridViewComboBoxItemWrapper(stochasticSoilProfile);
+ yield return new DataGridViewComboBoxItemWrapper(stochasticSoilProfile);
}
}
- private static List> GetSelectableHydraulicBoundaryLocationsDataSource(IEnumerable selectableHydraulicBoundaryLocations = null)
+ private static List> GetSelectableHydraulicBoundaryLocationsDataSource(
+ IEnumerable selectableHydraulicBoundaryLocations = null)
{
var dataGridViewComboBoxItemWrappers = new List>
{
@@ -459,17 +465,17 @@
private void FillAvailableSoilModelsList(DataGridViewRow dataGridViewRow)
{
var rowData = (PipingCalculationRow) dataGridViewRow.DataBoundItem;
- IEnumerable stochasticSoilModels = GetSoilModelsForCalculation(rowData.PipingCalculation);
+ IEnumerable stochasticSoilModels = GetSoilModelsForCalculation(rowData.PipingCalculation);
var cell = (DataGridViewComboBoxCell) dataGridViewRow.Cells[stochasticSoilModelColumnIndex];
SetItemsOnObjectCollection(cell.Items, GetStochasticSoilModelsDataSource(stochasticSoilModels).ToArray());
}
- private IEnumerable GetSoilModelsForCalculation(PipingCalculation pipingCalculation)
+ private IEnumerable GetSoilModelsForCalculation(PipingCalculation pipingCalculation)
{
if (pipingFailureMechanism == null)
{
- return Enumerable.Empty();
+ return Enumerable.Empty();
}
return PipingCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(
pipingCalculation.InputParameters.SurfaceLine,
@@ -491,22 +497,22 @@
}
}
- private void FillAvailableSoilProfilesList(DataGridViewRow dataGridViewRow)
+ private static void FillAvailableSoilProfilesList(DataGridViewRow dataGridViewRow)
{
var rowData = (PipingCalculationRow) dataGridViewRow.DataBoundItem;
PipingInputService.SyncStochasticSoilProfileWithStochasticSoilModel(rowData.PipingCalculation.InputParameters);
- IEnumerable stochasticSoilProfiles = GetSoilProfilesForCalculation(rowData.PipingCalculation);
+ IEnumerable stochasticSoilProfiles = GetSoilProfilesForCalculation(rowData.PipingCalculation);
var cell = (DataGridViewComboBoxCell) dataGridViewRow.Cells[stochasticSoilProfileColumnIndex];
SetItemsOnObjectCollection(cell.Items, GetSoilProfilesDataSource(stochasticSoilProfiles).ToArray());
}
- private IEnumerable GetSoilProfilesForCalculation(PipingCalculation pipingCalculation)
+ private static IEnumerable GetSoilProfilesForCalculation(PipingCalculation pipingCalculation)
{
if (pipingCalculation.InputParameters.StochasticSoilModel == null)
{
- return Enumerable.Empty();
+ return Enumerable.Empty();
}
return pipingCalculation.InputParameters.StochasticSoilModel.StochasticSoilProfiles;
}
@@ -528,12 +534,12 @@
// items.
using (new SuspendDataGridViewColumnResizes(stochasticSoilModelColumn))
{
- StochasticSoilModelCollection stochasticSoilModels = pipingFailureMechanism.StochasticSoilModels;
+ PipingStochasticSoilModelCollection stochasticSoilModels = pipingFailureMechanism.StochasticSoilModels;
SetItemsOnObjectCollection(stochasticSoilModelColumn.Items, GetPrefillStochasticSoilModelsDataSource(stochasticSoilModels).ToArray());
}
using (new SuspendDataGridViewColumnResizes(stochasticSoilProfileColumn))
{
- StochasticSoilProfile[] pipingSoilProfiles = GetPipingStochasticSoilProfilesFromStochasticSoilModels();
+ PipingStochasticSoilProfile[] pipingSoilProfiles = GetPipingStochasticSoilProfilesFromStochasticSoilModels();
SetItemsOnObjectCollection(stochasticSoilProfileColumn.Items, GetPrefillSoilProfilesDataSource(pipingSoilProfiles).ToArray());
}
using (new SuspendDataGridViewColumnResizes(selectableHydraulicBoundaryLocationColumn))
@@ -565,7 +571,7 @@
return selectableHydraulicBoundaryLocations;
}
- private StochasticSoilProfile[] GetPipingStochasticSoilProfilesFromStochasticSoilModels()
+ private PipingStochasticSoilProfile[] GetPipingStochasticSoilProfilesFromStochasticSoilModels()
{
return pipingFailureMechanism?.StochasticSoilModels
.SelectMany(ssm => ssm.StochasticSoilProfiles)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs
===================================================================
diff -u -ra1e976b5692d931d9bf7bc79ad667a2587125978 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision a1e976b5692d931d9bf7bc79ad667a2587125978)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -31,6 +31,7 @@
using Ringtoets.Common.Data.Hydraulics;
using Ringtoets.Common.Forms.Factories;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms.Factories;
using Ringtoets.Piping.Forms.PresentationObjects;
using Ringtoets.Piping.Primitives;
@@ -301,7 +302,7 @@
private void SetStochasticSoilModelsMapData()
{
- StochasticSoilModelCollection stochasticSoilModels = data.WrappedData.StochasticSoilModels;
+ PipingStochasticSoilModelCollection stochasticSoilModels = data.WrappedData.StochasticSoilModels;
stochasticSoilModelsMapData.Features = PipingMapDataFeaturesFactory.CreateStochasticSoilModelFeatures(stochasticSoilModels.ToArray());
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Configurations/PipingCalculationConfigurationImporter.cs
===================================================================
diff -u -ra1e976b5692d931d9bf7bc79ad667a2587125978 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Configurations/PipingCalculationConfigurationImporter.cs (.../PipingCalculationConfigurationImporter.cs) (revision a1e976b5692d931d9bf7bc79ad667a2587125978)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Configurations/PipingCalculationConfigurationImporter.cs (.../PipingCalculationConfigurationImporter.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -28,6 +28,7 @@
using Ringtoets.Common.IO.Configurations.Helpers;
using Ringtoets.Common.IO.Configurations.Import;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.IO.Properties;
using Ringtoets.Piping.Primitives;
@@ -226,9 +227,9 @@
/// The calculation to configure.
/// false when
///
- /// - the has a set
+ ///
- the has a set
/// which is not available in the failure mechanism.
- /// - The does not intersect with the
+ ///
- The does not intersect with the
/// when this is set.
///
/// true otherwise.
@@ -237,8 +238,8 @@
{
if (calculationConfiguration.StochasticSoilModelName != null)
{
- StochasticSoilModel soilModel = failureMechanism.StochasticSoilModels
- .FirstOrDefault(ssm => ssm.Name == calculationConfiguration.StochasticSoilModelName);
+ PipingStochasticSoilModel soilModel = failureMechanism.StochasticSoilModels
+ .FirstOrDefault(ssm => ssm.Name == calculationConfiguration.StochasticSoilModelName);
if (soilModel == null)
{
@@ -272,8 +273,8 @@
/// The calculation to configure.
/// false when the has:
///
- /// - a set but no is specified;
- /// - a set which is not available in the .
+ /// - a set but no is specified;
+ /// - a set which is not available in the .
///
/// true otherwise.
private bool TrySetStochasticSoilProfile(PipingCalculationConfiguration calculationConfiguration,
@@ -290,7 +291,7 @@
return false;
}
- StochasticSoilProfile soilProfile = pipingCalculation
+ PipingStochasticSoilProfile soilProfile = pipingCalculation
.InputParameters
.StochasticSoilModel
.StochasticSoilProfiles
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/IStochasticSoilModelUpdateModelStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Importers/StochasticSoilModelImporter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj
===================================================================
diff -u -ra5f97617cc03e3535d369676ae09179c82947b17 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision a5f97617cc03e3535d369676ae09179c82947b17)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -48,7 +48,6 @@
-
@@ -57,7 +56,6 @@
-
True
True
@@ -76,10 +74,8 @@
-
-
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilModelReader.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelReplaceDataStrategy.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelReplaceDataStrategy.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelReplaceDataStrategy.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,58 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using Core.Common.Base;
+using Ringtoets.Common.Data.UpdateDataStrategies;
+using Ringtoets.Common.IO.SoilProfile;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Service;
+
+namespace Ringtoets.Piping.Plugin.FileImporter
+{
+ ///
+ /// A to replace the stochastic
+ /// soil models with the imported stochastic soil models.
+ ///
+ public class PipingStochasticSoilModelReplaceDataStrategy : ReplaceDataStrategyBase,
+ IStochasticSoilModelUpdateModelStrategy
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism in which the models are updated.
+ /// Thrown when is null.
+ public PipingStochasticSoilModelReplaceDataStrategy(PipingFailureMechanism failureMechanism)
+ : base(failureMechanism, failureMechanism?.StochasticSoilModels) {}
+
+ public IEnumerable UpdateModelWithImportedData(IEnumerable stochasticSoilModels, string sourceFilePath)
+ {
+ return ReplaceTargetCollectionWithImportedData(stochasticSoilModels, sourceFilePath);
+ }
+
+ protected override IEnumerable ClearData()
+ {
+ return PipingDataSynchronizationService.RemoveAllStochasticSoilModels(FailureMechanism);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelUpdateDataStrategy.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelUpdateDataStrategy.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingStochasticSoilModelUpdateDataStrategy.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,114 @@
+// Copyright (C) Stichting Deltares 2017. 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 Core.Common.Utils;
+using Ringtoets.Common.Data.UpdateDataStrategies;
+using Ringtoets.Common.IO.SoilProfile;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.Primitives;
+using Ringtoets.Piping.Service;
+
+namespace Ringtoets.Piping.Plugin.FileImporter
+{
+ ///
+ /// An for updating stochastic soil models based on imported data.
+ ///
+ public class PipingStochasticSoilModelUpdateDataStrategy : UpdateDataStrategyBase,
+ IStochasticSoilModelUpdateModelStrategy
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism in which the models are updated.
+ /// Thrown when is null.
+ public PipingStochasticSoilModelUpdateDataStrategy(PipingFailureMechanism failureMechanism)
+ : base(failureMechanism, failureMechanism?.StochasticSoilModels, new SoilModelNameEqualityComparer()) {}
+
+ public IEnumerable UpdateModelWithImportedData(IEnumerable stochasticSoilModels, string sourceFilePath)
+ {
+ return UpdateTargetCollectionData(stochasticSoilModels, sourceFilePath);
+ }
+
+ #region Remove Data Functions
+
+ protected override IEnumerable RemoveObjectAndDependentData(PipingStochasticSoilModel removedModel)
+ {
+ return PipingDataSynchronizationService.RemoveStochasticSoilModel(FailureMechanism, removedModel);
+ }
+
+ #endregion
+
+ ///
+ /// Class for comparing by just the name.
+ ///
+ private class SoilModelNameEqualityComparer : IEqualityComparer
+ {
+ public bool Equals(PipingStochasticSoilModel x, PipingStochasticSoilModel y)
+ {
+ return x.Name == y.Name;
+ }
+
+ public int GetHashCode(PipingStochasticSoilModel obj)
+ {
+ return obj.Name.GetHashCode();
+ }
+ }
+
+ #region Update Data Functions
+
+ protected override IEnumerable UpdateObjectAndDependentData(PipingStochasticSoilModel soilModelToUpdate,
+ PipingStochasticSoilModel soilModelToUpdateFrom)
+ {
+ return UpdateStochasticSoilModel(soilModelToUpdate, soilModelToUpdateFrom);
+ }
+
+ private IEnumerable UpdateStochasticSoilModel(PipingStochasticSoilModel modelToUpdate, PipingStochasticSoilModel modelToUpdateFrom)
+ {
+ Dictionary oldProfiles = modelToUpdate
+ .StochasticSoilProfiles
+ .ToDictionary(ssp => ssp, ssp => ssp.SoilProfile, new ReferenceEqualityComparer());
+
+ PipingStochasticSoilModelProfileDifference difference = modelToUpdate.Update(modelToUpdateFrom);
+
+ var affectedObjects = new List();
+ foreach (PipingStochasticSoilProfile removedProfile in difference.RemovedProfiles)
+ {
+ affectedObjects.AddRange(PipingDataSynchronizationService.RemoveStochasticSoilProfileFromInput(FailureMechanism, removedProfile));
+ }
+ foreach (PipingStochasticSoilProfile updatedProfile in difference.UpdatedProfiles)
+ {
+ if (!oldProfiles[updatedProfile].Equals(updatedProfile.SoilProfile))
+ {
+ affectedObjects.AddRange(PipingDataSynchronizationService.ClearStochasticSoilProfileDependentData(FailureMechanism, updatedProfile));
+ }
+ affectedObjects.Add(updatedProfile);
+ }
+ return affectedObjects;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLineUpdateDataStrategy.cs
===================================================================
diff -u -raa49537188229065df91b1a931f088c32115702a -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLineUpdateDataStrategy.cs (.../PipingSurfaceLineUpdateDataStrategy.cs) (revision aa49537188229065df91b1a931f088c32115702a)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLineUpdateDataStrategy.cs (.../PipingSurfaceLineUpdateDataStrategy.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -28,6 +28,7 @@
using Ringtoets.Common.IO.SurfaceLines;
using Ringtoets.Common.Service;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms;
using Ringtoets.Piping.Primitives;
using Ringtoets.Piping.Service;
@@ -110,7 +111,7 @@
var affectedObjects = new List();
foreach (PipingCalculation calculation in calculationsToUpdate)
{
- IEnumerable matchingSoilModels = GetAvailableStochasticSoilModels(updatedSurfaceLine);
+ IEnumerable matchingSoilModels = GetAvailableStochasticSoilModels(updatedSurfaceLine);
PipingInput calculationInput = calculation.InputParameters;
PipingInputService.SetMatchingStochasticSoilModel(calculationInput, matchingSoilModels);
@@ -129,7 +130,7 @@
return affectedCalculations;
}
- private IEnumerable GetAvailableStochasticSoilModels(PipingSurfaceLine surfaceLine)
+ private IEnumerable GetAvailableStochasticSoilModels(PipingSurfaceLine surfaceLine)
{
return PipingCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(surfaceLine,
FailureMechanism.StochasticSoilModels);
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelImporterConfigurationFactory.cs
===================================================================
diff -u
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelImporterConfigurationFactory.cs (revision 0)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelImporterConfigurationFactory.cs (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -0,0 +1,64 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Ringtoets.Common.IO.SoilProfile;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
+using Ringtoets.Piping.IO.Importers;
+
+namespace Ringtoets.Piping.Plugin.FileImporter
+{
+ ///
+ /// Factory for creating valid configurations for the .
+ ///
+ public static class StochasticSoilModelImporterConfigurationFactory
+ {
+ ///
+ /// Creates a configuration to replace the current stochastic soil models on
+ /// with imported stochastic soil models.
+ ///
+ /// The failure mechanism to replace the stochastic soil models for.
+ /// The configuration for the replace operation.
+ public static StochasticSoilModelImporterConfiguration CreateReplaceStrategyConfiguration(
+ PipingFailureMechanism failureMechanism)
+ {
+ return new StochasticSoilModelImporterConfiguration(
+ new PipingStochasticSoilModelTransformer(),
+ new PipingStochasticSoilModelFilter(),
+ new PipingStochasticSoilModelReplaceDataStrategy(failureMechanism));
+ }
+
+ ///
+ /// Creates a configuration to update the current stochastic soil models on
+ /// with imported stochastic soil models.
+ ///
+ /// The failure mechanism to update the stochastic soil models for.
+ /// The configuration for the update operation.
+ public static StochasticSoilModelImporterConfiguration CreateUpdateStrategyConfiguration(
+ PipingFailureMechanism failureMechanism)
+ {
+ return new StochasticSoilModelImporterConfiguration(
+ new PipingStochasticSoilModelTransformer(),
+ new PipingStochasticSoilModelFilter(),
+ new PipingStochasticSoilModelUpdateDataStrategy(failureMechanism));
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelReplaceDataStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 26f527fb809a2325c8f883ece9da01a8f8040eb3 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/StochasticSoilModelUpdateDataStrategy.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs
===================================================================
diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -r26f527fb809a2325c8f883ece9da01a8f8040eb3
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3)
@@ -41,15 +41,16 @@
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.TreeNodeInfos;
using Ringtoets.Common.IO.FileImporters.MessageProviders;
+using Ringtoets.Common.IO.SoilProfile;
using Ringtoets.Common.IO.SurfaceLines;
using Ringtoets.Common.Service;
using Ringtoets.Piping.Data;
+using Ringtoets.Piping.Data.SoilProfile;
using Ringtoets.Piping.Forms;
using Ringtoets.Piping.Forms.PresentationObjects;
using Ringtoets.Piping.Forms.PropertyClasses;
using Ringtoets.Piping.Forms.Views;
using Ringtoets.Piping.IO.Configurations;
-using Ringtoets.Piping.IO.Importers;
using Ringtoets.Piping.Plugin.FileImporter;
using Ringtoets.Piping.Plugin.Properties;
using Ringtoets.Piping.Primitives;
@@ -81,12 +82,18 @@
CreateInstance = context => new PipingSurfaceLineCollectionProperties(context.WrappedData)
};
yield return new PropertyInfo();
- yield return new PropertyInfo
+ yield return new PropertyInfo
{
- CreateInstance = context => new StochasticSoilModelCollectionProperties(context.WrappedData)
+ CreateInstance = context => new PipingStochasticSoilModelCollectionProperties(context.WrappedData)
};
- yield return new PropertyInfo();
- yield return new PropertyInfo();
+ yield return new PropertyInfo
+ {
+ CreateInstance = stochasticSoilModel => new PipingStochasticSoilModelProperties(stochasticSoilModel)
+ };
+ yield return new PropertyInfo
+ {
+ CreateInstance = stochasticSoilProfile => new PipingStochasticSoilProfileProperties(stochasticSoilProfile)
+ };
}
public override IEnumerable GetImportInfos()
@@ -113,7 +120,12 @@
Image = PipingFormsResources.PipingSoilProfileIcon,
FileFilterGenerator = StochasticSoilModelFileFilter,
IsEnabled = context => context.AssessmentSection.ReferenceLine != null,
- CreateFileImporter = (context, filePath) => StochasticSoilModelImporter(context, filePath, new ImportMessageProvider(), new StochasticSoilModelReplaceDataStrategy(context.FailureMechanism)),
+ CreateFileImporter = (context, filePath) => new StochasticSoilModelImporter