// Copyright (C) Stichting Deltares 2017. All rights reserved. // // This file is part of the DAM Engine. // // The DAM Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Xml.Serialization; using Deltares.DamEngine.Data.General; using Deltares.DamEngine.Data.General.Results; using Deltares.DamEngine.Data.Geometry; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.Data.Standard.Calculation; namespace Deltares.DamEngine.Data.Design { /// ///1:"Id":invoer ///2:"Dijkringnaam":invoer ///3:"RDX":invoer ///4:"RDY":invoer ///5:"Scenarionummer (waterhoogtenummer, hoeveelste \"entry\" uit tabel; 1, 2, 3, 4 of 5)":invoer ///6:"Waterhoogtewaarde":invoer ///7:"Dijkhoogte bestaand":invoer ///8:"Huidige locatie teen":invoer ///9:"Dijktafelhoogte":invoer ///10:"1Dprofiel":invoer ///11:"Mechanisme":invoer ///12:"1Dprofiel kans":invoer ///13:"Berekende lokatie teen":uitvoer ///14:"Bermhoogte":uitvoer ///15:"Dijkbasis bestaand":invoer ///16:"Dijkbasis nieuw":uitvoer /// public class CsvExportData : ICloneable { private string id; private string baseFileName; private string calculationSubDir; private Dike dike; private AnalysisType analysisType; private ProbabilisticType probabilisticType; private DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification; private Scenario scenario; private SoilProfile1D soilProfile; private string soilGeometry2DName; private double? safetyFactorFlowSlide; private double? failureProbabilityPiping; private double? localPipingExitPointX; private SurfaceLine2 redesignedSurfaceLinePiping; 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? wti2017PipingFactor; private double? wti2017HCritical; private bool? isUplift; private double? pl3MinUplift; private double? pl3HeadAdjusted; private double? pl3LocalLocationXMinUplift; private double? pl4MinUplift; private double? pl4HeadAdjusted; private double? pl4LocalLocationXMinUplift; private readonly string nwoId; private readonly int nwoResultIndex; private double? locationXrdStart; private double? locationYrdStart; private readonly double? locationZrdStart; private double? locationXrdEnd; private double? locationYrdEnd; private readonly double? locationZrdEnd; private CalculationResult calculationResult = CalculationResult.NoRun; private string resultMessage = ""; private int numberOfIterations; private ResultEvaluation resultEvaluation = ResultEvaluation.NotEvaluated; private string notes = ""; private bool dirty = true; private List points = new List(); private StabilityKernelType selectedStabilityKernelType = StabilityKernelType.DamClassic; private SurfaceLine2 redesignedSurfaceLineStability; public CsvExportData() { } public CsvExportData(string id, Dike dike, DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification, Scenario scenario, SoilProfile1D soilProfile, string soilGeometry2DName, AnalysisType analysisType, int nwoResultIndex, ProbabilisticType probabilisticType) { this.id = id; this.BaseFileName = ""; this.CalculationSubDir = ""; this.dike = dike; this.damFailureMechanismeCalculationSpecification = damFailureMechanismeCalculationSpecification; this.scenario = scenario; this.soilProfile = soilProfile; this.SoilGeometry2DName = soilGeometry2DName; this.analysisType = analysisType; this.failureProbabilityPiping = null; this.redesignedSurfaceLinePiping = null; this.safetyFactorStability = null; this.failureProbabilityStability = null; this.redesignedSurfaceLineStability = null; this.zone1SafetyFactorStability = null; this.LocalZone1EntryPointX = null; this.LocalZone1ExitPointX = null; this.zone2SafetyFactorStability = null; this.LocalZone2EntryPointX = null; this.LocalZone2ExitPointX = null; this.blighPipingFactor = null; this.blighHCritical = null; this.sellmeijer2ForcesPipingFactor = null; this.sellmeijer2ForcesHCritical = null; this.sellmeijer4ForcesPipingFactor = null; this.sellmeijer4ForcesHCritical = null; this.sellmeijerPipingFactor = null; this.sellmeijerHCritical = null; this.wti2017PipingFactor = null; this.wti2017HCritical = null; this.isUplift = null; this.pl3MinUplift = null; this.pl3HeadAdjusted = null; this.pl3LocalLocationXMinUplift = null; this.pl4MinUplift = null; this.pl4HeadAdjusted = null; this.pl4LocalLocationXMinUplift = null; this.nwoId = ""; this.nwoResultIndex = nwoResultIndex; this.locationXrdStart = null; this.locationXrdEnd = null; this.locationYrdStart = null; this.locationYrdEnd = null; this.locationZrdStart = null; this.locationZrdEnd = null; this.dirty = true; if (damFailureMechanismeCalculationSpecification != null) { this.probabilisticType = probabilisticType; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: case FailureMechanismSystemType.StabilityOutside: if (analysisType == AnalysisType.AdaptNWO) { // an index of 0 can also indicate an error message. That has no futher data so check if there actualy is any. if (scenario.NwoResults.Count > 0) { this.nwoId = scenario.NwoResults[nwoResultIndex].NwoId; this.locationXrdStart = scenario.NwoResults[nwoResultIndex].LocationXrdStart; this.locationYrdStart = scenario.NwoResults[nwoResultIndex].LocationYrdStart; this.locationZrdStart = scenario.NwoResults[nwoResultIndex].LocationZrdStart; this.locationXrdEnd = scenario.NwoResults[nwoResultIndex].LocationXrdEnd; this.locationYrdEnd = scenario.NwoResults[nwoResultIndex].LocationYrdEnd; this.locationZrdEnd = scenario.NwoResults[nwoResultIndex].LocationZrdEnd; this.dirty = true; this.BaseFileName = scenario.NwoResults[nwoResultIndex].MStabResults.CalculationName; this.CalculationSubDir = scenario.NwoResults[nwoResultIndex].MStabResults.CalculationSubDir; this.numberOfIterations = scenario.NwoResults[nwoResultIndex].MStabResults.IterationNumber; this.safetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor; this.zone1SafetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor; this.LocalZone1EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.entryPointXCoordinate; this.LocalZone1ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.exitPointXCoordinate; if (scenario.NwoResults[nwoResultIndex].MStabResults.zone2 != null) { this.zone2SafetyFactorStability = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.safetyFactor; this.LocalZone2EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.entryPointXCoordinate; this.LocalZone2ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.exitPointXCoordinate; } } } else { MStabResults? mstabResults = scenario.GetMStabResults(this.SoilProfile, this.SoilGeometry2DName); this.resultMessage = scenario.GetResultMessage(this.SoilProfile, this.SoilGeometry2DName); calculationResult = DetermineStabilityCalculationResult(this.resultMessage, mstabResults); if (mstabResults != null) { BaseFileName = mstabResults.Value.CalculationName; CalculationSubDir = mstabResults.Value.CalculationSubDir; numberOfIterations = mstabResults.Value.IterationNumber; this.safetyFactorStability = mstabResults.Value.zone1.safetyFactor; this.zone1SafetyFactorStability = mstabResults.Value.zone1.safetyFactor; this.LocalZone1EntryPointX = mstabResults.Value.zone1.entryPointXCoordinate; this.LocalZone1ExitPointX = mstabResults.Value.zone1.exitPointXCoordinate; if (mstabResults.Value.zone2 != null) { this.zone2SafetyFactorStability = mstabResults.Value.zone2.Value.safetyFactor; this.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate; this.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate; } } } this.failureProbabilityStability = scenario.GetFailureProbabilityStability(this.SoilProfile, this.SoilGeometry2DName); this.redesignedSurfaceLineStability = scenario.GetRedesignedSurfaceLine(this.SoilProfile, this.SoilGeometry2DName); UpliftSituation? upliftSituation = scenario.GetStabilityUpliftSituation(this.SoilProfile, this.SoilGeometry2DName); if (upliftSituation != null) { SetUpliftSituationResults(upliftSituation.Value); } break; case FailureMechanismSystemType.Piping: this.failureProbabilityPiping = scenario.GetFailureProbabilityPiping(this.SoilProfile, this.SoilGeometry2DName); this.resultMessage = scenario.GetResultMessage(this.SoilProfile, this.SoilGeometry2DName); this.redesignedSurfaceLinePiping = scenario.GetRedesignedSurfaceLine(this.SoilProfile, this.SoilGeometry2DName); UpliftSituation? upliftSituationPiping = scenario.GetStabilityUpliftSituation(this.SoilProfile, this.SoilGeometry2DName); if (upliftSituationPiping != null) { SetUpliftSituationResults(upliftSituationPiping.Value); } PipingResults? pipingResults = scenario.GetPipingResults(this.SoilProfile, this.SoilGeometry2DName); if (pipingResults != null) { BaseFileName = pipingResults.Value.CalculationName; CalculationSubDir = pipingResults.Value.CalculationSubDir; this.blighPipingFactor = pipingResults.Value.BlighPipingFactor; this.blighHCritical = pipingResults.Value.BlighHCritical; this.sellmeijer2ForcesPipingFactor = pipingResults.Value.Sellmeijer2ForcesPipingFactor; this.sellmeijer2ForcesHCritical = pipingResults.Value.Sellmeijer2ForcesHCritical; this.sellmeijer4ForcesPipingFactor = pipingResults.Value.Sellmeijer4ForcesPipingFactor; this.sellmeijer4ForcesHCritical = pipingResults.Value.Sellmeijer4ForcesHCritical; this.sellmeijerPipingFactor = pipingResults.Value.SellmeijerPipingFactor; this.sellmeijerHCritical = pipingResults.Value.SellmeijerHCritical; this.wti2017PipingFactor = pipingResults.Value.Wti2017PipingFactor; this.wti2017HCritical = pipingResults.Value.Wti2017HCritical; this.localPipingExitPointX = pipingResults.Value.PipingExitPointX; this.HeaveFactor = pipingResults.Value.HeaveFactor; this.UpliftFactor = pipingResults.Value.UpliftFactor; } this.calculationResult = (this.PipingFactor == null && this.PipingFailureProbability == null) ? CalculationResult.RunFailed : CalculationResult.Succeeded; break; case FailureMechanismSystemType.FlowSlide: this.safetyFactorFlowSlide = scenario.GetSafetyFactorFlowSlide(this.SoilProfile, this.SoilGeometry2DName); break; } } } /// /// 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; } /// /// Determines the stability calculation run result. /// /// The result message. /// The mstab results. /// private CalculationResult DetermineStabilityCalculationResult(string message, MStabResults? mstabResults) { CalculationResult result; if ((message != null) && this.resultMessage.Contains("FAIL")) { result = CalculationResult.UnexpectedError; } else { // If no failure and no results, then no run has been made result = mstabResults != null ? CalculationResult.Succeeded : CalculationResult.NoRun; } return result; } /// /// Sets the uplift situation results. /// /// The uplift situation. private void SetUpliftSituationResults(UpliftSituation upliftSituation) { this.isUplift = upliftSituation.IsUplift; if (upliftSituation.Pl3MinUplift < double.MaxValue) { this.pl3MinUplift = upliftSituation.Pl3MinUplift; } if (upliftSituation.Pl3HeadAdjusted < double.MaxValue) { this.pl3HeadAdjusted = upliftSituation.Pl3HeadAdjusted; } if (upliftSituation.Pl3LocationXMinUplift < double.MaxValue) { this.pl3LocalLocationXMinUplift = upliftSituation.Pl3LocationXMinUplift; } if (upliftSituation.Pl4MinUplift < double.MaxValue) { this.pl4MinUplift = upliftSituation.Pl4MinUplift; } if (upliftSituation.Pl4HeadAdjusted < double.MaxValue) { this.pl4HeadAdjusted = upliftSituation.Pl4HeadAdjusted; } if (upliftSituation.Pl4LocationXMinUplift < double.MaxValue) { this.pl4LocalLocationXMinUplift = upliftSituation.Pl4LocationXMinUplift; } } public StabilityKernelType SelectedStabilityKernelType { get { return selectedStabilityKernelType; } set { selectedStabilityKernelType = value; } } public int NumberOfIterations { get { return numberOfIterations; } set { numberOfIterations = value; } } public string ResultFile { get { if (!String.IsNullOrEmpty(BaseFileName)) { const string wmfExtension = ".wmf"; string fullBaseFilename = DamProjectData.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 ""; } } public string InputFile { get { if (!String.IsNullOrEmpty(BaseFileName)) { string fileExtension = ".sti"; if (selectedStabilityKernelType != StabilityKernelType.DamClassic) { fileExtension = ".dsx"; } string fullBaseFilename = DamProjectData.ProjectWorkingPath; if (CalculationSubDir != "") { fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir); } fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName; string fullFilename = fullBaseFilename + fileExtension; return fullFilename; } return ""; } } public 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 = DamProjectData.ProjectWorkingPath; if (CalculationSubDir != "") { fullBaseFilename = Path.Combine(fullBaseFilename, CalculationSubDir); } fullBaseFilename = fullBaseFilename + Path.DirectorySeparatorChar + BaseFileName; string fullFilename = fullBaseFilename + txtExtension; return fullFilename; } return ""; } } public AnalysisType AnalysisType { get { return analysisType; } set { analysisType = value; } } public ProbabilisticType ProbabilisticType { get { return probabilisticType; } set { probabilisticType = value; } } [Browsable(false)] public DamFailureMechanismeCalculationSpecification DamFailureMechanismeCalculation { get { return damFailureMechanismeCalculationSpecification; } set { damFailureMechanismeCalculationSpecification = value; } } public string ID { get { return this.id; } } public string DikeName { get { return dike.Name; } } public string Calculation { get { return this.damFailureMechanismeCalculationSpecification != null ? this.damFailureMechanismeCalculationSpecification.ToString() : ""; } } public string ScenarioName { get { return this.Scenario.LocationScenarioID; } } public string LocationName { get { return this.Scenario.Location.Name; } } public int LocationScenarioCount { get { return this.Scenario.Location.Scenarios.Count; } } public string ScenarioDefinitionName { get { return this.Scenario.LocationScenarioID + " of " + this.LocationScenarioCount.ToString(); } } public CalculationResult CalculationResult { get { return calculationResult; } set { calculationResult = value; } } public string ResultMessage { get { return resultMessage; } set { resultMessage = value; } } [XmlIgnore] public double X { get { return (this.Scenario != null) ? this.Scenario.Location.XRd : 0.0; } set { if (this.Scenario != null) { this.Scenario.Location.XRd = value; } } } [XmlIgnore] public double Y { get { return (this.Scenario != null) ? this.Scenario.Location.YRd : 0.0; } set { if (this.Scenario != null) { this.Scenario.Location.YRd = value; } } } public string LocationScenarioId { get { return this.Scenario.LocationScenarioID; } } public double? RiverLevel { get { return this.Scenario.RiverLevel; } } public double? RiverLevelLow { get { return this.Scenario.RiverLevelLow; } } public double? DikeTableHeight { get { return this.Scenario.DikeTableHeight; } } public double? SlopeDampingPiezometricHeightPolderSide { get { return this.Scenario.Location.SlopeDampingPiezometricHeightPolderSide; } } public double? CurrentDikeHeight { get { return this.Scenario.Location.SurfaceLine2.GetDikeHeight(); } } public double? CurrentDikeToeAtPolderX { get { double? x = null; GeometryPoint point = this.Scenario.Location.SurfaceLine2.GetDikeToeInward(); if (point != null) x = point.X; return x; } } public double? CurrentDikeToeAtPolderZ { get { double? z = null; GeometryPoint point = this.Scenario.Location.SurfaceLine2.GetDikeToeInward(); if (point != null) z = point.Z; return z; } } private string GetSoilProfileName(FailureMechanismSystemType failureMechanismType) { string soilprofilename = ""; if (this.SoilProfile != null) { soilprofilename = this.SoilProfile.Name; } else { if (this.SoilGeometry2DName != null) { soilprofilename = this.SoilGeometry2DName; } } return failureMechanismType == this.damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ? soilprofilename : ""; } private double? GetSoilProfileProbability(FailureMechanismSystemType? failureMechanismType) { return this.Scenario.Location.GetSoilProfileProbability(this.SoilProfile, failureMechanismType); } public string StabilityProfileName { get { return GetSoilProfileName(FailureMechanismSystemType.StabilityInside); } } public double? StabilityProfileProbability { get { return GetSoilProfileProbability(FailureMechanismSystemType.StabilityInside); } } public string PipingProfileName { get { return GetSoilProfileName(FailureMechanismSystemType.Piping); } } public double? PipingProfileProbability { get { return GetSoilProfileProbability(FailureMechanismSystemType.Piping); } } public double? CurrentDikeLength { get { return this.Scenario.Location.SurfaceLine2.GetDikeLength(); } } public double? StabilityToeAtPolderX { get { if (this.redesignedSurfaceLineStability == null) return null; GeometryPoint point = this.redesignedSurfaceLineStability.GetDikeToeInward(); if (point != null) return point.X; else return null; } } public double? StabilityToeAtPolderZ { get { if (this.redesignedSurfaceLineStability == null) return null; GeometryPoint point = this.redesignedSurfaceLineStability.GetDikeToeInward(); if (point != null) return point.Z; else return null; } } public double? StabilityShoulderHeight { get { if (this.redesignedSurfaceLineStability == null) return null; GeometryPoint point = this.redesignedSurfaceLineStability.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; else return null; } } public double? StabilitySafetyFactor { get { return this.safetyFactorStability; } set { this.safetyFactorStability = value; } } public double? StabilityFailureProbability { get { return this.failureProbabilityStability; } set { this.failureProbabilityStability = value; } } public double? RequiredSafetyFactorStabilityInnerSlope { get { return this.Scenario.RequiredSafetyFactorStabilityInnerSlope;} } public double? RequiredSafetyFactorStabilityOuterSlope { get { return this.Scenario.RequiredSafetyFactorStabilityOuterSlope; } } public double? RequiredSafetyFactorPiping { get { return this.Scenario.RequiredSafetyFactorPiping; } } public double? PipingToeAtPolderX { get { if (this.redesignedSurfaceLinePiping == null) return null; GeometryPoint point = this.redesignedSurfaceLinePiping.GetDikeToeInward(); if (point != null) return point.X; else return null; } } public double? PipingToeAtPolderZ { get { if (this.redesignedSurfaceLinePiping == null) return null; GeometryPoint point = this.redesignedSurfaceLinePiping.GetDikeToeInward(); if (point != null) return point.Z; else return null; } } public double? PipingShoulderHeight { get { if (this.redesignedSurfaceLinePiping == null) return null; GeometryPoint point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; else return null; } } public double? PipingFailureProbability { get { return this.failureProbabilityPiping; } set { this.failureProbabilityPiping = value; } } public double? RequiredFailureProbabilityPiping { get { return this.Scenario.RequiredProbabilityOfFailurePiping; } } public double? DikeLength { get { double? maxDikeLength = null; List dikeLengths = new List(); SurfaceLine2 surfaceLine = this.Scenario.Location.SurfaceLine2; if (surfaceLine != null) dikeLengths.Add(surfaceLine.GetDikeLength()); switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: if (redesignedSurfaceLineStability != null) dikeLengths.Add(redesignedSurfaceLineStability.GetDikeLength()); break; case FailureMechanismSystemType.Piping: if (redesignedSurfaceLinePiping != null) dikeLengths.Add(redesignedSurfaceLinePiping.GetDikeLength()); break; } foreach (double? dikeLength in dikeLengths) { if (dikeLength.HasValue && (!maxDikeLength.HasValue || maxDikeLength < dikeLength)) maxDikeLength = dikeLength; } return maxDikeLength; } } public double? Zone1SafetyFactorStability { get { return this.zone1SafetyFactorStability; } set { this.zone1SafetyFactorStability = value; } } public double? LocalZone1EntryPointX { get { return localZone1EntryPointX; } set { localZone1EntryPointX = value; } } [XmlIgnore] public double? Zone1EntryPointX { get { if (this.LocalZone1EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone1EntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } [XmlIgnore] public double? Zone1EntryPointY { get { if (this.LocalZone1EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone1EntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } [XmlIgnore] public double? Zone1EntryPointZ { get { if (this.LocalZone1EntryPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; return this.redesignedSurfaceLineStability.Geometry.GetZatX(this.LocalZone1EntryPointX.Value); } } public double? LocalZone1ExitPointX { get { return localZone1ExitPointX; } set { localZone1ExitPointX = value; } } public double? Zone1ExitPointX { get { if (this.LocalZone1ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone1ExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } public double? Zone1ExitPointY { get { if (this.LocalZone1ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone1ExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? Zone1ExitPointZ { get { if (this.LocalZone1ExitPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; return this.redesignedSurfaceLineStability.Geometry.GetZatX(this.LocalZone1ExitPointX.Value); } } public double? Zone2SafetyFactorStability { get { return this.zone2SafetyFactorStability; } set { this.zone2SafetyFactorStability = value; } } public double? LocalZone2EntryPointX { get { return localZone2EntryPointX; } set { localZone2EntryPointX = value; } } public double? Zone2EntryPointX { get { if (this.LocalZone2EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone2EntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } public double? Zone2EntryPointY { get { if (this.LocalZone2EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone2EntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? Zone2EntryPointZ { get { if (this.LocalZone2EntryPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; return this.redesignedSurfaceLineStability.Geometry.GetZatX(this.LocalZone2EntryPointX.Value); } } public double? LocalZone2ExitPointX { get { return localZone2ExitPointX; } set { localZone2ExitPointX = value; } } public double? Zone2ExitPointX { get { if (this.LocalZone2ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone2ExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } public double? Zone2ExitPointY { get { if (this.LocalZone2ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalZone2ExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? Zone2ExitPointZ { get { if (this.LocalZone2ExitPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; return this.redesignedSurfaceLineStability.Geometry.GetZatX(this.LocalZone2ExitPointX.Value); } } public bool? IsUplift { get { return this.isUplift; } set { this.isUplift = value; } } public double? Pl3MinUplift { get { return this.pl3MinUplift; } set { this.pl3MinUplift = value; } } public double? Pl3HeadAdjusted { get { return this.pl3HeadAdjusted; } set { this.pl3HeadAdjusted = value; } } public double? Pl3LocalLocationXMinUplift { get { return this.pl3LocalLocationXMinUplift; } set { this.pl3LocalLocationXMinUplift = value; } } [XmlIgnore] public double? Pl3LocationXMinUplift { get { if (this.pl3LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.pl3LocalLocationXMinUplift.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } [XmlIgnore] public double? Pl3LocationYMinUplift { get { if (this.pl3LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.pl3LocalLocationXMinUplift.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? Pl4MinUplift { get { return this.pl4MinUplift; } set { this.pl4MinUplift = value; } } public double? Pl4HeadAdjusted { get { return this.pl4HeadAdjusted; } set { this.pl4HeadAdjusted = value; } } public double? Pl4LocalLocationXMinUplift { get { return this.pl4LocalLocationXMinUplift; } set { this.pl4LocalLocationXMinUplift = value; } } [XmlIgnore] public double? Pl4LocationXMinUplift { get { if (this.pl4LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.pl4LocalLocationXMinUplift.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } [XmlIgnore] public double? Pl4LocationYMinUplift { get { if (this.pl4LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.pl4LocalLocationXMinUplift.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? UpliftFactor { get { return this.upliftFactor; } set { this.upliftFactor = value; } } public double? HeaveFactor { get { return this.heaveFactor; } set { this.heaveFactor = value; } } public double? BlighPipingFactor { get { return this.blighPipingFactor; } set { this.blighPipingFactor = value; } } public double? BlighHCritical { get { return this.blighHCritical; } set { this.blighHCritical = value; } } public double? Sellmeijer2ForcesPipingFactor { get { return this.sellmeijer2ForcesPipingFactor; } set { this.sellmeijer2ForcesPipingFactor = value; } } public double? Sellmeijer2ForcesHCritical { get { return this.sellmeijer2ForcesHCritical; } set { this.sellmeijer2ForcesHCritical = value; } } public double? Sellmeijer4ForcesPipingFactor { get { return this.sellmeijer4ForcesPipingFactor; } set { this.sellmeijer4ForcesPipingFactor = value; } } public double? Sellmeijer4ForcesHCritical { get { return this.sellmeijer4ForcesHCritical; } set { this.sellmeijer4ForcesHCritical = value; } } public double? SellmeijerPipingFactor { get { return this.sellmeijerPipingFactor; } set { this.sellmeijerPipingFactor = value; } } public double? SellmeijerHCritical { get { return this.sellmeijerHCritical; } set { this.sellmeijerHCritical = value; } } /// /// Gets or sets the wti2017 piping factor. /// /// /// The wti2017 piping factor. /// public double? Wti2017PipingFactor { get { return wti2017PipingFactor; } set { wti2017PipingFactor = value; } } /// /// Gets or sets the wti2017 h critical. /// /// /// The wti2017 h critical. /// public double? Wti2017HCritical { get { return wti2017HCritical; } set { wti2017HCritical = value; } } public string NwoId { get { return this.nwoId; } } public int NwoResultIndex { get { return this.nwoResultIndex; } } public double? NWOLocationXrdStart { get { return this.locationXrdStart; } } public double? NWOLocationYrdStart { get { return this.locationYrdStart; } } public double? NWOLocationZrdStart { get { return this.locationZrdStart; } } public double? NWOLocationXrdEnd { get { return this.locationXrdEnd; } } public double? NWOLocationYrdEnd { get { return this.locationYrdEnd; } } public double? NWOLocationZrdEnd { get { return this.locationZrdEnd; } } //Note: using SurfaceLine instead of LocalXzSurfaceLine must give the proper RD coors. If this is not the case, error is somewhere else. Do not convert here! public double? DikeToeAtRiverXrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; } } public double? DikeToeAtRiverYrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } } public double? DikeToeAtRiverZrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } } public double? DikeTopAtRiverXrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } } public double? DikeTopAtRiverYrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } } public double? DikeTopAtRiverZrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } } public double? DikeTopAtPolderXrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } } public double? DikeTopAtPolderYrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } } public double? DikeTopAtPolderZrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } } public double? DikeToeAtPolderXrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } } public double? DikeToeAtPolderYrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } } public double? DikeToeAtPolderZrd { get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } } public double? FlowSlideSafetyFactor { get { return this.safetyFactorFlowSlide; } set { this.safetyFactorFlowSlide = value; } } public Scenario Scenario { get { return scenario; } set { scenario = value; } } public SoilProfile1D SoilProfile { get { return soilProfile; } set { soilProfile = value; } } public string SoilGeometry2DName { get { return soilGeometry2DName; } set { soilGeometry2DName = value; } } /// /// Creates a new instance based on /// with global coordinates instead of local coordinates. /// public SurfaceLine2 CreateRedesignedSurfaceLineStabilityGlobal() { if (this.RedesignedSurfaceLine2Stability == null) return null; SurfaceLine2 originalSurfaceLine = this.Scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); var redesignedSurfaceLineStabilityGlobal = new SurfaceLine2 { CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new GeometryPointString() }; redesignedSurfaceLineStabilityGlobal.Assign(this.RedesignedSurfaceLine2Stability); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLineStabilityGlobal.Geometry); return redesignedSurfaceLineStabilityGlobal; } public SurfaceLine2 RedesignedSurfaceLine2Stability { get { return redesignedSurfaceLineStability; } set { redesignedSurfaceLineStability = value; } } /// /// Creates a new instance based on /// with global coordinates instead of local coordinates. /// public SurfaceLine2 CreateRedesignedSurfaceLinePipingGlobal() { if (this.RedesignedSurfaceLine2Piping == null) return null; SurfaceLine2 originalSurfaceLine = this.Scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); var redesignedSurfaceLinePipingGlobal = new SurfaceLine2 { CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new GeometryPointString() }; redesignedSurfaceLinePipingGlobal.Assign(this.RedesignedSurfaceLine2Piping); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLinePipingGlobal.Geometry); return redesignedSurfaceLinePipingGlobal; } public SurfaceLine2 RedesignedSurfaceLine2Piping { get { return redesignedSurfaceLinePiping; } set { redesignedSurfaceLinePiping = value; } } [XmlIgnore] public string ProfileName { get { var res = ""; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.HorizontalBalance: case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: res = StabilityProfileName; break; case FailureMechanismSystemType.Piping: res = PipingProfileName; break; } return res; } } [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; } } [XmlIgnore] public MStabModelType? StabilityModel { get { switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityOutside: case FailureMechanismSystemType.StabilityInside: return damFailureMechanismeCalculationSpecification.FailureMechanismeParamatersMStab.MStabParameters.Model; default: return null; } } } [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; case FailureMechanismSystemType.FlowSlide: res = FlowSlideSafetyFactor; break; } return res; } } [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; } } [XmlIgnore] public double? RequiredFailureProbability { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.Piping: res = RequiredFailureProbabilityPiping; break; } return res; } } [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; } } [XmlIgnore] public double? ShoulderHeight { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: res = StabilityShoulderHeight; break; case FailureMechanismSystemType.Piping: res = PipingShoulderHeight; break; } return res; } } [XmlIgnore] public double? ToeAtPolderX { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: res = StabilityToeAtPolderX; break; case FailureMechanismSystemType.Piping: res = PipingToeAtPolderX; break; } return res; } } [XmlIgnore] public double? ToeAtPolderZ { get { double? res = null; switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) { case FailureMechanismSystemType.StabilityInside: res = StabilityToeAtPolderZ; break; case FailureMechanismSystemType.Piping: res = PipingToeAtPolderZ; break; } return res; } } [XmlIgnore] public PipingModelType? PipingModel { get { if (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType == FailureMechanismSystemType.Piping) { return damFailureMechanismeCalculationSpecification.PipingModelType; } return null; } } [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 = Wti2017PipingFactor; break; } } return res; } } [XmlIgnore] public double? LocalPipingEntryPointX { get { GeometryPoint point = null; if (this.RedesignedSurfaceLine2Piping != null) { point = this.RedesignedSurfaceLine2Piping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } else { point = this.scenario.Location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } if (point != null) return point.X; else return null; } } [XmlIgnore] public double? PipingEntryPointX { get { if (this.LocalPipingEntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalPipingEntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } [XmlIgnore] public double? PipingEntryPointY { get { if (this.LocalPipingEntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalPipingEntryPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? LocalPipingExitPointX { get { return localPipingExitPointX; } set { localPipingExitPointX = value; } } [XmlIgnore] public double? PipingExitPointX { get { if (this.LocalPipingExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalPipingExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.X; } } [XmlIgnore] public double? PipingExitPointY { get { if (this.LocalPipingExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( new GeometryPoint(this.LocalPipingExitPointX.Value, 0.0), this.Scenario.Location.SurfaceLine2); return point.Y; } } public double? SeepageLength { get { return LocalPipingExitPointX - LocalPipingEntryPointX; } } [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 = Wti2017HCritical; break; } } return res; } } public string BaseFileName { get { return baseFileName; } set { baseFileName = value; } } public string CalculationSubDir { get { return calculationSubDir; } set { calculationSubDir = value; } } public ResultEvaluation ResultEvaluation { get { return resultEvaluation; } set { resultEvaluation = value; } } public string Notes { get { return notes; } set { notes = value; } } /// /// Returns the begin point and end point as a list /// [XmlIgnore] public List Points { get { if (dirty) { dirty = false; points.Clear(); if (this.locationXrdStart.HasValue && this.locationYrdStart.HasValue) { points.Add(new GeometryPoint(this.locationXrdStart.Value, this.locationYrdStart.Value)); } if (this.locationXrdEnd.HasValue && this.locationYrdEnd.HasValue) { points.Add(new GeometryPoint(this.locationXrdEnd.Value, this.locationYrdEnd.Value)); } } return points; } } /// /// Copy data /// /// public void Assign(CsvExportData csvExportData) { this.id = csvExportData.id; this.BaseFileName = csvExportData.BaseFileName; this.CalculationSubDir = csvExportData.CalculationSubDir; this.NumberOfIterations = csvExportData.NumberOfIterations; this.dike = csvExportData.dike; this.damFailureMechanismeCalculationSpecification = csvExportData.damFailureMechanismeCalculationSpecification; this.Scenario = csvExportData.Scenario; this.SoilProfile = csvExportData.SoilProfile; this.SoilGeometry2DName = csvExportData.SoilGeometry2DName; this.probabilisticType = csvExportData.ProbabilisticType; this.failureProbabilityPiping = csvExportData.failureProbabilityPiping; this.redesignedSurfaceLinePiping = csvExportData.redesignedSurfaceLinePiping; this.safetyFactorStability = csvExportData.safetyFactorStability; this.failureProbabilityStability = csvExportData.failureProbabilityStability; this.zone1SafetyFactorStability = csvExportData.zone1SafetyFactorStability; this.LocalZone1EntryPointX = csvExportData.LocalZone1EntryPointX; this.LocalZone1ExitPointX = csvExportData.LocalZone1ExitPointX; this.zone2SafetyFactorStability = csvExportData.zone2SafetyFactorStability; this.LocalZone2EntryPointX = csvExportData.LocalZone2EntryPointX; this.LocalZone2ExitPointX = csvExportData.LocalZone2ExitPointX; this.blighPipingFactor = csvExportData.blighPipingFactor; this.blighHCritical = csvExportData.blighHCritical; this.sellmeijer2ForcesPipingFactor = csvExportData.sellmeijer2ForcesPipingFactor; this.sellmeijer2ForcesHCritical = csvExportData.sellmeijer2ForcesHCritical; this.sellmeijer4ForcesPipingFactor = csvExportData.sellmeijer4ForcesPipingFactor; this.sellmeijer4ForcesHCritical = csvExportData.sellmeijer4ForcesHCritical; this.sellmeijerPipingFactor = csvExportData.sellmeijerPipingFactor; this.sellmeijerHCritical = csvExportData.sellmeijerHCritical; this.wti2017PipingFactor = csvExportData.wti2017PipingFactor; this.wti2017HCritical = csvExportData.wti2017HCritical; this.redesignedSurfaceLineStability = csvExportData.redesignedSurfaceLineStability; this.calculationResult = csvExportData.calculationResult; } /// /// 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); File.Copy(resFile, copyResFile, true); } private string GetCurrentExeForOpenCalculationFile() { var exeName = DamProjectData.MStabExePath; if (SelectedStabilityKernelType != StabilityKernelType.DamClassic) { 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.DamClassic) { const string stdExtension = ".std"; CopyResultFile(stdExtension); const string stoExtension = ".sto"; CopyResultFile(stoExtension); } Process process = new Process(); process.StartInfo.RedirectStandardOutput = false; process.StartInfo.FileName = exeName; if (SelectedStabilityKernelType == StabilityKernelType.DamClassicWti || SelectedStabilityKernelType == StabilityKernelType.AdvancedWti) { process.StartInfo.Arguments = " -rto " + " \"" + copyFile + "\""; } else { 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); System.Diagnostics.Process.Start(copyFile); } } } /// /// Make a clone of object /// /// public object Clone() { CsvExportData csvExportData = new CsvExportData(this.id, this.dike, this.damFailureMechanismeCalculationSpecification, this.Scenario, this.SoilProfile, this.SoilGeometry2DName, this.analysisType, this.nwoResultIndex, this.probabilisticType); csvExportData.Assign(this); return csvExportData; } } }