Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r66af8add6f7cc445cbb5347af02ee69235ec63be -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 66af8add6f7cc445cbb5347af02ee69235ec63be)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -729,42 +729,114 @@
}
///
+ /// Looks up a localized string similar to Onverzadigd gewicht [kN/m³].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Verzadigd gewicht [kN/m³].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Cohesie [kN/m³].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Cohesion {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Cohesion", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Kleur.
///
- public static string MacroStabilityInwardsSoilLayerTable_ColumnHeader_Color {
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color {
get {
- return ResourceManager.GetString("MacroStabilityInwardsSoilLayerTable_ColumnHeader_Color", resourceCulture);
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color", resourceCulture);
}
}
///
+ /// Looks up a localized string similar to Wrijvingshoek [°].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_FrictionAngle {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_FrictionAngle", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Is aquifer.
///
- public static string MacroStabilityInwardsSoilLayerTable_ColumnHeader_IsAquifer {
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer {
get {
- return ResourceManager.GetString("MacroStabilityInwardsSoilLayerTable_ColumnHeader_IsAquifer", resourceCulture);
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer", resourceCulture);
}
}
///
/// Looks up a localized string similar to Naam.
///
- public static string MacroStabilityInwardsSoilLayerTable_ColumnHeader_MaterialName {
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName {
get {
- return ResourceManager.GetString("MacroStabilityInwardsSoilLayerTable_ColumnHeader_MaterialName", resourceCulture);
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Topniveau [m+NAP].
+ /// Looks up a localized string similar to POP [kN/m³].
///
- public static string MacroStabilityInwardsSoilLayerTable_ColumnHeader_Top {
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Pop {
get {
- return ResourceManager.GetString("MacroStabilityInwardsSoilLayerTable_ColumnHeader_Top", resourceCulture);
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Pop", resourceCulture);
}
}
///
+ /// Looks up a localized string similar to Schuifsterkte model.
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Schuifsterkte ratio S [-].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Sterkte toename exp (m) [-].
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Gebruik POP.
+ ///
+ public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd..
///
public static string MacroStabilityInwardsSurfaceLineCollection_SourcePath_Description {
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx
===================================================================
diff -u -r66af8add6f7cc445cbb5347af02ee69235ec63be -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 66af8add6f7cc445cbb5347af02ee69235ec63be)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -229,18 +229,42 @@
Handmatig toetspeil invoeren
-
+
Naam
-
+
Kleur
-
- Topniveau [m+NAP]
-
-
+
Is aquifer
+
+ Onverzadigd gewicht [kN/m³]
+
+
+ Verzadigd gewicht [kN/m³]
+
+
+ Schuifsterkte model
+
+
+ Cohesie [kN/m³]
+
+
+ Wrijvingshoek [°]
+
+
+ Schuifsterkte ratio S [-]
+
+
+ Sterkte toename exp (m) [-]
+
+
+ Gebruik POP
+
+
+ POP [kN/m³]
+
De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd.
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj
===================================================================
diff -u -r66af8add6f7cc445cbb5347af02ee69235ec63be -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 66af8add6f7cc445cbb5347af02ee69235ec63be)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -126,7 +126,7 @@
MacroStabilityInwardsFailureMechanismView.cs
-
+
UserControl
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.Designer.cs
===================================================================
diff -u -r650fc7b43cb6729baee51d079f0377df8d7a3de9 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.Designer.cs (.../MacroStabilityInwardsInputView.Designer.cs) (revision 650fc7b43cb6729baee51d079f0377df8d7a3de9)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.Designer.cs (.../MacroStabilityInwardsInputView.Designer.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -39,7 +39,7 @@
private void InitializeComponent()
{
this.chartControl = new Core.Components.OxyPlot.Forms.ChartControl();
- this.soilLayerTable = new MacroStabilityInwardsSoilLayerTable();
+ this.soilLayerDataTable = new MacroStabilityInwardsSoilLayerDataTable();
this.SuspendLayout();
//
// chartControl
@@ -58,22 +58,22 @@
//
// soilLayerTable
//
- this.soilLayerTable.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.soilLayerTable.Location = new System.Drawing.Point(0, 202);
- this.soilLayerTable.MinimumSize = new System.Drawing.Size(300, 150);
- this.soilLayerTable.MultiSelect = true;
- this.soilLayerTable.Name = "soilLayerTable";
- this.soilLayerTable.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect;
- this.soilLayerTable.Size = new System.Drawing.Size(333, 156);
- this.soilLayerTable.TabIndex = 1;
+ this.soilLayerDataTable.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.soilLayerDataTable.Location = new System.Drawing.Point(0, 202);
+ this.soilLayerDataTable.MinimumSize = new System.Drawing.Size(300, 150);
+ this.soilLayerDataTable.MultiSelect = true;
+ this.soilLayerDataTable.Name = "soilLayerDataTable";
+ this.soilLayerDataTable.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect;
+ this.soilLayerDataTable.Size = new System.Drawing.Size(333, 156);
+ this.soilLayerDataTable.TabIndex = 1;
//
// MacroStabilityInwardsInputView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScroll = true;
this.Controls.Add(this.chartControl);
- this.Controls.Add(this.soilLayerTable);
+ this.Controls.Add(this.soilLayerDataTable);
this.MinimumSize = new System.Drawing.Size(200, 300);
this.Name = "MacroStabilityInwardsInputView";
this.Size = new System.Drawing.Size(333, 358);
@@ -84,6 +84,6 @@
#endregion
private Core.Components.OxyPlot.Forms.ChartControl chartControl;
- private MacroStabilityInwardsSoilLayerTable soilLayerTable;
+ private MacroStabilityInwardsSoilLayerDataTable soilLayerDataTable;
}
}
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs
===================================================================
diff -u -r5007be256ef2923a6aecbc2639b1e80f38f45539 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 5007be256ef2923a6aecbc2639b1e80f38f45539)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsInputView.cs (.../MacroStabilityInwardsInputView.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -19,13 +19,16 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System.Collections.Generic;
+using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
using Core.Common.Utils.Extensions;
using Core.Components.Chart.Data;
using Core.Components.Chart.Forms;
using Ringtoets.Common.Forms.Factories;
using Ringtoets.MacroStabilityInwards.Data;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.Factories;
using Ringtoets.MacroStabilityInwards.Primitives;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
@@ -134,6 +137,7 @@
chartControl.Data = chartDataCollection;
UpdateChartTitle();
}
+ UpdateTableData();
}
}
@@ -157,6 +161,25 @@
base.Dispose(disposing);
}
+ private void UpdateTableData()
+ {
+ var soilLayerData = new List();
+
+ var profile1D = data?.InputParameters.StochasticSoilProfile?.SoilProfile as MacroStabilityInwardsSoilProfile1D;
+ var profile2D = data?.InputParameters.StochasticSoilProfile?.SoilProfile as MacroStabilityInwardsSoilProfile2D;
+
+ if (profile1D != null)
+ {
+ soilLayerData.AddRange(profile1D.Layers.Select(l => l.Data));
+ }
+ else if (profile2D != null)
+ {
+ soilLayerData.AddRange(profile2D.Layers.Select(l => l.Data));
+ }
+
+ soilLayerDataTable.SetData(soilLayerData);
+ }
+
private void UpdateChartTitle()
{
chartControl.ChartTitle = data.Name;
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -0,0 +1,182 @@
+// 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;
+using System.Drawing;
+using System.Linq;
+using Core.Common.Controls.DataGrid;
+using Ringtoets.Common.Data.Probabilistics;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+using Ringtoets.MacroStabilityInwards.Forms.Properties;
+using Ringtoets.MacroStabilityInwards.Primitives;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.MacroStabilityInwards.Forms.Views
+{
+ ///
+ /// This class defines a table in which properties of instances
+ /// are shown as rows.
+ ///
+ public class MacroStabilityInwardsSoilLayerDataTable : DataGridViewControl
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ public MacroStabilityInwardsSoilLayerDataTable()
+ {
+ AddColumns();
+ }
+
+ ///
+ /// Sets the given for which the properties
+ /// are shown in the table.
+ ///
+ /// The collection of layers to show.
+ public void SetData(IEnumerable layers)
+ {
+ SetDataSource(layers?.Select(l => new FormattedMacroStabilityInwardsSoilLayerDataRow(l)).ToArray());
+ }
+
+ private void AddColumns()
+ {
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.MaterialName),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName,
+ true);
+ AddColorColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.Color),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color);
+ AddCheckBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.IsAquifer),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.AbovePhreaticLevel),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.BelowPhreaticLevel),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.ShearStrengthModel),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.Cohesion),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Cohesion,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.FrictionAngle),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_FrictionAngle,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.ShearStrengthRatio),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.StrengthIncreaseExponent),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.UsePop),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop,
+ true);
+ AddTextBoxColumn(nameof(FormattedMacroStabilityInwardsSoilLayerDataRow.Pop),
+ Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Pop,
+ true);
+ }
+
+ private static string FormatDesignVariable(VariationCoefficientDesignVariable distribution)
+ {
+ return $"{distribution.GetDesignValue()} ({RingtoetsCommonFormsResources.NormalDistribution_Mean_DisplayName} = {distribution.Distribution.Mean}, " +
+ $"{RingtoetsCommonFormsResources.NormalDistribution_StandardDeviation_DisplayName} = {distribution.Distribution.CoefficientOfVariation})";
+ }
+
+ private class FormattedMacroStabilityInwardsSoilLayerDataRow
+ {
+ public FormattedMacroStabilityInwardsSoilLayerDataRow(IMacroStabilityInwardsSoilLayerData layerData)
+ {
+ MaterialName = layerData.MaterialName;
+ Color = layerData.Color;
+ IsAquifer = layerData.IsAquifer;
+ AbovePhreaticLevel = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetAbovePhreaticLevel(layerData));
+ BelowPhreaticLevel = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetBelowPhreaticLevel(layerData));
+ ShearStrengthModel = layerData.ShearStrengthModel;
+ Cohesion = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetCohesion(layerData));
+ FrictionAngle = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetFrictionAngle(layerData));
+ ShearStrengthRatio = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetShearStrengthRatio(layerData));
+ StrengthIncreaseExponent = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetStrengthIncreaseExponent(layerData));
+ UsePop = layerData.UsePop;
+ Pop = FormatDesignVariable(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPop(layerData));
+ }
+
+ ///
+ /// Gets a value indicating whether or not the is an aquifer.
+ ///
+ public bool IsAquifer { get; }
+
+ ///
+ /// Gets the name of the material that was assigned to the .
+ ///
+ public string MaterialName { get; }
+
+ ///
+ /// Gets the that was used to represent the .
+ ///
+ public Color Color { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string AbovePhreaticLevel { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string BelowPhreaticLevel { get; }
+
+ ///
+ /// Gets the type.
+ ///
+ public MacroStabilityInwardsShearStrengthModel ShearStrengthModel { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string Cohesion { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string FrictionAngle { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string ShearStrengthRatio { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string StrengthIncreaseExponent { get; }
+
+ ///
+ /// Gets a value indicating whether or not the is using POP.
+ ///
+ public bool UsePop { get; }
+
+ ///
+ /// Gets the formatted design variable for .
+ ///
+ public string Pop { get; }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 9fa257acbd8aeded7918b346a8e120fdc80f95b0 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerTable.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsShearStrengthModel.cs
===================================================================
diff -u -r90a9502badff5788374461a1b2179a5dd0e866a2 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsShearStrengthModel.cs (.../MacroStabilityInwardsShearStrengthModel.cs) (revision 90a9502badff5788374461a1b2179a5dd0e866a2)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/MacroStabilityInwardsShearStrengthModel.cs (.../MacroStabilityInwardsShearStrengthModel.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -19,15 +19,26 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System.ComponentModel;
+using Core.Common.Utils;
+using Core.Common.Utils.Attributes;
+using Ringtoets.MacroStabilityInwards.Primitives.Properties;
+
namespace Ringtoets.MacroStabilityInwards.Primitives
{
///
/// All shear strength model types.
///
+ [TypeConverter(typeof(EnumTypeConverter))]
public enum MacroStabilityInwardsShearStrengthModel
{
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsShearStrengthModel_SuCalculated_DisplayName))]
SuCalculated = 1,
+
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsShearStrengthModel_CPhi_DisplayName))]
CPhi = 2,
+
+ [ResourcesDisplayName(typeof(Resources), nameof(Resources.MacroStabilityInwardsShearStrengthModel_CPhiOrSuCalculated_DisplayName))]
CPhiOrSuCalculated = 3
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs
===================================================================
diff -u -r15f9709130561c93bb217e1c7b5ab942be97f958 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 15f9709130561c93bb217e1c7b5ab942be97f958)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -119,6 +119,33 @@
}
///
+ /// Looks up a localized string similar to CPhi.
+ ///
+ public static string MacroStabilityInwardsShearStrengthModel_CPhi_DisplayName {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsShearStrengthModel_CPhi_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to CPhi of Su berekend.
+ ///
+ public static string MacroStabilityInwardsShearStrengthModel_CPhiOrSuCalculated_DisplayName {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsShearStrengthModel_CPhiOrSuCalculated_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Su berekend.
+ ///
+ public static string MacroStabilityInwardsShearStrengthModel_SuCalculated_DisplayName {
+ get {
+ return ResourceManager.GetString("MacroStabilityInwardsShearStrengthModel_SuCalculated_DisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Eén of meerdere lagen hebben een top onder de bodem van de ondergrondschematisatie..
///
public static string MacroStabilityInwardsSoilProfile_Layers_Layer_top_below_profile_bottom {
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx
===================================================================
diff -u -r15f9709130561c93bb217e1c7b5ab942be97f958 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx (.../Resources.resx) (revision 15f9709130561c93bb217e1c7b5ab942be97f958)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/Properties/Resources.resx (.../Resources.resx) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -138,4 +138,13 @@
De waarde voor parameter '{0}' voor de grensspanning moet een concreet getal zijn.
+
+ CPhi of Su berekend
+
+
+ CPhi
+
+
+ Su berekend
+
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsShearStrengthModelTest.cs
===================================================================
diff -u -r90a9502badff5788374461a1b2179a5dd0e866a2 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsShearStrengthModelTest.cs (.../MacroStabilityInwardsShearStrengthModelTest.cs) (revision 90a9502badff5788374461a1b2179a5dd0e866a2)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsShearStrengthModelTest.cs (.../MacroStabilityInwardsShearStrengthModelTest.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -19,23 +19,52 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
+using System.Collections.Generic;
+using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.Primitives;
namespace Ringtoets.MacroStabilityInwards.Data.Test
{
[TestFixture]
- public class MacroStabilityInwardsShearStrengthModelTest
+ public class MacroStabilityInwardsShearStrengthModelTest : EnumTestFixture
{
- [Test]
- public void Values_ExpectedValues()
+ protected override IDictionary ExpectedDisplayNameForEnumValues
{
- // Assert
- Assert.AreEqual(3, Enum.GetValues(typeof(MacroStabilityInwardsShearStrengthModel)).Length);
- Assert.AreEqual(1, (int) MacroStabilityInwardsShearStrengthModel.SuCalculated);
- Assert.AreEqual(2, (int) MacroStabilityInwardsShearStrengthModel.CPhi);
- Assert.AreEqual(3, (int) MacroStabilityInwardsShearStrengthModel.CPhiOrSuCalculated);
+ get
+ {
+ return new Dictionary
+ {
+ {
+ MacroStabilityInwardsShearStrengthModel.SuCalculated, "Su berekend"
+ },
+ {
+ MacroStabilityInwardsShearStrengthModel.CPhi, "CPhi"
+ },
+ {
+ MacroStabilityInwardsShearStrengthModel.CPhiOrSuCalculated, "CPhi of Su berekend"
+ }
+ };
+ }
}
+
+ protected override IDictionary ExpectedValueForEnumValues
+ {
+ get
+ {
+ return new Dictionary
+ {
+ {
+ MacroStabilityInwardsShearStrengthModel.SuCalculated, 1
+ },
+ {
+ MacroStabilityInwardsShearStrengthModel.CPhi, 2
+ },
+ {
+ MacroStabilityInwardsShearStrengthModel.CPhiOrSuCalculated, 3
+ }
+ };
+ }
+ }
}
}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs
===================================================================
diff -u -r5007be256ef2923a6aecbc2639b1e80f38f45539 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision 5007be256ef2923a6aecbc2639b1e80f38f45539)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -98,7 +98,7 @@
using (var view = new MacroStabilityInwardsInputView())
{
// Assert
- MacroStabilityInwardsSoilLayerTable tableControl = GetSoilLayerTable(view);
+ MacroStabilityInwardsSoilLayerDataTable tableControl = GetSoilLayerTable(view);
Assert.NotNull(tableControl);
Assert.AreEqual(DockStyle.Bottom, tableControl.Dock);
CollectionAssert.IsEmpty(tableControl.Rows);
@@ -161,14 +161,14 @@
}
[Test]
- public void Data_WithSurfaceLineAndSoilProfile_DataUpdatedToCollectionOfFilledChartData()
+ public void Data_WithSurfaceLineAndSoilProfile1D_DataUpdatedToCollectionOfFilledChartData()
{
// Setup
using (var view = new MacroStabilityInwardsInputView())
{
MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
- MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile();
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile1D();
var calculation = new MacroStabilityInwardsCalculationScenario
{
InputParameters =
@@ -191,6 +191,36 @@
}
[Test]
+ public void Data_WithSurfaceLineAndSoilProfile2D_DataUpdatedToCollectionOfFilledChartData()
+ {
+ // Setup
+ using (var view = new MacroStabilityInwardsInputView())
+ {
+ MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry();
+
+ MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = GetStochasticSoilProfile2D();
+ var calculation = new MacroStabilityInwardsCalculationScenario
+ {
+ InputParameters =
+ {
+ SurfaceLine = surfaceLine,
+ StochasticSoilProfile = stochasticSoilProfile
+ }
+ };
+
+ // Call
+ view.Data = calculation;
+
+ // Assert
+ Assert.AreSame(calculation, view.Data);
+ ChartDataCollection chartData = view.Chart.Data;
+ Assert.IsInstanceOf(chartData);
+ Assert.AreEqual(nrOfChartData, chartData.Collection.Count());
+ AssertSurfaceLineChartData(surfaceLine, chartData.Collection.ElementAt(surfaceLineIndex));
+ }
+ }
+
+ [Test]
public void Data_WithoutSurfaceLine_NoChartDataSet()
{
// Setup
@@ -583,21 +613,43 @@
return ControlTestHelper.GetControls(view, "chartControl").Single();
}
- private static MacroStabilityInwardsSoilLayerTable GetSoilLayerTable(MacroStabilityInwardsInputView view)
+ private static MacroStabilityInwardsSoilLayerDataTable GetSoilLayerTable(MacroStabilityInwardsInputView view)
{
- return ControlTestHelper.GetControls(view, "soilLayerTable").Single();
+ return ControlTestHelper.GetControls(view, "soilLayerDataTable").Single();
}
- private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile()
+ private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile1D()
{
- return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile1D("profile", -1, new[]
+ return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile1D("profile 1D", -1, new[]
{
new MacroStabilityInwardsSoilLayer1D(1),
new MacroStabilityInwardsSoilLayer1D(3),
new MacroStabilityInwardsSoilLayer1D(5)
}));
}
+ private static MacroStabilityInwardsStochasticSoilProfile GetStochasticSoilProfile2D()
+ {
+ return new MacroStabilityInwardsStochasticSoilProfile(0.5, new MacroStabilityInwardsSoilProfile2D("profile 2D", new[]
+ {
+ new MacroStabilityInwardsSoilLayer2D(new Ring(new List
+ {
+ new Point2D(0.0, 1.0),
+ new Point2D(2.0, 4.0)
+ }), new List()),
+ new MacroStabilityInwardsSoilLayer2D(new Ring(new List
+ {
+ new Point2D(3.0, 1.0),
+ new Point2D(8.0, 3.0)
+ }), new List()),
+ new MacroStabilityInwardsSoilLayer2D(new Ring(new List
+ {
+ new Point2D(2.0, 4.0),
+ new Point2D(2.0, 8.0)
+ }), new List())
+ }, new List()));
+ }
+
private static MacroStabilityInwardsSurfaceLine GetSurfaceLineWithGeometry()
{
var points = new[]
@@ -629,7 +681,7 @@
private static void AssertEmptySoilLayerTable(MacroStabilityInwardsInputView view)
{
- MacroStabilityInwardsSoilLayerTable tableControl = GetSoilLayerTable(view);
+ MacroStabilityInwardsSoilLayerDataTable tableControl = GetSoilLayerTable(view);
// Precondition
Assert.NotNull(tableControl);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerTableTest.cs
===================================================================
diff -u -r66893bb1248edc38de9409e959984dad5a4a6af6 -r9fa257acbd8aeded7918b346a8e120fdc80f95b0
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerTableTest.cs (.../MacroStabilityInwardsSoilLayerTableTest.cs) (revision 66893bb1248edc38de9409e959984dad5a4a6af6)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsSoilLayerTableTest.cs (.../MacroStabilityInwardsSoilLayerTableTest.cs) (revision 9fa257acbd8aeded7918b346a8e120fdc80f95b0)
@@ -25,9 +25,11 @@
using Core.Common.Base.Data;
using Core.Common.TestUtil;
using NUnit.Framework;
+using Ringtoets.Common.Data.Probabilistics;
using Ringtoets.Common.Data.TestUtil;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
using Ringtoets.MacroStabilityInwards.Forms.Views;
+using Ringtoets.MacroStabilityInwards.Primitives;
namespace Ringtoets.MacroStabilityInwards.Forms.Test.Views
{
@@ -36,26 +38,48 @@
{
private const int nameColumnIndex = 0;
private const int colorColumnIndex = 1;
- private const int topColumnIndex = 2;
- private const int isAquiferColumnIndex = 3;
+ private const int isAquiferColumnIndex = 2;
+ private const int abovePhreaticLevelColumnIndex = 3;
+ private const int belowPhreaticLevelColumnIndex = 4;
+ private const int shearStrengthModelColumnIndex = 5;
+ private const int cohesionColumnIndex = 6;
+ private const int frictionAngleColumnIndex = 7;
+ private const int shrearStrengthRatioColumnIndex = 8;
+ private const int strengthIncreaseExponentColumnIndex = 9;
+ private const int usePopColumnIndex = 10;
+ private const int popColumnIndex = 11;
[Test]
public void Constructor_InitializesWithColumns()
{
// Call
- using (var table = new MacroStabilityInwardsSoilLayerTable())
+ using (var table = new MacroStabilityInwardsSoilLayerDataTable())
{
// Assert
DataGridViewColumn nameColumn = table.GetColumnFromIndex(nameColumnIndex);
Assert.AreEqual("Naam", nameColumn.HeaderText);
DataGridViewColumn colorColumn = table.GetColumnFromIndex(colorColumnIndex);
Assert.AreEqual("Kleur", colorColumn.HeaderText);
- DataGridViewColumn topColumn = table.GetColumnFromIndex(topColumnIndex);
- Assert.AreEqual("Topniveau [m+NAP]", topColumn.HeaderText);
- DataGridViewColumn isAquiferColumn = table.GetColumnFromIndex(isAquiferColumnIndex);
- Assert.AreEqual("Is aquifer", isAquiferColumn.HeaderText);
+ DataGridViewColumn abovePhreaticLevelColumn = table.GetColumnFromIndex(abovePhreaticLevelColumnIndex);
+ Assert.AreEqual("Onverzadigd gewicht [kN/m³]", abovePhreaticLevelColumn.HeaderText);
+ DataGridViewColumn belowPhreaticLevelColumn = table.GetColumnFromIndex(belowPhreaticLevelColumnIndex);
+ Assert.AreEqual("Verzadigd gewicht [kN/m³]", belowPhreaticLevelColumn.HeaderText);
+ DataGridViewColumn shearStrengthModelColumn = table.GetColumnFromIndex(shearStrengthModelColumnIndex);
+ Assert.AreEqual("Schuifsterkte model", shearStrengthModelColumn.HeaderText);
+ DataGridViewColumn cohesionColumn = table.GetColumnFromIndex(cohesionColumnIndex);
+ Assert.AreEqual("Cohesie [kN/m³]", cohesionColumn.HeaderText);
+ DataGridViewColumn frictionAngleColumn = table.GetColumnFromIndex(frictionAngleColumnIndex);
+ Assert.AreEqual("Wrijvingshoek [°]", frictionAngleColumn.HeaderText);
+ DataGridViewColumn shrearStrengthRatioColumn = table.GetColumnFromIndex(shrearStrengthRatioColumnIndex);
+ Assert.AreEqual("Schuifsterkte ratio S [-]", shrearStrengthRatioColumn.HeaderText);
+ DataGridViewColumn strengthIncreaseExponentColumn = table.GetColumnFromIndex(strengthIncreaseExponentColumnIndex);
+ Assert.AreEqual("Sterkte toename exp (m) [-]", strengthIncreaseExponentColumn.HeaderText);
+ DataGridViewColumn usePopColumn = table.GetColumnFromIndex(usePopColumnIndex);
+ Assert.AreEqual("Gebruik POP", usePopColumn.HeaderText);
+ DataGridViewColumn popColumn = table.GetColumnFromIndex(popColumnIndex);
+ Assert.AreEqual("POP [kN/m³]", popColumn.HeaderText);
- Assert.Throws(() => table.GetColumnFromIndex(isAquiferColumnIndex + 1));
+ Assert.Throws(() => table.GetColumnFromIndex(popColumnIndex + 1));
CollectionAssert.IsEmpty(table.Rows);
}
@@ -65,13 +89,13 @@
public void SetData_NoDataAlreadySet_SetNewData()
{
// Setup
- using (var table = new MacroStabilityInwardsSoilLayerTable())
+ using (var table = new MacroStabilityInwardsSoilLayerDataTable())
{
var layers = new[]
{
- new MacroStabilityInwardsSoilLayer1D(2.5),
- new MacroStabilityInwardsSoilLayer1D(2.3),
- new MacroStabilityInwardsSoilLayer1D(1.1)
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData()
};
// Call
@@ -86,13 +110,13 @@
public void SetData_SetNullDataAfterDataAlreadySet_ClearsData()
{
// Setup
- using (var table = new MacroStabilityInwardsSoilLayerTable())
+ using (var table = new MacroStabilityInwardsSoilLayerDataTable())
{
var layers = new[]
{
- new MacroStabilityInwardsSoilLayer1D(2.5),
- new MacroStabilityInwardsSoilLayer1D(2.3),
- new MacroStabilityInwardsSoilLayer1D(1.1)
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData()
};
table.SetData(layers);
@@ -108,17 +132,17 @@
public void SetData_SetNewDataAfterDataAlreadySet_ClearDataAndAddNewData()
{
// Setup
- using (var table = new MacroStabilityInwardsSoilLayerTable())
+ using (var table = new MacroStabilityInwardsSoilLayerDataTable())
{
var layers = new[]
{
- new MacroStabilityInwardsSoilLayer1D(2.5),
- new MacroStabilityInwardsSoilLayer1D(2.3),
- new MacroStabilityInwardsSoilLayer1D(1.1)
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData(),
+ new MacroStabilityInwardsSoilLayerData()
};
table.SetData(new[]
{
- new MacroStabilityInwardsSoilLayer1D(1.0)
+ new MacroStabilityInwardsSoilLayerData()
});
// Call
@@ -133,17 +157,17 @@
public void SetData_WithData_ExpectedValuesInTable()
{
// Setup
- using (var table = new MacroStabilityInwardsSoilLayerTable())
+ using (var table = new MacroStabilityInwardsSoilLayerDataTable())
{
var layers = new[]
{
- CreateMacroStabilityInwardsSoilLayer(),
- CreateMacroStabilityInwardsSoilLayer(),
- CreateMacroStabilityInwardsSoilLayer()
+ CreateMacroStabilityInwardsSoilLayerData(),
+ CreateMacroStabilityInwardsSoilLayerData(),
+ CreateMacroStabilityInwardsSoilLayerData()
};
table.SetData(new[]
{
- new MacroStabilityInwardsSoilLayer1D(1.0)
+ new MacroStabilityInwardsSoilLayerData()
});
// Call
@@ -153,41 +177,102 @@
Assert.AreEqual(3, table.Rows.Count);
for (var i = 0; i < table.Rows.Count; i++)
{
- MacroStabilityInwardsSoilLayer1D soilLayer = layers[i];
+ MacroStabilityInwardsSoilLayerData soilLayerData = layers[i];
DataGridViewCellCollection rowCells = table.Rows[i].Cells;
- AssertColumnValueEqual(soilLayer.Top, rowCells[topColumnIndex].Value);
- AssertColumnValueEqual(soilLayer.Data.MaterialName, rowCells[nameColumnIndex].Value);
- AssertColumnValueEqual(soilLayer.Data.Color, rowCells[colorColumnIndex].Value);
- AssertColumnValueEqual(soilLayer.Data.IsAquifer, rowCells[isAquiferColumnIndex].Value);
+ AssertColumnValueEqual(soilLayerData.MaterialName,
+ rowCells[nameColumnIndex].Value);
+ AssertColumnValueEqual(soilLayerData.Color,
+ rowCells[colorColumnIndex].Value);
+ AssertColumnValueEqual(soilLayerData.IsAquifer,
+ rowCells[isAquiferColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetAbovePhreaticLevel(soilLayerData),
+ rowCells[abovePhreaticLevelColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetBelowPhreaticLevel(soilLayerData),
+ rowCells[belowPhreaticLevelColumnIndex].Value);
+ AssertColumnValueEqual(soilLayerData.ShearStrengthModel,
+ rowCells[shearStrengthModelColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetCohesion(soilLayerData),
+ rowCells[cohesionColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetFrictionAngle(soilLayerData),
+ rowCells[frictionAngleColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetShearStrengthRatio(soilLayerData),
+ rowCells[shrearStrengthRatioColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetStrengthIncreaseExponent(soilLayerData),
+ rowCells[strengthIncreaseExponentColumnIndex].Value);
+ AssertColumnValueEqual(soilLayerData.UsePop,
+ rowCells[usePopColumnIndex].Value);
+ AssertColumnValueEqual(MacroStabilityInwardsSemiProbabilisticDesignVariableFactory.GetPop(soilLayerData),
+ rowCells[popColumnIndex].Value);
}
}
}
private static void AssertColumnValueEqual(object expectedValue, object actualValue)
{
- if (expectedValue is string || expectedValue is Color)
- {
- Assert.AreEqual(expectedValue, actualValue);
- }
if (expectedValue is RoundedDouble)
{
Assert.IsInstanceOf(actualValue);
var expectedRoundedDouble = (RoundedDouble) expectedValue;
Assert.AreEqual(expectedRoundedDouble, (RoundedDouble) actualValue, expectedRoundedDouble.GetAccuracy());
}
+ else if (expectedValue is VariationCoefficientDesignVariable)
+ {
+ var expectedDesignVariable = (VariationCoefficientDesignVariable) expectedValue;
+ string expectedFormattedDesignVariable = $"{expectedDesignVariable.GetDesignValue()} (Verwachtingswaarde = {expectedDesignVariable.Distribution.Mean}, " +
+ $"Standaardafwijking = {expectedDesignVariable.Distribution.CoefficientOfVariation})";
+ Assert.AreEqual(expectedFormattedDesignVariable, actualValue);
+ }
+ else
+ {
+ Assert.AreEqual(expectedValue, actualValue);
+ }
}
- private static MacroStabilityInwardsSoilLayer1D CreateMacroStabilityInwardsSoilLayer()
+ private static MacroStabilityInwardsSoilLayerData CreateMacroStabilityInwardsSoilLayerData()
{
- var random = new Random();
+ var random = new Random(21);
- return new MacroStabilityInwardsSoilLayer1D(random.NextDouble())
+ return new MacroStabilityInwardsSoilLayerData
{
- Data =
+ MaterialName = $"{random.NextDouble()}",
+ Color = Color.FromKnownColor(random.NextEnumValue()),
+ IsAquifer = random.NextBoolean(),
+ AbovePhreaticLevel = new VariationCoefficientLogNormalDistribution
{
- MaterialName = $"{random.NextDouble()}",
- Color = Color.FromKnownColor(random.NextEnumValue()),
- IsAquifer = random.NextBoolean()
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ BelowPhreaticLevel = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ ShearStrengthModel = random.NextEnumValue(),
+ ShearStrengthRatio = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ Cohesion = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ FrictionAngle = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ StrengthIncreaseExponent = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
+ },
+ UsePop = random.NextBoolean(),
+ Pop = new VariationCoefficientLogNormalDistribution
+ {
+ CoefficientOfVariation = random.NextRoundedDouble(),
+ Mean = random.NextRoundedDouble()
}
};
}