Index: dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs =================================================================== diff -u -r743 -r753 --- dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 743) +++ dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 753) @@ -64,7 +64,6 @@ private string soilGeometry2DName; private double? failureProbabilityPiping; private double? localPipingExitPointX; - private SurfaceLine2 redesignedSurfaceLinePiping; private double? safetyFactorStability; private double? failureProbabilityStability; private double? zone1SafetyFactorStability; @@ -100,7 +99,16 @@ private string notes = ""; private StabilityKernelType selectedStabilityKernelType = StabilityKernelType.DamClassic; + // redesigned LOCAL surfaceline for stability (initialized with original local surfaceline) private SurfaceLine2 redesignedSurfaceLineStability; + // redesigned Global surfaceline for stability (based on redesignedSurfaceLineStability) + private SurfaceLine2 redesignedSurfaceLineStabilityGlobal; + // redesigned LOCAL surfaceline for piping (initialized with original local surfaceline) + private SurfaceLine2 redesignedSurfaceLinePiping; + // redesigned Global surfaceline for piping (based on redesignedSurfaceLinePiping) + private SurfaceLine2 redesignedSurfaceLinePipingGlobal; + // redesigned Global surfaceline in use for this result (either piping or stability) + private SurfaceLine2 redesignedSurfaceLineGlobal; public CsvExportData() { @@ -461,13 +469,25 @@ get { return scenario.Location.SlopeDampingPiezometricHeightPolderSide; } } + /// + /// Gets the height of the current original dike (so not of the redesigned surfaceline). + /// + /// + /// The height of the current dike. + /// [CsvExportColumn("CurrentDikeHeight", 13)] [Browsable(false)] public double? CurrentDikeHeight { get { return scenario.Location.SurfaceLine2.GetDikeHeight(); } } + /// + /// Gets the current original dike toe at polder x (so not of the redesigned surfaceline). + /// + /// + /// The current global dike toe at polder x. + /// [CsvExportColumn("CurrentDikeToeAtPolderX", 14)] [Browsable(false)] public double? CurrentDikeToeAtPolderX @@ -482,6 +502,12 @@ } } + /// + /// Gets the current original dike toe at polder z (so not of the redesigned surfaceline). + /// + /// + /// The current global dike toe at polder z. + /// [CsvExportColumn("CurrentDikeToeAtPolderZ", 15)] [Browsable(false)] public double? CurrentDikeToeAtPolderZ @@ -537,6 +563,12 @@ get { return GetSoilProfileProbability(FailureMechanismSystemType.Piping); } } + /// + /// Gets the length of the current original dike (so not of the redesigned surfaceline). + /// + /// + /// The length of the current dike. + /// [CsvExportColumn("CurrentDikeLength", 20)] [Browsable(false)] public double? CurrentDikeLength @@ -553,10 +585,10 @@ { get { - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStabilityGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStability.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineStabilityGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; @@ -572,10 +604,10 @@ { get { - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStabilityGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStability.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineStabilityGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; @@ -591,10 +623,10 @@ { get { - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLineStabilityGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStability.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); + GeometryPoint point = redesignedSurfaceLineStabilityGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; @@ -667,10 +699,10 @@ { get { - if (redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePipingGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePiping.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLinePipingGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; @@ -686,10 +718,10 @@ { get { - if (redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePipingGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePiping.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLinePipingGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; @@ -705,10 +737,10 @@ { get { - if (redesignedSurfaceLinePiping == null) + if (redesignedSurfaceLinePipingGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); + GeometryPoint point = redesignedSurfaceLinePipingGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; @@ -747,29 +779,7 @@ { get { - double? maxDikeLength = null; - List dikeLengths = new List(); - SurfaceLine2 surfaceLine = 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; + return redesignedSurfaceLineGlobal.GetDikeLength(); } } @@ -811,7 +821,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.X; } @@ -832,7 +842,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.Y; } @@ -883,7 +893,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.X; } @@ -903,7 +913,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.Y; } @@ -965,7 +975,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.X; @@ -986,7 +996,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.Y; @@ -1037,7 +1047,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.X; } @@ -1057,7 +1067,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); return point.Y; } @@ -1142,7 +1152,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -1163,7 +1173,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(pl3LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -1220,7 +1230,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -1241,7 +1251,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(pl4LocalLocationXMinUplift.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -1403,84 +1413,84 @@ [Browsable(false)] public double? DikeToeAtRiverXrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).X; } } [CsvExportColumn("DikeToeAtRiverYrd", 80)] [Browsable(false)] public double? DikeToeAtRiverYrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Y; } } [CsvExportColumn("DikeToeAtRiverZrd", 81)] [Browsable(false)] public double? DikeToeAtRiverZrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver).Z; } } [CsvExportColumn("DikeTopAtRiverXrd", 82)] [Browsable(false)] public double? DikeTopAtRiverXrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).X; } } [CsvExportColumn("DikeTopAtRiverYrd", 83)] [Browsable(false)] public double? DikeTopAtRiverYrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Y; } } [CsvExportColumn("DikeTopAtRiverZrd", 84)] [Browsable(false)] public double? DikeTopAtRiverZrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtRiver).Z; } } [CsvExportColumn("DikeTopAtPolderXrd", 85)] [Browsable(false)] public double? DikeTopAtPolderXrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).X; } } [CsvExportColumn("DikeTopAtPolderYrd", 86)] [Browsable(false)] public double? DikeTopAtPolderYrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Y; } } [CsvExportColumn("DikeTopAtPolderZrd", 87)] [Browsable(false)] public double? DikeTopAtPolderZrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeTopAtPolder).Z; } } [CsvExportColumn("DikeToeAtPolderXrd", 88)] [Browsable(false)] public double? DikeToeAtPolderXrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; } } [CsvExportColumn("DikeToeAtPolderYrd", 89)] [Browsable(false)] public double? DikeToeAtPolderYrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Y; } } [CsvExportColumn("DikeToeAtPolderZrd", 90)] [Browsable(false)] public double? DikeToeAtPolderZrd { - get { return scenario.Location.SurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } + get { return redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).Z; } } [Browsable(false)] @@ -1490,12 +1500,14 @@ set { scenario = value; - scenarioName = scenario.LocationScenarioID; - locationName = scenario.Location.Name; - locationScenarioCount = scenario.Location.Scenarios.Count; - xRd = scenario.Location.XRd; - yRd = scenario.Location.YRd; - + if (scenario != null) + { + scenarioName = scenario.LocationScenarioID; + locationName = scenario.Location.Name; + locationScenarioCount = scenario.Location.Scenarios.Count; + xRd = scenario.Location.XRd; + yRd = scenario.Location.YRd; + } } } @@ -1530,22 +1542,28 @@ var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); - var redesignedSurfaceLineStabilityGlobal = new SurfaceLine2 + var localRedesignedSurfaceLineStabilityGlobal = new SurfaceLine2 { CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new LocalizedGeometryPointString() }; - redesignedSurfaceLineStabilityGlobal.Assign(redesignedSurfaceLineStability); - coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLineStabilityGlobal.Geometry); + localRedesignedSurfaceLineStabilityGlobal.Assign(redesignedSurfaceLineStability); + coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLineStabilityGlobal.Geometry); - return redesignedSurfaceLineStabilityGlobal; + return localRedesignedSurfaceLineStabilityGlobal; } [Browsable(false)] public SurfaceLine2 RedesignedSurfaceLine2Stability { get { return redesignedSurfaceLineStability; } - set { redesignedSurfaceLineStability = value; } + set + { + redesignedSurfaceLineStability = value; + // Also determine and set the correct global versions in order to retrieve dependend properties + redesignedSurfaceLineStabilityGlobal = CreateRedesignedSurfaceLineStabilityGlobal(); + redesignedSurfaceLineGlobal = redesignedSurfaceLineStabilityGlobal; + } } /// @@ -1562,22 +1580,28 @@ var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); - var redesignedSurfaceLinePipingGlobal = new SurfaceLine2 + var localRedesignedSurfaceLinePipingGlobal = new SurfaceLine2 { CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new LocalizedGeometryPointString() }; - redesignedSurfaceLinePipingGlobal.Assign(redesignedSurfaceLinePiping); - coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(redesignedSurfaceLinePipingGlobal.Geometry); + localRedesignedSurfaceLinePipingGlobal.Assign(redesignedSurfaceLinePiping); + coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLinePipingGlobal.Geometry); - return redesignedSurfaceLinePipingGlobal; + return localRedesignedSurfaceLinePipingGlobal; } [Browsable(false)] public SurfaceLine2 RedesignedSurfaceLine2Piping { get { return redesignedSurfaceLinePiping; } - set { redesignedSurfaceLinePiping = value; } + set + { + redesignedSurfaceLinePiping = value; + // Also determine and set the correct global versions in order to retrieve dependend properties + redesignedSurfaceLinePipingGlobal = CreateRedesignedSurfaceLinePipingGlobal(); + redesignedSurfaceLineGlobal = redesignedSurfaceLinePipingGlobal; + } } [Label("Profile")] @@ -1898,15 +1922,11 @@ { get { - GeometryPoint point; + GeometryPoint point = null; if (redesignedSurfaceLinePiping != null) { point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } - else - { - point = scenario.Location.LocalXZSurfaceLine2.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); - } if (point != null) return point.X; return null; @@ -1927,7 +1947,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); return point.X; } @@ -1947,7 +1967,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); return point.Y; } @@ -1978,7 +1998,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); return point.X; } @@ -1998,7 +2018,7 @@ return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), scenario.Location.SurfaceLine2); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); return point.Y; } @@ -2224,29 +2244,6 @@ return true; } - } - - #region Backwards compatibility - - [Obsolete("Do not use this method; Only exists for backwards compatibility purposes.", true)] - [XmlIgnore] - [Browsable(false)] - public SurfaceLine RedesignedSurfaceLineStability - { - get { return null; } - set { redesignedSurfaceLineStability = new OldSurfaceLineToNewConverter().Convert(value);} - } - - [Obsolete("Do not use this method; Only exists for backwards compatibility purposes.", true)] - [XmlIgnore] - [Browsable(false)] - public SurfaceLine RedesignedSurfaceLinePiping - { - get { return null; } - set { redesignedSurfaceLinePiping = new OldSurfaceLineToNewConverter().Convert(value); } - } - - #endregion - + } } } \ No newline at end of file