// Copyright (C) Stichting Deltares 2021. 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.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Xml.Serialization;
using Deltares.Geographic;
using Deltares.Geometry;
using Deltares.Standard;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Units;
using System;
using Deltares.Geotechnics.Soils;
using Deltares.Geotechnics.SurfaceLines;
using Deltares.Standard.Attributes;
using System.Collections.Generic;
using Deltares.Standard.IO;
namespace Deltares.Dam.Data
{
///
/// Class for presenting Design results.
///
///
///
///
public class CsvExportData : IVisibleEnabled, IGeographicPoint
{
private string baseFileName;
private string scenarioName;
private string locationName;
private int locationScenarioCount;
private double xRd;
private double yRd;
private string profileName;
private string calculationSubDir;
private string dikeName;
private AnalysisType analysisType;
private DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification;
private Scenario scenario;
private SoilProfile1D soilProfile;
private string soilGeometry2DName;
private double? localPipingExitPointX;
private double? safetyFactorStability;
private double? upliftFactor;
private double? heaveFactor;
private double? blighPipingFactor;
private double? blighHCritical;
private double? sellmeijer2ForcesPipingFactor;
private double? sellmeijer2ForcesHCritical;
private double? sellmeijer4ForcesPipingFactor;
private double? sellmeijer4ForcesHCritical;
private double? sellmeijerPipingFactor;
private double? sellmeijerHCritical;
private double? wti2017BackwardErosionSafetyFactor;
private double? wti2017BackwardErosionHcritical;
private double? wti2017UpliftSafetyFactor;
private double? wti2017UpliftHcritical;
private double? wti2017BackwardErosionDeltaPhiC;
private double? wti2017BackwardErosionDeltaPhiReduced;
private double? wti2017UpliftDeltaPhiC;
private double? wti2017HeaveSafetyFactor;
private double? wti2017HeaveHcritical;
private double? wti2017Gradient;
private double? wti2017SafetyFactorOverall;
private double? wti2017HcriticalOverall;
private double? wti2017EffectiveStress;
private double? wti2017CCreep;
private bool? isUplift;
private double? pl3MinUplift;
private double? pl3HeadAdjusted;
private double? pl3LocalLocationXMinUplift;
private double? pl4MinUplift;
private double? pl4HeadAdjusted;
private double? pl4LocalLocationXMinUplift;
private CalculationResult calculationResult = CalculationResult.NoRun;
private string resultMessage = "";
private int numberOfIterations;
private MStabModelType? stabilityModel;
private double? activeCenterPointX;
private double? activeCenterPointZ;
private double? activeCenterPointRadius;
private double? passiveCenterPointX;
private double? passiveCenterPointZ;
private double? passiveCenterPointRadius;
private ResultEvaluation resultEvaluation = ResultEvaluation.NotEvaluated;
private string notes = "";
// redesigned LOCAL surfaceline (initialized with original local surfaceline)
private SurfaceLine2 redesignedSurfaceLine;
// redesigned Global surfaceline in use for this result (either piping or stability)
private SurfaceLine2 redesignedSurfaceLineGlobal;
private CsvExportSoilProfileWithSurfaceLine soilProfileWithSurfaceLine;
private double? stabilityToeAtPolderX;
private double? stabilityToeAtPolderY;
private double? stabilityShoulderHeight;
private double? zone1EntryPointX;
private double? zone1EntryPointY;
private double? zone1ExitPointX;
private double? zone1ExitPointY;
private double? zone2EntryPointX;
private double? zone2EntryPointY;
private double? zone2ExitPointX;
private double? zone2ExitPointY;
private double? dikeLength;
private double? dikeToeAtRiverXrd;
private double? dikeToeAtRiverYrd;
private double? dikeToeAtRiverZrd;
private double? dikeTopAtRiverXrd;
private double? dikeTopAtRiverYrd;
private double? dikeTopAtRiverZrd;
private double? dikeTopAtPolderXrd;
private double? dikeTopAtPolderYrd;
private double? dikeTopAtPolderZrd;
private double? dikeToeAtPolderXrd;
private double? dikeToeAtPolderYrd;
private double? dikeToeAtPolderZrd;
private double? pipingToeAtPolderX;
private double? pipingToeAtPolderZ;
private double? pipingShoulderHeight;
private double? pl3LocationXMinUplift;
private double? pl3LocationYMinUplift;
private double? pl4LocationXMinUplift;
private double? pl4LocationYMinUplift;
private double? pipingEntryPointX;
private double? pipingEntryPointY;
private double? pipingExitPointX;
private double? pipingExitPointY;
///
/// Gets or sets the exception message.
///
///
/// The exception message.
///
public string ExceptionMessage { get; set; }
///
/// Initializes a new instance of the class.
///
public CsvExportData()
{
redesignedSurfaceLine = null;
}
///
/// Initializes a new instance of the class.
///
/// Name of the location.
/// Name of the scenario.
public CsvExportData(string locationName, string scenarioName)
{
this.locationName = locationName;
this.scenarioName = scenarioName;
}
///
/// Determines the global point coordinates based on global surface line.
///
/// The local point.
/// The global surface line.
///
private GeometryPoint DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(GeometryPoint localPoint, SurfaceLine2 globalSurfaceLine)
{
CoordinateSystemConverter coordinateSystemConverter = new CoordinateSystemConverter();
coordinateSystemConverter.DefineGlobalXYZBasedOnLine(globalSurfaceLine.Geometry);
coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localPoint);
return localPoint;
}
///
/// Gets or sets the number of iterations (as used in the design calculation).
///
///
/// The number of iterations.
///
[ReadOnly(true)]
public int NumberOfIterations
{
get
{
return numberOfIterations;
}
set { numberOfIterations = value; }
}
///
/// Gets the result file.
///
///
/// The result file.
///
[Browsable(false)]
public string ResultFile
{
get
{
if (!String.IsNullOrEmpty(BaseFileName))
{
const string wmfExtension = ".wmf";
string fullBaseFilename = DamProject.ProjectWorkingPath;
if (!string.IsNullOrEmpty(CalculationSubDir))
{
fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir);
}
fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName;
string fullFilename = fullBaseFilename + wmfExtension;
if (!File.Exists(fullFilename))
{
fullFilename = fullBaseFilename + "z1" + wmfExtension;
}
if (!File.Exists(fullFilename))
{
fullFilename = fullBaseFilename + "z2" + wmfExtension;
}
return fullFilename;
}
return "";
}
}
///
/// Gets the input file.
///
///
/// The input file.
///
[Browsable(false)]
private string InputFile
{
get
{
if (!String.IsNullOrEmpty(BaseFileName))
{
const string fileExtension = ".stix";
const string suffix = "_result";
string fullBaseFilename = DamProject.ProjectWorkingPath;
if (CalculationSubDir != "")
{
fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir);
}
fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName + suffix;
string fullFilename = fullBaseFilename + fileExtension;
return fullFilename;
}
return "";
}
}
///
/// Gets the piping result file.
///
///
/// The piping result file.
///
[Browsable(false)]
public string PipingResultFile
{
get
{
if (!String.IsNullOrEmpty(BaseFileName))
{
const string pipingResultFileExtension = ".prxml";
string fullFilename = DamProject.ProjectWorkingPath;
if (string.IsNullOrEmpty(CalculationSubDir))
{
CalculationSubDir = Path.Combine("Piping", PipingModel.ToString());
}
fullFilename = Path.Combine(fullFilename, CalculationSubDir);
fullFilename = fullFilename + Path.DirectorySeparatorChar + BaseFileName;
fullFilename = fullFilename + pipingResultFileExtension;
return fullFilename;
}
return "";
}
}
[PropertyOrder(1, 2)]
[ReadOnly(true)]
public AnalysisType AnalysisType // moet vanuit invoer komen
{
get { return analysisType; }
set { analysisType = value; }
}
[Browsable(false)]
public DamFailureMechanismeCalculationSpecification DamFailureMechanismeCalculation // moet vanuit invoer komen
{
get { return damFailureMechanismeCalculationSpecification; }
set
{
// Clone the specification to ensure a non-changeable version.
damFailureMechanismeCalculationSpecification = value.Clone();
if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping)
{
redesignedSurfaceLine = RedesignedSurfaceLine2;
}
}
}
[CsvExportColumn("DikeName", 2)]
[Browsable(false)]
public string DikeName
{
get
{
return dikeName;
}
set
{
dikeName = value;
}
}
[CsvExportColumn("Calculation", 3)]
[Browsable(false)]
public string Calculation
{
get { return damFailureMechanismeCalculationSpecification?.ToString() ?? ""; }
}
[CsvExportColumn("Scenario", 4)]
[Browsable(false)]
public string ScenarioName
{
get
{
return scenarioName;
}
set
{
scenarioName = value;
}
}
[CsvExportColumn("LocationName", 5)]
[PropertyOrder(0, 1)]
[ReadOnly(true)]
public string LocationName
{
get
{
return locationName;
}
set
{
locationName = value;
}
}
[PropertyOrder(0, 2)]
[ReadOnly(true)]
public string ScenarioDefinitionName
{
get { return scenarioName + " of " + locationScenarioCount.ToString(); }
}
[Browsable(false)]
public int LocationScenarioCount
{
get { return locationScenarioCount; }
set { locationScenarioCount = value; }
}
[PropertyOrder(0, 3)]
[ReadOnly(true)]
public CalculationResult CalculationResult
{
get
{
return calculationResult;
}
set
{
calculationResult = value;
}
}
[PropertyOrder(8,1)]
[ReadOnly(true)]
public string ResultMessage
{
get
{
RemoveCarriageReturnsFromMessage(ref resultMessage);
return resultMessage;
}
set { resultMessage = value; }
}
///
/// Removes the carriage returns from message.
///
/// The message.
internal static void RemoveCarriageReturnsFromMessage(ref string message)
{
// remove carriage return at the end
message = message.TrimEnd('\r', '\n');
// replace other carriage returns by a space
message = message.Replace("\r\n", " ");
}
[CsvExportColumn("X", 6)]
[Format("F3")]
[PropertyOrder(1, 0)]
[Unit(UnitType.Length)]
[XmlIgnore]
[ReadOnly(true)]
public double X
{
get
{
return xRd;
}
set
{
xRd = value;
}
}
[CsvExportColumn("Y", 7)]
[Format("F3")]
[PropertyOrder(1, 1)]
[Unit(UnitType.Length)]
[XmlIgnore]
[ReadOnly(true)]
public double Y
{
get
{
return yRd;
}
set
{
yRd = value;
}
}
[CsvExportColumn("LocationScenarioId", 8)]
[Browsable(false)]
public string LocationScenarioId
{
get { return scenarioName; }
}
[CsvExportColumn("RiverLevel", 9)]
[PropertyOrder(2, 12)]
[Format("F3")]
[ReadOnly(true)]
public double? RiverLevel
{
get { return scenario.RiverLevel; }
}
[CsvExportColumn("RiverLevelLow", 10)]
[PropertyOrder(2, 13)]
[Format("F3")]
[ReadOnly(true)]
public double? RiverLevelLow
{
get { return scenario.RiverLevelLow; }
}
[CsvExportColumn("DikeTableHeight", 11)]
[PropertyOrder(2, 14)]
[Format("F3")]
[ReadOnly(true)]
public double? DikeTableHeight
{
get { return scenario.DikeTableHeight; }
}
[CsvExportColumn("DikeTableHeight", 12)]
[PropertyOrder(2, 15)]
[Format("F3")]
[ReadOnly(true)]
public double? SlopeDampingPiezometricHeightPolderSide
{
get { return scenario.Location.SlopeDampingPiezometricHeightPolderSide; }
}
///
/// Gets the height of the current original dike (so not of the redesigned surfaceline).
///
///
/// The height of the current dike.
///
[CsvExportColumn("CurrentDikeHeight", 13)]
[Browsable(false)]
public double? CurrentDikeHeight
{
get { return scenario.Location.SurfaceLine2.GetDikeHeight(); }
}
///
/// Gets the current original dike toe at polder x (so not of the redesigned surfaceline).
///
///
/// The current global dike toe at polder x.
///
[CsvExportColumn("CurrentDikeToeAtPolderX", 14)]
[Browsable(false)]
public double? CurrentDikeToeAtPolderX
{
get
{
double? x = null;
GeometryPoint point = scenario.Location.SurfaceLine2.GetDikeToeInward();
if (point != null)
x = point.X;
return x;
}
}
///
/// Gets the current original dike toe at polder z (so not of the redesigned surfaceline).
///
///
/// The current global dike toe at polder z.
///
[CsvExportColumn("CurrentDikeToeAtPolderZ", 15)]
[Browsable(false)]
public double? CurrentDikeToeAtPolderZ
{
get
{
double? z = null;
GeometryPoint point = scenario.Location.SurfaceLine2.GetDikeToeInward();
if (point != null)
z = point.Z;
return z;
}
}
private double? GetSoilProfileProbability(FailureMechanismSystemType? failureMechanismType)
{
if (SoilProfile != null)
{
return scenario.Location.GetSoilProfileProbability(soilProfile, failureMechanismType);
}
return scenario.Location.GetSoilGeometry2DProbability(soilGeometry2DName, failureMechanismType);
}
[CsvExportColumn("StabilityProfileName", 16)]
[Browsable(false)]
public string StabilityProfileName
{
get { return ProfileName; }
}
[CsvExportColumn("StabilityProfileProbability", 17)]
[Format("F3")]
[Unit(UnitType.Fractions)]
[Browsable(false)]
public double? StabilityProfileProbability
{
get { return GetSoilProfileProbability(FailureMechanismSystemType.StabilityInside); }
}
[CsvExportColumn("PipingProfileName", 18)]
[Browsable(false)]
public string PipingProfileName
{
get { return ProfileName; }
}
[CsvExportColumn("PipingProfileProbability", 19)]
[Format("F3")]
[Unit(UnitType.Fractions)]
[Browsable(false)]
public double? PipingProfileProbability
{
get { return GetSoilProfileProbability(FailureMechanismSystemType.Piping); }
}
///
/// Gets the length of the current original dike (so not of the redesigned surfaceline).
///
///
/// The length of the current dike.
///
[CsvExportColumn("CurrentDikeLength", 20)]
[Browsable(false)]
public double? CurrentDikeLength
{
get { return scenario.Location.SurfaceLine2.GetDikeLength(); }
}
[CsvExportColumn("StabilityToeAtPolderX", 21)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? StabilityToeAtPolderX
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.GetDikeToeInward();
if (point != null)
{
stabilityToeAtPolderX = point.X;
}
return stabilityToeAtPolderX;
}
set => stabilityToeAtPolderX = value;
}
[CsvExportColumn("StabilityToeAtPolderZ", 22)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? StabilityToeAtPolderZ
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.GetDikeToeInward();
if (point != null)
{
stabilityToeAtPolderY = point.Z;
}
return stabilityToeAtPolderY;
}
set => stabilityToeAtPolderY = value;
}
[CsvExportColumn("StabilityShoulderHeight", 23)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? StabilityShoulderHeight
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside);
if (point != null)
{
stabilityShoulderHeight = point.Z;
}
return stabilityShoulderHeight;
}
set => stabilityShoulderHeight = value;
}
[CsvExportColumn("StabilitySafetyFactor", 24)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? StabilitySafetyFactor
{
get { return safetyFactorStability; }
set { safetyFactorStability = value; }
}
[CsvExportColumn("RequiredSafetyFactorStabilityInnerSlope", 26)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? RequiredSafetyFactorStabilityInnerSlope
{
get { return scenario.RequiredSafetyFactorStabilityInnerSlope;}
}
[CsvExportColumn("RequiredSafetyFactorStabilityOuterSlope", 27)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? RequiredSafetyFactorStabilityOuterSlope
{
get { return scenario.RequiredSafetyFactorStabilityOuterSlope; }
}
[CsvExportColumn("RequiredSafetyFactorPiping", 28)]
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[Browsable(false)]
public double? RequiredSafetyFactorPiping
{
get { return scenario.RequiredSafetyFactorPiping; }
}
[CsvExportColumn("PipingToeAtPolderX", 29)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? PipingToeAtPolderX
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.GetDikeToeInward();
if (point != null)
{
pipingToeAtPolderX = point.X;
}
return pipingToeAtPolderX;
}
set => pipingToeAtPolderX = value;
}
[CsvExportColumn("PipingToeAtPolderZ", 30)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? PipingToeAtPolderZ
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.GetDikeToeInward();
if (point != null)
{
pipingToeAtPolderZ = point.Z;
}
return pipingToeAtPolderZ;
}
set => pipingToeAtPolderZ = value;
}
[CsvExportColumn("PipingShoulderHeight", 31)]
[Format("F3")]
[Unit(UnitType.Length)]
[Browsable(false)]
public double? PipingShoulderHeight
{
get
{
GeometryPoint point = redesignedSurfaceLineGlobal?.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside);
if (point != null)
{
pipingShoulderHeight = point.Z;
}
return pipingShoulderHeight;
}
set => pipingShoulderHeight = value;
}
[CsvExportColumn("DikeLength", 33)]
[Format("F3")]
[PropertyOrder(4, 1)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? DikeLength
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
dikeLength = redesignedSurfaceLineGlobal.GetDikeLength();
}
return dikeLength;
}
set => dikeLength = value;
}
[CsvExportColumn("IsUplift", 52)]
[PropertyOrder(1, 4)]
[ReadOnly(true)]
public bool? IsUplift
{
get { return isUplift; }
set { isUplift = value; }
}
[CsvExportColumn("Pl3MinUplift", 53)]
[Format("F3")]
[PropertyOrder(5, 1)]
[Unit(UnitType.None)]
[ReadOnly(true)]
public double? Pl3MinUplift
{
get { return pl3MinUplift; }
set { pl3MinUplift = value; }
}
[CsvExportColumn("Pl3HeadAdjusted", 54)]
[Format("F3")]
[PropertyOrder(5, 2)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? Pl3HeadAdjusted
{
get { return pl3HeadAdjusted; }
set { pl3HeadAdjusted = value; }
}
[CsvExportColumn("pl3LocalLocationXMinUplift", 55)]
[Format("F3")]
[PropertyOrder(5, 3)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? Pl3LocalLocationXMinUplift
{
get { return pl3LocalLocationXMinUplift; }
set { pl3LocalLocationXMinUplift = value; }
}
[CsvExportColumn("Pl3LocationXMinUplift", 56)]
[Format("F3")]
[PropertyOrder(5, 4)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? Pl3LocationXMinUplift
{
get
{
if (pl3LocalLocationXMinUplift == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pl3LocationXMinUplift = point.X;
}
}
return pl3LocationXMinUplift;
}
set => pl3LocationXMinUplift = value;
}
[CsvExportColumn("Pl3LocationYMinUplift", 57)]
[Format("F3")]
[PropertyOrder(5, 5)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? Pl3LocationYMinUplift
{
get
{
if (pl3LocalLocationXMinUplift == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pl3LocationYMinUplift = point.Y;
}
}
return pl3LocationYMinUplift;
}
set => pl3LocationYMinUplift = value;
}
[CsvExportColumn("Pl4MinUplift", 58)]
[Format("F3")]
[PropertyOrder(5, 6)]
[Unit(UnitType.None)]
[ReadOnly(true)]
public double? Pl4MinUplift
{
get { return pl4MinUplift; }
set { pl4MinUplift = value; }
}
[CsvExportColumn("Pl4HeadAdjusted", 59)]
[Format("F3")]
[PropertyOrder(5, 7)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? Pl4HeadAdjusted
{
get { return pl4HeadAdjusted; }
set { pl4HeadAdjusted = value; }
}
[CsvExportColumn("pl4LocalLocationXMinUplift", 60)]
[Format("F3")]
[PropertyOrder(5, 8)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? Pl4LocalLocationXMinUplift
{
get { return pl4LocalLocationXMinUplift; }
set { pl4LocalLocationXMinUplift = value; }
}
[CsvExportColumn("Pl4LocationXMinUplift", 61)]
[Format("F3")]
[PropertyOrder(5, 9)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? Pl4LocationXMinUplift
{
get
{
if (pl4LocalLocationXMinUplift == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pl4LocationXMinUplift = point.X;
}
}
return pl4LocationXMinUplift;
}
set => pl4LocationXMinUplift = value;
}
[CsvExportColumn("Pl4LocationYMinUplift", 62)]
[Format("F3")]
[PropertyOrder(5, 10)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? Pl4LocationYMinUplift
{
get
{
if (pl4LocalLocationXMinUplift == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pl4LocationYMinUplift = point.Y;
}
}
return pl4LocationYMinUplift;
}
set => pl4LocationYMinUplift = value;
}
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[PropertyOrder(6, 11)]
public double? UpliftFactor
{
get { return upliftFactor; }
set { upliftFactor = value; }
}
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[PropertyOrder(6, 12)]
[Browsable(false)]
public double? HeaveFactor
{
get { return heaveFactor; }
set { heaveFactor = value; }
}
[CsvExportColumn("BlighPipingFactor", 63)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? BlighPipingFactor
{
get { return blighPipingFactor; }
set { blighPipingFactor = value; }
}
[CsvExportColumn("BlighHCritical", 64)]
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[Browsable(false)]
public double? BlighHCritical
{
get { return blighHCritical; }
set { blighHCritical = value; }
}
[CsvExportColumn("Sellmeijer2ForcesPipingFactor", 65)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? Sellmeijer2ForcesPipingFactor
{
get { return sellmeijer2ForcesPipingFactor; }
set { sellmeijer2ForcesPipingFactor = value; }
}
[CsvExportColumn("Sellmeijer2ForcesHCritical", 66)]
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[Browsable(false)]
public double? Sellmeijer2ForcesHCritical
{
get { return sellmeijer2ForcesHCritical; }
set { sellmeijer2ForcesHCritical = value; }
}
[CsvExportColumn("Sellmeijer4ForcesPipingFactor", 67)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? Sellmeijer4ForcesPipingFactor
{
get { return sellmeijer4ForcesPipingFactor; }
set { sellmeijer4ForcesPipingFactor = value; }
}
[CsvExportColumn("Sellmeijer4ForcesHCritical", 68)]
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[Browsable(false)]
public double? Sellmeijer4ForcesHCritical
{
get { return sellmeijer4ForcesHCritical; }
set { sellmeijer4ForcesHCritical = value; }
}
[CsvExportColumn("SellmeijerPipingFactor", 69)]
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[Browsable(false)]
public double? SellmeijerPipingFactor
{
get { return sellmeijerPipingFactor; }
set { sellmeijerPipingFactor = value; }
}
[CsvExportColumn("SellmeijerHCritical", 70)]
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[Browsable(false)]
public double? SellmeijerHCritical
{
get { return sellmeijerHCritical; }
set { sellmeijerHCritical = value; }
}
///
/// Gets or sets the wti2017 safety factor for backward erosion.
///
///
/// The wti2017 safety factor.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017BackwardErosionSafetyFactor", 71)]
[PropertyOrder(7, 1)]
public double? Wti2017BackwardErosionSafetyFactor
{
get { return wti2017BackwardErosionSafetyFactor; }
set { wti2017BackwardErosionSafetyFactor = value; }
}
///
/// Gets or sets the wti2017 safety factor for Uplift.
///
///
/// The wti2017 safety factor for Uplift.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017UpliftSafetyFactor", 72)]
[PropertyOrder(7, 5)]
public double? Wti2017UpliftSafetyFactor
{
get
{
return wti2017UpliftSafetyFactor;
}
set
{
wti2017UpliftSafetyFactor = value;
}
}
///
/// Gets or sets the wti2017 safety factor heave.
///
///
/// The wti2017 safety factor heave.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017HeaveSafetyFactor", 73)]
[PropertyOrder(7, 8)]
public double? Wti2017HeaveSafetyFactor
{
get
{
return wti2017HeaveSafetyFactor;
}
set
{
wti2017HeaveSafetyFactor = value;
}
}
///
/// Gets or sets the wti2017 safety factor overall (see MWDAM-1299).
///
///
/// The wti2017 safety factor overall.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017SafetyFactorOverall", 74)]
[PropertyOrder(7, 11)]
public double? Wti2017SafetyFactorOverall
{
get
{
return wti2017SafetyFactorOverall;
}
set
{
wti2017SafetyFactorOverall = value;
}
}
///
/// Gets or sets the wti2017 critical waterlevel for backward erosion.
///
///
/// The wti2017 critical waterlevel backward erosion.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017BackwardErosionHcritical", 75)]
[PropertyOrder(7, 2)]
public double? Wti2017BackwardErosionHcritical
{
get { return wti2017BackwardErosionHcritical; }
set { wti2017BackwardErosionHcritical = value; }
}
///
/// Gets or sets the wti2017 critical waterlevel for Uplift.
///
///
/// The wti2017 hcritical uplift.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017UpliftHcritical", 76)]
[PropertyOrder(7, 6)]
public double? Wti2017UpliftHcritical
{
get
{
return wti2017UpliftHcritical;
}
set
{
wti2017UpliftHcritical = value;
}
}
///
/// Gets or sets the wti2017 critical waterlevel for Heave.
///
///
/// The wti2017 hcritical heave.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017HeaveHcritical", 77)]
[PropertyOrder(7, 9)]
public double? Wti2017HeaveHcritical
{
get
{
return wti2017HeaveHcritical;
}
set
{
wti2017HeaveHcritical = value;
}
}
///
/// Gets or sets the wti2017 critical waterlevel overall (see MWDAM-1299).
///
///
/// The wti2017 hcritical overall.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017HcriticalOverall", 78)]
[PropertyOrder(7, 12)]
public double? Wti2017HcriticalOverall
{
get
{
return wti2017HcriticalOverall;
}
set
{
wti2017HcriticalOverall = value;
}
}
///
/// Gets or sets the wti2017 delta phi c be (backward erosion, critical head difference).
///
///
/// The wti2017 delta phi c be.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017BackwardErosionDeltaPhiC", 79)]
[PropertyOrder(7, 3)]
public double? Wti2017BackwardErosionDeltaPhiC
{
get
{
return wti2017BackwardErosionDeltaPhiC;
}
set
{
wti2017BackwardErosionDeltaPhiC = value;
}
}
///
/// Gets or sets the wti2017 delta phi c be (backward erosion, reduced head difference).
///
///
/// The wti2017 delta phi c be.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017BackwardErosionDeltaPhiReduced", 80)]
[PropertyOrder(7, 4)]
public double? Wti2017BackwardErosionDeltaPhiReduced
{
get
{
return wti2017BackwardErosionDeltaPhiReduced;
}
set
{
wti2017BackwardErosionDeltaPhiReduced = value;
}
}
///
/// Gets or sets the wti2017 delta phi cu (Uplift, critical head difference).
///
///
/// The wti2017 delta phi cu.
///
[Format("F3")]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017UpliftDeltaPhiC", 81)]
[PropertyOrder(7, 7)]
public double? Wti2017UpliftDeltaPhiC
{
get
{
return wti2017UpliftDeltaPhiC;
}
set
{
wti2017UpliftDeltaPhiC = value;
}
}
///
/// Gets or sets the wti2017 gradient (vertical outflow gradient for Heave).
///
///
/// The wti2017 gradient.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017Gradient", 82)]
[PropertyOrder(7, 10)]
public double? Wti2017Gradient
{
get
{
return wti2017Gradient;
}
set
{
wti2017Gradient = value;
}
}
///
/// Gets or sets the effective stress (at exit point, as calculated with Wti EffectiveThicknessCalculator).
///
///
/// The effective stress.
///
[Format("F3")]
[Unit(UnitType.Pressure)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017EffectiveStress", 83)]
[PropertyOrder(7, 13)]
public double? Wti2017EffectiveStress
{
get
{
return wti2017EffectiveStress;
}
set
{
wti2017EffectiveStress = value;
}
}
///
/// Gets or sets the wti2017 c creep (Creep coefficient).
///
///
/// The wti2017 c creep.
///
[Format("F3")]
[Unit(UnitType.None)]
[ReadOnly(true)]
[CsvExportColumn("Wti2017CCreep", 84)]
[PropertyOrder(7, 14)]
public double? Wti2017CCreep
{
get { return wti2017CCreep; }
set { wti2017CCreep = value; }
}
[CsvExportColumn("DikeToeAtRiverXrd", 85)]
[Browsable(false)]
public double? DikeToeAtRiverXrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X;
}
return dikeToeAtRiverXrd;
}
set => dikeToeAtRiverXrd = value;
}
[CsvExportColumn("DikeToeAtRiverYrd", 86)]
[Browsable(false)]
public double? DikeToeAtRiverYrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y;
}
return dikeToeAtRiverYrd;
}
set => dikeToeAtRiverYrd = value;
}
[CsvExportColumn("DikeToeAtRiverZrd", 87)]
[Browsable(false)]
public double? DikeToeAtRiverZrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z;
}
return dikeToeAtRiverZrd;
}
set => dikeToeAtRiverZrd = value;
}
[CsvExportColumn("DikeTopAtRiverXrd", 88)]
[Browsable(false)]
public double? DikeTopAtRiverXrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X;
}
return dikeTopAtRiverXrd;
}
set => dikeTopAtRiverXrd = value;
}
[CsvExportColumn("DikeTopAtRiverYrd", 89)]
[Browsable(false)]
public double? DikeTopAtRiverYrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y;
}
return dikeTopAtRiverYrd;
}
set => dikeTopAtRiverYrd = value;
}
[CsvExportColumn("DikeTopAtRiverZrd", 90)]
[Browsable(false)]
public double? DikeTopAtRiverZrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z;
}
return dikeTopAtRiverZrd;
}
set => dikeTopAtRiverZrd = value;
}
[CsvExportColumn("DikeTopAtPolderXrd", 91)]
[Browsable(false)]
public double? DikeTopAtPolderXrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X;
}
return dikeTopAtPolderXrd;
}
set => dikeTopAtPolderXrd = value;
}
[CsvExportColumn("DikeTopAtPolderYrd", 92)]
[Browsable(false)]
public double? DikeTopAtPolderYrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y;
}
return dikeTopAtPolderYrd;
}
set => dikeTopAtPolderYrd = value;
}
[CsvExportColumn("DikeTopAtPolderZrd", 93)]
[Browsable(false)]
public double? DikeTopAtPolderZrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z;
}
return dikeTopAtPolderZrd;
}
set => dikeTopAtPolderZrd = value;
}
[CsvExportColumn("DikeToeAtPolderXrd", 94)]
[Browsable(false)]
public double? DikeToeAtPolderXrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X;
}
return dikeToeAtPolderXrd;
}
set => dikeToeAtPolderXrd = value;
}
[CsvExportColumn("DikeToeAtPolderYrd", 95)]
[Browsable(false)]
public double? DikeToeAtPolderYrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y;
}
return dikeToeAtPolderYrd;
}
set => dikeToeAtPolderYrd = value;
}
[CsvExportColumn("DikeToeAtPolderZrd", 96)]
[Browsable(false)]
public double? DikeToeAtPolderZrd
{
get
{
if (redesignedSurfaceLineGlobal != null)
{
return redesignedSurfaceLineGlobal.CharacteristicPoints
.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z;
}
return dikeToeAtPolderZrd;
}
set => dikeToeAtPolderZrd = value;
}
[CsvExportColumn("ActiveCenterPointX", 97)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? ActiveCenterPointX
{
get { return activeCenterPointX; }
set { activeCenterPointX = value; }
}
[CsvExportColumn("ActiveCenterPointZ", 98)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? ActiveCenterPointZ
{
get { return activeCenterPointZ; }
set { activeCenterPointZ = value; }
}
[CsvExportColumn("ActiveCenterPointRadius", 99)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? ActiveCenterPointRadius
{
get { return activeCenterPointRadius; }
set { activeCenterPointRadius = value; }
}
[CsvExportColumn("PassiveCenterPointX", 100)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? PassiveCenterPointX
{
get { return passiveCenterPointX; }
set { passiveCenterPointX = value; }
}
[CsvExportColumn("PassiveCenterPointZ", 101)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? PassiveCenterPointZ
{
get { return passiveCenterPointZ; }
set { passiveCenterPointZ = value; }
}
[CsvExportColumn("PassiveCenterPointRadius", 102)]
[Format("F3")]
[ReadOnly(true)]
[Browsable(false)]
public double? PassiveCenterPointRadius
{
get { return passiveCenterPointRadius; }
set { passiveCenterPointRadius = value; }
}
[Browsable(false)]
public Scenario Scenario
{
get { return scenario; }
set
{
scenario = value;
if (scenario != null)
{
scenarioName = scenario.LocationScenarioID;
locationName = scenario.Location.Name;
locationScenarioCount = scenario.Location.Scenarios.Count;
xRd = scenario.Location.XRd;
yRd = scenario.Location.YRd;
}
}
}
[Browsable(false)]
[XmlIgnore]
public SoilProfile1D SoilProfile
{
get
{
if (soilProfile == null && damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping &&
File.Exists(PipingResultFile))
{
if (soilProfileWithSurfaceLine == null)
{
soilProfileWithSurfaceLine = ReadSoilProfileWithSurfaceLineFromFile();
}
soilProfile = soilProfileWithSurfaceLine.SoilProfile;
}
return soilProfile;
}
set
{
soilProfile = value;
}
}
[Browsable(false)]
public string SoilGeometry2DName
{
get { return soilGeometry2DName; }
set { soilGeometry2DName = value; }
}
///
/// Creates a new instance based on
/// with global coordinates instead of local coordinates.
///
[Browsable(false)]
public SurfaceLine2 CreateRedesignedSurfaceLineGlobal()
{
SurfaceLine2 localRedesignedSurfaceLineGlobal = null;
if (redesignedSurfaceLine != null)
{
SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2;
if (originalSurfaceLine != null)
{
var coordinateSystemConverter = new CoordinateSystemConverter();
coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry);
localRedesignedSurfaceLineGlobal = redesignedSurfaceLine.FullDeepClone();
coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLineGlobal.Geometry);
}
}
return localRedesignedSurfaceLineGlobal;
}
private CsvExportSoilProfileWithSurfaceLine ReadSoilProfileWithSurfaceLineFromFile()
{
CsvExportSoilProfileWithSurfaceLine localSoilProfileWithSurfaceLine = null;
DataEventPublisher.InvokeWithoutPublishingEvents(() =>
{
var xmlDeSerializer = new Deltares.Standard.IO.Xml.XmlDeserializer();
var classFactory = new DefaultClassFactory();
localSoilProfileWithSurfaceLine =
(CsvExportSoilProfileWithSurfaceLine)xmlDeSerializer.XmlDeserialize(PipingResultFile,
typeof(CsvExportSoilProfileWithSurfaceLine), classFactory);
});
return localSoilProfileWithSurfaceLine;
}
///
/// Gets or sets the redesigned surface line2.
///
///
/// The redesigned surface line2.
///
[Browsable(false)]
[XmlIgnore]
public SurfaceLine2 RedesignedSurfaceLine2
{
get
{
if (redesignedSurfaceLine == null && damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping &&
File.Exists(PipingResultFile))
{
if (soilProfileWithSurfaceLine == null)
{
soilProfileWithSurfaceLine = ReadSoilProfileWithSurfaceLineFromFile();
}
redesignedSurfaceLine = soilProfileWithSurfaceLine.SurfaceLine;
// Also determine and set the correct global version in order to retrieve dependend properties
redesignedSurfaceLineGlobal = CreateRedesignedSurfaceLineGlobal();
}
return redesignedSurfaceLine;
}
set
{
redesignedSurfaceLine = value;
// Also determine and set the correct global version in order to retrieve dependend properties
redesignedSurfaceLineGlobal = CreateRedesignedSurfaceLineGlobal();
}
}
[Browsable(false)]
[XmlIgnore]
public List ResultSlices { get; set; }
[PropertyOrder(2, 1)]
[XmlIgnore]
[ReadOnly(true)]
public string ProfileName
{
get
{
if (scenario != null)
{
profileName = GetSoilProfileName();
}
return profileName;
}
set
{
profileName = value;
}
}
private string GetSoilProfileName()
{
string soilprofilename = "";
if (soilProfile != null)
{
soilprofilename = soilProfile.Name;
}
else
{
if (!String.IsNullOrEmpty(soilGeometry2DName))
{
soilprofilename = soilGeometry2DName;
}
}
return soilprofilename;
}
[Format("F3")]
[PropertyOrder(2, 2)]
[Unit(UnitType.Fractions)]
[ReadOnly(true)]
[XmlIgnore]
public double? ProfileProbability
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityOutside:
case FailureMechanismSystemType.StabilityInside:
res = StabilityProfileProbability;
break;
case FailureMechanismSystemType.Piping:
res = PipingProfileProbability;
break;
}
return res;
}
}
[Unit(UnitType.None)]
[PropertyOrder(2, 3)]
[ReadOnly(true)]
public MStabModelType? StabilityModel
{
get
{
return stabilityModel;
}
set { stabilityModel = value; }
}
[Unit(UnitType.None)]
[Format("F3")]
[PropertyOrder(2, 4)]
[ReadOnly(true)]
[XmlIgnore]
public double? SafetyFactor
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityOutside:
case FailureMechanismSystemType.StabilityInside:
res = StabilitySafetyFactor;
break;
case FailureMechanismSystemType.Piping:
res = PipingFactor;
break;
}
return res;
}
}
[Format("F3")]
[PropertyOrder(2, 10)]
[Unit(UnitType.None)]
[ReadOnly(true)]
[XmlIgnore]
public double? RequiredSafetyFactor
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityOutside:
res = RequiredSafetyFactorStabilityOuterSlope;
break;
case FailureMechanismSystemType.StabilityInside:
res = RequiredSafetyFactorStabilityInnerSlope;
break;
case FailureMechanismSystemType.Piping:
res = RequiredSafetyFactorPiping;
break;
}
return res;
}
}
[Format("F3")]
[PropertyOrder(2, 5)]
[Unit(UnitType.Length)]
[XmlIgnore]
[ReadOnly(true)]
public double? ShoulderHeight
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityInside:
res = StabilityShoulderHeight;
break;
case FailureMechanismSystemType.Piping:
res = PipingShoulderHeight;
break;
}
return res;
}
}
[Format("F3")]
[PropertyOrder(2, 7)]
[Unit(UnitType.Length)]
[XmlIgnore]
[ReadOnly(true)]
public double? ToeAtPolderX
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityInside:
res = StabilityToeAtPolderX;
break;
case FailureMechanismSystemType.Piping:
res = PipingToeAtPolderX;
break;
}
return res;
}
}
[Format("F3")]
[PropertyOrder(2, 8)]
[Unit(UnitType.Length)]
[XmlIgnore]
[ReadOnly(true)]
public double? ToeAtPolderZ
{
get
{
double? res = null;
switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType)
{
case FailureMechanismSystemType.StabilityInside:
res = StabilityToeAtPolderZ;
break;
case FailureMechanismSystemType.Piping:
res = PipingToeAtPolderZ;
break;
}
return res;
}
}
[PropertyOrder(6, 1)]
[Unit(UnitType.None)]
[ReadOnly(true)]
[XmlIgnore]
public PipingModelType? PipingModel
{
get
{
if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping)
{
return damFailureMechanismeCalculationSpecification.PipingModelType;
}
return null;
}
}
[Format("F3")]
[PropertyOrder(6, 2)]
[Unit(UnitType.None)]
[ReadOnly(true)]
[XmlIgnore]
public double? PipingFactor
{
get
{
double? res = null;
if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping)
{
switch (damFailureMechanismeCalculationSpecification.PipingModelType)
{
case PipingModelType.Bligh:
res = BlighPipingFactor;
break;
case PipingModelType.Sellmeijer:
res = SellmeijerPipingFactor;
break;
case PipingModelType.Sellmeijer2Forces:
res = Sellmeijer2ForcesPipingFactor;
break;
case PipingModelType.Sellmeijer4Forces:
res = Sellmeijer4ForcesPipingFactor;
break;
case PipingModelType.Wti2017:
res = Wti2017SafetyFactorOverall;
break;
}
}
return res;
}
}
[Format("F3")]
[PropertyOrder(6, 3)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? LocalPipingEntryPointX
{
get
{
GeometryPoint point = null;
if (RedesignedSurfaceLine2 != null)
{
point = redesignedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver);
}
if (point != null && scenario != null)
return point.X - scenario.Location.DistanceToEntryPoint;
if (point != null)
return point.X;
return null;
}
}
[Format("F3")]
[PropertyOrder(6, 4)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? PipingEntryPointX
{
get
{
if (LocalPipingEntryPointX == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pipingEntryPointX = point.X;
}
}
return pipingEntryPointX;
}
set => pipingEntryPointX = value;
}
[Format("F3")]
[PropertyOrder(6, 5)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? PipingEntryPointY
{
get
{
if (LocalPipingEntryPointX == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pipingEntryPointY = point.Y;
}
}
return pipingEntryPointY;
}
set => pipingEntryPointY = value;
}
[Format("F3")]
[PropertyOrder(6, 6)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? LocalPipingExitPointX
{
get { return localPipingExitPointX; }
set { localPipingExitPointX = value; }
}
[Format("F3")]
[PropertyOrder(6, 7)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? PipingExitPointX
{
get
{
if (localPipingExitPointX == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pipingExitPointX = point.X;
}
}
return pipingExitPointX;
}
set => pipingExitPointX = value;
}
[Format("F3")]
[PropertyOrder(6, 8)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? PipingExitPointY
{
get
{
if (localPipingExitPointX == null)
return null;
if (redesignedSurfaceLineGlobal != null)
{
GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine(
new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal);
if (point != null)
{
pipingExitPointY = point.Y;
}
}
return pipingExitPointY;
}
set => pipingExitPointY = value;
}
[Format("F3")]
[PropertyOrder(6, 9)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
public double? SeepageLength
{
get
{
if (scenario != null)
{
return localPipingExitPointX - LocalPipingEntryPointX;
}
return localPipingExitPointX - LocalPipingEntryPointX;
}
}
[Format("F3")]
[PropertyOrder(6, 10)]
[Unit(UnitType.Length)]
[ReadOnly(true)]
[XmlIgnore]
public double? HCritical
{
get
{
double? res = null;
if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping)
{
switch (damFailureMechanismeCalculationSpecification.PipingModelType)
{
case PipingModelType.Bligh:
res = BlighHCritical;
break;
case PipingModelType.Sellmeijer:
res = SellmeijerHCritical;
break;
case PipingModelType.Sellmeijer2Forces:
res = Sellmeijer2ForcesHCritical;
break;
case PipingModelType.Sellmeijer4Forces:
res = Sellmeijer4ForcesHCritical;
break;
case PipingModelType.Wti2017:
res = Wti2017HcriticalOverall;
break;
}
}
return res;
}
}
[Browsable(false)]
public string BaseFileName
{
get { return baseFileName; }
set { baseFileName = value; }
}
[Browsable(false)]
public string CalculationSubDir
{
get { return calculationSubDir; }
set { calculationSubDir = value; }
}
public ResultEvaluation ResultEvaluation
{
get { return resultEvaluation; }
set
{
DataEventPublisher.BeforeChange(this, "ResultEvaluation");
resultEvaluation = value;
DataEventPublisher.AfterChange(this, "ResultEvaluation");
}
}
[Description("Use this area to explain the valuation and for any further remarks")]
public string Notes
{
get { return notes; }
set
{
DataEventPublisher.BeforeChange(this, "Notes");
notes = value;
DataEventPublisher.AfterChange(this, "Notes");
}
}
///
/// Copies the result file.
///
/// The extension.
private void CopyResultFile(string extension)
{
string copyResFile = Path.GetDirectoryName(InputFile) + Path.DirectorySeparatorChar +
Path.GetFileNameWithoutExtension(InputFile) + " (copy)" + extension;
var resFile = Path.ChangeExtension(InputFile, extension);
if (resFile != null)
{
File.Copy(resFile, copyResFile, true);
}
}
///
/// Creates the piping results file for surface line and profile.
///
/// The DES result.
public void CreatePipingResultsFileForSurfaceLineAndProfile(CsvExportData desResult)
{
var fullPath = Path.Combine(DamProject.ProjectMapWorkingPath, CalculationSubDir);
if (!Directory.Exists(fullPath))
{
Directory.CreateDirectory(fullPath);
}
var soilProfileWithSurfaceLine = new CsvExportSoilProfileWithSurfaceLine
{
SoilProfile = soilProfile,
SurfaceLine = redesignedSurfaceLine
};
var xmlSerializer = new Deltares.Standard.IO.Xml.XmlSerializer();
xmlSerializer.Serialize(soilProfileWithSurfaceLine, PipingResultFile);
}
///
/// Opens the calculation file.
///
public void OpenCalculationFile()
{
if (File.Exists(InputFile))
{
string copyFile = Path.GetDirectoryName(InputFile) + Path.DirectorySeparatorChar +
Path.GetFileNameWithoutExtension(InputFile) + " (copy)" +
Path.GetExtension(InputFile);
File.Copy(InputFile, copyFile, true);
var process = new Process
{
StartInfo = new ProcessStartInfo(copyFile)
{
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Normal
}
};
try
{
process.Start();
}
catch (Exception)
{
ExceptionMessage = string.Format(
"The file {0} could not be opened with D-Stability. Make sure D-Stability is installed and that files with the extension {1} are associated with D-Stability.",
InputFile, Path.GetExtension(InputFile));
DataEventPublisher.AfterChange(this, "ExceptionMessage");
}
}
else
{
if (File.Exists(PipingResultFile))
{
string copyFile = Path.GetTempPath() + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(PipingResultFile) + " (copy)" +
Path.GetExtension(PipingResultFile);
File.Copy(PipingResultFile, copyFile, true);
Process.Start(copyFile);
}
}
}
public bool IsEnabled(string property)
{
return true;
}
public bool IsVisible(string property)
{
if (damFailureMechanismeCalculationSpecification == null)
{
return false;
}
switch (property)
{
case "StabilityModel":
return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ==
FailureMechanismSystemType.StabilityInside ||
damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ==
FailureMechanismSystemType.StabilityOutside;
case "PipingModel":
return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ==
FailureMechanismSystemType.Piping;
case "PipingFactor":
return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ==
FailureMechanismSystemType.Piping;
case "HCritical":
return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ==
FailureMechanismSystemType.Piping;
case "OpenCalculationFile":
return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType !=
FailureMechanismSystemType.Piping;
default:
return true;
}
}
}
}