Index: dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs =================================================================== diff -u -r726 -r743 --- dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs (.../FillDamUiFromXmlOutput.cs) (revision 726) +++ dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs (.../FillDamUiFromXmlOutput.cs) (revision 743) @@ -24,6 +24,7 @@ using Deltares.DamEngine.Io.XmlOutput; using Deltares.Geometry; using Deltares.Geotechnics.GeotechnicalGeometry; +using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; using Deltares.Standard.EventPublisher; using LogMessageType = Deltares.Standard.Logging.LogMessageType; @@ -87,13 +88,18 @@ SelectedStabilityKernelType = StabilityKernelType.DamClassic, // de enige die we nu doen AnalysisType = DamProjectCalculationSpecification.SelectedAnalysisType, //is nu vanuit invoer, niet echo invoer tenzij damproject de echo is! ProbabilisticType = ProbabilisticType.Deterministic, // is dit de enige voor nu ? - Dike = damProjectData.WaterBoard.Dikes[0], // is de enige voor nu + DikeName = damProjectData.WaterBoard.Dikes[0].Name, // is de enige voor nu CalculationResult = ConversionHelper.ConvertToCalculationResult(designResult.CalculationResult), BaseFileName = designResult.BaseFileName, ProfileName = designResult.ProfileName }; desResult.CalculationResult = ConversionHelper.ConvertToCalculationResult(designResult.CalculationResult); desResult.Scenario = GetScenarioByName(damProjectData, designResult.LocationName, designResult.ScenarioName); + desResult.SoilProfile = GetSoilProfileByName(damProjectData, designResult.ProfileName); + if (desResult.SoilProfile == null) + { + desResult.SoilGeometry2DName = designResult.ProfileName; + } if (designResult.PipingDesignResults != null) { CreateDesignResultsPipingOutput(designResult, desResult); @@ -162,6 +168,19 @@ return null; } + private static SoilProfile1D GetSoilProfileByName(DamProjectData damProjectData , string profileName) + { + var soilProfiles1D = damProjectData.WaterBoard.Dikes[0].SoilProfiles; + foreach (var soilProfile1D in soilProfiles1D) + { + if (soilProfile1D.Name == profileName) + { + return soilProfile1D; + } + } + return null; + } + private static SurfaceLine2 ConvertXmlSurfaceLineToSurfaceLine2(SurfaceLine inputSurfaceLine) { var surfaceLine = new SurfaceLine2 Index: dam clients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs =================================================================== diff -u -r339 -r743 --- dam clients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs (.../DamFailureMechanismeCalculationSpecification.cs) (revision 339) +++ dam clients/DamUI/trunk/src/Dam/Data/DamFailureMechanismeCalculationSpecification.cs (.../DamFailureMechanismeCalculationSpecification.cs) (revision 743) @@ -177,9 +177,13 @@ public void Assign(DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculation) { - this.FailureMechanismSystemType = damFailureMechanismeCalculation.failureMechanismSystemType; - this.FailureMechanismeParamatersMStab.Assign(damFailureMechanismeCalculation.FailureMechanismeParamatersMStab); - //assign interface + failureMechanismSystemType = damFailureMechanismeCalculation.FailureMechanismSystemType; + calculationModel = damFailureMechanismeCalculation.CalculationModel; + pipingModelType = damFailureMechanismeCalculation.pipingModelType; + failureMechanismeParamatersMStab.Assign(damFailureMechanismeCalculation.FailureMechanismeParamatersMStab); + StabilityModelType = damFailureMechanismeCalculation.StabilityModelType; + stabilityKernelType = damFailureMechanismeCalculation.StabilityKernelType; + //assign interface } public DamFailureMechanismeCalculationSpecification Clone() Index: dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs =================================================================== diff -u -r709 -r743 --- dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 709) +++ dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 743) @@ -644,24 +644,12 @@ return; } - //DataEventPublisher.InvokeWithoutPublishingEvents(() => - //{ - // mainForm.Invoke(new TaskDelegate(DataEventPublisher.SelectionChanged), damProject.DamProjectData.WaterBoard); - // damProject.DamProjectData.EnsureProperZoneSafetyFactors(); - // damRunner = new DamRunner(this.damProject); - // damRunner.MaxCalculationCores = this.MaxCalculationCores; - // LogManager.Clear(); - // damProject.DamProjectData.ClearResults(); - // damRunner.PerformCalculation(this.progressDelegate); - //}); + DataEventPublisher.InvokeWithoutPublishingEvents(() => + { + LogManager.Clear(); + damProject.DamProjectData.ClearResults(); + }); - - //mainForm.Invoke(new PublisherDelegate(DataEventPublisher.DataListModified), LogManager.Messages, null); - //mainForm.Invoke(new PublisherDelegate(DataEventPublisher.DataListModified), this.damProject.DamProjectData.DesignCalculations, null); - //this.damProject.SaveXMLProject(this.damProject.ProjectFileName, this.damProject); - - //LocalizedMessageBox.ShowError(this, "NoCalculationPossible"); - LogManager.Clear(); try { Input input = FillXmlInputFromDamUi.CreateInput(damProject.DamProjectData); Index: dam clients/DamUI/trunk/src/Dam/Data/DamProjectData.cs =================================================================== diff -u -r726 -r743 --- dam clients/DamUI/trunk/src/Dam/Data/DamProjectData.cs (.../DamProjectData.cs) (revision 726) +++ dam clients/DamUI/trunk/src/Dam/Data/DamProjectData.cs (.../DamProjectData.cs) (revision 743) @@ -181,6 +181,7 @@ /// public void ClearResults() { + designCalculations.Clear(); foreach (LocationJob locationJob in this.LocationJobs) { locationJob.LocationResult = new LocationResult(); Index: dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs =================================================================== diff -u -r654 -r743 --- dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 654) +++ dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 743) @@ -55,7 +55,7 @@ private string profileName; private string calculationSubDir; - private Dike dike; + private string dikeName; private AnalysisType analysisType; private ProbabilisticType probabilisticType; private DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification; @@ -285,27 +285,25 @@ public DamFailureMechanismeCalculationSpecification DamFailureMechanismeCalculation // moet vanuit invoer komen { get { return damFailureMechanismeCalculationSpecification; } - set { damFailureMechanismeCalculationSpecification = value; } + 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 dike.Name; } - } - - [Browsable(false)] - public Dike Dike - { get { - return dike; + return dikeName; } set { - dike = value; + dikeName = value; } } @@ -430,7 +428,7 @@ [ReadOnly(true)] public double? RiverLevel { - get { return this.Scenario.RiverLevel; } + get { return scenario.RiverLevel; } } [Label("River level low")] @@ -440,7 +438,7 @@ [ReadOnly(true)] public double? RiverLevelLow { - get { return this.Scenario.RiverLevelLow; } + get { return scenario.RiverLevelLow; } } [Label("Dike table height")] @@ -450,7 +448,7 @@ [ReadOnly(true)] public double? DikeTableHeight { - get { return this.Scenario.DikeTableHeight; } + get { return scenario.DikeTableHeight; } } [Label("Slope damping factor")] @@ -460,14 +458,14 @@ [ReadOnly(true)] public double? SlopeDampingPiezometricHeightPolderSide { - get { return this.Scenario.Location.SlopeDampingPiezometricHeightPolderSide; } + get { return scenario.Location.SlopeDampingPiezometricHeightPolderSide; } } [CsvExportColumn("CurrentDikeHeight", 13)] [Browsable(false)] public double? CurrentDikeHeight { - get { return this.Scenario.Location.SurfaceLine2.GetDikeHeight(); } + get { return scenario.Location.SurfaceLine2.GetDikeHeight(); } } [CsvExportColumn("CurrentDikeToeAtPolderX", 14)] @@ -477,7 +475,7 @@ get { double? x = null; - GeometryPoint point = this.Scenario.Location.SurfaceLine2.GetDikeToeInward(); + GeometryPoint point = scenario.Location.SurfaceLine2.GetDikeToeInward(); if (point != null) x = point.X; return x; @@ -491,7 +489,7 @@ get { double? z = null; - GeometryPoint point = this.Scenario.Location.SurfaceLine2.GetDikeToeInward(); + GeometryPoint point = scenario.Location.SurfaceLine2.GetDikeToeInward(); if (point != null) z = point.Z; return z; @@ -500,7 +498,7 @@ private double? GetSoilProfileProbability(FailureMechanismSystemType? failureMechanismType) { - return this.Scenario.Location.GetSoilProfileProbability(this.SoilProfile, failureMechanismType); + return scenario.Location.GetSoilProfileProbability(soilProfile, failureMechanismType); } [CsvExportColumn("StabilityProfileName", 16)] @@ -543,7 +541,7 @@ [Browsable(false)] public double? CurrentDikeLength { - get { return this.Scenario.Location.SurfaceLine2.GetDikeLength(); } + get { return scenario.Location.SurfaceLine2.GetDikeLength(); } } [CsvExportColumn("StabilityToeAtPolderX", 21)] @@ -555,14 +553,13 @@ { get { - if (this.redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStability == null) return null; - GeometryPoint point = this.redesignedSurfaceLineStability.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineStability.GetDikeToeInward(); if (point != null) return point.X; - else - return null; + return null; } } @@ -575,14 +572,13 @@ { get { - if (this.redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStability == null) return null; - GeometryPoint point = this.redesignedSurfaceLineStability.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineStability.GetDikeToeInward(); if (point != null) return point.Z; - else - return null; + return null; } } @@ -595,14 +591,13 @@ { get { - if (this.redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStability == null) return null; - GeometryPoint point = this.redesignedSurfaceLineStability.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); + GeometryPoint point = redesignedSurfaceLineStability.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; - else - return null; + return null; } } @@ -614,8 +609,8 @@ [Browsable(false)] public double? StabilitySafetyFactor { - get { return this.safetyFactorStability; } - set { this.safetyFactorStability = value; } + get { return safetyFactorStability; } + set { safetyFactorStability = value; } } [CsvExportColumn("StabilityFailureProbability", 25)] @@ -626,8 +621,8 @@ [Browsable(false)] public double? StabilityFailureProbability { - get { return this.failureProbabilityStability; } - set { this.failureProbabilityStability = value; } + get { return failureProbabilityStability; } + set { failureProbabilityStability = value; } } [CsvExportColumn("RequiredSafetyFactorStabilityInnerSlope", 26)] @@ -638,7 +633,7 @@ [Browsable(false)] public double? RequiredSafetyFactorStabilityInnerSlope { - get { return this.Scenario.RequiredSafetyFactorStabilityInnerSlope;} + get { return scenario.RequiredSafetyFactorStabilityInnerSlope;} } [CsvExportColumn("RequiredSafetyFactorStabilityOuterSlope", 27)] @@ -649,7 +644,7 @@ [Browsable(false)] public double? RequiredSafetyFactorStabilityOuterSlope { - get { return this.Scenario.RequiredSafetyFactorStabilityOuterSlope; } + get { return scenario.RequiredSafetyFactorStabilityOuterSlope; } } [CsvExportColumn("RequiredSafetyFactorPiping", 28)] @@ -660,7 +655,7 @@ [Browsable(false)] public double? RequiredSafetyFactorPiping { - get { return this.Scenario.RequiredSafetyFactorPiping; } + get { return scenario.RequiredSafetyFactorPiping; } } [CsvExportColumn("PipingToeAtPolderX", 29)] @@ -672,14 +667,13 @@ { get { - if (this.redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePiping == null) return null; - GeometryPoint point = this.redesignedSurfaceLinePiping.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLinePiping.GetDikeToeInward(); if (point != null) return point.X; - else - return null; + return null; } } @@ -692,14 +686,13 @@ { get { - if (this.redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePiping == null) return null; - GeometryPoint point = this.redesignedSurfaceLinePiping.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLinePiping.GetDikeToeInward(); if (point != null) return point.Z; - else - return null; + return null; } } @@ -712,14 +705,13 @@ { get { - if (this.redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePiping == null) return null; GeometryPoint point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; - else - return null; + return null; } } @@ -731,8 +723,8 @@ [Browsable(false)] public double? PipingFailureProbability { - get { return this.failureProbabilityPiping; } - set { this.failureProbabilityPiping = value; } + get { return failureProbabilityPiping; } + set { failureProbabilityPiping = value; } } [Label("Required piping failure probability")] @@ -742,7 +734,7 @@ [Browsable(false)] public double? RequiredFailureProbabilityPiping { - get { return this.Scenario.RequiredProbabilityOfFailurePiping; } + get { return scenario.RequiredProbabilityOfFailurePiping; } } [CsvExportColumn("DikeLength", 33)] @@ -757,7 +749,7 @@ { double? maxDikeLength = null; List dikeLengths = new List(); - SurfaceLine2 surfaceLine = this.Scenario.Location.SurfaceLine2; + SurfaceLine2 surfaceLine = scenario.Location.SurfaceLine2; if (surfaceLine != null) dikeLengths.Add(surfaceLine.GetDikeLength()); switch (damFailureMechanismeCalculationSpecification.FailureMechanismSystemType) @@ -789,8 +781,8 @@ [ReadOnly(true)] public double? Zone1SafetyFactorStability { - get { return this.zone1SafetyFactorStability; } - set { this.zone1SafetyFactorStability = value; } + get { return zone1SafetyFactorStability; } + set { zone1SafetyFactorStability = value; } } [Label("Zone 1 entry point (X-local)")] @@ -815,11 +807,11 @@ { get { - if (this.LocalZone1EntryPointX == null) + if (localZone1EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone1EntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -836,11 +828,11 @@ { get { - if (this.LocalZone1EntryPointX == null) + if (localZone1EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone1EntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -857,11 +849,11 @@ { get { - if (this.LocalZone1EntryPointX == null) + if (localZone1EntryPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; - return this.redesignedSurfaceLineStability.Geometry.GetZAtX(this.LocalZone1EntryPointX.Value); + return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone1EntryPointX.Value); } } @@ -887,11 +879,11 @@ { get { - if (this.LocalZone1ExitPointX == null) + if (localZone1ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone1ExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -907,11 +899,11 @@ { get { - if (this.LocalZone1ExitPointX == null) + if (localZone1ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone1ExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -927,11 +919,11 @@ { get { - if (this.LocalZone1ExitPointX == null) + if (localZone1ExitPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; - return this.redesignedSurfaceLineStability.Geometry.GetZAtX(this.LocalZone1ExitPointX.Value); + return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone1ExitPointX.Value); } } @@ -943,8 +935,8 @@ [ReadOnly(true)] public double? Zone2SafetyFactorStability { - get { return this.zone2SafetyFactorStability; } - set { this.zone2SafetyFactorStability = value; } + get { return zone2SafetyFactorStability; } + set { zone2SafetyFactorStability = value; } } [CsvExportColumn("LocalZone2EntryPointX", 44)] @@ -969,11 +961,11 @@ { get { - if (this.LocalZone2EntryPointX == null) + if (localZone2EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone2EntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; @@ -990,11 +982,11 @@ { get { - if (this.LocalZone2EntryPointX == null) + if (localZone2EntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone2EntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; @@ -1011,11 +1003,11 @@ { get { - if (this.LocalZone2EntryPointX == null) + if (localZone2EntryPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; - return this.redesignedSurfaceLineStability.Geometry.GetZAtX(this.LocalZone2EntryPointX.Value); + return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone2EntryPointX.Value); } } @@ -1041,11 +1033,11 @@ { get { - if (this.LocalZone2ExitPointX == null) + if (localZone2ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone2ExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -1061,11 +1053,11 @@ { get { - if (this.LocalZone2ExitPointX == null) + if (localZone2ExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalZone2ExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -1081,11 +1073,11 @@ { get { - if (this.LocalZone2ExitPointX == null) + if (localZone2ExitPointX == null) return null; if (redesignedSurfaceLineStability == null) return null; - return this.redesignedSurfaceLineStability.Geometry.GetZAtX(this.LocalZone2ExitPointX.Value); + return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone2ExitPointX.Value); } } @@ -1095,8 +1087,8 @@ [ReadOnly(true)] public bool? IsUplift { - get { return this.isUplift; } - set { this.isUplift = value; } + get { return isUplift; } + set { isUplift = value; } } [CsvExportColumn("Pl3MinUplift", 53)] @@ -1107,8 +1099,8 @@ [ReadOnly(true)] public double? Pl3MinUplift { - get { return this.pl3MinUplift; } - set { this.pl3MinUplift = value; } + get { return pl3MinUplift; } + set { pl3MinUplift = value; } } [CsvExportColumn("Pl3HeadAdjusted", 54)] @@ -1119,8 +1111,8 @@ [ReadOnly(true)] public double? Pl3HeadAdjusted { - get { return this.pl3HeadAdjusted; } - set { this.pl3HeadAdjusted = value; } + get { return pl3HeadAdjusted; } + set { pl3HeadAdjusted = value; } } [CsvExportColumn("pl3LocalLocationXMinUplift", 55)] @@ -1131,8 +1123,8 @@ [ReadOnly(true)] public double? Pl3LocalLocationXMinUplift { - get { return this.pl3LocalLocationXMinUplift; } - set { this.pl3LocalLocationXMinUplift = value; } + get { return pl3LocalLocationXMinUplift; } + set { pl3LocalLocationXMinUplift = value; } } [CsvExportColumn("Pl3LocationXMinUplift", 56)] @@ -1146,11 +1138,11 @@ { get { - if (this.pl3LocalLocationXMinUplift == null) + if (pl3LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.pl3LocalLocationXMinUplift.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -1167,11 +1159,11 @@ { get { - if (this.pl3LocalLocationXMinUplift == null) + if (pl3LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.pl3LocalLocationXMinUplift.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -1185,8 +1177,8 @@ [ReadOnly(true)] public double? Pl4MinUplift { - get { return this.pl4MinUplift; } - set { this.pl4MinUplift = value; } + get { return pl4MinUplift; } + set { pl4MinUplift = value; } } [CsvExportColumn("Pl4HeadAdjusted", 59)] @@ -1197,8 +1189,8 @@ [ReadOnly(true)] public double? Pl4HeadAdjusted { - get { return this.pl4HeadAdjusted; } - set { this.pl4HeadAdjusted = value; } + get { return pl4HeadAdjusted; } + set { pl4HeadAdjusted = value; } } [CsvExportColumn("pl4LocalLocationXMinUplift", 60)] @@ -1209,8 +1201,8 @@ [ReadOnly(true)] public double? Pl4LocalLocationXMinUplift { - get { return this.pl4LocalLocationXMinUplift; } - set { this.pl4LocalLocationXMinUplift = value; } + get { return pl4LocalLocationXMinUplift; } + set { pl4LocalLocationXMinUplift = value; } } [CsvExportColumn("Pl4LocationXMinUplift", 61)] @@ -1224,11 +1216,11 @@ { get { - if (this.pl4LocalLocationXMinUplift == null) + if (pl4LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.pl4LocalLocationXMinUplift.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -1245,11 +1237,11 @@ { get { - if (this.pl4LocalLocationXMinUplift == null) + if (pl4LocalLocationXMinUplift == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.pl4LocalLocationXMinUplift.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -1262,8 +1254,8 @@ //[Browsable(false)] public double? UpliftFactor { - get { return this.upliftFactor; } - set { this.upliftFactor = value; } + get { return upliftFactor; } + set { upliftFactor = value; } } [Label("Heave Factor")] @@ -1273,8 +1265,8 @@ //[Browsable(false)] public double? HeaveFactor { - get { return this.heaveFactor; } - set { this.heaveFactor = value; } + get { return heaveFactor; } + set { heaveFactor = value; } } [CsvExportColumn("BlighPipingFactor", 63)] @@ -1285,8 +1277,8 @@ [Browsable(false)] public double? BlighPipingFactor { - get { return this.blighPipingFactor; } - set { this.blighPipingFactor = value; } + get { return blighPipingFactor; } + set { blighPipingFactor = value; } } [CsvExportColumn("BlighHCritical", 64)] @@ -1297,8 +1289,8 @@ [Browsable(false)] public double? BlighHCritical { - get { return this.blighHCritical; } - set { this.blighHCritical = value; } + get { return blighHCritical; } + set { blighHCritical = value; } } [CsvExportColumn("Sellmeijer2ForcesPipingFactor", 65)] @@ -1309,8 +1301,8 @@ [Browsable(false)] public double? Sellmeijer2ForcesPipingFactor { - get { return this.sellmeijer2ForcesPipingFactor; } - set { this.sellmeijer2ForcesPipingFactor = value; } + get { return sellmeijer2ForcesPipingFactor; } + set { sellmeijer2ForcesPipingFactor = value; } } [CsvExportColumn("Sellmeijer2ForcesHCritical", 66)] @@ -1321,8 +1313,8 @@ [Browsable(false)] public double? Sellmeijer2ForcesHCritical { - get { return this.sellmeijer2ForcesHCritical; } - set { this.sellmeijer2ForcesHCritical = value; } + get { return sellmeijer2ForcesHCritical; } + set { sellmeijer2ForcesHCritical = value; } } [CsvExportColumn("Sellmeijer4ForcesPipingFactor", 67)] @@ -1333,8 +1325,8 @@ [Browsable(false)] public double? Sellmeijer4ForcesPipingFactor { - get { return this.sellmeijer4ForcesPipingFactor; } - set { this.sellmeijer4ForcesPipingFactor = value; } + get { return sellmeijer4ForcesPipingFactor; } + set { sellmeijer4ForcesPipingFactor = value; } } [CsvExportColumn("Sellmeijer4ForcesHCritical", 68)] @@ -1345,8 +1337,8 @@ [Browsable(false)] public double? Sellmeijer4ForcesHCritical { - get { return this.sellmeijer4ForcesHCritical; } - set { this.sellmeijer4ForcesHCritical = value; } + get { return sellmeijer4ForcesHCritical; } + set { sellmeijer4ForcesHCritical = value; } } [CsvExportColumn("SellmeijerPipingFactor", 69)] @@ -1357,8 +1349,8 @@ [Browsable(false)] public double? SellmeijerPipingFactor { - get { return this.sellmeijerPipingFactor; } - set { this.sellmeijerPipingFactor = value; } + get { return sellmeijerPipingFactor; } + set { sellmeijerPipingFactor = value; } } [CsvExportColumn("SellmeijerHCritical", 70)] @@ -1369,8 +1361,8 @@ [Browsable(false)] public double? SellmeijerHCritical { - get { return this.sellmeijerHCritical; } - set { this.sellmeijerHCritical = value; } + get { return sellmeijerHCritical; } + set { sellmeijerHCritical = value; } } /// @@ -1411,84 +1403,84 @@ [Browsable(false)] public double? DikeToeAtRiverXrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; } } [CsvExportColumn("DikeToeAtRiverYrd", 80)] [Browsable(false)] public double? DikeToeAtRiverYrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } } [CsvExportColumn("DikeToeAtRiverZrd", 81)] [Browsable(false)] public double? DikeToeAtRiverZrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } } [CsvExportColumn("DikeTopAtRiverXrd", 82)] [Browsable(false)] public double? DikeTopAtRiverXrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } } [CsvExportColumn("DikeTopAtRiverYrd", 83)] [Browsable(false)] public double? DikeTopAtRiverYrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } } [CsvExportColumn("DikeTopAtRiverZrd", 84)] [Browsable(false)] public double? DikeTopAtRiverZrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } } [CsvExportColumn("DikeTopAtPolderXrd", 85)] [Browsable(false)] public double? DikeTopAtPolderXrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } } [CsvExportColumn("DikeTopAtPolderYrd", 86)] [Browsable(false)] public double? DikeTopAtPolderYrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } } [CsvExportColumn("DikeTopAtPolderZrd", 87)] [Browsable(false)] public double? DikeTopAtPolderZrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } } [CsvExportColumn("DikeToeAtPolderXrd", 88)] [Browsable(false)] public double? DikeToeAtPolderXrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } } [CsvExportColumn("DikeToeAtPolderYrd", 89)] [Browsable(false)] public double? DikeToeAtPolderYrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } } [CsvExportColumn("DikeToeAtPolderZrd", 90)] [Browsable(false)] public double? DikeToeAtPolderZrd { - get { return this.Scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } + get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } } [Browsable(false)] @@ -1511,7 +1503,10 @@ public SoilProfile1D SoilProfile { get { return soilProfile; } - set { soilProfile = value; } + set + { + soilProfile = value; + } } [Browsable(false)] @@ -1528,10 +1523,10 @@ [Browsable(false)] public SurfaceLine2 CreateRedesignedSurfaceLineStabilityGlobal() { - if (this.RedesignedSurfaceLine2Stability == null) + if (redesignedSurfaceLineStability == null) return null; - SurfaceLine2 originalSurfaceLine = this.Scenario.Location.SurfaceLine2; + SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); @@ -1540,7 +1535,7 @@ CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new LocalizedGeometryPointString() }; - redesignedSurfaceLineStabilityGlobal.Assign(this.RedesignedSurfaceLine2Stability); + redesignedSurfaceLineStabilityGlobal.Assign(redesignedSurfaceLineStability); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLineStabilityGlobal.Geometry); return redesignedSurfaceLineStabilityGlobal; @@ -1560,10 +1555,10 @@ [Browsable(false)] public SurfaceLine2 CreateRedesignedSurfaceLinePipingGlobal() { - if (this.RedesignedSurfaceLine2Piping == null) + if (redesignedSurfaceLinePiping == null) return null; - SurfaceLine2 originalSurfaceLine = this.Scenario.Location.SurfaceLine2; + SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); @@ -1572,7 +1567,7 @@ CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new LocalizedGeometryPointString() }; - redesignedSurfaceLinePipingGlobal.Assign(this.RedesignedSurfaceLine2Piping); + redesignedSurfaceLinePipingGlobal.Assign(redesignedSurfaceLinePiping); coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLinePipingGlobal.Geometry); return redesignedSurfaceLinePipingGlobal; @@ -1595,7 +1590,7 @@ { if (scenario != null) { - GetSoilProfileName(damFailureMechanismeCalculationSpecification.FailureMechanismSystemType); + profileName = GetSoilProfileName(); } return profileName; } @@ -1605,21 +1600,21 @@ } } - private string GetSoilProfileName(FailureMechanismSystemType failureMechanismType) + private string GetSoilProfileName() { string soilprofilename = ""; - if (this.SoilProfile != null) + if (soilProfile != null) { - soilprofilename = this.SoilProfile.Name; + soilprofilename = soilProfile.Name; } else { - if (this.SoilGeometry2DName != null) + if (!String.IsNullOrEmpty(soilGeometry2DName)) { - soilprofilename = this.SoilGeometry2DName; + soilprofilename = soilGeometry2DName; } } - return failureMechanismType == this.damFailureMechanismeCalculationSpecification.FailureMechanismSystemType ? soilprofilename : ""; + return soilprofilename; } [Label("Profile probability")] @@ -1903,19 +1898,18 @@ { get { - GeometryPoint point = null; - if (this.RedesignedSurfaceLine2Piping != null) + GeometryPoint point; + if (redesignedSurfaceLinePiping != null) { - point = this.RedesignedSurfaceLine2Piping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); + point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } else { - point = this.scenario.Location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); + point = scenario.Location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } if (point != null) return point.X; - else - return null; + return null; } } @@ -1929,11 +1923,11 @@ { get { - if (this.LocalPipingEntryPointX == null) + if (LocalPipingEntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalPipingEntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -1949,11 +1943,11 @@ { get { - if (this.LocalPipingEntryPointX == null) + if (LocalPipingEntryPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalPipingEntryPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -1980,11 +1974,11 @@ { get { - if (this.LocalPipingExitPointX == null) + if (localPipingExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalPipingExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.X; } @@ -2000,11 +1994,11 @@ { get { - if (this.LocalPipingExitPointX == null) + if (localPipingExitPointX == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(this.LocalPipingExitPointX.Value, 0.0, 0.0), this.Scenario.Location.SurfaceLine2); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); return point.Y; } @@ -2016,7 +2010,7 @@ [ReadOnly(true)] public double? SeepageLength { - get { return LocalPipingExitPointX - LocalPipingEntryPointX; } + get { return localPipingExitPointX - LocalPipingEntryPointX; } } [Label("H critical")] @@ -2104,7 +2098,10 @@ { string copyResFile = Path.GetDirectoryName(InputFile) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(InputFile) + " (copy)" + extension; var resFile = Path.ChangeExtension(InputFile, extension); - File.Copy(resFile, copyResFile, true); + if (resFile != null) + { + File.Copy(resFile, copyResFile, true); + } } private string GetCurrentExeForOpenCalculationFile() @@ -2139,9 +2136,14 @@ const string stoExtension = ".sto"; CopyResultFile(stoExtension); } - Process process = new Process(); - process.StartInfo.RedirectStandardOutput = false; - process.StartInfo.FileName = exeName; + var process = new Process + { + StartInfo = + { + RedirectStandardOutput = false, + FileName = exeName + } + }; if (SelectedStabilityKernelType == StabilityKernelType.DamClassicWti || SelectedStabilityKernelType == StabilityKernelType.AdvancedWti) { @@ -2163,7 +2165,7 @@ Path.GetExtension(PipingResultFile); File.Copy(PipingResultFile, copyFile, true); - System.Diagnostics.Process.Start(copyFile); + Process.Start(copyFile); } } }