Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs =================================================================== diff -u -r576 -r586 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 576) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Results/DesignResult.cs (.../DesignResult.cs) (revision 586) @@ -34,24 +34,53 @@ /// public class DesignResult : ICloneable { - private string id; - private double xrd; - private double yrd; + private double? safetyFactor; + private double? failureProbability; + private string baseFileName; private string locationName; private string scenarioName; private string profileName; - private double? safetyFactor; - private double? failureProbability; private CalculationResult calculationResult = CalculationResult.NoRun; - private NwoDesignResults nwoDesignResults; private StabilityDesignResults stabilityDesignResults; private PipingDesignResults pipingDesignResults; - - + /// + /// Gets the safety factor (derived result). + /// Note: this is a placeholder, not to be part of the results as written to xml + /// + /// + /// The safety factor. + /// + public double? SafetyFactor + { + get + { + return safetyFactor; + } + } + + /// + /// Gets or sets the failure probability (derived result). + /// Note: this is a placeholder, not to be part of the results as written to xml + /// + /// + /// The failure probability. + /// + public double? FailureProbability + { + get + { + return failureProbability; + } + set + { + failureProbability = value; + } + } + /// /// Gets or sets the dam failure mechanisme calculation. /// Note: this is a placeholder, not to be part of the results as written to xml /// @@ -125,16 +154,10 @@ /// Initializes a new instance of the class. /// Needed for testing purposes. /// - /// The identifier. - /// The x rd. - /// The y rd. /// Name of the location. /// Name of the scenario. - internal DesignResult(string id, double xRd, double yRd, string locationName, string scenarioName) + internal DesignResult(string locationName, string scenarioName) { - this.id = id; - xrd = xRd; - yrd = yRd; this.locationName = locationName; this.scenarioName = scenarioName; } @@ -149,12 +172,9 @@ /// Name of the soil geometry2 d. /// Type of the analysis. /// Index of the nwo result. - public DesignResult(string id, DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification, + public DesignResult(DamFailureMechanismeCalculationSpecification damFailureMechanismeCalculationSpecification, DesignScenario scenario, SoilProfile1D soilProfile, string soilGeometry2DName, AnalysisType analysisType, int nwoResultIndex) { - this.id = id; - xrd = scenario.Location.XRd; - yrd = scenario.Location.YRd; locationName = scenario.Location.Name; scenarioName = scenario.LocationScenarioID; // terughalen vanuit csvexport indien echt nodig baseFileName = ""; @@ -168,66 +188,30 @@ case FailureMechanismSystemType.StabilityInside: case FailureMechanismSystemType.StabilityOutside: profileName = soilGeometry2DName; - 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) + + stabilityDesignResults = new StabilityDesignResults(); + MStabResults? mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName); + stabilityDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); + calculationResult = DetermineStabilityCalculationResult(stabilityDesignResults.ResultMessage, mstabResults); + if (mstabResults != null) + { + baseFileName = mstabResults.Value.CalculationName; + stabilityDesignResults.NumberOfIterations = mstabResults.Value.IterationNumber; + stabilityDesignResults.SafetyFactor = mstabResults.Value.zone1.safetyFactor; + stabilityDesignResults.Zone1SafetyFactor = mstabResults.Value.zone1.safetyFactor; + stabilityDesignResults.LocalZone1EntryPointX = mstabResults.Value.zone1.entryPointXCoordinate; + stabilityDesignResults.LocalZone1ExitPointX = mstabResults.Value.zone1.exitPointXCoordinate; + if (mstabResults.Value.zone2 != null) { - nwoDesignResults = new NwoDesignResults - { - NwoId = scenario.NwoResults[nwoResultIndex].NwoId, - LocationXrdStart = scenario.NwoResults[nwoResultIndex].LocationXrdStart, - LocationYrdStart = scenario.NwoResults[nwoResultIndex].LocationYrdStart, - LocationZrdStart = scenario.NwoResults[nwoResultIndex].LocationZrdStart, - LocationXrdEnd = scenario.NwoResults[nwoResultIndex].LocationXrdEnd, - LocationYrdEnd = scenario.NwoResults[nwoResultIndex].LocationYrdEnd, - LocationZrdEnd = scenario.NwoResults[nwoResultIndex].LocationZrdEnd, - NumberOfIterations = scenario.NwoResults[nwoResultIndex].MStabResults.IterationNumber, - SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor, - Zone1SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.safetyFactor, - LocalZone1EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.entryPointXCoordinate, - LocalZone1ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone1.exitPointXCoordinate, - ResultIndex = nwoResultIndex - }; - - if (scenario.NwoResults[nwoResultIndex].MStabResults.zone2 != null) - { - nwoDesignResults.Zone2SafetyFactor = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.safetyFactor; - nwoDesignResults.LocalZone2EntryPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.entryPointXCoordinate; - nwoDesignResults.LocalZone2ExitPointX = scenario.NwoResults[nwoResultIndex].MStabResults.zone2.Value.exitPointXCoordinate; - } - baseFileName = scenario.NwoResults[nwoResultIndex].MStabResults.CalculationName; - safetyFactor = nwoDesignResults.SafetyFactor; + stabilityDesignResults.Zone2SafetyFactor = mstabResults.Value.zone2.Value.safetyFactor; + stabilityDesignResults.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate; + stabilityDesignResults.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate; } } - else - { - stabilityDesignResults = new StabilityDesignResults(); - MStabResults? mstabResults = scenario.GetMStabResults(soilProfile, soilGeometry2DName); - stabilityDesignResults.ResultMessage = scenario.GetResultMessage(soilProfile, soilGeometry2DName); - calculationResult = DetermineStabilityCalculationResult(stabilityDesignResults.ResultMessage, mstabResults); - if (mstabResults != null) - { - - baseFileName = mstabResults.Value.CalculationName; - stabilityDesignResults.NumberOfIterations = mstabResults.Value.IterationNumber; - stabilityDesignResults.SafetyFactor = mstabResults.Value.zone1.safetyFactor; - stabilityDesignResults.Zone1SafetyFactor = mstabResults.Value.zone1.safetyFactor; - stabilityDesignResults.LocalZone1EntryPointX = mstabResults.Value.zone1.entryPointXCoordinate; - stabilityDesignResults.LocalZone1ExitPointX = mstabResults.Value.zone1.exitPointXCoordinate; - if (mstabResults.Value.zone2 != null) - { - stabilityDesignResults.Zone2SafetyFactor = mstabResults.Value.zone2.Value.safetyFactor; - stabilityDesignResults.LocalZone2EntryPointX = mstabResults.Value.zone2.Value.entryPointXCoordinate; - stabilityDesignResults.LocalZone2ExitPointX = mstabResults.Value.zone2.Value.exitPointXCoordinate; - } - } - } stabilityDesignResults.FailureProbability = scenario.GetFailureProbabilityStability(soilProfile, soilGeometry2DName); + stabilityDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); failureProbability = stabilityDesignResults.FailureProbability; safetyFactor = stabilityDesignResults.SafetyFactor; - stabilityDesignResults.RedesignedSurfaceLine = scenario.GetRedesignedSurfaceLine(soilProfile, soilGeometry2DName); - UpliftSituation? upliftSituation = scenario.GetStabilityUpliftSituation(soilProfile, soilGeometry2DName); if (upliftSituation != null) { @@ -270,45 +254,6 @@ } } - /// - /// Gets the identifier. - /// - /// - /// The identifier. - /// - public string Id - { - get { return id; } - } - - /// - /// Gets the XRD. - /// - /// - /// The XRD. - /// - public double Xrd - { - get - { - return xrd; - } - } - - /// - /// Gets the yrd. - /// - /// - /// The yrd. - /// - public double Yrd - { - get - { - return yrd; - } - } - //Identifiers, needed to retrace the origin of the result /// /// Gets the name of the location. @@ -380,65 +325,6 @@ } /// - /// Gets the safety factor (derived result). - /// - /// - /// The safety factor. - /// - public double? SafetyFactor - { - get - { - return safetyFactor; - } - } - - /// - /// Sets the safety factor. - /// Needed for testing purposes. - /// - /// The value. - internal void SetSafetyFactor(double value) - { - safetyFactor = value; - } - - /// - /// Gets or sets the failure probability (derived result). - /// - /// - /// The failure probability. - /// - public double? FailureProbability - { - get - { - return failureProbability; - } - set - { - failureProbability = value; - } - } - /// - /// Gets or sets the nwo design results. - /// - /// - /// The nwo design results. - /// - public NwoDesignResults NwoDesignResults - { - get - { - return nwoDesignResults; - } - set - { - nwoDesignResults = value; - } - } - - /// /// Gets or sets the stability design results. /// /// @@ -485,18 +371,13 @@ Scenario = designResult.Scenario; // copy direct data - id = designResult.id; - xrd = designResult.Xrd; - yrd = designResult.Yrd; baseFileName = designResult.BaseFileName; locationName = designResult.LocationName; scenarioName = designResult.ScenarioName; profileName = designResult.ProfileName; + calculationResult = designResult.calculationResult; safetyFactor = designResult.SafetyFactor; failureProbability = designResult.FailureProbability; - calculationResult = designResult.calculationResult; - nwoDesignResults = new NwoDesignResults(); - designResult.NwoDesignResults.CloneProperties(nwoDesignResults); stabilityDesignResults = new StabilityDesignResults(); designResult.StabilityDesignResults.CloneProperties(stabilityDesignResults); pipingDesignResults = new PipingDesignResults(DamFailureMechanismeCalculation.PipingModelType);