// Copyright (C) Stichting Deltares 2019. All rights reserved.
//
// This file is part of the application DAM - Clients Library.
//
// DAM - UI 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;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Xml.Serialization;
using Deltares.Dam.Data.Sensors;
using Deltares.Geographic;
using Deltares.Geometry;
using Deltares.Geotechnics.Converter;
using Deltares.Geotechnics.Soils;
using Deltares.Geotechnics.SurfaceLines;
using Deltares.Geotechnics.Validation;
using Deltares.Probabilistic;
using Deltares.Soilbase;
using Deltares.Standard;
using Deltares.Standard.Attributes;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Language;
using Deltares.Standard.Units;
using Deltares.Standard.Validation;
namespace Deltares.Dam.Data
{
internal static class LocationParameterNames
{
public const string DikeRingId = "DikeRingId";
public const string Description = "Description";
public const string XRd = "XRd";
public const string YRd = "YRd";
public const string SegmentId = "SegmentId";
public const string SurfaceLineId = "SurfaceLineId";
public const string PL1LineId = "PL1LineId";
public const string PolderLevel = "PolderLevel";
public const string HeadPL2 = "HeadPL2";
public const string HeadPL3 = "HeadPL3";
public const string HeadPL4 = "HeadPL4";
public const string GrassQuality = "GrassQuality";
public const string Direction = "Direction";
public const string XSoilGeometry2DOrigin = "XSoilGeometry2DOrigin";
public const string DikeEmbankmentMaterial = "DikeEmbankmentMaterial";
public const string ShoulderEmbankmentMaterial = "ShoulderEmbankmentMaterial";
public const string DampingFactorPL3 = "DampingFactorPL3";
public const string DampingFactorPL4 = "DampingFactorPL4";
public const string IsUseOriginalPLLineAssignments = "IsUseOriginalPLLineAssignments";
public const string PenetrationLength = "PenetrationLength";
public const string TrafficLoad = "TrafficLoad";
public const string TL_DegreeOfConsolidation = "TL_DegreeOfConsolidation";
public const string PLLineCreationMethod = "PLLineCreationMethod";
public const string PLLineOffsetBelowDikeTopAtRiver = "PLLineOffsetBelowDikeTopAtRiver";
public const string PLLineOffsetBelowDikeTopAtPolder = "PLLineOffsetBelowDikeTopAtPolder";
public const string PLLineOffsetBelowShoulderBaseInside = "PLLineOffsetBelowShoulderBaseInside";
public const string PLLineOffsetBelowDikeToeAtPolder = "PLLineOffsetBelowDikeToeAtPolder";
public const string PlLineOffsetBelowDikeCrestMiddle = "PlLineOffsetBelowDikeCrestMiddle";
public const string PlLineOffsetFactorBelowShoulderCrest = "PlLineOffsetFactorBelowShoulderCrest";
public const string UsePlLineOffsetBelowDikeCrestMiddle = "UsePlLineOffsetBelowDikeCrestMiddle";
public const string UsePlLineOffsetFactorBelowShoulderCrest = "UsePlLineOffsetFactorBelowShoulderCrest";
public const string StabilityShoulderGrowSlope = "StabilityShoulderGrowSlope";
public const string StabilityShoulderGrowDeltaX = "StabilityShoulderGrowDeltaX";
public const string StabilitySlopeAdaptionDeltaX = "StabilitySlopeAdaptionDeltaX";
public const string MinimalCircleDepth = "MinimalCircleDepth";
public const string LevelReductionInside = "LevelReductionInside";
public const string LevelReductionOutside = "LevelReductionOutside";
public const string LayerHeightDistribution = "LayerHeightDistribution";
public const string LayerHeightDeviation = "LayerHeightDeviation";
public const string DistanceToEntryPoint = "DistanceToEntryPoint";
public const string RequiredSafetyFactorStabilityInnerSlope = "RequiredSafetyFactorStabilityInnerSlope";
public const string RequiredSafetyFactorStabilityOuterSlope = "RequiredSafetyFactorStabilityOuterSlope";
public const string RequiredSafetyFactorPiping = "RequiredSafetyFactorPiping";
public const string StabilityZoneType = "StabilityZoneType";
public const string ForbiddenZoneFactor = "ForbiddenZoneFactor";
public const string ZoneAreaRestSlopeCrestWidth = "ZoneAreaRestSlopeCrestWidth";
public const string StabilityDesignMethod = "StabilityDesignMethod";
public const string SlopeAdaptionStartCotangent = "SlopeAdaptionStartCotangent";
public const string SlopeAdaptionEndCotangent = "SlopeAdaptionEndCotangent";
public const string SlopeAdaptionStepCotangent = "SlopeAdaptionStepCotangent";
public const string SlopeDampingPiezometricHeightPolderSide = "SlopeDampingPiezometricHeightPolderSide";
public const string NewDepthDitch = "NewDepthDitch";
public const string NewDikeSlopeInside = "NewDikeSlopeInside";
public const string NewDikeSlopeOutside = "NewDikeSlopeOutside";
public const string NewDikeTopWidth = "NewDikeTopWidth";
public const string NewMaxHeightShoulderAsFraction = "NewMaxHeightShoulderAsFraction";
public const string NewMinDistanceDikeToeStartDitch = "NewMinDistanceDikeToeStartDitch";
public const string NewShoulderBaseSlope = "NewShoulderBaseSlope";
public const string NewShoulderTopSlope = "NewShoulderTopSlope";
public const string NewSlopeAngleDitch = "NewSlopeAngleDitch";
public const string NewWidthDitchBottom = "NewWidthDitchBottom";
public const string UseNewDikeSlopeInside = "UseNewDikeSlopeInside";
public const string UseNewDikeSlopeOutside = "UseNewDikeSlopeOutside";
public const string UseNewDikeTopWidth = "UseNewDikeTopWidth";
public const string UseNewDitchDefinition = "UseNewDitchDefinition";
public const string UseNewMaxHeightShoulderAsFraction = "UseNewMaxHeightShoulderAsFraction";
public const string UseNewMinDistanceDikeToeStartDitch = "UseNewMinDistanceDikeToeStartDitch";
public const string UseNewShoulderBaseSlope = "UseNewShoulderBaseSlope";
public const string UseNewShoulderTopSlope = "UseNewShoulderTopSlope";
public const string IntrusionVerticalWaterPressure = "IntrusionVerticalWaterPressure";
public const string DikeTableHeight = "DikeTableHeight";
public const string WaterHeight = "WaterHeight";
public const string WaterHeightLow = "WaterHeightLow";
}
[TrackChanges]
public class Location : IVisibleEnabled, IGeographicPoint, IRepairer, IDomain, IDisposable
{
// Added initial value as these properties must be tested for real values on import
public const string AllCategory = "MainItems";
public const string DikeCategory = "Dike";
public const string WaterCategory = "Water levels";
public const string DesignCategory = "Design";
private const double newDikeTopWidthMinValue = 0.1;
private const double newDikeSlopeInsideMinValue = 0.01;
private const double newDikeSlopeOutsideMinValue = 0.01;
private const double penetrationLenghtMinValue = 0.00;
private static DamProjectType damProjectType = DamProjectType.Calamity;
private readonly List scenarios = new List();
private bool areLocalXZObjectsCreated = false;
// ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// When adding properties below do not forget to add these properties to SetParameterFromNameValuePair and GetParametersAsNameValuePairs
//
// ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
private double dampingFactorPL3 = 0;
private double dampingFactorPL4 = 0;
private string description = "";
private string dikeEmbankmentMaterial = "";
private string dikeRingId = "";
private double direction = 0;
private double distanceToEntryPoint = 0;
private double forbiddenZoneFactor = 1.0;
private IList gaugePLLines = new List();
private IList gauges = new List();
private double grassQuality = 0;
private double? headPL2 = null;
private double? headPL3 = null;
private double? headPL4 = null;
private bool isUseOriginalPLLineAssignments = false;
private double layerHeightDeviation = 0;
private DistributionType layerHeightDistribution = 0;
// Start of parameters that are also defined in modelparameters
private double levelReductionInside = 0;
private double levelReductionOutside = 0;
private PL1Line localXZPL1Line;
private SurfaceLine2 localXzSurfaceLine;
private string mapForSoilGeometries2D = "";
private double minimalCircleDepth = 0;
private ModelFactors modelFactors = new ModelFactors();
private string name = "";
private double newDepthDitch = 1.0;
private double newDikeSlopeInside = 1.0/3.0; // as tangent
private double newDikeSlopeOutside = 1.0/3.0; // as tangent
private double newDikeTopWidth = 5.0;
private double newMaxHeightShoulderAsFraction = 2.0/3.0; // as tangent
private double newMinDistanceDikeToeStartDitch = 5.0;
private double newShoulderBaseSlope = 1.0/3.0; // as tangent
private double newShoulderTopSlope = 1.0/20.0; // as tangent
private double newSlopeAngleDitch = 1.0/0.5; // as tangent
private double newWidthDitchBottom = 1.0;
private PL1Line pL1Line;
private PLLineCreationMethod pLLineCreationMethod = PLLineCreationMethod.ExpertKnowledgeRRD;
private double pLLineOffsetBelowDikeToeAtPolder = 0.1;
private double pLLineOffsetBelowDikeTopAtPolder = 1.5;
private double pLLineOffsetBelowDikeTopAtRiver = 0.5;
private double pLLineOffsetBelowShoulderBaseInside = 0.1;
private double penetrationLength = 0;
private double polderLevel = 0;
private bool redesignDikeHeight = true;
private bool redesignDikeShoulder = true;
private Segment segment;
private SensorLocation sensorLocation;
private string shoulderEmbankmentMaterial = "";
private double slopeAdaptionEndCotangent = 6.0;
private double slopeAdaptionStartCotangent = 3.0;
private double slopeAdaptionStepCotangent = 0.5;
private double slopeDampingPiezometricHeightPolderSide = 0.0;
private SoilSurfaceProfile soilSurfaceProfile = null;
private string soildatabaseName = "";
private StabilityDesignMethod stabilityDesignMethod = StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption;
private double stabilityShoulderGrowDeltaX = 2.0;
private double stabilityShoulderGrowSlope = 1.0/3;
private double stabilitySlopeAdaptionDeltaX = 2.0;
private MStabZonesType stabilityZoneType = MStabZonesType.NoZones;
private SurfaceLine2 surfaceLine2;
private string surfaceLineId = "";
private double trafficLoad = 0;
private double degreeOfConsolidation = 0;
private bool useNewDikeSlopeInside;
private bool useNewDikeSlopeOutside;
private bool useNewDikeTopWidth;
private bool useNewDitchDefinition;
private bool useNewMaxHeightShoulderAsFraction;
private bool useNewMinDistanceDikeToeStartDitch;
private bool useNewShoulderBaseSlope;
private bool useNewShoulderTopSlope;
private double xRdDikeLine;
private double xSoilGeometry2DOrigin = 0;
private double xrd = 0;
private double yrd = 0;
private double zoneAreaRestSlopeCrestWidth = 3.0;
private double? plLineOffsetFactorBelowShoulderCrest;
private double? plLineOffsetBelowDikeCrestMiddle;
private IntrusionVerticalWaterPressureType? intrusionVerticalWaterPressure = IntrusionVerticalWaterPressureType.Standard;
private double? dikeTableHeight = null;
private double? waterHeight = null;
private double? waterHeightLow = null;
public Location()
{
SoilList = null;
}
///
/// Initializes a new instance of the class.
///
/// The name.
public Location(string name) : this()
{
this.name = name;
}
public bool HasSensorData
{
get
{
return sensorLocation != null;
}
}
[Browsable(false)]
[XmlOldName("SensorData")]
public virtual SensorLocation SensorLocation
{
get
{
return sensorLocation;
}
set
{
sensorLocation = value;
sensorLocation.Location = this;
}
}
[Browsable(false)]
public virtual bool AreLocalXZObjectsCreated
{
get
{
return areLocalXZObjectsCreated;
}
set
{
DataEventPublisher.BeforeChange(this, "AreLocalXZObjectsCreated");
areLocalXZObjectsCreated = value;
DataEventPublisher.AfterChange(this, "AreLocalXZObjectsCreated");
}
}
[Label("Name")]
[PropertyOrder(0, 1)]
[ReadOnly(true)]
[Category(AllCategory)]
public virtual string Name
{
get
{
return name;
}
set
{
DataEventPublisher.BeforeChange(this, "Name");
name = value;
DataEventPublisher.AfterChange(this, "Name");
}
}
[Label("Description")]
[Category(DikeCategory)]
[PropertyOrder(1, 10)]
public virtual string Description
{
get
{
return description;
}
set
{
DataEventPublisher.BeforeChange(this, "Description");
description = value;
DataEventPublisher.AfterChange(this, "Description");
}
}
[Unit(UnitType.Length)]
[Label("X location (RDS)")]
[Description("Location according to Rijksdriehoekstelsel")]
[Format("F3")]
[ReadOnly(true)]
[PropertyOrder(1, 1)]
[Category(AllCategory)]
public virtual double XRd
{
get
{
return xrd;
}
set
{
DataEventPublisher.BeforeChange(this, "XRd");
xrd = value;
DataEventPublisher.AfterChange(this, "XRd");
}
}
[Unit(UnitType.Length)]
[Label("Y location (RDS)")]
[Description("Location according to Rijksdriehoekstelsel")]
[Format("F3")]
[ReadOnly(true)]
[PropertyOrder(1, 1)]
[Category(AllCategory)]
public virtual double YRd
{
get
{
return yrd;
}
set
{
DataEventPublisher.BeforeChange(this, "YRd");
yrd = value;
DataEventPublisher.AfterChange(this, "YRd");
}
}
public virtual double XRdDikeLine
{
get
{
return xRdDikeLine;
}
set
{
this.SetAndNotify2(out xRdDikeLine, value, x => x.XRdDikeLine);
}
}
[Browsable(false)]
public virtual double GrassQuality
{
get
{
return grassQuality;
}
set
{
DataEventPublisher.BeforeChange(this, "GrassQuality");
grassQuality = value;
DataEventPublisher.AfterChange(this, "GrassQuality");
}
}
[Browsable(false)]
public virtual double Direction
{
get
{
return direction;
}
set
{
DataEventPublisher.BeforeChange(this, "Direction");
direction = value;
DataEventPublisher.AfterChange(this, "Direction");
}
}
[Browsable(false)]
public virtual double XSoilGeometry2DOrigin
{
get
{
return xSoilGeometry2DOrigin;
}
set
{
DataEventPublisher.BeforeChange(this, "XSoilGeometry2DOrigin");
xSoilGeometry2DOrigin = value;
DataEventPublisher.AfterChange(this, "XSoilGeometry2DOrigin");
}
}
[Unit(UnitType.PressurePerLength)]
[Label("Traffic load")]
[Description("Traffic load")]
[Format("F3")]
[Category(DikeCategory)]
[PropertyOrder(1, 20)]
public virtual double TrafficLoad
{
get
{
return trafficLoad;
}
set
{
DataEventPublisher.BeforeChange(this, "TrafficLoad");
trafficLoad = value;
DataEventPublisher.AfterChange(this, "TrafficLoad");
}
}
[Unit(UnitType.Percentage)]
[Format("F3")]
[Category(DikeCategory)]
[PropertyOrder(1, 21)]
public virtual double TL_DegreeOfConsolidation
{
get
{
return degreeOfConsolidation;
}
set
{
DataEventPublisher.BeforeChange(this, "TL_DegreeOfConsolidation");
degreeOfConsolidation = value;
DataEventPublisher.AfterChange(this, "TL_DegreeOfConsolidation");
}
}
[Browsable(false)]
public virtual bool IsUseOriginalPLLineAssignments
{
get
{
return isUseOriginalPLLineAssignments;
}
set
{
DataEventPublisher.BeforeChange(this, "IsUseOriginalPLLineAssignments");
isUseOriginalPLLineAssignments = value;
DataEventPublisher.AfterChange(this, "IsUseOriginalPLLineAssignments");
}
}
[Browsable(false)]
public virtual PL1Line PL1Line
{
get
{
return pL1Line;
}
set
{
DataEventPublisher.BeforeChange(this, "PL1Line");
pL1Line = value;
DataEventPublisher.AfterChange(this, "PL1Line");
}
}
[Browsable(false)]
public virtual PL1Line LocalXZPL1Line
{
get
{
return localXZPL1Line;
}
set
{
DataEventPublisher.BeforeChange(this, "LocalXZPL1Line");
localXZPL1Line = value;
DataEventPublisher.AfterChange(this, "LocalXZPL1Line");
}
}
///
/// TODO
///
/// Composite relationship.
[Validate]
public virtual SurfaceLine2 LocalXZSurfaceLine2
{
get
{
return localXzSurfaceLine;
}
set
{
this.SetAndNotify2(out localXzSurfaceLine, value, l => l.LocalXZSurfaceLine2);
}
}
///
/// Gets or sets the Segment
///
[PropertyOrder(1, 6)]
[Label("Segment")]
[Category(DikeCategory)]
[ReadOnly(true)]
public virtual string SegmentId { get; set; }
///
/// Gets or sets the Segment
///
[Browsable(false)]
public virtual Segment Segment
{
get
{
return segment;
}
set
{
DataEventPublisher.BeforeChange(this, "Segment");
segment = value;
DataEventPublisher.AfterChange(this, "Segment");
}
}
///
/// Gets or sets the surface line
///
[Browsable(false)]
public virtual SurfaceLine2 SurfaceLine2
{
get
{
return surfaceLine2;
}
set
{
this.SetAndNotify2(out surfaceLine2, value, l => l.SurfaceLine2);
}
}
///
///
///
[Unit(UnitType.Length)]
[Label("Minimum circle depth")]
[Format("F2")]
[PropertyOrder(4, 4)]
[Minimum(0)]
[Maximum(10000)]
[Category(DikeCategory)]
public virtual double MinimalCircleDepth
{
get
{
return minimalCircleDepth;
}
set
{
DataEventPublisher.BeforeChange(this, "MinimalCircleDepth");
minimalCircleDepth = value;
DataEventPublisher.AfterChange(this, "MinimalCircleDepth");
}
}
[Unit(UnitType.Length)]
[Label("Level reduction inside")]
[Format("F2")]
[PropertyOrder(4, 5)]
[Category(WaterCategory)]
public virtual double LevelReductionInside
{
get
{
return levelReductionInside;
}
set
{
DataEventPublisher.BeforeChange(this, "LevelReductionInside");
levelReductionInside = value;
DataEventPublisher.AfterChange(this, "LevelReductionInside");
}
}
[Unit(UnitType.Length)]
[Label("Level reduction outside")]
[Format("F2")]
[PropertyOrder(4, 6)]
[Category(WaterCategory)]
public virtual double LevelReductionOutside
{
get
{
return levelReductionOutside;
}
set
{
DataEventPublisher.BeforeChange(this, "LevelReductionOutside");
levelReductionOutside = value;
DataEventPublisher.AfterChange(this, "LevelReductionOutside");
}
}
[Browsable(false)]
public virtual ModelFactors ModelFactors
{
get
{
return modelFactors;
}
set
{
DataEventPublisher.BeforeChange(this, "ModelFactors");
modelFactors = value;
DataEventPublisher.AfterChange(this, "ModelFactors");
}
}
[Label("Layer height distribution")]
[Category(AllCategory)]
[PropertyOrder(4, 7)]
public virtual DistributionType LayerHeightDistribution
{
get
{
return layerHeightDistribution;
}
set
{
DataEventPublisher.BeforeChange(this, "LayerHeightDistribution");
layerHeightDistribution = value;
DataEventPublisher.AfterChange(this, "LayerHeightDistribution");
}
}
[Label("Layer height deviation")]
[Category(AllCategory)]
[PropertyOrder(4, 8)]
[Format("F2")]
public virtual double LayerHeightDeviation
{
get
{
return layerHeightDeviation;
}
set
{
DataEventPublisher.BeforeChange(this, "LayerHeightDeviation");
layerHeightDeviation = value;
DataEventPublisher.AfterChange(this, "LayerHeightDeviation");
}
}
[Unit(UnitType.Length)]
[Label("Distance to Entrypoint")]
[Description("Distance from toe of dike to entry point of river in deep sandlayer")]
[Format("F2")]
[PropertyOrder(2, 12)]
public virtual double DistanceToEntryPoint
{
get
{
return distanceToEntryPoint;
}
set
{
DataEventPublisher.BeforeChange(this, "DistanceToEntryPoint");
distanceToEntryPoint = value;
DataEventPublisher.AfterChange(this, "DistanceToEntryPoint");
}
}
[Label("Slope damping factor")]
[Description("The tangent of the slope damping for piezometric height polderSide (for PL3 and PL4)")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 14)]
public virtual double SlopeDampingPiezometricHeightPolderSide
{
get
{
return slopeDampingPiezometricHeightPolderSide;
}
set
{
DataEventPublisher.BeforeChange(this, "SlopeDampingPiezometricHeightPolderSide");
slopeDampingPiezometricHeightPolderSide = value;
DataEventPublisher.AfterChange(this, "SlopeDampingPiezometricHeightPolderSide");
}
}
[Label("Dike")]
[ReadOnly(true)]
[Category(DikeCategory)]
[PropertyOrder(1, 4)]
public string DikeRingId
{
get
{
return dikeRingId;
}
set
{
dikeRingId = value;
}
}
[Browsable(false)]
public string SurfaceLineId
{
get
{
return surfaceLineId;
}
set
{
surfaceLineId = value;
}
}
[Browsable(false)]
public string SoildatabaseName
{
get
{
return soildatabaseName;
}
set
{
soildatabaseName = value;
}
}
[Browsable(false)]
public SoilList SoilList { get; set; }
[Browsable(false)]
[XmlIgnore]
public SoilbaseDB SoilbaseDB
{
get
{
if (SoildatabaseName == null || !File.Exists(SoildatabaseName))
{
throw new DikeException(String.Format("The soil database '{0}' cannot be found", SoildatabaseName));
}
return SoilbaseDB.Create(SoildatabaseName);
}
}
[Browsable(false)]
public string MapForSoilGeometries2D
{
get
{
return mapForSoilGeometries2D;
}
set
{
mapForSoilGeometries2D = value;
}
}
[Browsable(false)]
public virtual IList Gauges
{
get
{
return gauges;
}
set
{
gauges = value;
}
}
[Browsable(false)]
public virtual IList GaugePLLines
{
get
{
return gaugePLLines;
}
set
{
gaugePLLines = value;
}
}
[Browsable(false)]
public bool UsesGauges
{
get
{
return GaugePLLines != null && GaugePLLines.Count > 0 && Gauges != null;
}
}
[Browsable(false)]
public double GaugeMissVal { get; set; }
[Label("Redesign dike height")]
[PropertyOrder(7, 1)]
[Category(DesignCategory)]
public bool RedesignDikeHeight
{
get
{
return redesignDikeHeight;
}
set
{
DataEventPublisher.BeforeChange(this, "RedesignDikeHeight");
redesignDikeHeight = value;
DataEventPublisher.AfterChange(this, "RedesignDikeHeight");
}
}
[Label("Redesign dike shoulder")]
[PropertyOrder(7, 2)]
[Category(DesignCategory)]
public bool RedesignDikeShoulder
{
get
{
return redesignDikeShoulder;
}
set
{
DataEventPublisher.BeforeChange(this, "RedesignDikeShoulder");
redesignDikeShoulder = value;
DataEventPublisher.AfterChange(this, "RedesignDikeShoulder");
}
}
[Label("Stability design method")]
[PropertyOrder(7, 3)]
[Category(DesignCategory)]
public StabilityDesignMethod StabilityDesignMethod
{
get
{
return stabilityDesignMethod;
}
set
{
DataEventPublisher.BeforeChange(this, "StabilityDesignMethod");
stabilityDesignMethod = value;
DataEventPublisher.AfterChange(this, "StabilityDesignMethod");
}
}
[Label("Start value for design of slope")]
[PropertyOrder(7, 4)]
[Format("F2")]
[Category(DesignCategory)]
public double SlopeAdaptionStartCotangent
{
get
{
return slopeAdaptionStartCotangent;
}
set
{
DataEventPublisher.BeforeChange(this, "SlopeAdaptionStartCotangent");
slopeAdaptionStartCotangent = value;
DataEventPublisher.AfterChange(this, "SlopeAdaptionStartCotangent");
}
}
[Label("End value for design of slope")]
[PropertyOrder(7, 5)]
[Format("F2")]
[Category(DesignCategory)]
public double SlopeAdaptionEndCotangent
{
get
{
return slopeAdaptionEndCotangent;
}
set
{
DataEventPublisher.BeforeChange(this, "SlopeAdaptionEndCotangent");
slopeAdaptionEndCotangent = value;
DataEventPublisher.AfterChange(this, "SlopeAdaptionEndCotangent");
}
}
[Label("Step value for design of slope")]
[PropertyOrder(7, 6)]
[Format("F2")]
[Category(DesignCategory)]
public double SlopeAdaptionStepCotangent
{
get
{
return slopeAdaptionStepCotangent;
}
set
{
DataEventPublisher.BeforeChange(this, "SlopeAdaptionStepCotangent");
slopeAdaptionStepCotangent = value;
DataEventPublisher.AfterChange(this, "SlopeAdaptionStepCotangent");
}
}
[Description("Use the value for new width of dike top")]
[PropertyOrder(7, 7)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewDikeTopWidth
{
get
{
return useNewDikeTopWidth;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewDikeTopWidth");
useNewDikeTopWidth = value;
DataEventPublisher.AfterChange(this, "UseNewDikeTopWidth");
}
}
[Description("Value for new width of dike top")]
[PropertyOrder(7, 8)]
[Format("F2")]
[Category(DesignCategory)]
public double NewDikeTopWidth
{
get
{
return newDikeTopWidth;
}
set
{
DataEventPublisher.BeforeChange(this, "NewDikeTopWidth");
newDikeTopWidth = value;
DataEventPublisher.AfterChange(this, "NewDikeTopWidth");
}
}
[Description("Use the value for new angle of the inside slope")]
[PropertyOrder(7, 9)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewDikeSlopeInside
{
get
{
return useNewDikeSlopeInside;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewDikeSlopeInside");
useNewDikeSlopeInside = value;
DataEventPublisher.AfterChange(this, "UseNewDikeSlopeInside");
}
}
[Description("Value for new angle of the inside slope")]
[PropertyOrder(7, 10)]
[Format("F2")]
[Category(DesignCategory)]
public double NewDikeSlopeInside
{
get
{
return newDikeSlopeInside;
}
set
{
DataEventPublisher.BeforeChange(this, "NewDikeSlopeInside");
newDikeSlopeInside = value;
DataEventPublisher.AfterChange(this, "NewDikeSlopeInside");
}
}
[Description("Use the value for new angle of the outside slope")]
[PropertyOrder(7, 11)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewDikeSlopeOutside
{
get
{
return useNewDikeSlopeOutside;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewDikeSlopeOutside");
useNewDikeSlopeOutside = value;
DataEventPublisher.AfterChange(this, "UseNewDikeSlopeOutside");
}
}
[Description("Value for new angle of the outside slope")]
[PropertyOrder(7, 12)]
[Format("F2")]
[Category(DesignCategory)]
public double NewDikeSlopeOutside
{
get
{
return newDikeSlopeOutside;
}
set
{
DataEventPublisher.BeforeChange(this, "NewDikeSlopeOutside");
newDikeSlopeOutside = value;
DataEventPublisher.AfterChange(this, "NewDikeSlopeOutside");
}
}
[Description("Use the value for new angle of the top slope of shoulder")]
[PropertyOrder(7, 13)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewShoulderTopSlope
{
get
{
return useNewShoulderTopSlope;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewShoulderTopSlope");
useNewShoulderTopSlope = value;
DataEventPublisher.AfterChange(this, "UseNewShoulderTopSlope");
}
}
[Description("Value for new angle of the top slope of shoulder")]
[PropertyOrder(7, 14)]
[Format("F2")]
[Category(DesignCategory)]
public double NewShoulderTopSlope
{
get
{
return newShoulderTopSlope;
}
set
{
DataEventPublisher.BeforeChange(this, "NewShoulderTopSlope");
newShoulderTopSlope = value;
DataEventPublisher.AfterChange(this, "NewShoulderTopSlope");
}
}
[Description("Use the value for new angle of the base slope of shoulder")]
[PropertyOrder(7, 15)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewShoulderBaseSlope
{
get
{
return useNewShoulderBaseSlope;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewShoulderBaseSlope");
useNewShoulderBaseSlope = value;
DataEventPublisher.AfterChange(this, "UseNewShoulderBaseSlope");
}
}
[Description("Value for new angle of the base slope of shoulder")]
[PropertyOrder(7, 16)]
[Format("F2")]
[Category(DesignCategory)]
public double NewShoulderBaseSlope
{
get
{
return newShoulderBaseSlope;
}
set
{
DataEventPublisher.BeforeChange(this, "NewShoulderBaseSlope");
newShoulderBaseSlope = value;
DataEventPublisher.AfterChange(this, "NewShoulderBaseSlope");
}
}
[Label("Use the value for new allowed height of shoulder as fraction of dike height")]
[PropertyOrder(7, 17)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewMaxHeightShoulderAsFraction
{
get
{
return useNewMaxHeightShoulderAsFraction;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewMaxHeightShoulderAsFraction");
useNewMaxHeightShoulderAsFraction = value;
DataEventPublisher.AfterChange(this, "UseNewMaxHeightShoulderAsFraction");
}
}
[Description("Value for new allowed height of shoulder as fraction of dike height")]
[PropertyOrder(7, 18)]
[Format("F2")]
[Category(DesignCategory)]
public double NewMaxHeightShoulderAsFraction
{
get
{
return newMaxHeightShoulderAsFraction;
}
set
{
DataEventPublisher.BeforeChange(this, "NewMaxHeightShoulderAsFraction");
newMaxHeightShoulderAsFraction = value;
DataEventPublisher.AfterChange(this, "NewMaxHeightShoulderAsFraction");
}
}
[Description("Use the value for new minimum distance dike toe - start ditch")]
[PropertyOrder(7, 19)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewMinDistanceDikeToeStartDitch
{
get
{
return useNewMinDistanceDikeToeStartDitch;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewMinDistanceDikeToeStartDitch");
useNewMinDistanceDikeToeStartDitch = value;
DataEventPublisher.AfterChange(this, "UseNewMinDistanceDikeToeStartDitch");
}
}
[Description("Value for new minimum distance dike toe - start ditch")]
[PropertyOrder(7, 20)]
[Format("F2")]
[Category(DesignCategory)]
public double NewMinDistanceDikeToeStartDitch
{
get
{
return newMinDistanceDikeToeStartDitch;
}
set
{
DataEventPublisher.BeforeChange(this, "NewMinDistanceDikeToeStartDitch");
newMinDistanceDikeToeStartDitch = value;
DataEventPublisher.AfterChange(this, "NewMinDistanceDikeToeStartDitch");
}
}
[Description("Use the values for new ditch definition")]
[PropertyOrder(7, 21)]
[Format("F2")]
[Category(DesignCategory)]
public bool UseNewDitchDefinition
{
get
{
return useNewDitchDefinition;
}
set
{
DataEventPublisher.BeforeChange(this, "UseNewDitchDefinition");
useNewDitchDefinition = value;
DataEventPublisher.AfterChange(this, "UseNewDitchDefinition");
}
}
[Description("Value for new width of ditch bottom")]
[PropertyOrder(7, 22)]
[Format("F2")]
[Category(DesignCategory)]
public double NewWidthDitchBottom
{
get
{
return newWidthDitchBottom;
}
set
{
DataEventPublisher.BeforeChange(this, "NewWidthDitchBottom");
newWidthDitchBottom = value;
DataEventPublisher.AfterChange(this, "NewWidthDitchBottom");
}
}
[Description("Value for new angle of ditch slopes")]
[PropertyOrder(7, 23)]
[Format("F2")]
[Category(DesignCategory)]
public double NewSlopeAngleDitch
{
get
{
return newSlopeAngleDitch;
}
set
{
DataEventPublisher.BeforeChange(this, "newSlopeAngleDitch");
newSlopeAngleDitch = value;
DataEventPublisher.AfterChange(this, "newSlopeAngleDitch");
}
}
[Description("Value for new depth of ditch bottom")]
[PropertyOrder(7, 24)]
[Format("F2")]
[Category(DesignCategory)]
public double NewDepthDitch
{
get
{
return newDepthDitch;
}
set
{
DataEventPublisher.BeforeChange(this, "NewDepthDitch");
newDepthDitch = value;
DataEventPublisher.AfterChange(this, "NewDepthDitch");
}
}
[ReadOnly(true)]
[Validate]
public List Scenarios
{
get
{
return scenarios;
}
}
[Browsable(false)]
[XmlIgnore]
public static DamProjectType DamProjectType
{
get
{
return damProjectType;
}
set
{
damProjectType = value;
}
}
#region IGeographic Members
[Label("Zone type")]
[Description("Type of zone to be used in stability calculations")]
[PropertyOrder(4, 10)]
[Category(AllCategory)]
public MStabZonesType StabilityZoneType
{
get
{
return stabilityZoneType;
}
set
{
DataEventPublisher.BeforeChange(this, "StabilityZoneType");
stabilityZoneType = value;
DataEventPublisher.AfterChange(this, "StabilityZoneType");
}
}
[Label("Forbidden Zone Factor")]
[Description("Factor of zone to be used in stability calculations")]
[Format("F2")]
[Unit(UnitType.None)]
[Minimum(0.0)]
[Maximum(1.0)]
[PropertyOrder(4, 11)]
[Category(AllCategory)]
public double ForbiddenZoneFactor
{
get
{
return forbiddenZoneFactor;
}
set
{
DataEventPublisher.BeforeChange(this, "ForbiddenZoneFactor");
forbiddenZoneFactor = value;
DataEventPublisher.AfterChange(this, "ForbiddenZoneFactor");
}
}
[Label("Zone Area Rest Slope Crest Width")]
[Description("Zone Area Rest Slope Crest Width")]
[Format("F2")]
[Unit(UnitType.Length)]
[Minimum(0.1)]
[PropertyOrder(4, 12)]
[Category(AllCategory)]
public double ZoneAreaRestSlopeCrestWidth
{
get
{
return zoneAreaRestSlopeCrestWidth;
}
set
{
DataEventPublisher.BeforeChange(this, "ZoneAreaRestSlopeCrestWidth");
zoneAreaRestSlopeCrestWidth = value;
DataEventPublisher.AfterChange(this, "ZoneAreaRestSlopeCrestWidth");
}
}
[XmlIgnore]
[Browsable(false)]
public double X
{
get
{
return XRd;
}
set
{
XRd = value;
}
}
[XmlIgnore]
[Browsable(false)]
public double Y
{
get
{
return YRd;
}
set
{
YRd = value;
}
}
///
/// Checks whether the required safety (stability inner slope) is given as that is needed to work with zone areas.
///
///
[Validate]
public ValidationResult[] IsRequiredSafetySetForZoneTypeArea()
{
if (stabilityZoneType == MStabZonesType.ZoneAreas)
{
// For design projects, the safetey must be defined per scenario, not per location
if (DamProjectType == DamProjectType.Design && scenarios != null && scenarios.Count > 0)
{
foreach (var scenario in scenarios)
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "NoRequiredSafetyForZonesScenario"),
scenario, "StabilityZoneType", "ZoneTypeSafety", null)
};
}
}
else
{
if (modelFactors.RequiredSafetyFactorStabilityInnerSlope == null)
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "NoRequiredSafetyForZones"),
this, "StabilityZoneType", "ZoneTypeSafety", (IRepairer) this)
};
}
}
}
return new ValidationResult[0];
}
[Validate]
public ValidationResult[] ValidateDikeEmbankmentMaterial()
{
if (DamProjectType == DamProjectType.Design &&
DamProjectCalculationSpecification.SelectedAnalysisType == AnalysisType.AdaptGeometry &&
!HasValidDikeEmbankmentMaterial())
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "NoDikeEmbankmentMaterial"),
this)
};
}
else
{
return new ValidationResult[0];
}
}
[Validate]
public ValidationResult[] ValidateLocationNewDikeTopWidth()
{
if (DamProjectType == DamProjectType.Design)
{
if ((UseNewDikeTopWidth) && (NewDikeTopWidth < newDikeTopWidthMinValue))
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeTopWidthRangeError"), newDikeTopWidthMinValue), this, "NewDikeTopWidth", "AssignMinValue", this)
};
}
}
return new ValidationResult[0];
}
[Validate]
public ValidationResult[] ValidateLocationNewDikeSlopeInside()
{
if (DamProjectType == DamProjectType.Design)
{
if ((UseNewDikeSlopeInside) && (NewDikeSlopeInside < newDikeSlopeInsideMinValue))
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeSlopeInsideRangeError"), newDikeSlopeInsideMinValue), this, "NewDikeSlopeInside", "AssignMinValue", this)
};
}
}
return new ValidationResult[0];
}
[Validate]
public ValidationResult[] ValidateLocationNewDikeSlopeOutside()
{
if (DamProjectType == DamProjectType.Design)
{
if ((UseNewDikeSlopeOutside) && (NewDikeSlopeOutside < newDikeSlopeOutsideMinValue))
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeSlopeOutsideRangeError"), newDikeSlopeOutsideMinValue), this, "NewDikeSlopeOutside", "AssignMinValue", this)
};
}
}
return new ValidationResult[0];
}
///
/// Validates the use of the penetration length.
///
/// Validation result
[Validate]
public ValidationResult[] ValidateLocationUseOfPenetrationLength()
{
if (PenetrationLength > 0)
{
// It may be used on 1D geometries
if (!String.IsNullOrEmpty(this.Segment.GetMostProbableGeometry2DName(FailureMechanismSystemType.StabilityInside)))
{
// It may be used on 2D geometries only if condition below is true
if (this.IntrusionVerticalWaterPressure != IntrusionVerticalWaterPressureType.SemiTimeDependent)
{
return new[]
{
new ValidationResult(ValidationResultType.Error, String.Format(LocalizationManager.GetTranslatedText(this, "UseOfPenetrationLengthError"), penetrationLenghtMinValue), this, "PenetrationLength", "AssignMinValue", this)
};
}
}
}
return new ValidationResult[0];
}
[Validate]
public ValidationResult[] ValidateShoulderEmbankmentMaterial()
{
if (DamProjectType == DamProjectType.Design &&
DamProjectCalculationSpecification.SelectedAnalysisType == AnalysisType.AdaptGeometry &&
!HasValidShoulderEmbankmentMaterial())
{
return new[]
{
new ValidationResult(ValidationResultType.Error, LocalizationManager.GetTranslatedText(this, "NoShoulderEmbankmentMaterial"), this)
};
}
else
{
return new ValidationResult[0];
}
}
///
/// Validates the location has segment.
///
///
[Validate]
public ValidationResult[] ValidateLocationHasSegment()
{
if (Segment == null)
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "LocationHasNoSegment"),
this)
};
}
else
{
return new ValidationResult[0];
}
}
[Validate]
public ValidationResult[] ValidateDikeEmbankmentMaterialDefinedIfSurfacelineAboveSoilProfile()
{
if (IsSurfaceLineAboveSoilProfile() && !HasValidDikeEmbankmentMaterial())
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "NoDikeEmbankmentMaterialAndNeeded"),
this)
};
}
else
{
return new ValidationResult[0];
}
}
///
/// Determines whether [is pl line offset factor below shoulder crest valid].
///
///
[Validate]
public ValidationResult[] IsPlLineOffsetFactorBelowShoulderCrestValid()
{
if (!IsDesign() && ArePlLineCreationExpertKnowledgeParametersNeeded() && UsePlLineOffsetFactorBelowShoulderCrest.HasValue && UsePlLineOffsetFactorBelowShoulderCrest.Value &&
PlLineOffsetFactorBelowShoulderCrest.HasValue)
{
if (PlLineOffsetFactorBelowShoulderCrest.Value < DamGlobalConstants.PlLineOffsetFactorBelowShoulderCrestMinValue)
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "PlLineOffsetFactorBelowShoulderCrestTooSmall"),
this, "PlLineOffsetFactorBelowShoulderCrest", "AssignMinValue", (IRepairer) this)
};
}
if (PlLineOffsetFactorBelowShoulderCrest.Value > DamGlobalConstants.PlLineOffsetFactorBelowShoulderCrestMaxValue)
{
return new[]
{
new ValidationResult(ValidationResultType.Error,
LocalizationManager.GetTranslatedText(this, "PlLineOffsetFactorBelowShoulderCrestTooLarge"),
this, "PlLineOffsetFactorBelowShoulderCrest", "AssignMaxValue", (IRepairer) this)
};
}
}
return new ValidationResult[0];
}
///
/// Check if DikeEmbankmentMaterial is defined and is available as soil
///
///
private bool HasValidDikeEmbankmentMaterial()
{
return !String.IsNullOrEmpty(DikeEmbankmentMaterial) && GetDikeEmbankmentSoil() != null;
}
///
/// Check if ShoulderEmbankmentMaterial is defined and is available as soil
///
///
private bool HasValidShoulderEmbankmentMaterial()
{
return !String.IsNullOrEmpty(ShoulderEmbankmentMaterial) && GetShoulderEmbankmentSoil() != null;
}
///
/// Determine if surfaceline is higher than any of the 1D soilprofiles
///
///
private bool IsSurfaceLineAboveSoilProfile()
{
bool isSurfaceLineAboveSoilProfile = false;
if (Segment != null)
{
foreach (var soilGeometryProbability in Segment.SoilProfileProbabilities)
{
SoilProfile1D soilProfile = soilGeometryProbability.SoilProfile;
if (soilProfile != null)
{
isSurfaceLineAboveSoilProfile = isSurfaceLineAboveSoilProfile || (LocalXZSurfaceLine2.Geometry.GetMaxZ() > soilGeometryProbability.SoilProfile.TopLevel);
}
}
}
return isSurfaceLineAboveSoilProfile;
}
#endregion
#region Design parameters
[Label("Dike emb. material")]
[Description("Dike embankment material")]
[Category(AllCategory)]
[PropertyOrder(5, 1)]
public virtual string DikeEmbankmentMaterial
{
get
{
return dikeEmbankmentMaterial;
}
set
{
DataEventPublisher.BeforeChange(this, "DikeEmbankmentMaterial");
dikeEmbankmentMaterial = value;
DataEventPublisher.AfterChange(this, "DikeEmbankmentMaterial");
}
}
[Label("Shoulder emb. material")]
[Description("Shoulder embankment material")]
[Category(DesignCategory)]
[PropertyOrder(5, 2)]
public virtual string ShoulderEmbankmentMaterial
{
get
{
return shoulderEmbankmentMaterial;
}
set
{
DataEventPublisher.BeforeChange(this, "ShoulderEmbankmentMaterial");
shoulderEmbankmentMaterial = value;
DataEventPublisher.AfterChange(this, "ShoulderEmbankmentMaterial");
}
}
[Unit(UnitType.None)]
[Label("Shoulder growth slope")]
[Description("Shoulder growth slope for stability design")]
[Format("F4")]
[Category(DesignCategory)]
[PropertyOrder(5, 3)]
public virtual double StabilityShoulderGrowSlope
{
get
{
return stabilityShoulderGrowSlope;
}
set
{
DataEventPublisher.BeforeChange(this, "StabilityShoulderGrowSlope");
stabilityShoulderGrowSlope = value;
DataEventPublisher.AfterChange(this, "StabilityShoulderGrowSlope");
}
}
[Unit(UnitType.Length)]
[Label("Shoulder growth delta X")]
[Description("Shoulder growth delta X for stability design")]
[Format("F2")]
[Category(DesignCategory)]
[PropertyOrder(5, 4)]
public virtual double StabilityShoulderGrowDeltaX
{
get
{
return stabilityShoulderGrowDeltaX;
}
set
{
DataEventPublisher.BeforeChange(this, "StabilityShoulderGrowDeltaX");
stabilityShoulderGrowDeltaX = value
;
DataEventPublisher.AfterChange(this, "StabilityShoulderGrowDeltaX");
}
}
[Unit(UnitType.Length)]
[Label("Slope adaption delta X")]
[Description("Slope adaption delta X for stability design")]
[Format("F2")]
[Category(DesignCategory)]
[PropertyOrder(5, 5)]
public virtual double StabilitySlopeAdaptionDeltaX
{
get
{
return stabilitySlopeAdaptionDeltaX;
}
set
{
DataEventPublisher.BeforeChange(this, "StabilitySlopeAdaptionDeltaX");
stabilitySlopeAdaptionDeltaX = value;
DataEventPublisher.AfterChange(this, "StabilitySlopeAdaptionDeltaX");
}
}
#endregion
#region PLLine creation parameters
///
/// Gets or sets the pl line creation method.
///
///
/// The pl line creation method.
///
[Unit(UnitType.None)]
[Label("PL-Line creation")]
[Description("PL-Line creation method")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(3, 1)]
public virtual PLLineCreationMethod PLLineCreationMethod
{
get
{
return pLLineCreationMethod;
}
set
{
DataEventPublisher.BeforeChange(this, "PLLineCreationMethod");
pLLineCreationMethod = value;
DataEventPublisher.AfterChange(this, "PLLineCreationMethod");
}
}
///
/// Gets or sets the head pl 2.
///
///
/// The head pl 2.
///
[Unit(UnitType.Length)]
[Label("Head PL2")]
[Description("Head level for PL2")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 8)]
[Clearable]
public virtual double? HeadPL2
{
get
{
return headPL2;
}
set
{
DataEventPublisher.BeforeChange(this, "HeadPL2");
headPL2 = value;
DataEventPublisher.AfterChange(this, "HeadPL2");
}
}
///
/// Gets or sets the head PL3.
///
///
/// The head PL3.
///
[Unit(UnitType.Length)]
[Label("Head PL3")]
[Description("Head level for PL3")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 9)]
[Clearable]
[XmlOldName("HeadPL3")]
public virtual double? HeadPl3
{
get
{
return headPL3;
}
set
{
DataEventPublisher.BeforeChange(this, "HeadPl3");
headPL3 = value;
DataEventPublisher.AfterChange(this, "HeadPl3");
}
}
///
/// Gets or sets the head PL4.
///
///
/// The head PL4.
///
[Unit(UnitType.Length)]
[Label("Head PL4")]
[Description("Head level for PL4")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 10)]
[Clearable]
[XmlOldName("HeadPL4")]
public virtual double? HeadPl4
{
get
{
return headPL4;
}
set
{
DataEventPublisher.BeforeChange(this, "HeadPl4");
headPL4 = value;
DataEventPublisher.AfterChange(this, "HeadPl4");
}
}
///
/// Gets or sets the damping factor pl 3.
///
///
/// The damping factor pl 3.
///
[Unit(UnitType.None)]
[Label("Damping factor PL3")]
[Description("Damping factor PL3")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 11)]
[Minimum(0.0)]
[Maximum(1.0)]
public virtual double DampingFactorPL3
{
get
{
return dampingFactorPL3;
}
set
{
DataEventPublisher.BeforeChange(this, "DampingFactorPL3");
dampingFactorPL3 = value;
DataEventPublisher.AfterChange(this, "DampingFactorPL3");
}
}
///
/// Gets or sets the damping factor pl 4.
///
///
/// The damping factor pl 4.
///
[Unit(UnitType.None)]
[Label("Damping factor PL4")]
[Description("Damping factor PL4")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 12)]
[Minimum(0.0)]
[Maximum(1.0)]
public virtual double DampingFactorPL4
{
get
{
return dampingFactorPL4;
}
set
{
DataEventPublisher.BeforeChange(this, "DampingFactorPL4");
dampingFactorPL4 = value;
DataEventPublisher.AfterChange(this, "DampingFactorPL4");
}
}
///
/// Gets or sets the length of the penetration.
///
///
/// The length of the penetration.
///
[Unit(UnitType.Length)]
[Label("Penetration length")]
[Description("Penetration Length (for PL4)")]
[Format("F3")]
[Category(WaterCategory)]
[Minimum(0.0)]
[PropertyOrder(2, 13)]
public virtual double PenetrationLength
{
get
{
return penetrationLength;
}
set
{
DataEventPublisher.BeforeChange(this, "PenetrationLength");
penetrationLength = value;
DataEventPublisher.AfterChange(this, "PenetrationLength");
}
}
///
/// Gets or sets the pl line offset below dike top at river.
///
///
/// The pl line offset below dike top at river.
///
[Unit(UnitType.Length)]
[Label("PL1 below top dike (river)")]
[Description("PL1 below top dike (riverside)")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(3, 2)]
[XmlOldName("PLLineOffsetBelowDikeTopAtRiver")]
public virtual double PlLineOffsetBelowDikeTopAtRiver
{
get
{
return pLLineOffsetBelowDikeTopAtRiver;
}
set
{
DataEventPublisher.BeforeChange(this, "PlLineOffsetBelowDikeTopAtRiver");
pLLineOffsetBelowDikeTopAtRiver = value;
DataEventPublisher.AfterChange(this, "PlLineOffsetBelowDikeTopAtRiver");
}
}
///
/// Gets or sets the pl line offset below dike top at polder.
///
///
/// The pl line offset below dike top at polder.
///
[Unit(UnitType.Length)]
[Label("PL1 below top dike (polder)")]
[Description("PL1 below top dike (polderside)")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(3, 3)]
[XmlOldName("PLLineOffsetBelowDikeTopAtPolder")]
public virtual double PlLineOffsetBelowDikeTopAtPolder
{
get
{
return pLLineOffsetBelowDikeTopAtPolder;
}
set
{
DataEventPublisher.BeforeChange(this, "PlLineOffsetBelowDikeTopAtPolder");
pLLineOffsetBelowDikeTopAtPolder = value;
DataEventPublisher.AfterChange(this, "PlLineOffsetBelowDikeTopAtPolder");
}
}
///
/// Gets or sets the pl line offset below shoulder base inside.
///
///
/// The pl line offset below shoulder base inside.
///
[Unit(UnitType.Length)]
[Label("PL1 below shoulder base (polder)")]
[Description("PL1 below shoulder base (polderside)")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(3, 4)]
[XmlOldName("PLLineOffsetBelowShoulderBaseInside")]
public virtual double PlLineOffsetBelowShoulderBaseInside
{
get
{
return pLLineOffsetBelowShoulderBaseInside;
}
set
{
DataEventPublisher.BeforeChange(this, "PlLineOffsetBelowShoulderBaseInside");
pLLineOffsetBelowShoulderBaseInside = value;
DataEventPublisher.AfterChange(this, "PlLineOffsetBelowShoulderBaseInside");
}
}
///
/// Gets or sets the pl line offset below dike toe at polder.
///
///
/// The pl line offset below dike toe at polder.
///
[Unit(UnitType.Length)]
[Label("PL1 below toe of dike (polder)")]
[Description("PL1 below toe of dike (polderside)")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(3, 5)]
[XmlOldName("PLLineOffsetBelowDikeToeAtPolder")]
public virtual double PlLineOffsetBelowDikeToeAtPolder
{
get
{
return pLLineOffsetBelowDikeToeAtPolder;
}
set
{
DataEventPublisher.BeforeChange(this, "PlLineOffsetBelowDikeToeAtPolder");
pLLineOffsetBelowDikeToeAtPolder = value;
DataEventPublisher.AfterChange(this, "PlLineOffsetBelowDikeToeAtPolder");
}
}
///
/// Gets or sets the use pl line offset below dike crest middle.
///
///
/// The use pl line offset below dike crest middle.
///
[Unit(UnitType.None)]
[Category(WaterCategory)]
[Clearable]
[PropertyOrder(3, 10)]
public bool? UsePlLineOffsetBelowDikeCrestMiddle { get; set; }
///
/// Gets or sets the pl line offset below dike crest middle.
///
///
/// The pl line offset below dike crest middle.
///
[Unit(UnitType.Length)]
[Format("F2")]
[Category(WaterCategory)]
[PropertyOrder(3, 11)]
public double? PlLineOffsetBelowDikeCrestMiddle
{
get { return plLineOffsetBelowDikeCrestMiddle; }
set
{
DataEventPublisher.BeforeChange(this, x => x.PlLineOffsetBelowDikeCrestMiddle);
plLineOffsetBelowDikeCrestMiddle = value;
DataEventPublisher.AfterChange(this, x => x.PlLineOffsetBelowDikeCrestMiddle);
}
}
///
/// Gets or sets the use pl line offset factor below shoulder crest.
///
///
/// The use pl line offset factor below shoulder crest.
///
[Unit(UnitType.None)]
[Category(WaterCategory)]
[Clearable]
[PropertyOrder(3, 12)]
public bool? UsePlLineOffsetFactorBelowShoulderCrest { get; set; }
///
/// Gets or sets the pl line offset factor below shoulder crest.
///
///
/// The pl line offset factor below shoulder crest.
///
[Unit(UnitType.Fractions)]
[Format("F2")]
[Category(WaterCategory)]
[PropertyOrder(3, 13)]
public double? PlLineOffsetFactorBelowShoulderCrest
{
get { return plLineOffsetFactorBelowShoulderCrest; }
set
{
DataEventPublisher.BeforeChange(this, x => x.PlLineOffsetFactorBelowShoulderCrest);
plLineOffsetFactorBelowShoulderCrest = value;
DataEventPublisher.AfterChange(this, x => x.PlLineOffsetFactorBelowShoulderCrest);
}
}
//
/// Gets or sets the intrusion vertical water pressure.
///
///
/// The intrusion vertical water pressure.
///
[Category(WaterCategory)]
[PropertyOrder(3, 18)]
public IntrusionVerticalWaterPressureType? IntrusionVerticalWaterPressure
{
get { return intrusionVerticalWaterPressure; }
set
{
DataEventPublisher.BeforeChange(this, x => x.IntrusionVerticalWaterPressure);
intrusionVerticalWaterPressure = value;
DataEventPublisher.AfterChange(this, x => x.IntrusionVerticalWaterPressure);
}
}
#endregion
#region Waterlevels
[Unit(UnitType.Length)]
[Label("Polder level")]
[Description("Water level in polder")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 4)]
public virtual double PolderLevel
{
get
{
return polderLevel;
}
set
{
DataEventPublisher.BeforeChange(this, "PolderLevel");
polderLevel = value;
DataEventPublisher.AfterChange(this, "PolderLevel");
}
}
[Unit(UnitType.Length)]
[Label("DikeTableHeight")]
[Description("Dike table height")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 14)]
[Clearable]
public virtual double? DikeTableHeight
{
get
{
return dikeTableHeight;
}
set
{
DataEventPublisher.BeforeChange(this, "DikeTableHeight");
dikeTableHeight = value;
DataEventPublisher.AfterChange(this, "DikeTableHeight");
}
}
[Unit(UnitType.Length)]
[Label("WaterHeight")]
[Description("Water height")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 15)]
[Clearable]
public virtual double? WaterHeight
{
get
{
return waterHeight;
}
set
{
DataEventPublisher.BeforeChange(this, "WaterHeight");
waterHeight = value;
DataEventPublisher.AfterChange(this, "WaterHeight");
}
}
[Unit(UnitType.Length)]
[Label("WaterHeightLow")]
[Description("Water height low")]
[Format("F3")]
[Category(WaterCategory)]
[PropertyOrder(2, 16)]
[Clearable]
public virtual double? WaterHeightLow
{
get
{
return waterHeightLow;
}
set
{
DataEventPublisher.BeforeChange(this, "WaterHeightLow");
waterHeightLow = value;
DataEventPublisher.AfterChange(this, "WaterHeightLow");
}
}
#endregion
///
/// Sets the default values
///
public void SetDefaultValues()
{
zoneAreaRestSlopeCrestWidth = 3.0;
}
///
/// Assemble a list of key/value pairs with the relevant parameters for the location
///
///
public Dictionary GetParametersAsNameValuePairs()
{
var numberFormatInfo = new NumberFormatInfo();
numberFormatInfo.NumberDecimalSeparator = ".";
var nameValuePairs = new Dictionary();
nameValuePairs.Add(LocationParameterNames.DikeRingId, DikeRingId);
nameValuePairs.Add(LocationParameterNames.SurfaceLineId, SurfaceLineId);
nameValuePairs.Add(LocationParameterNames.Description, Description);
nameValuePairs.Add(LocationParameterNames.XRd, XRd.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.YRd, YRd.ToString(numberFormatInfo));
if (Segment != null)
{
nameValuePairs.Add(LocationParameterNames.SegmentId, Segment.Name);
}
else
{
nameValuePairs.Add(LocationParameterNames.SegmentId, SegmentId);
}
if (SurfaceLine2 != null)
{
nameValuePairs[LocationParameterNames.SurfaceLineId] = SurfaceLine2.Name;
}
if (PL1Line != null)
{
nameValuePairs.Add(LocationParameterNames.PL1LineId, PL1Line.Name);
}
nameValuePairs.Add(LocationParameterNames.PolderLevel, PolderLevel.ToString(numberFormatInfo));
if (HeadPL2.HasValue)
{
nameValuePairs.Add(LocationParameterNames.HeadPL2, HeadPL2.Value.ToString(numberFormatInfo));
}
if (HeadPl3.HasValue)
{
nameValuePairs.Add(LocationParameterNames.HeadPL3, HeadPl3.Value.ToString(numberFormatInfo));
}
if (HeadPl4.HasValue)
{
nameValuePairs.Add(LocationParameterNames.HeadPL4, HeadPl4.Value.ToString(numberFormatInfo));
}
nameValuePairs.Add(LocationParameterNames.GrassQuality, GrassQuality.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.Direction, Direction.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.XSoilGeometry2DOrigin, XSoilGeometry2DOrigin.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.DikeEmbankmentMaterial, DikeEmbankmentMaterial);
nameValuePairs.Add(LocationParameterNames.ShoulderEmbankmentMaterial, ShoulderEmbankmentMaterial);
nameValuePairs.Add(LocationParameterNames.DampingFactorPL3, DampingFactorPL3.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.DampingFactorPL4, DampingFactorPL4.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.PenetrationLength, PenetrationLength.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.PLLineCreationMethod, PLLineCreationMethod.ToString());
nameValuePairs.Add(LocationParameterNames.PLLineOffsetBelowDikeTopAtRiver, PlLineOffsetBelowDikeTopAtRiver.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.PLLineOffsetBelowDikeTopAtPolder, PlLineOffsetBelowDikeTopAtPolder.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.PLLineOffsetBelowShoulderBaseInside, PlLineOffsetBelowShoulderBaseInside.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.PLLineOffsetBelowDikeToeAtPolder, PlLineOffsetBelowDikeToeAtPolder.ToString(numberFormatInfo));
if (PlLineOffsetBelowDikeCrestMiddle.HasValue)
{
nameValuePairs.Add(LocationParameterNames.PlLineOffsetBelowDikeCrestMiddle,
PlLineOffsetBelowDikeCrestMiddle.Value.ToString(numberFormatInfo));
}
if (PlLineOffsetFactorBelowShoulderCrest.HasValue)
{
nameValuePairs.Add(LocationParameterNames.PlLineOffsetFactorBelowShoulderCrest,
PlLineOffsetFactorBelowShoulderCrest.Value.ToString(numberFormatInfo));
}
if (UsePlLineOffsetBelowDikeCrestMiddle.HasValue)
{
nameValuePairs.Add(LocationParameterNames.UsePlLineOffsetBelowDikeCrestMiddle,
UsePlLineOffsetBelowDikeCrestMiddle.Value.ToString());
}
if (UsePlLineOffsetFactorBelowShoulderCrest.HasValue)
{
nameValuePairs.Add(LocationParameterNames.UsePlLineOffsetFactorBelowShoulderCrest,
UsePlLineOffsetFactorBelowShoulderCrest.Value.ToString());
}
if (IntrusionVerticalWaterPressure.HasValue)
{
nameValuePairs.Add(LocationParameterNames.IntrusionVerticalWaterPressure,
IntrusionVerticalWaterPressure.Value.ToString());
}
nameValuePairs.Add(LocationParameterNames.StabilityShoulderGrowSlope, StabilityShoulderGrowSlope.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.StabilityShoulderGrowDeltaX, StabilityShoulderGrowDeltaX.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.StabilitySlopeAdaptionDeltaX, StabilitySlopeAdaptionDeltaX.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.IsUseOriginalPLLineAssignments, IsUseOriginalPLLineAssignments.ToString());
nameValuePairs.Add(LocationParameterNames.TrafficLoad, TrafficLoad.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.TL_DegreeOfConsolidation, TL_DegreeOfConsolidation.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.MinimalCircleDepth, MinimalCircleDepth.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.LevelReductionInside, LevelReductionInside.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.LevelReductionOutside, LevelReductionOutside.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.LayerHeightDistribution, LayerHeightDistribution.ToString());
nameValuePairs.Add(LocationParameterNames.LayerHeightDeviation, LayerHeightDeviation.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.DistanceToEntryPoint, DistanceToEntryPoint.ToString(numberFormatInfo));
if (ModelFactors.RequiredSafetyFactorStabilityInnerSlope != null)
{
nameValuePairs.Add(LocationParameterNames.RequiredSafetyFactorStabilityInnerSlope, ModelFactors.RequiredSafetyFactorStabilityInnerSlope.Value.ToString(numberFormatInfo));
}
if (ModelFactors.RequiredSafetyFactorStabilityOuterSlope != null)
{
nameValuePairs.Add(LocationParameterNames.RequiredSafetyFactorStabilityOuterSlope, ModelFactors.RequiredSafetyFactorStabilityOuterSlope.Value.ToString(numberFormatInfo));
}
if (ModelFactors.RequiredSafetyFactorPiping != null)
{
nameValuePairs.Add(LocationParameterNames.RequiredSafetyFactorPiping, ModelFactors.RequiredSafetyFactorPiping.Value.ToString(numberFormatInfo));
}
nameValuePairs.Add(LocationParameterNames.StabilityZoneType, StabilityZoneType.ToString());
nameValuePairs.Add(LocationParameterNames.ForbiddenZoneFactor, ForbiddenZoneFactor.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.ZoneAreaRestSlopeCrestWidth, ZoneAreaRestSlopeCrestWidth.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.SlopeDampingPiezometricHeightPolderSide, SlopeDampingPiezometricHeightPolderSide.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.StabilityDesignMethod, StabilityDesignMethod.ToString());
nameValuePairs.Add(LocationParameterNames.SlopeAdaptionStartCotangent, SlopeAdaptionStartCotangent.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.SlopeAdaptionEndCotangent, SlopeAdaptionEndCotangent.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.SlopeAdaptionStepCotangent, SlopeAdaptionStepCotangent.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewDepthDitch, NewDepthDitch.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewDikeSlopeInside, NewDikeSlopeInside.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewDikeSlopeOutside, NewDikeSlopeOutside.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewDikeTopWidth, NewDikeTopWidth.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewMaxHeightShoulderAsFraction, NewMaxHeightShoulderAsFraction.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewMinDistanceDikeToeStartDitch, NewMinDistanceDikeToeStartDitch.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewShoulderBaseSlope, NewShoulderBaseSlope.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewShoulderTopSlope, NewShoulderTopSlope.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewSlopeAngleDitch, NewSlopeAngleDitch.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.NewWidthDitchBottom, NewWidthDitchBottom.ToString(numberFormatInfo));
nameValuePairs.Add(LocationParameterNames.UseNewDikeSlopeInside, UseNewDikeSlopeInside.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewDikeSlopeOutside, UseNewDikeSlopeOutside.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewDikeTopWidth, UseNewDikeTopWidth.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewDitchDefinition, UseNewDitchDefinition.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewMaxHeightShoulderAsFraction, UseNewMaxHeightShoulderAsFraction.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewMinDistanceDikeToeStartDitch, UseNewMinDistanceDikeToeStartDitch.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewShoulderBaseSlope, UseNewShoulderBaseSlope.ToString());
nameValuePairs.Add(LocationParameterNames.UseNewShoulderTopSlope, UseNewShoulderTopSlope.ToString());
if (DikeTableHeight.HasValue)
{
nameValuePairs.Add(LocationParameterNames.DikeTableHeight, DikeTableHeight.Value.ToString(numberFormatInfo));
}
if (WaterHeight.HasValue)
{
nameValuePairs.Add(LocationParameterNames.WaterHeight, WaterHeight.Value.ToString(numberFormatInfo));
}
if (WaterHeightLow.HasValue)
{
nameValuePairs.Add(LocationParameterNames.WaterHeightLow, WaterHeightLow.Value.ToString(numberFormatInfo));
}
return nameValuePairs;
}
public void AddNewSensorData()
{
var factory = new SensorFactory();
SensorLocation = factory.CreateSensorLocation(this);
}
[Validate]
public ValidationResult[] AscendingLocalXZSurfaceLine()
{
if (LocalXZSurfaceLine2 != null)
{
return new SurfaceLine2Validator().ValidateCharacteristicPointsAreOrdered(LocalXZSurfaceLine2).ToArray();
}
else
{
return new ValidationResult[0];
}
}
///
/// Gets the dike embankment soil.
///
///
public Soil GetDikeEmbankmentSoil()
{
if (String.IsNullOrEmpty(SoildatabaseName) || String.IsNullOrEmpty(DikeEmbankmentMaterial))
{
return null;
}
else
{
return SoilList.GetSoilByName(DikeEmbankmentMaterial);
}
}
///
/// Gets the shoulder embankment soil.
///
///
public Soil GetShoulderEmbankmentSoil()
{
if (String.IsNullOrEmpty(SoildatabaseName) || String.IsNullOrEmpty(ShoulderEmbankmentMaterial))
{
return null;
}
else
{
return SoilList.GetSoilByName(ShoulderEmbankmentMaterial);
}
}
///
/// Gets the most probable profile. If there are no elements in the it returns null
/// and leave the handling over to the caller
///
/// The soil profile
public SoilProfile1D GetMostProbableProfile(FailureMechanismSystemType? segmentFailureMechanismType)
{
if (Segment == null)
{
throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
}
return Segment.GetMostProbableProfile(segmentFailureMechanismType);
}
///
/// Gets the most probable profile. If there are no elements in the it returns null
/// and leave the handling over to the caller
///
/// The soil profile
public string GetMostProbableGeometry2DName(FailureMechanismSystemType? segmentFailureMechanismType)
{
if (Segment == null)
{
throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
}
return Segment.GetMostProbableGeometry2DName(segmentFailureMechanismType);
}
///
/// Gets the soil profile probability.
///
/// The soil profile.
/// Type of the segment failure mechanism.
///
///
public double? GetSoilProfileProbability(SoilProfile1D soilProfile, FailureMechanismSystemType? segmentFailureMechanismType)
{
if (Segment == null)
{
throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
}
return Segment.GetSoilProfileProbability(soilProfile, segmentFailureMechanismType);
}
///
/// Gets the soil geometry2 d probability.
///
/// Name of the soil geometry2 d.
/// Type of the segment failure mechanism.
///
///
public double? GetSoilGeometry2DProbability(string soilGeometry2DName, FailureMechanismSystemType? segmentFailureMechanismType)
{
if (Segment == null)
{
throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
}
return Segment.GetSoilGeometry2DProbability(soilGeometry2DName, segmentFailureMechanismType);
}
///
/// Gets a sorted list of soil geometry probabilities for a certain failure mechanism type
///
/// The failure mechanism type
/// List of geometry probabilities
public List GetGeometryProbabilities(FailureMechanismSystemType failureMechanismType)
{
var geometryProbabilities = new List();
if (Segment != null)
{
foreach (var existingGeometryProbability in Segment.SoilProfileProbabilities)
{
if (existingGeometryProbability.SegmentFailureMechanismType.HasValue && existingGeometryProbability.SegmentFailureMechanismType.Value == failureMechanismType)
{
geometryProbabilities.Add(existingGeometryProbability);
}
}
geometryProbabilities.Sort();
}
return geometryProbabilities;
}
///
/// Gets the combination of the surface line and soil profile for a given failure mechanism and index
///
/// Failure mechanism type
/// The index indicates the ranking in probability
/// The probability of the soil surface profile
/// The soil surface profile
public SoilSurfaceProfile GetSoilSurfaceProfile(FailureMechanismSystemType failureMechanismType, int index, out double probability)
{
List soilGeometryProbabilities = GetGeometryProbabilities(failureMechanismType);
SoilGeometryProbability soilGeometryProbability = index < soilGeometryProbabilities.Count ? soilGeometryProbabilities[index] : null;
SoilProfile1D originalProfile = soilGeometryProbability != null ? soilGeometryProbability.SoilProfile : null;
probability = soilGeometryProbability != null ? soilGeometryProbability.Probability : 0;
if (soilSurfaceProfile == null || originalProfile == null ||
!(soilSurfaceProfile.SoilProfile.Name == originalProfile.Name &&
soilSurfaceProfile.SoilProfile.LayerCount == originalProfile.LayerCount) ||
!(soilSurfaceProfile.SurfaceLine2.Name == LocalXZSurfaceLine2.Name &&
soilSurfaceProfile.SurfaceLine2.CharacteristicPoints.Count == LocalXZSurfaceLine2.CharacteristicPoints.Count))
{
Soil dikeSoil = SoilList.GetSoilByName(DikeEmbankmentMaterial);
if (soilSurfaceProfile == null)
{
soilSurfaceProfile = new SoilSurfaceProfile();
}
// Do not assign the orginal soilprofile, because it will be changed in the class SoilSurfaceProfile
SoilProfile1D soilProfile1D;
if (originalProfile == null)
{
soilProfile1D = new SoilProfile1D(SurfaceLine2.Geometry.GetMaxZ(), -10, dikeSoil);
}
else
{
soilProfile1D = new SoilProfile1D();
soilProfile1D.Assign(originalProfile);
}
soilSurfaceProfile.SoilProfile = soilProfile1D;
soilSurfaceProfile.SurfaceLine2 = LocalXZSurfaceLine2;
soilSurfaceProfile.DikeEmbankmentMaterial = GetDikeEmbankmentSoil();
foreach (SoilLayer2D layer in soilSurfaceProfile.Surfaces)
{
if (layer.Soil == null)
{
layer.Soil = dikeSoil;
}
}
}
return soilSurfaceProfile;
}
public void AlignBoundaryPointsOfPL1LineWithAdaptedSurfaceLine(SurfaceLine2 adaptedSurfaceLine)
{
if ((LocalXZPL1Line != null) && (LocalXZPL1Line.Points.Count > 1))
{
GeometryPoint lastPointPL1Line = LocalXZPL1Line.Points.Last();
GeometryPoint lastPointSurfaceLine = adaptedSurfaceLine.Geometry.Points.Last();
lastPointPL1Line.X = lastPointSurfaceLine.X;
GeometryPoint firstPointPL1Line = LocalXZPL1Line.Points.First();
GeometryPoint firstPointSurfaceLine = adaptedSurfaceLine.Geometry.Points.First();
firstPointPL1Line.X = firstPointSurfaceLine.X;
}
}
public void SetParameterFromNameValuePair(string parameterName, string parameterValue)
{
var numberFormatInfo = new NumberFormatInfo();
numberFormatInfo.NumberDecimalSeparator = ".";
if (parameterName.Equals(LocationParameterNames.DikeRingId))
{
DikeRingId = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.Description))
{
Description = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.XRd))
{
XRd = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.YRd))
{
YRd = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.SegmentId))
{
SegmentId = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.SurfaceLineId))
{
SurfaceLineId = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.PolderLevel))
{
PolderLevel = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.HeadPL2))
{
HeadPL2 = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.HeadPL3))
{
HeadPl3 = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.HeadPL4))
{
HeadPl4 = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.GrassQuality))
{
GrassQuality = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.Direction))
{
Direction = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.XSoilGeometry2DOrigin))
{
XSoilGeometry2DOrigin = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.DikeEmbankmentMaterial))
{
DikeEmbankmentMaterial = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.ShoulderEmbankmentMaterial))
{
ShoulderEmbankmentMaterial = parameterValue;
}
if (parameterName.Equals(LocationParameterNames.DampingFactorPL3))
{
DampingFactorPL3 = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.DampingFactorPL4))
{
DampingFactorPL4 = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PenetrationLength))
{
PenetrationLength = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PLLineCreationMethod))
{
PLLineCreationMethod = (PLLineCreationMethod) Enum.Parse(typeof(PLLineCreationMethod), parameterValue);
}
if (parameterName.Equals(LocationParameterNames.PLLineOffsetBelowDikeTopAtRiver))
{
PlLineOffsetBelowDikeTopAtRiver = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PLLineOffsetBelowDikeTopAtPolder))
{
PlLineOffsetBelowDikeTopAtPolder = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PLLineOffsetBelowShoulderBaseInside))
{
PlLineOffsetBelowShoulderBaseInside = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PLLineOffsetBelowDikeToeAtPolder))
{
PlLineOffsetBelowDikeToeAtPolder = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PlLineOffsetBelowDikeCrestMiddle))
{
PlLineOffsetBelowDikeCrestMiddle = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.PlLineOffsetFactorBelowShoulderCrest))
{
PlLineOffsetFactorBelowShoulderCrest = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UsePlLineOffsetBelowDikeCrestMiddle))
{
UsePlLineOffsetBelowDikeCrestMiddle = Convert.ToBoolean(parameterValue);
}
if (parameterName.Equals(LocationParameterNames.UsePlLineOffsetFactorBelowShoulderCrest))
{
UsePlLineOffsetFactorBelowShoulderCrest = Convert.ToBoolean(parameterValue);
}
if (parameterName.Equals(LocationParameterNames.IntrusionVerticalWaterPressure))
{
IntrusionVerticalWaterPressure =
(IntrusionVerticalWaterPressureType)
Enum.Parse(typeof (IntrusionVerticalWaterPressureType), parameterValue);
}
if (parameterName.Equals(LocationParameterNames.StabilityShoulderGrowSlope))
{
StabilityShoulderGrowSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.StabilityShoulderGrowDeltaX))
{
StabilityShoulderGrowDeltaX = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.StabilitySlopeAdaptionDeltaX))
{
StabilitySlopeAdaptionDeltaX = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.IsUseOriginalPLLineAssignments))
{
IsUseOriginalPLLineAssignments = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.TrafficLoad))
{
TrafficLoad = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.TL_DegreeOfConsolidation))
{
TL_DegreeOfConsolidation = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.MinimalCircleDepth))
{
MinimalCircleDepth = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.LevelReductionInside))
{
LevelReductionInside = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.LevelReductionOutside))
{
LevelReductionOutside = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.LayerHeightDistribution))
{
LayerHeightDistribution = (DistributionType) Enum.Parse(typeof(DistributionType), parameterValue);
}
if (parameterName.Equals(LocationParameterNames.LayerHeightDeviation))
{
LayerHeightDeviation = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.DistanceToEntryPoint))
{
DistanceToEntryPoint = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.RequiredSafetyFactorStabilityInnerSlope))
{
ModelFactors.RequiredSafetyFactorStabilityInnerSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.RequiredSafetyFactorStabilityOuterSlope))
{
ModelFactors.RequiredSafetyFactorStabilityOuterSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.RequiredSafetyFactorPiping))
{
ModelFactors.RequiredSafetyFactorPiping = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.StabilityZoneType))
{
StabilityZoneType = (MStabZonesType) Enum.Parse(typeof(MStabZonesType), parameterValue);
}
if (parameterName.Equals(LocationParameterNames.ForbiddenZoneFactor))
{
ForbiddenZoneFactor = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.ZoneAreaRestSlopeCrestWidth))
{
ZoneAreaRestSlopeCrestWidth = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.SlopeDampingPiezometricHeightPolderSide))
{
SlopeDampingPiezometricHeightPolderSide = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.StabilityDesignMethod))
{
StabilityDesignMethod = (StabilityDesignMethod) Enum.Parse(typeof(StabilityDesignMethod), parameterValue);
}
if (parameterName.Equals(LocationParameterNames.SlopeAdaptionStartCotangent))
{
SlopeAdaptionStartCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.SlopeAdaptionEndCotangent))
{
SlopeAdaptionEndCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.SlopeAdaptionStepCotangent))
{
SlopeAdaptionStepCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewDepthDitch))
{
NewDepthDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewDikeSlopeInside))
{
NewDikeSlopeInside = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewDikeSlopeOutside))
{
NewDikeSlopeOutside = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewDikeTopWidth))
{
NewDikeTopWidth = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewMaxHeightShoulderAsFraction))
{
NewMaxHeightShoulderAsFraction = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewMinDistanceDikeToeStartDitch))
{
NewMinDistanceDikeToeStartDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewShoulderBaseSlope))
{
NewShoulderBaseSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewShoulderTopSlope))
{
NewShoulderTopSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewSlopeAngleDitch))
{
NewSlopeAngleDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.NewWidthDitchBottom))
{
NewWidthDitchBottom = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewDikeSlopeInside))
{
UseNewDikeSlopeInside = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewDikeSlopeOutside))
{
UseNewDikeSlopeOutside = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewDikeTopWidth))
{
UseNewDikeTopWidth = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewDitchDefinition))
{
UseNewDitchDefinition = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewMaxHeightShoulderAsFraction))
{
UseNewMaxHeightShoulderAsFraction = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewMinDistanceDikeToeStartDitch))
{
UseNewMinDistanceDikeToeStartDitch = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewShoulderBaseSlope))
{
UseNewShoulderBaseSlope = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.UseNewShoulderTopSlope))
{
UseNewShoulderTopSlope = Convert.ToBoolean(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.DikeTableHeight))
{
DikeTableHeight = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.WaterHeight))
{
WaterHeight = Convert.ToDouble(parameterValue, numberFormatInfo);
}
if (parameterName.Equals(LocationParameterNames.WaterHeightLow))
{
WaterHeightLow = Convert.ToDouble(parameterValue, numberFormatInfo);
}
}
#region IVisibleEnabled Members
public bool IsEnabled(string property)
{
return true;
}
public bool IsVisible(string property)
{
var arePlLineCreationExpertKnowledgeParametersNeeded = ArePlLineCreationExpertKnowledgeParametersNeeded();
var isDesign = IsDesign();
// TODO: These string literals below should be replaced with the constants defined in LocationParameterNames
switch (property)
{
case "ShoulderEmbankmentMaterial":
return isDesign;
case "StabilityShoulderGrowSlope":
return isDesign;
case "StabilityShoulderGrowDeltaX":
return isDesign;
case "StabilitySlopeAdaptionDeltaX":
return isDesign;
case "PlLineOffsetBelowDikeToeAtPolder":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "PlLineOffsetBelowDikeTopAtPolder":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "PlLineOffsetBelowDikeTopAtRiver":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "PlLineOffsetBelowShoulderBaseInside":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "PlLineOffsetBelowDikeCrestMiddle":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "PlLineOffsetFactorBelowShoulderCrest":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "UsePlLineOffsetBelowDikeCrestMiddle":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "UsePlLineOffsetFactorBelowShoulderCrest":
return !isDesign && arePlLineCreationExpertKnowledgeParametersNeeded;
case "IntrusionVerticalWaterPressure": return true;
case "RedesignDikeHeight":
return isDesign;
case "RedesignDikeShoulder":
return isDesign;
// these will always be shown
case "StabilityDesignMethod":
return true;
case "SlopeAdaptionStartCotangent":
return true;
case "SlopeAdaptionEndCotangent":
return true;
case "SlopeAdaptionStepCotangent":
return true;
case "Name":
return true;
case "XRd":
return true;
case "YRd":
return true;
case "DikeRingId":
return true;
case "SegmentId":
return true;
case "Description":
return true;
case "TrafficLoad":
return true;
case "TL_DegreeOfConsolidation":
return true;
case "PolderLevel":
return true;
case "HeadPL2":
return true;
case "DampingFactorPL3":
return true;
case "DampingFactorPL4":
return true;
case "PenetrationLength":
return true;
case "SlopeDampingPiezometricHeightPolderSide":
return true;
case "PLLineCreationMethod":
return true;
case "MinimalCircleDepth":
return true;
case "StabilityZoneType":
return true;
case "DikeEmbankmentMaterial":
return true;
case "DistanceToEntryPoint":
return false;
case "LevelReductionInside":
return false;
case "LevelReductionOutside":
return false;
case "LayerHeightDistribution":
return false;
case "LayerHeightDeviation":
return false;
case "ModelFactorRequiredSafetyFactorPiping":
return false; // Probably obsolete, because it is defined in the scenario
case "ModelFactorRequiredSafetyFactorStabilityInnerSlope":
return false; // Probably obsolete, because it is defined in the scenario
case "ModelFactorRequiredSafetyFactorStabilityOuterSlope":
return false; // Probably obsolete, because it is defined in the scenario
case "HasSensorData":
return false;
case "XRdDikeLine":
return false;
case "IsUseOriginalPLLineAssignments":
return false;
// The following design parameters are only visible for design option and when that design option does not involve the special Rijnland option.
case "NewDikeTopWidth":
case "UseNewDikeTopWidth":
case "NewDikeSlopeInside":
case "UseNewDikeSlopeInside":
case "NewDikeSlopeOutside":
case "UseNewDikeSlopeOutside":
case "NewShoulderTopSlope":
case "UseNewShoulderTopSlope":
case "NewShoulderBaseSlope":
case "UseNewShoulderBaseSlope":
case "NewMaxHeightShoulderAsFraction":
case "UseNewMaxHeightShoulderAsFraction":
case "NewMinDistanceDikeToeStartDitch":
case "UseNewMinDistanceDikeToeStartDitch":
case "UseNewDitchDefinition":
case "NewWidthDitchBottom":
case "NewDepthDitch":
case "NewSlopeAngleDitch":
return isDesign && StabilityDesignMethod != StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption;
// Next will only be shown if not Design as then they are part of the scenarios
case "HeadPl3":
return !isDesign;
case "HeadPl4":
return !isDesign;
case "DikeTableHeight":
return !isDesign;
case "WaterHeight":
return !isDesign;
case "WaterHeightLow":
return !isDesign;
default:
return true;
}
}
private bool IsDesign()
{
bool isDesign = (DamProjectType == DamProjectType.Design);
return isDesign;
}
private bool ArePlLineCreationExpertKnowledgeParametersNeeded()
{
bool arePlLineCreationExpertKnowledgeParametersNeeded = PLLineCreationMethod ==
PLLineCreationMethod.ExpertKnowledgeRRD ||
PLLineCreationMethod ==
PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD;
return arePlLineCreationExpertKnowledgeParametersNeeded;
}
#endregion
public override string ToString()
{
return Name;
/* StringBuilder sb = new StringBuilder();
sb.Append(this.Name);
if (this.Segment != null)
sb.Append(String.Format(" @ Segment {0}", this.Segment.Name));
if (this.SurfaceLine != null)
sb.Append(String.Format(" with {0})", this.SurfaceLine.Name));
sb.Append(String.Format(" | X={0}, Y={1}, PolderLevel={2:F2}, HeadPL2={3:F2}, HeadPl3={4:F2}", this.XRd, this.YRd, this.PolderLevel, this.HeadPL2, this.HeadPl3));
return sb.ToString();*/
}
public void Dispose()
{
if (surfaceLine != null)
{
surfaceLine.Dispose();
}
if (LocalXZSurfaceLine2 != null)
{
LocalXZSurfaceLine2.Dispose();
}
}
public ICollection GetDomain(string property)
{
switch (property)
{
case "PLLineCreationMethod":
return new[]
{
PLLineCreationMethod.ExpertKnowledgeRRD,
PLLineCreationMethod.ExpertKnowledgeLinearInDike,
};
case "IntrusionVerticalWaterPressure":
return new[]
{
this.Translate("Standard"),
this.Translate("Linear"),
this.Translate("FullHydroStatic"),
this.Translate("HydroStatic"),
this.Translate("SemiTimeDependent")
};
default:
return null;
}
}
public void Repair(object subject, string property, string id)
{
if (subject is Location)
{
if (id == "AssignMinValue" && property == "NewDikeTopWidth")
{
NewDikeTopWidth = newDikeTopWidthMinValue;
}
if (id == "AssignMinValue" && property == "NewDikeSlopeInside")
{
NewDikeSlopeInside = newDikeSlopeInsideMinValue;
}
if (id == "AssignMinValue" && property == "NewDikeSlopeOutside")
{
NewDikeSlopeOutside = newDikeSlopeOutsideMinValue;
}
if (id == "AssignMinValue" && property == "PlLineOffsetFactorBelowShoulderCrest")
{
PlLineOffsetFactorBelowShoulderCrest = DamGlobalConstants.PlLineOffsetFactorBelowShoulderCrestMinValue;
}
if (id == "AssignMaxValue" && property == "PlLineOffsetFactorBelowShoulderCrest")
{
PlLineOffsetFactorBelowShoulderCrest = DamGlobalConstants.PlLineOffsetFactorBelowShoulderCrestMaxValue;
}
if (id == "AssignMinValue" && property == "PenetrationLength")
{
PenetrationLength = penetrationLenghtMinValue;
}
}
}
public string GetRepairDescription(object subject, string property, string id)
{
if (id == "ZoneTypeSafety" && property == "StabilityZoneType")
{
return LocalizationManager.GetTranslatedText(this, "NoRequiredSafetyForZonesRepair");
}
if (id == "AssignMinValue")
{
return LocalizationManager.GetTranslatedText(this, "AssignMinValue");
}
if (id == "AssignMaxValue")
{
return LocalizationManager.GetTranslatedText(this, "AssignMaxValue");
}
return "";
}
#region Backwards compatibility
private SurfaceLine surfaceLine;
[Obsolete("Do not use this property; Only exists for backwards compatibility.", true)]
[Browsable(false)]
public virtual SurfaceLine LocalXZSurfaceLine
{
get
{
return null;
}
set
{
// Convert persisted 'old style surfaceline' into the new format, and discard the old one.
LocalXZSurfaceLine2 = new OldSurfaceLineToNewConverter().Convert(value);
value.Dispose();
}
}
///
/// Gets or sets the surface line
///
/// Aggregate relationship from .
[Browsable(false)]
[Obsolete("Do not use this property; Exists only for backwards compatibility.", true)]
public virtual SurfaceLine SurfaceLine
{
get
{
return surfaceLine;
}
set
{
surfaceLine = value;
}
}
///
/// Allows this location instance to update its
/// property if an old-style surfaceline was persisted.
///
/// The potential replacement candidate for a persisted
/// old-style surfaceline.
public void SetNewSurfaceLineIfMatchesWithOldPersistedSurfaceLine(SurfaceLine2 otherSurfaceline)
{
if (surfaceLine != null && Equals(otherSurfaceline.Name, surfaceLine.Name))
{
SurfaceLine2 = otherSurfaceline;
surfaceLine.Dispose();
surfaceLine = null;
}
}
#endregion
}
}