// Copyright (C) Stichting Deltares 2018. 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; 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 ProbabilisticType probabilisticType; private DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification; private Scenario scenario; private SoilProfile1D soilProfile; private string soilGeometry2DName; private double? failureProbabilityPiping; private double? localPipingExitPointX; private double? safetyFactorStability; private double? failureProbabilityStability; private double? zone1SafetyFactorStability; private double? localZone1EntryPointX; private double? localZone1ExitPointX; private double? zone2SafetyFactorStability; private double? localZone2EntryPointX; private double? localZone2ExitPointX; 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 ResultEvaluation resultEvaluation = ResultEvaluation.NotEvaluated; private string notes = ""; private StabilityKernelType selectedStabilityKernelType = StabilityKernelType.DamClassicStabilty; // 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; public CsvExportData() { // this contructor is needed for the UI table eventhough is seems not to be referenced. } /// /// 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; } [Browsable(false)] public StabilityKernelType SelectedStabilityKernelType { get { return selectedStabilityKernelType; } set { selectedStabilityKernelType = value; } } /// /// Gets or sets the number of iterations (as used in the design calculation). /// /// /// The number of iterations. /// [Label("Number of iterations")] [ReadOnly(true)] public int NumberOfIterations { get { if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside || damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityOutside) { var mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName); if (mstabResults != null) { numberOfIterations = mstabResults.Value.IterationNumber; } } return numberOfIterations; } set { numberOfIterations = value; } } /// /// Gets the result file. /// /// /// The result file. /// [Browsable(false)] [Label("Image file")] public string ResultFile { get { if (!String.IsNullOrEmpty(BaseFileName)) { const string wmfExtension = ".wmf"; string fullBaseFilename = DamProject.ProjectWorkingPath; if (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)] [Label("Input file")] private string InputFile { get { if (!String.IsNullOrEmpty(BaseFileName)) { string fileExtension = ".sti"; if (selectedStabilityKernelType != StabilityKernelType.DamClassicStabilty) { fileExtension = ".dsx"; } string fullBaseFilename = DamProject.ProjectWorkingPath; if (CalculationSubDir != "") { fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir); } fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName; string fullFilename = fullBaseFilename + fileExtension; return fullFilename; } return ""; } } /// /// Gets the piping result file. /// /// /// The piping result file. /// [Browsable(false)] [Label("Input file")] private string PipingResultFile { // Path of piping is not based on the working dir but on assembly (Assembly.GetExecutingAssembly().Location) get { if (!String.IsNullOrEmpty(BaseFileName)) { const string txtExtension = ".txt"; string fullBaseFilename = DamProject.ProjectWorkingPath; if (CalculationSubDir != "") { fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir); } fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName; string fullFilename = fullBaseFilename + txtExtension; return fullFilename; } return ""; } } [Label("Analysis")] [PropertyOrder(1, 2)] [ReadOnly(true)] public AnalysisType AnalysisType // moet vanuit invoer komen { get { return analysisType; } set { analysisType = value; } } [Label("Probabilistic")] [PropertyOrder(1, 3)] [ReadOnly(true)] public ProbabilisticType ProbabilisticType // moet vanuit invoer komen { get { return probabilisticType; } set { probabilisticType = 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(); } } [CsvExportColumn("DikeName", 2)] [Browsable(false)] [Label("Dike")] public string DikeName { get { return dikeName; } set { dikeName = value; } } [CsvExportColumn("Calculation", 3)] [Browsable(false)] public string Calculation { get { return damFailureMechanismeCalculationSpecification != null ? damFailureMechanismeCalculationSpecification.ToString() : ""; } } [CsvExportColumn("Scenario", 4)] [Browsable(false)] public string ScenarioName { get { return scenarioName; } set { scenarioName = value; } } [CsvExportColumn("LocationName", 5)] [Label("Location")] [PropertyOrder(0, 1)] [ReadOnly(true)] public string LocationName { get { return locationName; } set { locationName = value; } } [Label("Scenario")] [PropertyOrder(0, 2)] [ReadOnly(true)] public string ScenarioDefinitionName { get { return scenarioName + " of " + locationScenarioCount.ToString(); } } [Label("Calculation result")] [PropertyOrder(0, 3)] [ReadOnly(true)] public CalculationResult CalculationResult { get { return calculationResult; } set { calculationResult = value; } } [Label("Message")] [PropertyOrder(8,1)] [ReadOnly(true)] public string ResultMessage { get { return resultMessage; } set { resultMessage = value; } } [CsvExportColumn("X", 6)] [Label("Global X-coordinate")] [Format("F3")] [PropertyOrder(1, 0)] [Unit(UnitType.Length)] [XmlIgnore] [ReadOnly(true)] public double X { get { return xRd; } set { xRd = value; } } [CsvExportColumn("Y", 7)] [Label("Global Y-coordinate")] [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; } } [Label("River level")] [CsvExportColumn("RiverLevel", 9)] [PropertyOrder(2, 12)] [Format("F3")] [ReadOnly(true)] public double? RiverLevel { get { return scenario.RiverLevel; } } [Label("River level low")] [CsvExportColumn("RiverLevelLow", 10)] [PropertyOrder(2, 13)] [Format("F3")] [ReadOnly(true)] public double? RiverLevelLow { get { return scenario.RiverLevelLow; } } [Label("Dike table height")] [CsvExportColumn("DikeTableHeight", 11)] [PropertyOrder(2, 14)] [Format("F3")] [ReadOnly(true)] public double? DikeTableHeight { get { return scenario.DikeTableHeight; } } [Label("Slope damping factor")] [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) { return scenario.Location.GetSoilProfileProbability(soilProfile, failureMechanismType); } [CsvExportColumn("StabilityProfileName", 16)] [Label("Stability profile")] [Browsable(false)] public string StabilityProfileName { get { return ProfileName; } } [CsvExportColumn("StabilityProfileProbability", 17)] [Label("Stability probability")] [Format("F3")] [Unit(UnitType.Fractions)] [Browsable(false)] public double? StabilityProfileProbability { get { return GetSoilProfileProbability(FailureMechanismSystemType.StabilityInside); } } [CsvExportColumn("PipingProfileName", 18)] [Label("Piping profile")] [Browsable(false)] public string PipingProfileName { get { return ProfileName; } } [CsvExportColumn("PipingProfileProbability", 19)] [Label("Piping probability")] [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)] [Label("Stability toe polder")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? StabilityToeAtPolderX { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; } } [CsvExportColumn("StabilityToeAtPolderZ", 22)] [Label("Height stability toe polder")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? StabilityToeAtPolderZ { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; } } [CsvExportColumn("StabilityShoulderHeight", 23)] [Label("Stability shoulder height")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? StabilityShoulderHeight { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; } } [CsvExportColumn("StabilitySafetyFactor", 24)] [Label("Stability safety factor")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? StabilitySafetyFactor { get { return safetyFactorStability; } set { safetyFactorStability = value; } } [CsvExportColumn("StabilityFailureProbability", 25)] [Label("Stability failure probability")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? StabilityFailureProbability { get { return failureProbabilityStability; } set { failureProbabilityStability = value; } } [CsvExportColumn("RequiredSafetyFactorStabilityInnerSlope", 26)] [Label("Required safety factor stability inside")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? RequiredSafetyFactorStabilityInnerSlope { get { return scenario.RequiredSafetyFactorStabilityInnerSlope;} } [CsvExportColumn("RequiredSafetyFactorStabilityOuterSlope", 27)] [Label("Required safety factor stability outside")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? RequiredSafetyFactorStabilityOuterSlope { get { return scenario.RequiredSafetyFactorStabilityOuterSlope; } } [CsvExportColumn("RequiredSafetyFactorPiping", 28)] [Label("Required safety factor piping")] [Format("F3")] [Unit(UnitType.Length)] [ReadOnly(true)] [Browsable(false)] public double? RequiredSafetyFactorPiping { get { return scenario.RequiredSafetyFactorPiping; } } [CsvExportColumn("PipingToeAtPolderX", 29)] [Label("Piping toe")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? PipingToeAtPolderX { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; } } [CsvExportColumn("PipingToeAtPolderZ", 30)] [Label("Height Piping toe")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? PipingToeAtPolderZ { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; } } [CsvExportColumn("PipingShoulderHeight", 31)] [Label("Piping shoulder height")] [Format("F3")] [Unit(UnitType.Length)] [Browsable(false)] public double? PipingShoulderHeight { get { if (redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; } } [CsvExportColumn("PipingFailureProbability", 32)] [Label("Piping failure probability")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? PipingFailureProbability { get { return failureProbabilityPiping; } set { failureProbabilityPiping = value; } } [Label("Required piping failure probability")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? RequiredFailureProbabilityPiping { get { return scenario.RequiredProbabilityOfFailurePiping; } } [CsvExportColumn("DikeLength", 33)] [Label("Dike length")] [Format("F3")] [PropertyOrder(4, 1)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? DikeLength { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.GetDikeLength(); } return null; } } [CsvExportColumn("Zone1SafetyFactorStability", 34)] [Label("Zone 1 safety factor")] [Format("F3")] [PropertyOrder(3, 1)] [Unit(UnitType.None)] [ReadOnly(true)] public double? Zone1SafetyFactorStability { get { return zone1SafetyFactorStability; } set { zone1SafetyFactorStability = value; } } [Label("Zone 1 entry point (X-local)")] [Format("F3")] [PropertyOrder(3, 2)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? LocalZone1EntryPointX { get { return localZone1EntryPointX; } set { localZone1EntryPointX = value; } } [CsvExportColumn("Zone1EntryPointX", 36)] [Label("Zone 1 entry point (X-global)")] [Format("F3")] [PropertyOrder(3, 3)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Zone1EntryPointX { get { if (localZone1EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Zone1EntryPointY", 37)] [Label("Zone 1 entry point (Y-global)")] [Format("F3")] [PropertyOrder(3, 4)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Zone1EntryPointY { get { if (localZone1EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [CsvExportColumn("Zone1EntryPointZ", 38)] [Label("Zone 1 entry point (Z)")] [Format("F3")] [PropertyOrder(3, 5)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Zone1EntryPointZ { get { if (localZone1EntryPointX == null) return null; if (redesignedSurfaceLine == null) return null; return redesignedSurfaceLine.Geometry.GetZAtX(localZone1EntryPointX.Value); } } [CsvExportColumn("LocalZone1ExitPointX", 39)] [Label("Zone 1 exit point (X-local)")] [Format("F3")] [PropertyOrder(3, 6)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? LocalZone1ExitPointX { get { return localZone1ExitPointX; } set { localZone1ExitPointX = value; } } [CsvExportColumn("Zone1ExitPointX", 40)] [Label("Zone 1 exit point (X-global)")] [Format("F3")] [PropertyOrder(3, 7)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone1ExitPointX { get { if (localZone1ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Zone1ExitPointY", 41)] [Label("Zone 1 exit point (Y-global)")] [Format("F3")] [PropertyOrder(3, 8)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone1ExitPointY { get { if (localZone1ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [CsvExportColumn("Zone1ExitPointZ", 42)] [Label("Zone 1 exit point (Z)")] [Format("F3")] [PropertyOrder(3, 9)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone1ExitPointZ { get { if (localZone1ExitPointX == null) return null; if (redesignedSurfaceLine == null) return null; return redesignedSurfaceLine.Geometry.GetZAtX(localZone1ExitPointX.Value); } } [CsvExportColumn("Zone2SafetyFactorStability", 43)] [Label("Zone 2 safety factor")] [Format("F3")] [PropertyOrder(3, 10)] [Unit(UnitType.None)] [ReadOnly(true)] public double? Zone2SafetyFactorStability { get { return zone2SafetyFactorStability; } set { zone2SafetyFactorStability = value; } } [CsvExportColumn("LocalZone2EntryPointX", 44)] [Label("Zone 2 entry point (X-local)")] [Format("F3")] [PropertyOrder(3, 11)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? LocalZone2EntryPointX { get { return localZone2EntryPointX; } set { localZone2EntryPointX = value; } } [CsvExportColumn("Zone2EntryPointX", 45)] [Label("Zone 2 entry point (X-global)")] [Format("F3")] [PropertyOrder(3, 12)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2EntryPointX { get { if (localZone2EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Zone2EntryPointY", 46)] [Label("Zone 2 entry point (Y-global)")] [Format("F3")] [PropertyOrder(3, 13)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2EntryPointY { get { if (localZone2EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [CsvExportColumn("Zone2EntryPointZ", 47)] [Label("Zone 2 entry point (Z)")] [Format("F3")] [PropertyOrder(3, 14)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2EntryPointZ { get { if (localZone2EntryPointX == null) return null; if (redesignedSurfaceLine == null) return null; return redesignedSurfaceLine.Geometry.GetZAtX(localZone2EntryPointX.Value); } } [CsvExportColumn("LocalZone2ExitPointX", 48)] [Label("Zone 2 exit point (X-local)")] [Format("F3")] [PropertyOrder(3, 15)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? LocalZone2ExitPointX { get { return localZone2ExitPointX; } set { localZone2ExitPointX = value; } } [CsvExportColumn("Zone2ExitPointX", 49)] [Label("Zone 2 exit point (X-global)")] [Format("F3")] [PropertyOrder(3, 16)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2ExitPointX { get { if (localZone2ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Zone2ExitPointY", 50)] [Label("Zone 2 exit point (Y-global)")] [Format("F3")] [PropertyOrder(3, 17)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2ExitPointY { get { if (localZone2ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [CsvExportColumn("Zone2ExitPointZ", 51)] [Label("Zone 2 exit point (Z)")] [Format("F3")] [PropertyOrder(3, 18)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Zone2ExitPointZ { get { if (localZone2ExitPointX == null || redesignedSurfaceLine == null) return null; return redesignedSurfaceLine.Geometry.GetZAtX(localZone2ExitPointX.Value); } } [CsvExportColumn("IsUplift", 52)] [Label("Uplift")] [PropertyOrder(1, 4)] [ReadOnly(true)] public bool? IsUplift { get { return isUplift; } set { isUplift = value; } } [CsvExportColumn("Pl3MinUplift", 53)] [Label("PL3 Min uplift")] [Format("F3")] [PropertyOrder(5, 1)] [Unit(UnitType.None)] [ReadOnly(true)] public double? Pl3MinUplift { get { return pl3MinUplift; } set { pl3MinUplift = value; } } [CsvExportColumn("Pl3HeadAdjusted", 54)] [Label("PL3 Head adjusted")] [Format("F3")] [PropertyOrder(5, 2)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Pl3HeadAdjusted { get { return pl3HeadAdjusted; } set { pl3HeadAdjusted = value; } } [CsvExportColumn("pl3LocalLocationXMinUplift", 55)] [Label("PL3 Min uplift (X-local)")] [Format("F3")] [PropertyOrder(5, 3)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Pl3LocalLocationXMinUplift { get { return pl3LocalLocationXMinUplift; } set { pl3LocalLocationXMinUplift = value; } } [CsvExportColumn("Pl3LocationXMinUplift", 56)] [Label("PL3 Min uplift (X-global)")] [Format("F3")] [PropertyOrder(5, 4)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Pl3LocationXMinUplift { get { if (pl3LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Pl3LocationYMinUplift", 57)] [Label("PL3 Min uplift (Y-global)")] [Format("F3")] [PropertyOrder(5, 5)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Pl3LocationYMinUplift { get { if (pl3LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [CsvExportColumn("Pl4MinUplift", 58)] [Label("PL4 Min uplift")] [Format("F3")] [PropertyOrder(5, 6)] [Unit(UnitType.None)] [ReadOnly(true)] public double? Pl4MinUplift { get { return pl4MinUplift; } set { pl4MinUplift = value; } } [CsvExportColumn("Pl4HeadAdjusted", 59)] [Label("PL4 Head adjusted")] [Format("F3")] [PropertyOrder(5, 7)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Pl4HeadAdjusted { get { return pl4HeadAdjusted; } set { pl4HeadAdjusted = value; } } [CsvExportColumn("pl4LocalLocationXMinUplift", 60)] [Label("PL4 Min uplift (X-local)")] [Format("F3")] [PropertyOrder(5, 8)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? Pl4LocalLocationXMinUplift { get { return pl4LocalLocationXMinUplift; } set { pl4LocalLocationXMinUplift = value; } } [CsvExportColumn("Pl4LocationXMinUplift", 61)] [Label("PL4 Min uplift (X-global)")] [Format("F3")] [PropertyOrder(5, 9)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Pl4LocationXMinUplift { get { if (pl4LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [CsvExportColumn("Pl4LocationYMinUplift", 62)] [Label("PL4 Min uplift (Y-global)")] [Format("F3")] [PropertyOrder(5, 10)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? Pl4LocationYMinUplift { get { if (pl4LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [Label("Uplift Factor")] [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)] [Label("Bligh H critical")] [Format("F3")] [Unit(UnitType.Length)] [ReadOnly(true)] [Browsable(false)] public double? BlighHCritical { get { return blighHCritical; } set { blighHCritical = value; } } [CsvExportColumn("Sellmeijer2ForcesPipingFactor", 65)] [Label("Sellmeijer 2 piping factor")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? Sellmeijer2ForcesPipingFactor { get { return sellmeijer2ForcesPipingFactor; } set { sellmeijer2ForcesPipingFactor = value; } } [CsvExportColumn("Sellmeijer2ForcesHCritical", 66)] [Label("Sellmeijer 2 H Critical")] [Format("F3")] [Unit(UnitType.Length)] [ReadOnly(true)] [Browsable(false)] public double? Sellmeijer2ForcesHCritical { get { return sellmeijer2ForcesHCritical; } set { sellmeijer2ForcesHCritical = value; } } [CsvExportColumn("Sellmeijer4ForcesPipingFactor", 67)] [Label("Sellmeijer 4 piping factor")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? Sellmeijer4ForcesPipingFactor { get { return sellmeijer4ForcesPipingFactor; } set { sellmeijer4ForcesPipingFactor = value; } } [CsvExportColumn("Sellmeijer4ForcesHCritical", 68)] [Label("Sellmeijer 4 H Critical")] [Format("F3")] [Unit(UnitType.Length)] [ReadOnly(true)] [Browsable(false)] public double? Sellmeijer4ForcesHCritical { get { return sellmeijer4ForcesHCritical; } set { sellmeijer4ForcesHCritical = value; } } [CsvExportColumn("SellmeijerPipingFactor", 69)] [Label("Sellmeijer piping factor")] [Format("F3")] [Unit(UnitType.None)] [ReadOnly(true)] [Browsable(false)] public double? SellmeijerPipingFactor { get { return sellmeijerPipingFactor; } set { sellmeijerPipingFactor = value; } } [CsvExportColumn("SellmeijerHCritical", 70)] [Label("Sellmeijer H Critical")] [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 null; } } [CsvExportColumn("DikeToeAtRiverYrd", 86)] [Browsable(false)] public double? DikeToeAtRiverYrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } return null; } } [CsvExportColumn("DikeToeAtRiverZrd", 87)] [Browsable(false)] public double? DikeToeAtRiverZrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } return null; } } [CsvExportColumn("DikeTopAtRiverXrd", 88)] [Browsable(false)] public double? DikeTopAtRiverXrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } return null; } } [CsvExportColumn("DikeTopAtRiverYrd", 89)] [Browsable(false)] public double? DikeTopAtRiverYrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } return null; } } [CsvExportColumn("DikeTopAtRiverZrd", 90)] [Browsable(false)] public double? DikeTopAtRiverZrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } return null; } } [CsvExportColumn("DikeTopAtPolderXrd", 91)] [Browsable(false)] public double? DikeTopAtPolderXrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } return null; } } [CsvExportColumn("DikeTopAtPolderYrd", 92)] [Browsable(false)] public double? DikeTopAtPolderYrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } return null; } } [CsvExportColumn("DikeTopAtPolderZrd", 93)] [Browsable(false)] public double? DikeTopAtPolderZrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } return null; } } [CsvExportColumn("DikeToeAtPolderXrd", 94)] [Browsable(false)] public double? DikeToeAtPolderXrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } return null; } } [CsvExportColumn("DikeToeAtPolderYrd", 95)] [Browsable(false)] public double? DikeToeAtPolderYrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } return null; } } [CsvExportColumn("DikeToeAtPolderZrd", 96)] [Browsable(false)] public double? DikeToeAtPolderZrd { get { if (redesignedSurfaceLineGlobal != null) { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } return null; } } [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)] public SoilProfile1D SoilProfile { get { 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() { if (redesignedSurfaceLine == null) return null; SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); var localRedesignedSurfaceLineGlobal = redesignedSurfaceLine.FullDeepClone(); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLineGlobal.Geometry); return localRedesignedSurfaceLineGlobal; } [Browsable(false)] public SurfaceLine2 RedesignedSurfaceLine2 { get { return redesignedSurfaceLine; } set { redesignedSurfaceLine = value; // Also determine and set the correct global version in order to retrieve dependend properties redesignedSurfaceLineGlobal = CreateRedesignedSurfaceLineGlobal(); } } [Label("Profile")] [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; } [Label("Profile probability")] [Format("F3")] [PropertyOrder(2, 2)] [Unit(UnitType.Fractions)] [ReadOnly(true)] [XmlIgnore] public double? ProfileProbability { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.HorizontalBalance: case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: res = StabilityProfileProbability; break; case FailureMechanismSystemType.Piping: res = PipingProfileProbability; break; } return res; } } [Label("StabilityModel")] [Unit(UnitType.None)] [PropertyOrder(2, 3)] [ReadOnly(true)] public MStabModelType? StabilityModel { get { if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside || damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityOutside) { var mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName); if (mstabResults != null) { stabilityModel = mstabResults.Value.MStabModelType; } } return stabilityModel; } set { stabilityModel = value; } } [Label("SafetyFactor")] [Unit(UnitType.None)] [Format("F3")] [PropertyOrder(2, 4)] [ReadOnly(true)] [XmlIgnore] public double? SafetyFactor { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.HorizontalBalance: case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: res = StabilitySafetyFactor; break; case FailureMechanismSystemType.Piping: res = PipingFactor; break; } return res; } } [Label("Failure probability")] [Format("F3")] [PropertyOrder(2, 5)] [Unit(UnitType.None)] [ReadOnly(true)] [XmlIgnore] public double? FailureProbability { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.HorizontalBalance: case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: res = StabilityFailureProbability; break; case FailureMechanismSystemType.Piping: res = PipingFailureProbability; break; } return res; } } [Label("Required failure probability")] [Format("F3")] [PropertyOrder(2, 9)] [Unit(UnitType.None)] [ReadOnly(true)] [XmlIgnore] public double? RequiredFailureProbability { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.Piping: res = RequiredFailureProbabilityPiping; break; } return res; } } [Label("Required safety factor")] [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; } } [Label("Shoulder height")] [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; } } [Label("Toe polder")] [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; } } [Label("Height toe polder")] [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; } } [Label("Piping model")] [PropertyOrder(6, 1)] [Unit(UnitType.None)] [ReadOnly(true)] [XmlIgnore] public PipingModelType? PipingModel { get { if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping) { return damFailureMechanismeCalculationSpecification.PipingModelType; } return null; } } [Label("Piping factor")] [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; } } [Label("Piping entry point (X-local)")] [Format("F3")] [PropertyOrder(6, 3)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? LocalPipingEntryPointX { get { GeometryPoint point = null; if (redesignedSurfaceLine != null) { point = redesignedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } if (point != null) return point.X; return null; } } [Label("Piping entry point (X-global)")] [Format("F3")] [PropertyOrder(6, 4)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? PipingEntryPointX { get { if (LocalPipingEntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [Label("Piping entry point (Y-global)")] [Format("F3")] [PropertyOrder(6, 5)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? PipingEntryPointY { get { if (LocalPipingEntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [Label("Piping exit point (X-local)")] [Format("F3")] [PropertyOrder(6, 6)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? LocalPipingExitPointX { get { return localPipingExitPointX; } set { localPipingExitPointX = value; } } [Label("Piping exit point (X-global)")] [Format("F3")] [PropertyOrder(6, 7)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? PipingExitPointX { get { if (localPipingExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } } [Label("Piping exit point (Y-global)")] [Format("F3")] [PropertyOrder(6, 8)] [Unit(UnitType.Length)] [ReadOnly(true)] [XmlIgnore] public double? PipingExitPointY { get { if (localPipingExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } } [Format("F3")] [PropertyOrder(6, 9)] [Unit(UnitType.Length)] [ReadOnly(true)] public double? SeepageLength { get { return localPipingExitPointX - LocalPipingEntryPointX; } } [Label("H critical")] [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; } } [Label("Evaluation")] //[Category(ResultCategory)] public ResultEvaluation ResultEvaluation { get { return resultEvaluation; } set { DataEventPublisher.BeforeChange(this, "ResultEvaluation"); resultEvaluation = value; DataEventPublisher.AfterChange(this, "ResultEvaluation"); } } [Label("Notes")] [Description("Use this area to explain the valuation and for any further remarks")] //[Category(ResultCategory)] 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); } } private string GetCurrentExeForOpenCalculationFile() { var exeName = DamHelperFunctions.MStabExePath; if (SelectedStabilityKernelType != StabilityKernelType.DamClassicStabilty) { exeName = Path.GetDirectoryName(exeName) + "\\MStab.exe"; } return exeName; } /// /// 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 exeName = GetCurrentExeForOpenCalculationFile(); if (SelectedStabilityKernelType == StabilityKernelType.DamClassicStabilty) { const string stdExtension = ".std"; CopyResultFile(stdExtension); const string stoExtension = ".sto"; CopyResultFile(stoExtension); } var process = new Process { StartInfo = { RedirectStandardOutput = false, FileName = exeName } }; if (SelectedStabilityKernelType == StabilityKernelType.DamClassicStabilty) { process.StartInfo.Arguments = " \"" + copyFile + "\""; } process.StartInfo.UseShellExecute = false; process.StartInfo.WindowStyle = ProcessWindowStyle.Normal; process.Start(); } 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) { // #Bka note that using FailureMechanismSystemType here is only possible as long as multiple specifications are NOT allowed. Otherwise visibility would // have top be set here per line instead for whole column. case "Zone1SafetyFactorStability": case "Zone1EntryPointX": case "Zone1EntryPointZ": case "Zone1ExitPointX": case "Zone1ExitPointZ": case "Zone2SafetyFactorStability": case "Zone2EntryPointX": case "Zone2EntryPointZ": case "Zone2ExitPointX": case "Zone2ExitPointZ": return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside;// && //(damFailureMechanismeCalculationSpecification.FailureMechanismeParamatersMStab.MStabParameters.ZonesType == MStabZonesType.ZoneAreas || //damFailureMechanismeCalculationSpecification.FailureMechanismeParamatersMStab.MStabParameters.ZonesType == MStabZonesType.ForbiddenZone); //#Bka: zones are defined per location so can differ from result to result. Hence using Isvisible is not possible for this as zones should then be made // visible or invisible per line in the table. case "StabilityModel": return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityInside || damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.StabilityOutside; case "RequiredSafetyFactor": return probabilisticType == ProbabilisticType.Deterministic; case "SafetyFactor": return probabilisticType == ProbabilisticType.Deterministic; case "FailureProbability": return probabilisticType == ProbabilisticType.Probabilistic || probabilisticType == ProbabilisticType.ProbabilisticFragility; case "RequiredFailureProbability": return probabilisticType == ProbabilisticType.Probabilistic || probabilisticType == ProbabilisticType.ProbabilisticFragility; case "PipingModel": return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping; case "PipingFactor": return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping; case "HCritical": return damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping; case "OpenCalculationFile": return File.Exists(GetCurrentExeForOpenCalculationFile()); default: return true; } } } }