Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/SoilGeometry2DName.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/SoilGeometry2DName.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/SoilGeometry2DName.cs (revision 3305)
@@ -0,0 +1,34 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Deltares.Dam.Data
+{
+ public class SoilGeometry2DName
+ {
+ private string geometry2DName;
+
+ public virtual string Geometry2DName
+ {
+ get { return geometry2DName; }
+ set { geometry2DName = value; }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParserException.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParserException.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParserException.cs (revision 3305)
@@ -0,0 +1,52 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Deltares.Dam.Data
+{
+
+ [Serializable]
+ public class CsvParserException : Exception
+ {
+ public CsvParserException()
+ {
+ }
+
+ public CsvParserException(string message)
+ : base(message)
+ {
+ }
+
+ public CsvParserException(string message, Exception inner)
+ : base(message, inner)
+ {
+ }
+
+ protected CsvParserException(
+ SerializationInfo info,
+ StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSerieCollection.cs (revision 3305)
@@ -0,0 +1,276 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml.Linq;
+using System.IO;
+using Deltares.Dam.Data.Assemblers;
+using Deltares.Standard.Extensions;
+
+namespace Deltares.Dam.Data
+{
+
+ public class TimeSerieCollection
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public TimeSerieCollection()
+ {
+ this.Series = new List();
+ }
+
+ ///
+ /// Gets or sets the series.
+ ///
+ ///
+ /// The series.
+ ///
+ public List Series { get; set; }
+
+ ///
+ /// Gets or sets the version.
+ ///
+ ///
+ /// The version.
+ ///
+ public string Version { get; set; }
+
+ ///
+ /// Gets or sets the time zone.
+ ///
+ ///
+ /// The time zone.
+ ///
+ public double TimeZone { get; set; }
+
+ ///
+ /// Loads a time serie collection from file and validates the file with the resource embedded XSD
+ ///
+ /// The file info object containing the file to load
+ /// When valid a loaded time serie collection
+ ///
+ public static TimeSerieCollection LoadFromFile(FileInfo fileInfo)
+ {
+ return LoadFromFile(fileInfo.FullName, true);
+ }
+
+ ///
+ /// Loads a time serie collection from file and validates the file with the resource embedded XSD
+ ///
+ /// The file to load
+ /// When valid a loaded time serie collection
+ ///
+ public static TimeSerieCollection LoadFromFile(string fileName)
+ {
+ return LoadFromFile(fileName, true);
+ }
+
+ ///
+ /// Loads a time serie collection from file.
+ ///
+ /// The file name of the time serie
+ /// The value indicating if the file needs to be validated
+ /// The loaded time serie collection
+ public static TimeSerieCollection LoadFromFile(string fileName, bool validateWithEmbeddedXsd)
+ {
+ try
+ {
+ string message;
+ var assembler = new TimeSeriesAssembler();
+ var doc = XDocument.Load(fileName);
+ if (validateWithEmbeddedXsd)
+ if (!assembler.ValidateSchema(doc, out message))
+ throw new TimeSerieSchemaValidationException(message);
+ return assembler.CreateDomainObject(doc);
+ }
+ catch (Exception e)
+ {
+ throw new TimeSerieSchemaValidationException(fileName + ": " + e.Message);
+ }
+ }
+
+ ///
+ /// Saves the time serie collection to a specified file using the time serie assembler
+ ///
+ /// The name of the file
+ public void Save(string fileName)
+ {
+ ThrowHelper.ThrowIfFileNameNullOrEmpty(fileName, StringResourceNames.FileNameNotValid);
+
+ var timeSerieAssembler = new TimeSeriesAssembler();
+ XDocument doc = timeSerieAssembler.CreateDataTransferDocument(this);
+ doc.Save(fileName);
+ FileWriterUtil.RemoveThreeBytesFromXml(fileName); // apply this fix for FEWS!
+ }
+
+ ///
+ /// Updates the time serie entries with new values by applying the function to each value entry
+ ///
+ /// The parameter ID of the time serie to update
+ /// The function to apply to each entry
+ public void UpdateAllEntryValues(string parameterId, Func function)
+ {
+ foreach (var timeSerie in this.GetSeriesByParameterId(parameterId))
+ {
+ foreach (var sourceEntry in timeSerie.Entries)
+ {
+ if (!sourceEntry.Value.AlmostEquals(timeSerie.MissVal))
+ {
+ sourceEntry.Value = function(sourceEntry.Value);
+ }
+ }
+ }
+ }
+
+ ///
+ /// Creates a shallow copy of the current time serie collection and applies the map function to each of its entries
+ ///
+ public IEnumerable Map(IEnumerable locations, string parameterId, IEnumerable> functionList)
+ {
+ return from locationId in locations
+ from timeSerie in this.GetSeriesByLocationId(locationId).Where(x => x.ParameterId.Equals(parameterId))
+ from function in functionList
+ select function(timeSerie);
+ }
+
+ ///
+ /// Creates a shallow copy of the current time serie collection and applies the map function to each of its entries
+ ///
+ /// The locations to look for in this collection
+ /// The parameter to look for in this collection
+ /// The function to apply
+ /// A sequence of new time series with the applied function to its entries
+ public IEnumerable Map(IEnumerable locations, string parameterId, Func function)
+ {
+ return Map(locations, parameterId, new List> { function });
+ }
+
+ ///
+ /// Creates a shallow copy of the current time serie collection and applies the map function to each of its entries
+ ///
+ public IEnumerable Map(string locationId, string parameterId, Func function)
+ {
+ return Map(new List { locationId }, parameterId, function);
+ }
+
+ ///
+ /// Searches for a time series matching the location and parameter id. There should be only 1 or none (null)
+ ///
+ /// The parameter id.
+ /// The location id.
+ /// The time series matching the criterium
+ public TimeSerie FindSerie(string parameterId, string locationId)
+ {
+ return (from series in this.Series
+ where series.ParameterId.Equals(parameterId, StringComparison.InvariantCultureIgnoreCase) &&
+ series.LocationId.Equals(locationId, StringComparison.InvariantCultureIgnoreCase)
+ select series).SingleOrDefault();
+ }
+
+ ///
+ /// Gets all the time series with the given parameter id.
+ ///
+ /// The parameter id.
+ /// The time series matching the criteria
+ public IEnumerable GetSeriesByParameterId(string parameterId)
+ {
+ return from series in this.Series
+ where series.ParameterId.Equals(parameterId, StringComparison.InvariantCultureIgnoreCase)
+ select series;
+ }
+
+ ///
+ /// Gets all the series with the given location id.
+ ///
+ /// The location id.
+ /// The time series matching the criteria
+ public IEnumerable GetSeriesByLocationId(string locationId)
+ {
+ return from series in this.Series
+ where series.LocationId.Equals(locationId, StringComparison.InvariantCultureIgnoreCase)
+ select series;
+ }
+
+
+ ///
+ /// Gets the series containing location id and parameter id.
+ ///
+ /// The location id.
+ /// The parameter id.
+ /// The time series matching the criteria
+ public IEnumerable GetSeriesByLocationIdAndParameterId(string locationId, string parameterId)
+ {
+ return from series in this.Series
+ where series.LocationId.Equals(locationId, StringComparison.InvariantCultureIgnoreCase) &&
+ series.ParameterId.Equals(parameterId, StringComparison.InvariantCultureIgnoreCase)
+ select series;
+ }
+
+ ///
+ /// Gets all the series containing the combined gage and location id. (using the gage_id/location_id pattern)
+ ///
+ /// The combined gage and location id.
+ ///
+ public IEnumerable GetSeriesByGageIdAndLocationId(string combinedGageAndLocationId)
+ {
+ var resultSeries = new List();
+ foreach (var serie in this.Series)
+ {
+ string gaugeLocationId = serie.LocationId.Split('/')[0];
+ if (combinedGageAndLocationId.Equals(gaugeLocationId, StringComparison.InvariantCultureIgnoreCase))
+ {
+ resultSeries.Add(serie);
+ }
+ }
+ return resultSeries;
+ }
+
+ public TimeSerieCollection GetShallowCopy()
+ {
+ var copy = new TimeSerieCollection
+ {
+ Version = Version,
+ TimeZone = TimeZone
+ };
+
+ copy.Series.Clear();
+ return copy;
+ }
+
+ ///
+ /// Clears the time series.
+ ///
+ public void Clear()
+ {
+ Series.Clear();
+ }
+
+ public TimeSerie AddNewSeries(string locationId)
+ {
+ var series = TimeSerie.CreateTimeSerie(locationId);
+ this.Series.Add(series);
+ return series;
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeMissingException.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeMissingException.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeMissingException.cs (revision 3305)
@@ -0,0 +1,43 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Deltares.Maps
+{
+ [Serializable]
+ public class AttributeMissingException : Exception
+ {
+ private const string MessagePattern =
+ "Attribute {0} is missing or not supported. Check the mapping with the column in the ShapeFile";
+
+ public AttributeMissingException(string attributeName) : base(string.Format(MessagePattern, attributeName))
+ {
+ }
+
+ protected AttributeMissingException(
+ SerializationInfo info,
+ StreamingContext context) : base(info, context)
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CalculationParameters.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CalculationParameters.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CalculationParameters.cs (revision 3305)
@@ -0,0 +1,70 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.IO;
+using System.Xml.Linq;
+using Deltares.Dam.Data.Assemblers;
+
+namespace Deltares.Dam.Data
+{
+ using System;
+
+ public class CalculationModules
+ {
+ public bool StabilityInside { get; set; }
+ public bool StabilityOutside { get; set; }
+ public bool PipingWti { get; set; }
+ public bool PipingBligh { get; set; }
+ public bool PipingSellmeijer { get; set; }
+ }
+
+ public class CalculationParameters
+ {
+ public string WorkingPath { get; set; }
+ public string StabilityWorkingPath { get; set; }
+ public string PipingWorkingPath { get; set; }
+ public string StabilityExePath { get; set; }
+
+ public bool CalculateAllAtOnce
+ {
+ get { return MStabParameters == null || MStabParameters.IsCalculateAllStabilityProjectsAtOnce; }
+ set { MStabParameters.IsCalculateAllStabilityProjectsAtOnce = value; }
+ }
+
+ public static CalculationParameters LoadFromFile(FileInfo xmlFile)
+ {
+ return LoadFromFile(xmlFile.FullName);
+ }
+
+ public static CalculationParameters LoadFromFile(string xmlFileName)
+ {
+ if (string.IsNullOrWhiteSpace(xmlFileName)) throw new ArgumentException("xmlFileName");
+
+ XDocument calculationParametersFileDocument = XDocument.Load(xmlFileName);
+ var assembler = new CalculationParametersAssembler();
+ assembler.FileName = xmlFileName;
+ return assembler.CreateDomainObject(calculationParametersFileDocument);
+ }
+
+ public CalculationModules CalculationModules { get; set; }
+ public MStabParameters MStabParameters { get; set; }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/GreaterThanOrEqualToSpecification.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/GreaterThanOrEqualToSpecification.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/GreaterThanOrEqualToSpecification.cs (revision 3305)
@@ -0,0 +1,56 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+
+namespace Deltares.Standard.Specifications
+{
+ ///
+ /// Defines a greater then of equal to specification
+ ///
+ /// The type of the candidate.
+ /// The type of the value.
+ public class GreaterThanOrEqualToSpecification : ValueBoundSpecification where TValue : IComparable
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Name of the attribute.
+ /// The attribute value.
+ public GreaterThanOrEqualToSpecification(string attributeName, TValue attributeValue)
+ : base(attributeName, attributeValue)
+ {
+ }
+
+ ///
+ /// Determines whether the candidate satisfies the specification.
+ ///
+ /// The candidate to test.
+ ///
+ /// true if the candidate satisfies the specification otherwise, false.
+ ///
+ public override bool IsSatisfiedBy(TCandidate candidate)
+ {
+ var actual = this.GetCandidateTValue(candidate) as IComparable;
+ return (actual.CompareTo(this.AttributeValue) >= 0);
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamHelperFunctions.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamHelperFunctions.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamHelperFunctions.cs (revision 3305)
@@ -0,0 +1,110 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Text.RegularExpressions;
+
+namespace Deltares.Dam.Data
+{
+ public class DamHelperFunctions
+ {
+ ///
+ /// Determine a filename based on the different inout parameters
+ ///
+ /// Name of the location.
+ /// Name of the scenario.
+ /// Name of the soil geometry.
+ /// Index of the iteration.
+ ///
+ public static string DetermineCalculationFilename(string locationName, string scenarioName,
+ string soilGeometryName, int iterationIndex)
+ {
+ string calculationName;
+ if (iterationIndex < 0)
+ {
+ calculationName = String.Format("Loc({0})_Sce({1})_Pro({2})", locationName, scenarioName,
+ soilGeometryName);
+ }
+ else
+ {
+ calculationName = String.Format("Loc({0})_Sce({1})_Pro({2})_Ite({3})", locationName, scenarioName,
+ soilGeometryName, iterationIndex);
+ }
+ return Regex.Replace(calculationName, @"[\\\/:\*\?""'<>|.]", "_");
+ }
+
+ ///
+ /// Convert Date to time stamp as needed by TNO AnySense.
+ ///
+ /// The date time.
+ ///
+ public static string DateToTimeStamp(DateTime dateTime)
+ {
+ // Following 2 lines is an example how to handle customization of this format.
+ // TNO at the last moment decided they did not need this change so we change it back to
+ // the default format
+ // string customFormat = "yyyy-MM-dd_HH-mm-ss";
+ // return dateTime.ToString(customFormat);
+ return dateTime.ToString("s", DateTimeFormatInfo.InvariantInfo);
+ }
+
+ ///
+ /// Determine name of Stability project file
+ ///
+ internal static string GetProjectFileName(string dikeName, Location location, int? jobCount, MStabModelType? model, string stabilityWorkingPath, DateTime? dateTime)
+ {
+ string calculationName = String.Format("Dik({0})_Loc({1})", dikeName, location.Name);
+ if (jobCount != null)
+ {
+ calculationName = calculationName + String.Format("_Stp({0})", jobCount);
+ }
+ if (model != null)
+ {
+ calculationName = calculationName + String.Format("_Mdl({0})", model);
+ }
+ if (dateTime != null)
+ {
+ calculationName = calculationName + "_" + DateToTimeStamp(dateTime.Value);
+ }
+ calculationName = Regex.Replace(calculationName, @"[\\\/:\*\?""'<>|.]", "_");
+ // assemble the target project file name
+ return Path.Combine(stabilityWorkingPath, calculationName + ".sti");
+ }
+
+ ///
+ /// Gets the D-GeoStability executable path.
+ ///
+ ///
+ /// The m stab executable path.
+ ///
+ public static string MStabExePath
+ {
+ get
+ {
+ return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
+ @"DGeoStability.exe");
+ }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/SoilProfileDataSet.xss
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/SoilProfileDataSet.xss (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/SoilProfileDataSet.xss (revision 3305)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 254
+ 283
+
+
+ 280
+ 283
+
+
+
+
+
+
+ 554
+ 275
+
+
+ 507
+ 275
+
+
+
+
+
+
+ 659
+ 347
+
+
+ 659
+ 420
+
+
+
+
+
+
+ 685
+ 596
+
+
+ 685
+ 559
+
+
+
+
+
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Gauge.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Gauge.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Gauge.cs (revision 3305)
@@ -0,0 +1,40 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+
+namespace Deltares.Dam.Data
+{
+
+ public class Gauge
+ {
+ public virtual string Name { get; set; }
+ public virtual Location Location{ get; set; }
+ public virtual double LocalX { get; set; }
+
+ public double? Value { get; set; }
+
+ public override string ToString()
+ {
+ return String.Format("{0} @ Location {1} | Local X={2}", this.Name, this.Location != null ? this.Location.Name : "?", this.LocalX);
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/LocationResult.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/LocationResult.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/LocationResult.cs (revision 3305)
@@ -0,0 +1,58 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Deltares.Standard.Attributes;
+using Deltares.Standard.EventPublisher;
+
+namespace Deltares.Dam.Data
+{
+ public class LocationResult
+ {
+ private TimeSerie stabilityTimeSerie = new TimeSerie();
+ private TimeSerie pipingTimeSerie = new TimeSerie();
+
+ public LocationResult()
+ {
+ }
+
+ public virtual TimeSerie StabilityTimeSerie
+ {
+ get { return stabilityTimeSerie; }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilityTimeSerie");
+ stabilityTimeSerie = value;
+ DataEventPublisher.AfterChange(this, "StabilityTimeSerie");
+ }
+ }
+
+ public TimeSerie PipingTimeSerie
+ {
+ get { return pipingTimeSerie; }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "PipingTimeSerie");
+ pipingTimeSerie = value;
+ DataEventPublisher.AfterChange(this, "PipingTimeSerie");
+ }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationPropertyImporter.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationPropertyImporter.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationPropertyImporter.cs (revision 3305)
@@ -0,0 +1,334 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using Deltares.Dam.Data.CsvImporters;
+using Deltares.Maps;
+using Deltares.Standard;
+using NetTopologySuite.Geometries;
+using DataAttribute = Deltares.Dam.Data.DataPlugins.Configuration.DataAttribute;
+
+namespace Deltares.Dam.Data.Importers
+{
+ public class LocationPropertyImporterException : Exception
+ {
+ public LocationPropertyImporterException(string message)
+ : base(message)
+ {
+ }
+ }
+
+ // ReSharper disable ClassWithVirtualMembersNeverInherited.Global
+ public class LocationPropertyImporter
+ // ReSharper restore ClassWithVirtualMembersNeverInherited.Global
+ {
+ private readonly IDictionary> filesToImportFrom;
+ private readonly PolygonAttributeImporter polygonAttributeImporter;
+ private readonly LineAttributeImporter lineAttributeImporter;
+ private List improperAttributeMessages = new List();
+ private IEnumerable targets;
+
+ public LocationPropertyImporter()
+ {
+ this.filesToImportFrom = new Dictionary>();
+
+ this.polygonAttributeImporter = new PolygonAttributeImporter
+ {
+ XGetter = (t) => t.GeoX.Value,
+ YGetter = (t) => t.GeoY.Value
+ };
+
+ this.lineAttributeImporter = new LineAttributeImporter();
+ }
+
+ public List ImproperAttributeMessages
+ {
+ get { return improperAttributeMessages; }
+ }
+
+ public LocationPropertyImporter(string dataLocation, IEnumerable dataAttributes) : this()
+ {
+ this.DataFileLocation = dataLocation;
+ improperAttributeMessages.Clear();
+ // Register configured property attributes
+ foreach (var dataAttribute in dataAttributes)
+ {
+ if (LocationShapeFileAttributeMap.IsPropertyAttribute(dataAttribute.AttributeId))
+ RegisterAttributeMapping(dataAttribute.AttributeId, dataAttribute.AttributeName, dataAttribute.DataSource);
+ }
+
+ if (improperAttributeMessages.Count > 0)
+ {
+ var message = Environment.NewLine + "The following attribute id's are supported:" + Environment.NewLine +
+ string.Join(", ", LocationShapeFileAttributeMap.AttributePropertyMap.Keys.OrderBy(k => k).ToArray());
+
+ message += Environment.NewLine + "Please change the id in the shape file or remove the shape for this attribute from the defx.";
+ improperAttributeMessages.Add(message);
+ }
+ // Should throw an exception when more then one crosssection is defined..
+ RegisterCrossSectionAttribute(dataAttributes);
+ }
+
+ public string DataFileLocation { private get; set; }
+
+ public IEnumerable ImportErrors
+ {
+ get { return this.polygonAttributeImporter.Errors.Concat(this.lineAttributeImporter.Errors); }
+ }
+
+ public IEnumerable Targets
+ {
+ set { this.targets = value; }
+ }
+
+ private void RegisterCrossSectionAttribute(IEnumerable dataAttributes)
+ {
+ DataAttribute crossSectionConfig = dataAttributes.SingleOrDefault(a => a.AttributeId.Equals(LocationShapeFileAttributeMap.CrossSectionAttributId, StringComparison.InvariantCultureIgnoreCase));
+
+ LocationAttributeMapping mapping = crossSectionConfig != null ?
+ LocationShapeFileAttributeMap.GetAttributeMapping(crossSectionConfig) :
+ LocationShapeFileAttributeMap.GetAttributeMapping(LocationShapeFileAttributeMap.CrossSectionAttributId);
+
+ RegisterCrossSectionAttribute(mapping.Name, mapping.File);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RegisterCrossSectionAttribute(string customAttributeName, string customFileName)
+ {
+ if (!IsValidString(customAttributeName))
+ throw new ArgumentException("customAttributeName");
+
+ if (!IsValidString(customFileName))
+ throw new ArgumentException("customFileName");
+
+ var file = GetFile(customFileName);
+ this.lineAttributeImporter.CrossSectionRepository = GetCrossSectionRepository(file);
+ this.lineAttributeImporter.LocationIDAttributeName = GetAttributeName(customAttributeName);
+ }
+
+ // method is used for test purpose
+ // a cleaner class design should not have this method public
+ // todo: fix this
+ public virtual string GetAttributeName(string name)
+ {
+ return name;
+ }
+
+ // method is used for test purpose
+ // a cleaner class design should not have this method public
+ // todo: fix this
+ public virtual IFeatureRepository GetCrossSectionRepository(ShapeFileLocation file)
+ {
+ return FeatureRepository.CreateFromShapeFile(file.FullPath);
+ }
+
+ // for now this method is only used for test purposes
+ internal void RegisterAttributeMapping(string attributeId)
+ {
+ RegisterAttributeMapping(attributeId, null);
+ }
+
+ ///
+ /// Registers a shape file attribute/column mapping to local id's. The attribute names are set to default names.
+ ///
+ /// Required argument. Use this argument to refer to a known attribute in the set of supported attributes (declared in this class). For example: TRAFLOAD.
+ /// The name of the Shape file that contains the data attribute
+ /// When the attribute id is unknown (not in the set declared here) this exception is thrown
+ /// When the attribute id is null or empty this exception is thrown
+ public void RegisterAttributeMapping(string attributeId, string dataFileName)
+ {
+ RegisterAttributeMapping(attributeId, null, dataFileName);
+ }
+
+ ///
+ /// Registers a shape file attribute to local id's
+ ///
+ ///
+ /// The Shape file attributes/columns are in the Dbf file
+ ///
+ /// Required argument. Use this argument to refer to a known attribute in the set of supported attributes (declared in this class). For example: TRAFLOAD.
+ /// The name of the attribute in the Shape file to map to. For example TRAFLOAD can be mapped to the TrafficLoad column in the Shape file. If the name is null or Empty the default name will be used. For TRAFLOAD this will be TRAFLOAD.
+ /// The name of the Shape file that contains the data attribute
+ /// If the attribute id is unknown (not in the set declared here) this exception is thrown
+ /// If the attribute id is null or empty this exception is thrown
+ /// If the file is not found this exceptions will be thrown
+ public void RegisterAttributeMapping(string attributeId, string customAttributeName, string dataFileName)
+ {
+ if (!IsValidString(attributeId))
+ throw new ArgumentException("attributeId");
+
+ if (!LocationShapeFileAttributeMap.IsAttributeIdSupported(attributeId))
+ {
+ string message = string.Format("The attribute id '{0}' is not supported by this importer.",
+ attributeId);
+ improperAttributeMessages.Add(message);
+ }
+ else
+ {
+ LocationAttributeMapping mapping = LocationShapeFileAttributeMap.GetAttributeMapping(attributeId);
+ string attrName = string.IsNullOrEmpty(customAttributeName) || customAttributeName.Trim() == ""
+ ? mapping.Name // return the default shape file colum name
+ : customAttributeName;
+
+ if (!IsValidString(dataFileName)) // not a valid file location? use the default file
+ dataFileName = mapping.File;
+
+ Action action = mapping.Action;
+
+ // Build a map to data (shape) files and attributes contained in the dbf file
+ // if a file is already added to the map a new attribute will be added
+ // to support the concept that multiple attributes can be contained in a single (shape) file
+ // ie. { somedatashapefile.shp, { TRAFFLOAD, PENLENGTH, .. } }
+
+ ShapeFileLocation file = GetFile(dataFileName);
+
+ string key = file.FullPath;
+
+ if (!this.filesToImportFrom.ContainsKey(key))
+ this.filesToImportFrom.Add(key, new List());
+
+ this.filesToImportFrom[key].Add(new LocationAttributeMapping
+ {
+ Action = action,
+ Name = attrName
+ });
+ }
+ }
+
+ // used for testing purposes...
+ public virtual ShapeFileLocation GetFile(string dataFileName)
+ {
+ var file = new ShapeFileLocation(this.DataFileLocation, dataFileName);
+ if (!file.Exists)
+ throw new FileNotFoundException(string.Format("The file '{0}' is not found", file.FullPath));
+ return file;
+ }
+
+ // used for testing purposes...
+
+ // ReSharper disable MemberCanBeProtected.Global
+ public virtual IFeatureRepository CreateFromShapeFile(string fileName)
+ // ReSharper restore MemberCanBeProtected.Global
+ {
+ return FeatureRepository.CreateFromShapeFile(new ShapeFileLocation(fileName));
+ }
+
+ ///
+ /// Imports the specified progress.
+ ///
+ /// The progress.
+ /// No target locations set
+ ///
+ ///
+ /// The file " + fileName + " does not exist so can not be imported.
+ /// or
+ /// Had problems reading attribute values from file: " + fileName
+ ///
+ public void Import(DamEngine.Data.Standard.Calculation.ProgressDelegate progress)
+ {
+ if (this.targets == null)
+ throw new InvalidOperationException("No target locations set");
+
+ try
+ {
+ this.polygonAttributeImporter.Targets = this.targets;
+ this.lineAttributeImporter.Targets = this.targets;
+ }
+ catch (LineAttributeImporterException e)
+ {
+ throw new LocationPropertyImporterException(String.Format("Error finding locations in crossections, {0}", e.Message));
+ }
+
+#if DEBUG
+ int targetCount = targets.Count();
+ int crossSectionCount = lineAttributeImporter != null && lineAttributeImporter.CrossSectionRepository != null ? lineAttributeImporter.CrossSectionRepository.Count : 0;
+#endif
+ // use the file / name attribute mapping table to retrieve the
+ // the actual value from the data (shape) file
+ var progressStep = 0.6*(1.0 /this.filesToImportFrom.Count);
+ var curProgress = 0.30;
+
+ foreach (var file in this.filesToImportFrom)
+ {
+ string fileName = file.Key;
+ if (!File.Exists(fileName))
+ {
+ throw new ImportException("The file " + fileName + " does not exist so can not be imported.");
+ }
+
+#if DEBUG
+ Debug.WriteLine(new string('=', 80));
+ Debug.WriteLine(fileName);
+ var stopwatch = new Stopwatch();
+ stopwatch.Start();
+#endif
+
+ IFeatureRepository attributeRepository = CreateFromShapeFile(fileName);
+ var feature = attributeRepository.Features.FirstOrDefault();
+ bool isPolygonTypeRepository = false;
+ if (feature != null)
+ {
+ isPolygonTypeRepository = feature.Geometry is Polygon || feature.Geometry is MultiPolygon;
+ IAttributeImporter importer = isPolygonTypeRepository ?
+ this.polygonAttributeImporter as IAttributeImporter :
+ this.lineAttributeImporter as IAttributeImporter;
+ importer.FileName = fileName;
+ importer.AttributeRepository = attributeRepository;
+ importer.AttributeMappings = file.Value.OfType>();
+
+ try
+ {
+ importer.Import();
+ }
+ catch (AttributeMissingException attributeMissingException)
+ {
+ importer.AddError(attributeMissingException);
+ }
+ catch(Exception e)
+ {
+ throw new ImportException("Had problems reading attribute values from file: " + fileName, e);
+ }
+ }
+ curProgress += progressStep;
+ if (progress != null) progress(curProgress);
+#if DEBUG
+ stopwatch.Stop();
+ Debug.WriteLine(string.Format("Number of source features: {0}", isPolygonTypeRepository ? targetCount : crossSectionCount));
+ Debug.WriteLine(string.Format("Number of target features: {0}", attributeRepository.Count));
+ Debug.WriteLine(string.Format("Time elapsed: {0}s", stopwatch.Elapsed.TotalSeconds));
+#endif
+ }
+ }
+
+ private static bool IsValidString(string value)
+ {
+ return !(string.IsNullOrEmpty(value) || value.Trim() == string.Empty);
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/Domain/FeatureTest.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/Domain/FeatureTest.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/Domain/FeatureTest.cs (revision 3305)
@@ -0,0 +1,105 @@
+// Copyright (C) Stichting Deltares 2018. All rights reserved.
+//
+// This file is part of the application DAM - UI.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+
+using NetTopologySuite.Geometries;
+
+using NUnit.Framework;
+
+namespace Deltares.Maps.Tests.Domain
+{
+ [TestFixture]
+ public class FeatureTest
+ {
+ private Feature feature;
+
+ #region Setup
+
+ [TestFixtureSetUp]
+ public void FixtureSetup()
+ {
+ }
+
+ [TestFixtureTearDown]
+ public void FixtureTearDown()
+ {
+ }
+
+ [SetUp]
+ public void TestSetup()
+ {
+ }
+
+ [TearDown]
+ public void TestTearDown()
+ {
+ }
+
+ #endregion
+
+ [Test]
+ public void FeatureCreation_NormalScenario_CreatesFeatureInstance()
+ {
+ const string geometryWkt = "POINT (0.1 0.2)";
+ feature = Feature.Create(geometryWkt);
+ Assert.IsNotNull(feature);
+ Assert.AreEqual(geometryWkt, feature.WktFormat);
+
+ feature = Feature.Create(geometryWkt);
+ Assert.IsNotNull(feature);
+ Assert.AreEqual(geometryWkt, feature.WktFormat);
+ Assert.IsInstanceOf(typeof(Point), feature.Geometry);
+ }
+
+ [Test]
+ //[ExpectedException(typeof(ArgumentException), ExpectedMessage = "There was an error parsing the WKT geometry string, maybe due to an incorrect culture format conversion")]
+ // NB This test fails when you change the decimal separator to a point in Dutch regional settings on your computer
+ [ExpectedException(typeof(ArgumentException))]
+ public void FeatueCreation_DutchCultureWktStringFormat_Throws()
+ {
+ Action test =
+ () =>
+ {
+ string geometryWkt = string.Format("MULTIPOINT ({0} {1},{2} {3})", 0.1, 0.2, 0.3, 0.4);
+ feature = Feature.Create(geometryWkt);
+ };
+
+ CultureHelper.InvokeWithDutchCulture(test);
+ }
+
+ [Test]
+ public void FeatureCreation_DutchCulture_FeatureIsCreatedWithoutExceptions()
+ {
+ Action test =
+ () =>
+ {
+ const string geometryWkt = "MULTIPOINT (0.0 0.1,0.2 0.3)";
+ feature = Feature.Create(geometryWkt);
+ Assert.IsNotNull(feature);
+ Assert.AreEqual(geometryWkt, feature.WktFormat);
+ Assert.IsInstanceOf(typeof(MultiPoint), feature.Geometry);
+ };
+
+ CultureHelper.InvokeWithDutchCulture(test);
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/JobResultInterpreter.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/JobResultInterpreter.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/JobResultInterpreter.cs (revision 3305)
@@ -0,0 +1,86 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Drawing;
+
+namespace Deltares.Dam.Data
+{
+ public class JobResultInterpreter
+ {
+ public static JobResult GetJobResult(double result, double demand, bool smaller)
+ {
+ if (result >= DamGlobalConstants.NoRunValue)
+ {
+ return JobResult.NoRun;
+ }
+ else if (result < 0 || double.IsNaN(result))
+ {
+ return JobResult.Failed;
+ }
+ else if (smaller)
+ {
+ if (result < demand)
+ {
+ return JobResult.Bad;
+ }
+ else
+ {
+ return JobResult.Good;
+ }
+ }
+ else
+ {
+ if (result > demand)
+ {
+ return JobResult.Bad;
+ }
+ else
+ {
+ return JobResult.Good;
+ }
+ }
+ }
+
+ public static Color GetJobResultColor(double result, double demand, bool smaller)
+ {
+ switch (GetJobResult(result, demand, smaller))
+ {
+ case JobResult.NoRun: return Color.Gray;
+ case JobResult.Failed: return Color.White;
+ case JobResult.Good: return Color.Lime;
+ case JobResult.Bad: return Color.Red;
+ default: return Color.Pink;
+ }
+ }
+
+ public static Color GetJobResultColor(JobResult jobResult)
+ {
+ switch (jobResult)
+ {
+ case JobResult.NoRun: return Color.Gray;
+ case JobResult.Failed: return Color.White;
+ case JobResult.Good: return Color.Lime;
+ case JobResult.Bad: return Color.Red;
+ default: return Color.Pink;
+ }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DtoAssembler/Assemblers/FileIdentificationAssembler.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DtoAssembler/Assemblers/FileIdentificationAssembler.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DtoAssembler/Assemblers/FileIdentificationAssembler.cs (revision 3305)
@@ -0,0 +1,130 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Xml.Linq;
+using Deltares.Standard.IO.DtoAssembler;
+
+namespace Deltares.Standard
+{
+ public class FileIdentificationAssembler : IDtoAssembler
+ {
+ private const string elementName = "FileIdentification";
+ private const string elementNamespace = "http://deltares.nl/2008/FileIdentificationDefinition";
+
+ private readonly DtoPropertyAttributeMap map = new DtoPropertyAttributeMap();
+
+ public FileIdentificationAssembler()
+ {
+ const string attApplication = "Application";
+ this.map.Add(attApplication, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attApplication,
+ AttributeName = attApplication,
+ Importance = DtoPropertyImportance.Required
+ });
+
+ const string attVersion = "Version";
+ this.map.Add(attVersion, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attVersion,
+ AttributeName = attVersion,
+ Importance = DtoPropertyImportance.Required
+ });
+
+ const string attCreated = "Created";
+ this.map.Add(attCreated, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attCreated,
+ AttributeName = attCreated,
+ Importance = DtoPropertyImportance.Required
+ });
+
+ const string attCompany = "Company";
+ this.map.Add(attCompany, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attCompany,
+ AttributeName = attCompany,
+ Importance = DtoPropertyImportance.Required
+ });
+
+ const string attLicense = "License";
+ this.map.Add(attLicense, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attLicense,
+ AttributeName = attLicense,
+ Importance = DtoPropertyImportance.Optional
+ });
+
+ const string attDescription = "Description";
+ this.map.Add(attDescription, new DtoPropertyAttriubteMapping()
+ {
+ PropertyName = attDescription,
+ AttributeName = attDescription,
+ Importance = DtoPropertyImportance.Optional
+ });
+ }
+
+ ///
+ /// Gets or sets the namespace value for the element
+ ///
+ public string ElementNamespace
+ {
+ get { return elementNamespace; }
+ }
+
+ #region IDtoAssembler Members
+
+ ///
+ /// Gets the xml element name
+ ///
+ public string ElementName
+ {
+ get { return elementName; }
+ }
+
+ ///
+ /// Assembles a FieldIdentification object from an Dto (XElement)
+ ///
+ /// The data transfer object
+ /// The materialized domain object
+ public FileIdentification CreateDomainObject(XElement dtoObj)
+ {
+ return new FileIdentification()
+ .Materialize(dtoObj);
+ }
+
+ public XElement CreateDataTransferObject(FileIdentification domainObj)
+ {
+ XElement el = new XElement(elementName)
+ .Materialize(domainObj, this.map);
+
+ return el;
+ }
+
+ #endregion
+
+ public XElement CreateDataTransferObject(FileIdentification domainObj, XNamespace elementNamespace)
+ {
+ return new XElement(elementNamespace + elementName)
+ .Materialize(domainObj, this.map);
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/ParameterizedSpecification.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/ParameterizedSpecification.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/ParameterizedSpecification.cs (revision 3305)
@@ -0,0 +1,33 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Deltares.Standard.Specifications
+{
+ public abstract class ParameterSpecification : SpecificationBase
+ {
+ protected readonly TParameter ParameterValue;
+
+ protected ParameterSpecification(TParameter parameterValue)
+ {
+ this.ParameterValue = parameterValue;
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/app.config
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/app.config (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/app.config (revision 3305)
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+ segments
+
+
+ locations
+
+
+ soilprofiles
+
+
+ surfacelines
+
+
+ characteristicpoints
+
+
+ csv
+
+
+ Soilbase\soilbase.mdb
+
+
+ modelparameters
+
+
+ 0.66
+
+
+ pl1lines
+
+
+ gauges
+
+
+ .\DGeoStability.exe
+
+
+ .\GeoStudio.exe
+
+
+ Automatic
+
+
+ 36
+
+
+ 2
+
+
+ 14
+
+
+ 2
+
+
+ 3
+
+
+ 2
+
+
+ 6
+
+
+ 2
+
+
+ 10
+
+
+ 2.5
+
+
+ 10
+
+
+ 2.5
+
+
+ OnBoundaryLines
+
+
+ 0.25
+
+
+ OnBoundaryLines
+
+
+ 0.25
+
+
+
+
+
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (revision 3305)
@@ -0,0 +1,1375 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Collections.Generic;
+using System.Configuration;
+using Deltares.DamEngine.Io.XmlInput;
+using Deltares.DamEngine.Io.XmlOutput;
+using Deltares.Geotechnics;
+using Deltares.Geotechnics.Soils;
+using Deltares.Standard;
+using Deltares.Standard.Extensions;
+using Deltares.Standard.Logging;
+using CharacteristicPointType = Deltares.Geotechnics.SurfaceLines.CharacteristicPointType;
+
+namespace Deltares.Dam.Data.DamEngineIo
+{
+ ///
+ /// Converts types from Dam Engine class to Input serializer class and vice versa
+ ///
+ public static class ConversionHelper
+ {
+ ///
+ /// Converts the type DamProjectType from input object type to Dam Engine type.
+ ///
+ /// Type of the input object.
+ /// Dam Engine type
+ public static DamProjectType ConvertToDamProjectType(InputDamProjectType inputDamProjectType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputDamProjectType.Design, DamProjectType.Design},
+ {InputDamProjectType.Operational, DamProjectType.Calamity}
+ };
+ return translationTable[inputDamProjectType];
+ }
+
+ ///
+ /// Converts the type DamProjectType from Dam Engine type to input object type.
+ ///
+ /// Type of the dam project.
+ /// Type of the input object.
+ public static InputDamProjectType ConvertToInputDamProjectType(DamProjectType damProjectType)
+ {
+ if (damProjectType == DamProjectType.DamLiveConfiguration)
+ damProjectType = DamProjectType.Calamity;
+ var translationTable = new Dictionary()
+ {
+ {DamProjectType.Design, InputDamProjectType.Design},
+ {DamProjectType.Calamity, InputDamProjectType.Operational},
+ };
+ return translationTable[damProjectType];
+ }
+
+ ///
+ /// Converts the type PLLineCreationMethod from Dam Engine type to input object type.
+ ///
+ /// Type of the dam project.
+ ///
+ /// Type of the input object.
+ ///
+ public static LocationWaternetOptionsPhreaticLineCreationMethod ConvertToInputPhreaticLineCreationMethod(PLLineCreationMethod plLineCreationMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PLLineCreationMethod.ExpertKnowledgeLinearInDike, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike},
+ {PLLineCreationMethod.ExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD},
+ {PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD},
+ {PLLineCreationMethod.Sensors, LocationWaternetOptionsPhreaticLineCreationMethod.Sensors},
+ {PLLineCreationMethod.None, LocationWaternetOptionsPhreaticLineCreationMethod.None}
+ };
+ return translationTable[plLineCreationMethod];
+ }
+
+ ///
+ /// Converts the type PLLineCreationMethod from input object type to Dam Engine type.
+ ///
+ /// Type of the input object.
+ ///
+ /// Type of the dam object.
+ ///
+ public static PLLineCreationMethod ConvertToPhreaticLineCreationMethod(LocationWaternetOptionsPhreaticLineCreationMethod inputPhreaticLineCreationMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeLinearInDike,PLLineCreationMethod.ExpertKnowledgeLinearInDike},
+ {LocationWaternetOptionsPhreaticLineCreationMethod.ExpertKnowledgeRRD, PLLineCreationMethod.ExpertKnowledgeRRD},
+ {LocationWaternetOptionsPhreaticLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD, PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD},
+ {LocationWaternetOptionsPhreaticLineCreationMethod.Sensors, PLLineCreationMethod.Sensors},
+ {LocationWaternetOptionsPhreaticLineCreationMethod.None, PLLineCreationMethod.None}
+ };
+ return translationTable[inputPhreaticLineCreationMethod];
+ }
+
+ ///
+ /// Converts the type IntrusionVerticalWaterPressureType from Dam Engine type to input object type.
+ ///
+ /// Type of the dam project.
+ ///
+ /// Type of the input object.
+ ///
+ public static LocationWaternetOptionsIntrusionVerticalWaterPressure ConvertToInputIntrusionVerticalWaterPressure(IntrusionVerticalWaterPressureType intrusionVerticalWaterPressureType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {IntrusionVerticalWaterPressureType.FullHydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic},
+ {IntrusionVerticalWaterPressureType.HydroStatic, LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic},
+ {IntrusionVerticalWaterPressureType.Linear, LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear},
+ {IntrusionVerticalWaterPressureType.SemiTimeDependent, LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent},
+ {IntrusionVerticalWaterPressureType.Standard, LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard}
+ };
+ return translationTable[intrusionVerticalWaterPressureType];
+ }
+
+ ///
+ /// Converts the type IntrusionVerticalWaterPressureType from input object type to Dam Engine type.
+ ///
+ /// Type of the input object.
+ ///
+ /// Type of the dam object.
+ ///
+ public static IntrusionVerticalWaterPressureType ConvertToIntrusionVerticalWaterPressure(LocationWaternetOptionsIntrusionVerticalWaterPressure inputIntrusionVerticalWaterPressure)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LocationWaternetOptionsIntrusionVerticalWaterPressure.FullHydroStatic, IntrusionVerticalWaterPressureType.FullHydroStatic},
+ {LocationWaternetOptionsIntrusionVerticalWaterPressure.HydroStatic, IntrusionVerticalWaterPressureType.HydroStatic},
+ {LocationWaternetOptionsIntrusionVerticalWaterPressure.Linear, IntrusionVerticalWaterPressureType.Linear},
+ {LocationWaternetOptionsIntrusionVerticalWaterPressure.SemiTimeDependent, IntrusionVerticalWaterPressureType.SemiTimeDependent},
+ {LocationWaternetOptionsIntrusionVerticalWaterPressure.Standard, IntrusionVerticalWaterPressureType.Standard}
+ };
+ return translationTable[inputIntrusionVerticalWaterPressure];
+ }
+
+ public const int CpNone = 0;//
+ public const int CpSurfaceLevelOutside = 1; // Maaiveld buitenwaarts
+ public const int CpDikeToeAtRiver = 5; // Teen dijk buitenwaarts
+ public const int CpShoulderTopOutside = 6; // Kruin buitenberm
+ public const int CpShoulderBaseOutside = 7; // Insteek buitenberm
+ public const int CpDikeTopAtRiver = 8; // Kruin buitentalud
+ public const int CpDikeLine = 9; // referentielijn
+ public const int CpTrafficLoadOutside = 10; // Verkeersbelasting kant buitenwaarts
+ public const int CpTrafficLoadInside = 11; // Verkeersbelasting kant binnenwaarts
+ public const int CpDikeTopAtPolder = 12; // Kruin binnentalud
+ public const int CpShoulderBaseInside = 13; // Insteek binnenberm
+ public const int CpShoulderTopInside = 14; // Kruin binnenberm
+ public const int CpDikeToeAtPolder = 15; // Teen dijk binnenwaarts
+ public const int CpDitchDikeSide = 16; // Insteek sloot dijkzijde
+ public const int CpBottomDitchDikeSide = 17; // Slootbodem dijkzijde
+ public const int CpBottomDitchPolderSide = 18; // Slootbodem polderzijde
+ public const int CpDitchPolderSide = 19; // Insteek sloot polderzijde
+ public const int CpSurfaceLevelInside = 25; // Maaiveld binnenwaarts
+
+ ///
+ /// Converts the type of to dam point.
+ ///
+ /// Type of the input point.
+ ///
+ public static CharacteristicPointType ConvertToDamPointType(int inputPointType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {CpNone, CharacteristicPointType.None},
+ {CpSurfaceLevelOutside, CharacteristicPointType.SurfaceLevelOutside},
+ {CpDikeToeAtRiver, CharacteristicPointType.DikeToeAtRiver},
+ {CpShoulderTopOutside, CharacteristicPointType.ShoulderTopOutside},
+ {CpShoulderBaseOutside, CharacteristicPointType.ShoulderBaseOutside},
+ {CpDikeTopAtRiver, CharacteristicPointType.DikeTopAtRiver},
+ {CpDikeLine, CharacteristicPointType.DikeLine},
+ {CpTrafficLoadOutside, CharacteristicPointType.TrafficLoadOutside},
+ {CpTrafficLoadInside, CharacteristicPointType.TrafficLoadInside},
+ {CpDikeTopAtPolder, CharacteristicPointType.DikeTopAtPolder},
+ {CpShoulderBaseInside, CharacteristicPointType.ShoulderBaseInside},
+ {CpShoulderTopInside, CharacteristicPointType.ShoulderTopInside},
+ {CpDikeToeAtPolder, CharacteristicPointType.DikeToeAtPolder},
+ {CpDitchDikeSide, CharacteristicPointType.DitchDikeSide},
+ {CpBottomDitchDikeSide, CharacteristicPointType.BottomDitchDikeSide},
+ {CpBottomDitchPolderSide, CharacteristicPointType.BottomDitchPolderSide},
+ {CpDitchPolderSide, CharacteristicPointType.DitchPolderSide},
+ {CpSurfaceLevelInside, CharacteristicPointType.SurfaceLevelInside}
+ };
+ return translationTable[inputPointType];
+ }
+
+ ///
+ /// Converts the type of to input point.
+ ///
+ /// Type of the characteristic point.
+ ///
+ public static int ConvertToInputPointType(CharacteristicPointType characteristicPointType)
+ {
+ var translationTable = new Dictionary()
+ {
+ // The following types do not have a meaning in DAM, so should be mapped to CpNone
+ {CharacteristicPointType.BottomRiverChannel, CpNone},
+ {CharacteristicPointType.InsertRiverChannel, CpNone},
+ {CharacteristicPointType.ForelandStart, CpNone},
+ {CharacteristicPointType.DunesBoundaryProfile, CpNone},
+ {CharacteristicPointType.DunesTransectLocation, CpNone},
+ // The following types are DAM related, so should be translated
+ {CharacteristicPointType.None, CpNone},
+ {CharacteristicPointType.SurfaceLevelOutside, CpSurfaceLevelOutside},
+ {CharacteristicPointType.DikeToeAtRiver, CpDikeToeAtRiver},
+ {CharacteristicPointType.ShoulderTopOutside, CpShoulderTopOutside},
+ {CharacteristicPointType.ShoulderBaseOutside, CpShoulderBaseOutside},
+ {CharacteristicPointType.DikeTopAtRiver, CpDikeTopAtRiver},
+ {CharacteristicPointType.DikeLine, CpDikeLine},
+ {CharacteristicPointType.TrafficLoadOutside, CpTrafficLoadOutside},
+ {CharacteristicPointType.TrafficLoadInside, CpTrafficLoadInside},
+ {CharacteristicPointType.DikeTopAtPolder, CpDikeTopAtPolder},
+ {CharacteristicPointType.ShoulderBaseInside, CpShoulderBaseInside},
+ {CharacteristicPointType.ShoulderTopInside, CpShoulderTopInside},
+ {CharacteristicPointType.DikeToeAtPolder, CpDikeToeAtPolder},
+ {CharacteristicPointType.DitchDikeSide, CpDitchDikeSide},
+ {CharacteristicPointType.BottomDitchDikeSide, CpBottomDitchDikeSide},
+ {CharacteristicPointType.BottomDitchPolderSide, CpBottomDitchPolderSide},
+ {CharacteristicPointType.DitchPolderSide, CpDitchPolderSide},
+ {CharacteristicPointType.SurfaceLevelInside, CpSurfaceLevelInside}
+ };
+ return translationTable[characteristicPointType];
+ }
+
+ ///
+ /// Converts to calculation result.
+ ///
+ /// The calculation result.
+ ///
+ public static CalculationResult ConvertToCalculationResult(int calculationResult)
+ {
+ var translationTable = new Dictionary()
+ {
+ {0, CalculationResult.NoRun},
+ {1, CalculationResult.Succeeded},
+ {2, CalculationResult.NoInput},
+ {3, CalculationResult.NoLicense},
+ {4, CalculationResult.UserAbort},
+ {5, CalculationResult.InvalidInputStructure},
+ {6, CalculationResult.InvalidInputData},
+ {7, CalculationResult.RunFailed},
+ {8, CalculationResult.UnexpectedError}
+ };
+ return translationTable[calculationResult];
+ }
+
+ ///
+ /// Converts to output calculation result.
+ ///
+ /// Type of the dam project.
+ ///
+ public static int ConvertToOutputCalculationResult(CalculationResult calculationResult)
+ {
+ var translationTable = new Dictionary()
+ {
+ {CalculationResult.NoRun, 0},
+ {CalculationResult.Succeeded, 1},
+ {CalculationResult.NoInput, 2},
+ {CalculationResult.NoLicense, 3},
+ {CalculationResult.UserAbort, 4},
+ {CalculationResult.InvalidInputStructure, 5},
+ {CalculationResult.InvalidInputData, 6},
+ {CalculationResult.RunFailed, 7},
+ {CalculationResult.UnexpectedError, 8}
+ };
+ return translationTable[calculationResult];
+ }
+
+ ///
+ /// Converts to waterpressure interpolation model.
+ ///
+ /// The input waterpressure interpolation model.
+ ///
+ public static WaterpressureInterpolationModel ConvertToWaterpressureInterpolationModel(int inputWaterpressureInterpolationModel)
+ {
+ var translationTable = new Dictionary()
+ {
+ {0, WaterpressureInterpolationModel.Automatic},
+ {1, WaterpressureInterpolationModel.Hydrostatic}
+ };
+ return translationTable[inputWaterpressureInterpolationModel];
+ }
+
+ ///
+ /// Converts to input waterpressure interpolation model.
+ ///
+ /// The waterpressure interpolation model.
+ ///
+ public static int ConvertToInputWaterpressureInterpolationModel(WaterpressureInterpolationModel waterpressureInterpolationModel)
+ {
+ var translationTable = new Dictionary()
+ {
+ {WaterpressureInterpolationModel.Automatic, 0},
+ {WaterpressureInterpolationModel.Hydrostatic, 1}
+ };
+ return translationTable[waterpressureInterpolationModel];
+ }
+
+ ///
+ /// Converts the Dam profile type to the input profile type
+ ///
+ /// Type of the soil geometry.
+ ///
+ public static int ConvertToInputSoilProfileType(SoilProfileType soilProfileType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {SoilProfileType.SoilProfile1D, 0},
+ {SoilProfileType.SoilProfile2D, 1},
+ {SoilProfileType.SoilGeometryStiFile, 2}
+ };
+ return translationTable[soilProfileType];
+ }
+
+ ///
+ /// Converts the input profile type to the Dam profile type
+ ///
+ /// Type of the soil geometry.
+ ///
+ public static SoilProfileType ConvertToSoilProfileType(int soilProfileType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {0, SoilProfileType.SoilProfile1D},
+ {1, SoilProfileType.SoilProfile2D},
+ {2, SoilProfileType.SoilGeometryStiFile}
+ };
+ return translationTable[soilProfileType];
+ }
+
+ /// The enumerated constants for input failure mechanism stability inside
+ public const int InputFailureMechanismStabilityInside = 0;
+ public const int InputFailureMechanismStabilityOutside = 1;
+ public const int InputFailureMechanismPiping = 2;
+ public const int InputFailureMechanismHorizontalBalance = 3;
+ public const int InputFailureMechanismFlowSlide = 4;
+
+ ///
+ /// Converts the Dam failure mechanism type to the input failure mechanism type .
+ ///
+ /// Type of the segment failure mechanism.
+ ///
+ public static int ConvertToInputFailureMechanismSystemType(FailureMechanismSystemType segmentFailureMechanismType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {FailureMechanismSystemType.StabilityInside, InputFailureMechanismStabilityInside},
+ {FailureMechanismSystemType.StabilityOutside, InputFailureMechanismStabilityOutside},
+ {FailureMechanismSystemType.Piping, InputFailureMechanismPiping},
+ {FailureMechanismSystemType.HorizontalBalance, InputFailureMechanismHorizontalBalance},
+ {FailureMechanismSystemType.FlowSlide, InputFailureMechanismFlowSlide}
+ };
+ return translationTable[segmentFailureMechanismType];
+ }
+
+ ///
+ /// Converts the input failure mechanism type to the Dam failure mechanism type .
+ ///
+ /// Type of the failure mechanism system.
+ ///
+ public static FailureMechanismSystemType ConvertToFailureMechanismSystemType(int failureMechanismSystemType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputFailureMechanismStabilityInside, FailureMechanismSystemType.StabilityInside},
+ {InputFailureMechanismStabilityOutside, FailureMechanismSystemType.StabilityOutside},
+ {InputFailureMechanismPiping, FailureMechanismSystemType.Piping},
+ {InputFailureMechanismHorizontalBalance, FailureMechanismSystemType.HorizontalBalance},
+ {InputFailureMechanismFlowSlide, FailureMechanismSystemType.FlowSlide},
+ };
+ return translationTable[failureMechanismSystemType];
+ }
+
+ /// The enumerated constants for input segment failure mechanism stability inside
+ public const int InputSegmentFailureMechanismAll = 0;
+ public const int InputSegmentFailureMechanismStability = 1;
+ public const int InputSegmentFailureMechanismPiping = 2;
+ public const int InputSegmentFailureMechanismLiquefaction = 3;
+
+ ///
+ /// Converts the Dam segment failure mechanism type to the input segment failure mechanism type .
+ ///
+ /// Type of the segment failure mechanism.
+ ///
+ public static int ConvertToInputSegmentFailureMechanismType(FailureMechanismSystemType segmentFailureMechanismType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {FailureMechanismSystemType.StabilityInside, InputSegmentFailureMechanismStability},
+ {FailureMechanismSystemType.StabilityOutside, InputSegmentFailureMechanismStability},
+ {FailureMechanismSystemType.Piping, InputSegmentFailureMechanismPiping},
+ {FailureMechanismSystemType.FlowSlide, InputSegmentFailureMechanismLiquefaction},
+ {FailureMechanismSystemType.HorizontalBalance, InputSegmentFailureMechanismStability}
+ };
+ return translationTable[segmentFailureMechanismType];
+ }
+
+ ///
+ /// Converts the input segment failure mechanism type to the Dam segment failure mechanism type .
+ ///
+ /// Type of the failure mechanism system.
+ ///
+ public static FailureMechanismSystemType ConvertToSegmentFailureMechanismType(int failureMechanismSystemType)
+ {
+ if (failureMechanismSystemType == InputSegmentFailureMechanismAll)
+ {
+ throw new ConversionException(typeof(FailureMechanismSystemType), failureMechanismSystemType);
+ }
+ var translationTable = new Dictionary()
+ {
+ {InputSegmentFailureMechanismStability, FailureMechanismSystemType.StabilityInside},
+ {InputSegmentFailureMechanismPiping, FailureMechanismSystemType.Piping},
+ {InputSegmentFailureMechanismLiquefaction, FailureMechanismSystemType.FlowSlide},
+ };
+ return translationTable[failureMechanismSystemType];
+ }
+
+ ///
+ /// Converts the Dam piping model to the input piping model.
+ ///
+ /// Type of the piping model.
+ ///
+ public static InputPipingModelType ConvertToInputPipingModelType(PipingModelType pipingModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PipingModelType.Bligh, InputPipingModelType.Bligh},
+ {PipingModelType.Sellmeijer, InputPipingModelType.SellmeijerVnk},
+ {PipingModelType.Sellmeijer4Forces, InputPipingModelType.Sellmeijer4Forces},
+ {PipingModelType.Wti2017, InputPipingModelType.WtiSellmeijerRevised}
+ };
+ return translationTable[pipingModelType];
+ }
+
+ ///
+ /// Converts the input piping model to the Dam piping model.
+ ///
+ /// Type of the input piping model.
+ ///
+ public static PipingModelType ConvertToPipingModelType(InputPipingModelType inputPipingModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputPipingModelType.Bligh, PipingModelType.Bligh},
+ {InputPipingModelType.SellmeijerVnk, PipingModelType.Sellmeijer},
+ {InputPipingModelType.Sellmeijer4Forces, PipingModelType.Sellmeijer4Forces},
+ {InputPipingModelType.WtiSellmeijerRevised, PipingModelType.Wti2017}
+ };
+ return translationTable[inputPipingModelType];
+ }
+
+ ///
+ /// Converts the Dam stability model to the input stability model.
+ ///
+ /// Type of the stability model.
+ ///
+ public static InputStabilityModelType ConvertToInputStabilityModelType(MStabModelType stabilityModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MStabModelType.Bishop, InputStabilityModelType.Bishop},
+ {MStabModelType.UpliftVan, InputStabilityModelType.UpliftVan},
+ {MStabModelType.BishopUpliftVan,InputStabilityModelType.BishopUpliftVan}
+ };
+ return translationTable[stabilityModelType];
+ }
+
+ ///
+ /// Converts the input stability model to the Dam stability model.
+ ///
+ /// Type of the input stability model.
+ ///
+ public static MStabModelType ConvertToStabilityModelType(InputStabilityModelType inputStabilityModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputStabilityModelType.Bishop, MStabModelType.Bishop},
+ {InputStabilityModelType.UpliftVan, MStabModelType.UpliftVan},
+ {InputStabilityModelType.BishopUpliftVan, MStabModelType.BishopUpliftVan}
+ };
+ return translationTable[inputStabilityModelType];
+ }
+
+ ///
+ /// Converts the Dam stability model to the output stability model.
+ ///
+ /// Type of the stability model.
+ ///
+ public static DesignResultStabilityDesignResultsStabilityModelType ConvertToOutputStabilityModelType(MStabModelType stabilityModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MStabModelType.Bishop, DesignResultStabilityDesignResultsStabilityModelType.Bishop},
+ {MStabModelType.UpliftVan, DesignResultStabilityDesignResultsStabilityModelType.UpliftVan},
+ {MStabModelType.BishopUpliftVan, DesignResultStabilityDesignResultsStabilityModelType.BishopUpliftVan}
+ };
+ return translationTable[stabilityModelType];
+ }
+
+ ///
+ /// Converts the output stability model to the Dam stability model.
+ ///
+ /// Type of the output stability model.
+ ///
+ public static MStabModelType ConvertToStabilityModelType(DesignResultStabilityDesignResultsStabilityModelType outputStabilityModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {DesignResultStabilityDesignResultsStabilityModelType.Bishop, MStabModelType.Bishop},
+ {DesignResultStabilityDesignResultsStabilityModelType.UpliftVan, MStabModelType.UpliftVan},
+ {DesignResultStabilityDesignResultsStabilityModelType.BishopUpliftVan, MStabModelType.BishopUpliftVan}
+ };
+ return translationTable[outputStabilityModelType];
+ }
+
+ ///
+ /// Converts the Dam analysis type to the input analysis type.
+ ///
+ /// Type of the analysis.
+ ///
+ public static InputAnalysisType ConvertToInputAnalysisType(AnalysisType analysisType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {AnalysisType.NoAdaption, InputAnalysisType.NoAdaption},
+ {AnalysisType.AdaptGeometry, InputAnalysisType.AdaptGeometry}
+ };
+ return translationTable[analysisType];
+ }
+
+ ///
+ /// Converts the input analysis type to the Dam analysis type.
+ ///
+ /// Type of the input analysis.
+ ///
+ public static AnalysisType ConvertToAnalysisType(InputAnalysisType inputAnalysisType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputAnalysisType.NoAdaption, AnalysisType.NoAdaption},
+ {InputAnalysisType.AdaptGeometry, AnalysisType.AdaptGeometry}
+ };
+ return translationTable[inputAnalysisType];
+ }
+
+ ///
+ /// The input zone type no zones
+ ///
+ public const int InputZoneTypeNoZones = 0;
+ ///
+ /// The input zone type zone areas
+ ///
+ public const int InputZoneTypeZoneAreas = 1;
+ ///
+ /// The input zone types forbidden zones
+ ///
+ public const int InputZoneTypesForbiddenZones = 2;
+
+ ///
+ /// Converts the type of to input zone.
+ ///
+ /// Type of the zone.
+ ///
+ public static int ConvertToInputZoneType(MStabZonesType zoneType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MStabZonesType.NoZones, InputZoneTypeNoZones},
+ {MStabZonesType.ZoneAreas, InputZoneTypeZoneAreas},
+ {MStabZonesType.ForbiddenZone, InputZoneTypesForbiddenZones}
+ };
+ return translationTable[zoneType];
+ }
+
+ ///
+ /// Converts the type of to zone.
+ ///
+ /// Type of the input zone.
+ ///
+ public static MStabZonesType ConvertToZoneType(int inputZoneType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {InputZoneTypeNoZones, MStabZonesType.NoZones},
+ {InputZoneTypeZoneAreas, MStabZonesType.ZoneAreas},
+ {InputZoneTypesForbiddenZones, MStabZonesType.ForbiddenZone}
+ };
+ return translationTable[inputZoneType];
+ }
+
+ ///
+ /// Converts the Dam message type to the input message type.
+ ///
+ /// Type of the message.
+ ///
+ public static MessageMessageType ConvertToInputMessageType(LogMessageType messageType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LogMessageType.Warning, MessageMessageType.Warning},
+ {LogMessageType.Debug, MessageMessageType.Info},
+ {LogMessageType.Error, MessageMessageType.Error},
+ {LogMessageType.FatalError, MessageMessageType.Error},
+ {LogMessageType.Info, MessageMessageType.Info},
+ {LogMessageType.Trace, MessageMessageType.Info}
+ };
+ return translationTable[messageType];
+ }
+
+ ///
+ /// Converts the input message type to the Dam message type.
+ ///
+ /// Type of the validation result message.
+ ///
+ public static LogMessageType ConvertToMessageType(MessageMessageType validationResultMessageType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MessageMessageType.Warning, LogMessageType.Warning},
+ {MessageMessageType.Error, LogMessageType.Error},
+ {MessageMessageType.Info, LogMessageType.Info}
+ };
+ return translationTable[validationResultMessageType];
+ }
+
+ ///
+ /// The input search method grid
+ ///
+ public const int InputSearchMethodGrid = 0;
+
+ ///
+ /// The input search method genetic
+ ///
+ public const int InputSearchMethodGenetic = 1;
+
+ ///
+ /// Converts to input search method.
+ ///
+ /// The search method.
+ ///
+ public static int ConvertToInputSearchMethod(MStabSearchMethod searchMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ MStabSearchMethod.Grid, InputSearchMethodGrid
+ },
+ {
+ MStabSearchMethod.GeneticAlgorithm, InputSearchMethodGenetic
+ }
+ };
+ return translationTable[searchMethod];
+ }
+
+ ///
+ /// Converts to search method.
+ ///
+ /// The search method.
+ ///
+ public static MStabSearchMethod ConvertToSearchMethod(int searchMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ InputSearchMethodGrid, MStabSearchMethod.Grid
+ },
+ {
+ InputSearchMethodGenetic, MStabSearchMethod.GeneticAlgorithm
+ }
+ };
+ return translationTable[searchMethod];
+ }
+
+ ///
+ /// The input grid type automatic
+ ///
+ public const int InputGridTypeAutomatic = 0;
+
+ ///
+ /// The input grid type specified
+ ///
+ public const int InputGridTypeSpecified = 1;
+
+ ///
+ /// Converts to input grid determination.
+ ///
+ /// Type of the grid.
+ ///
+ public static int ConvertToInputGridDetermination(GridSizeDetermination gridType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ GridSizeDetermination.Automatic, InputGridTypeAutomatic
+ },
+ {
+ GridSizeDetermination.Specified, InputGridTypeSpecified
+ }
+ };
+
+ return translationTable[gridType];
+ }
+
+ ///
+ /// Converts to grid determination.
+ ///
+ /// Type of the grid.
+ ///
+ public static GridSizeDetermination ConvertToGridDetermination(int gridType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ InputGridTypeAutomatic, GridSizeDetermination.Automatic
+ },
+ {
+ InputGridTypeSpecified, GridSizeDetermination.Specified
+ }
+ };
+ return translationTable[gridType];
+ }
+
+ ///
+ /// The input tangent lines on boundaty lines
+ ///
+ public const int InputTangentLinesOnBoundatyLines = 0;
+
+ ///
+ /// The input tangent lines specified
+ ///
+ public const int InputTangentLinesSpecified = 1;
+
+ ///
+ /// Converts to input tangent lines definition.
+ ///
+ /// Type of the tangent line.
+ ///
+ public static int ConvertToInputTangentLinesDefinition(TangentLinesDefinition tangentLineType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ TangentLinesDefinition.OnBoundaryLines, InputGridTypeAutomatic
+ },
+ {
+ TangentLinesDefinition.Specified, InputGridTypeSpecified
+ }
+ };
+ return translationTable[tangentLineType];
+ }
+
+ ///
+ /// Converts to tangent lines definition.
+ ///
+ /// Type of the tangent line.
+ ///
+ public static TangentLinesDefinition ConvertToTangentLinesDefinition(int tangentLineType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {
+ InputGridTypeAutomatic, TangentLinesDefinition.OnBoundaryLines
+ },
+ {
+ InputGridTypeSpecified, TangentLinesDefinition.Specified
+ }
+ };
+ return translationTable[tangentLineType];
+ }
+
+ ///
+ /// Converts the shear strength model to soil shear strength model.
+ ///
+ /// The shear strength model.
+ ///
+ public static SoilShearStrengthModel ConvertToSoilShearStrengthModel(ShearStrengthModel shearStrengthModel)
+ {
+ var translationTable = new Dictionary()
+ {
+ {ShearStrengthModel.None, SoilShearStrengthModel.None},
+ {ShearStrengthModel.CPhi, SoilShearStrengthModel.CPhi},
+ {ShearStrengthModel.StressTable, SoilShearStrengthModel.StressTable},
+ {ShearStrengthModel.PseudoValues, SoilShearStrengthModel.PseudoValues},
+ {ShearStrengthModel.CuMeasured, SoilShearStrengthModel.SuMeasured},
+ {ShearStrengthModel.CuCalculated, SoilShearStrengthModel.SuCalculated},
+ {ShearStrengthModel.CuGradient, SoilShearStrengthModel.SuGradient},
+ {ShearStrengthModel.CuCalculatedYield, SoilShearStrengthModel.SuCalculatedWithYield},
+ {ShearStrengthModel.CPhiOrCuCalculated, SoilShearStrengthModel.CPhiOrSuCalculated},
+ };
+ return translationTable[shearStrengthModel];
+ }
+
+ ///
+ /// Converts the soil shear strength model to shear strength model.
+ ///
+ /// The soil shear strength model.
+ ///
+ public static ShearStrengthModel ConvertToShearStrengthModel(SoilShearStrengthModel soilShearStrengthModel)
+ {
+ var translationTable = new Dictionary()
+ {
+ {SoilShearStrengthModel.None, ShearStrengthModel.None},
+ {SoilShearStrengthModel.CPhi, ShearStrengthModel.CPhi},
+ {SoilShearStrengthModel.StressTable, ShearStrengthModel.StressTable},
+ {SoilShearStrengthModel.PseudoValues, ShearStrengthModel.PseudoValues},
+ {SoilShearStrengthModel.SuMeasured, ShearStrengthModel.CuMeasured},
+ {SoilShearStrengthModel.SuCalculated, ShearStrengthModel.CuCalculated},
+ {SoilShearStrengthModel.SuGradient, ShearStrengthModel.CuGradient},
+ {SoilShearStrengthModel.SuCalculatedWithYield, ShearStrengthModel.CuCalculatedYield},
+ {SoilShearStrengthModel.CPhiOrSuCalculated, ShearStrengthModel.CPhiOrCuCalculated},
+ };
+ return translationTable[soilShearStrengthModel];
+ }
+
+ ///
+ /// Converts the dilatancy type to soil dilatancy dilatancy.
+ ///
+ /// Type of the dilatancy.
+ ///
+ public static SoilDilatancyType ConvertToSoilDilatancyType(DilatancyType dilatancyType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {DilatancyType.Zero, SoilDilatancyType.Zero},
+ {DilatancyType.Phi, SoilDilatancyType.Phi},
+ {DilatancyType.MinusPhi, SoilDilatancyType.MinusPhi},
+ };
+ return translationTable[dilatancyType];
+ }
+
+ ///
+ /// Converts the soil dilatancy type to dilatancy type.
+ ///
+ /// Type of the soil dilatancy.
+ ///
+ public static DilatancyType ConvertToDilatancyType(SoilDilatancyType soilDilatancyType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {SoilDilatancyType.Zero, DilatancyType.Zero},
+ {SoilDilatancyType.Phi, DilatancyType.Phi},
+ {SoilDilatancyType.MinusPhi, DilatancyType.MinusPhi},
+ };
+ return translationTable[soilDilatancyType];
+ }
+
+ ///
+ /// Converts the input StabilityDesignMethod to the Dam StabilityDesignMethod.
+ ///
+ /// The stability design method.
+ ///
+ public static StabilityDesignMethod ConvertToDamStabilityDesignMethod(LocationDesignOptionsStabilityDesignMethod stabilityDesignMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption},
+ {LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption}
+ };
+ return translationTable[stabilityDesignMethod];
+ }
+
+ ///
+ /// Converts the Dam StabilityDesignMethod to the input StabilityDesignMethod.
+ ///
+ /// The stability design method.
+ ///
+ public static LocationDesignOptionsStabilityDesignMethod ConvertToInputStabilityDesignMethod(StabilityDesignMethod stabilityDesignMethod)
+ {
+ var translationTable = new Dictionary()
+ {
+ {StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.OptimizedSlopeAndShoulderAdaption},
+ {StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption, LocationDesignOptionsStabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption}
+ };
+ return translationTable[stabilityDesignMethod];
+ }
+
+ ///
+ /// The load situation dry
+ ///
+ public const int LoadSituationDry = 0;
+
+ ///
+ /// The load situation wet
+ ///
+ public const int LoadSituationWet = 1;
+
+ ///
+ /// Converts to Load Situation.
+ ///
+ /// The input Load Situation.
+ ///
+ public static LoadSituation ConvertToLoadSituation(int inputLoadSituation)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LoadSituationDry, LoadSituation.Dry},
+ {LoadSituationWet, LoadSituation.Wet}
+ };
+ return translationTable[inputLoadSituation];
+ }
+
+ ///
+ /// Converts to output LoadSituation.
+ ///
+ /// The Load Situation.
+ ///
+ public static int ConvertToOutputLoadSituation(LoadSituation loadSituation)
+ {
+ var translationTable = new Dictionary()
+ {
+ {LoadSituation.Dry, LoadSituationDry},
+ {LoadSituation.Wet, LoadSituationWet}
+ };
+ return translationTable[loadSituation];
+ }
+
+ ///
+ /// The dike dry sensitivity none
+ ///
+ public const int DikeDrySensitivityNone = 0;
+
+ ///
+ /// The dike dry sensitivity dry
+ ///
+ public const int DikeDrySensitivityDry = 1;
+
+ ///
+ /// The hydraulic shortcut type hydraulic shortcut
+ ///
+ public const int HydraulicShortcutTypeHydraulicShortcut = 0;
+
+ ///
+ /// The hydraulic shortcut type no hydraulic shortcut
+ ///
+ public const int HydraulicShortcutTypeNoHydraulicShortcut = 1;
+
+ ///
+ /// The uplift type uplift
+ ///
+ public const int UpliftTypeUplift = 0;
+
+ ///
+ /// The uplift type no uplift
+ ///
+ public const int UpliftTypeNoUplift = 1;
+
+ ///
+ /// Converts to Uplift Type.
+ ///
+ /// The input UpliftType.
+ ///
+ public static UpliftType ConvertToUpliftType(int inputUpliftType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {UpliftTypeUplift, UpliftType.Uplift},
+ {UpliftTypeNoUplift, UpliftType.NoUplift}
+ };
+ return translationTable[inputUpliftType];
+ }
+
+ ///
+ /// Converts to output Uplift Type.
+ ///
+ /// The UpliftType.
+ ///
+ public static int ConvertToOutputUpliftType(UpliftType upliftType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {UpliftType.Uplift, UpliftTypeUplift},
+ {UpliftType.NoUplift, UpliftTypeNoUplift}
+ };
+ return translationTable[upliftType];
+ }
+
+ ///
+ /// The m stab model type bishop
+ ///
+ public const int MStabModelTypeBishop = 0;
+
+ ///
+ /// The m stab model type spencer
+ ///
+ public const int MStabModelTypeSpencer = 1;
+
+ ///
+ /// The m stab model type fellenius
+ ///
+ public const int MStabModelTypeFellenius = 2;
+
+ ///
+ /// The m stab model type uplift van
+ ///
+ public const int MStabModelTypeUpliftVan = 3;
+
+ ///
+ /// The m stab model type uplift spencer
+ ///
+ public const int MStabModelTypeUpliftSpencer = 4;
+
+ ///
+ /// The m stab model type bishop random field
+ ///
+ public const int MStabModelTypeBishopRandomField = 5;
+
+ ///
+ /// The m stab model type horizontal balance
+ ///
+ public const int MStabModelTypeHorizontalBalance = 6;
+
+ ///
+ /// The m stab model type bishop uplift van
+ ///
+ public const int MStabModelTypeBishopUpliftVan = 7;
+
+ ///
+ /// The m stab model type spencer high
+ ///
+ public const int MStabModelTypeSpencerHigh = 8;
+
+ ///
+ /// The m stab model type spencer low
+ ///
+ public const int MStabModelTypeSpencerLow = 9;
+
+ ///
+ /// Converts to MStab Model Type.
+ ///
+ /// The input MStabModelType.
+ ///
+ public static MStabModelType ConvertToMStabModelType(int inputMStabModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MStabModelTypeBishop, MStabModelType.Bishop},
+ {MStabModelTypeSpencer, MStabModelType.Spencer},
+ {MStabModelTypeFellenius, MStabModelType.Fellenius},
+ {MStabModelTypeUpliftVan, MStabModelType.UpliftVan},
+ {MStabModelTypeUpliftSpencer, MStabModelType.UpliftSpencer},
+ {MStabModelTypeBishopRandomField, MStabModelType.BishopRandomField},
+ {MStabModelTypeHorizontalBalance, MStabModelType.HorizontalBalance},
+ {MStabModelTypeBishopUpliftVan, MStabModelType.BishopUpliftVan},
+ {MStabModelTypeSpencerHigh, MStabModelType.SpencerHigh},
+ {MStabModelTypeSpencerLow, MStabModelType.SpencerLow}
+ };
+ return translationTable[inputMStabModelType];
+ }
+
+ ///
+ /// Converts to output MStabModelType.
+ ///
+ /// The UpliftType.
+ ///
+ public static int ConvertToOutputMStabModelType(MStabModelType mStabModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {MStabModelType.Bishop, MStabModelTypeBishop},
+ {MStabModelType.Spencer, MStabModelTypeSpencer},
+ {MStabModelType.Fellenius, MStabModelTypeFellenius},
+ {MStabModelType.UpliftVan, MStabModelTypeUpliftVan},
+ {MStabModelType.UpliftSpencer, MStabModelTypeUpliftSpencer},
+ {MStabModelType.BishopRandomField, MStabModelTypeBishopRandomField},
+ {MStabModelType.HorizontalBalance, MStabModelTypeHorizontalBalance},
+ {MStabModelType.BishopUpliftVan, MStabModelTypeBishopUpliftVan},
+ {MStabModelType.SpencerHigh, MStabModelTypeSpencerHigh},
+ {MStabModelType.SpencerLow, MStabModelTypeSpencerLow}
+ };
+ return translationTable[mStabModelType];
+ }
+
+ ///
+ /// The scenario type scenario01
+ ///
+ public const int ScenarioTypeScenario01 = 0;
+
+ ///
+ /// The scenario type scenario02
+ ///
+ public const int ScenarioTypeScenario02 = 1;
+
+ ///
+ /// The scenario type scenario03
+ ///
+ public const int ScenarioTypeScenario03 = 2;
+
+ ///
+ /// The scenario type scenario04
+ ///
+ public const int ScenarioTypeScenario04 = 3;
+
+ ///
+ /// The scenario type scenario05
+ ///
+ public const int ScenarioTypeScenario05 = 4;
+
+ ///
+ /// The scenario type scenario06
+ ///
+ public const int ScenarioTypeScenario06 = 5;
+
+ ///
+ /// The scenario type scenario07
+ ///
+ public const int ScenarioTypeScenario07 = 6;
+
+ ///
+ /// The scenario type scenario08
+ ///
+ public const int ScenarioTypeScenario08 = 7;
+
+ ///
+ /// The scenario type scenario09
+ ///
+ public const int ScenarioTypeScenario09 = 8;
+
+ ///
+ /// The scenario type scenario10
+ ///
+ public const int ScenarioTypeScenario10 = 9;
+
+ ///
+ /// The scenario type scenario11
+ ///
+ public const int ScenarioTypeScenario11 = 10;
+
+ ///
+ /// The piping model type bligh
+ ///
+ public const int PipingModelTypeBligh = 0;
+
+ ///
+ /// The piping model type sellmeijer
+ ///
+ public const int PipingModelTypeSellmeijer = 1;
+
+ ///
+ /// The piping model type sellmeijer4 forces
+ ///
+ public const int PipingModelTypeSellmeijer4Forces = 2;
+
+ ///
+ /// The piping model type wti2017
+ ///
+ public const int PipingModelTypeWti2017 = 3;
+
+ ///
+ /// Converts to Piping Model Type.
+ ///
+ /// The input PipingModelType.
+ ///
+ public static PipingModelType ConvertToPipingModelType(int inputPipingModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PipingModelTypeBligh, PipingModelType.Bligh},
+ {PipingModelTypeSellmeijer, PipingModelType.Sellmeijer},
+ {PipingModelTypeSellmeijer4Forces, PipingModelType.Sellmeijer4Forces},
+ {PipingModelTypeWti2017, PipingModelType.Wti2017}
+ };
+ return translationTable[inputPipingModelType];
+ }
+
+ ///
+ /// Converts to output PipingModelType.
+ ///
+ /// The UpliftType.
+ ///
+ public static int ConvertToOutputPipingModelType(PipingModelType pipingModelType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PipingModelType.Bligh, PipingModelTypeBligh},
+ {PipingModelType.Sellmeijer, PipingModelTypeSellmeijer},
+ {PipingModelType.Sellmeijer4Forces, PipingModelTypeSellmeijer4Forces},
+ {PipingModelType.Wti2017, PipingModelTypeWti2017}
+ };
+ return translationTable[pipingModelType];
+ }
+
+ ///
+ /// Constants for translating to Enums TimeStepUnit
+ ///
+ public const uint TimeStepUnitSecond = 0;
+ public const uint TimeStepUnitMinute = 1;
+ public const uint TimeStepUnitHour = 2;
+ public const uint TimeStepUnitDay = 3;
+ public const uint TimeStepUnitMonth = 4;
+ public const uint TimeStepUnitWeek = 5;
+ public const uint TimeStepUnitYear = 6;
+ public const uint TimeStepUnitNonequidistant = 7;
+
+ ///
+ /// Converts the input TimeStepUnit to the TimeStepUnit.
+ ///
+ /// The time step unit.
+ ///
+ public static TimeStepUnit ConvertToTimeStepUnit(uint timeStepUnit)
+ {
+ var translationTable = new Dictionary()
+ {
+ {TimeStepUnitSecond, TimeStepUnit.Second},
+ {TimeStepUnitMinute, TimeStepUnit.Minute},
+ {TimeStepUnitHour, TimeStepUnit.Hour},
+ {TimeStepUnitDay, TimeStepUnit.Day},
+ {TimeStepUnitMonth, TimeStepUnit.Month},
+ {TimeStepUnitWeek, TimeStepUnit.Week},
+ {TimeStepUnitYear, TimeStepUnit.Year},
+ {TimeStepUnitNonequidistant, TimeStepUnit.Nonequidistant},
+ };
+ return translationTable[timeStepUnit];
+ }
+
+ ///
+ /// Converts the TimeStepUnit to the input TimeStepUnit.
+ ///
+ /// The time step unit.
+ ///
+ public static uint ConvertToInputTimeStepUnit(TimeStepUnit timeStepUnit)
+ {
+ var translationTable = new Dictionary()
+ {
+ {TimeStepUnit.Second, TimeStepUnitSecond},
+ {TimeStepUnit.Minute, TimeStepUnitMinute},
+ {TimeStepUnit.Hour, TimeStepUnitHour},
+ {TimeStepUnit.Day, TimeStepUnitDay},
+ {TimeStepUnit.Month, TimeStepUnitMonth},
+ {TimeStepUnit.Week, TimeStepUnitWeek},
+ {TimeStepUnit.Year, TimeStepUnitYear},
+ {TimeStepUnit.Nonequidistant, TimeStepUnitNonequidistant},
+ };
+ return translationTable[timeStepUnit];
+ }
+
+ ///
+ /// Constants for translating to Enums PlLineType
+ ///
+ public const uint PlLineTypePl1 = 1;
+ public const uint PlLineTypePl2 = 2;
+ public const uint PlLineTypePl3 = 3;
+ public const uint PlLineTypePl4 = 4;
+
+ ///
+ /// Converts the input plLineType to Dam plLineType.
+ ///
+ /// Type of the pl line.
+ /// plLineType
+ public static PLLineType ConvertToPlLineType(uint plLineType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PlLineTypePl1, PLLineType.PL1},
+ {PlLineTypePl2, PLLineType.PL2},
+ {PlLineTypePl3, PLLineType.PL3},
+ {PlLineTypePl4, PLLineType.PL4}
+ };
+ return translationTable[plLineType];
+ }
+
+ ///
+ /// Converts the Dam plLineType to input plLineType.
+ ///
+ /// Type of the pl line.
+ /// plLineType as integer
+ public static uint ConvertToInputPlLineType(PLLineType plLineType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {PLLineType.PL1, PlLineTypePl1},
+ {PLLineType.PL2, PlLineTypePl2},
+ {PLLineType.PL3, PlLineTypePl3},
+ {PLLineType.PL4, PlLineTypePl4}
+ };
+ return translationTable[plLineType];
+ }
+
+ ///
+ /// Constants for translating to Enums SensorType
+ ///
+ public const uint SensorTypePiezometricHead = 0;
+ public const uint SensorTypeWaterLevel = 1;
+ public const uint SensorTypePolderLevel = 2;
+
+ ///
+ /// Converts the Dam sensorType to input sensorType.
+ ///
+ /// Type of the sensor.
+ /// sensorType
+ public static SensorType ConvertToSensorType(uint sensorType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {SensorTypePiezometricHead, SensorType.PiezometricHead},
+ {SensorTypePolderLevel, SensorType.PolderLevel},
+ {SensorTypeWaterLevel, SensorType.WaterLevel}
+ };
+ return translationTable[sensorType];
+ }
+
+ ///
+ /// Converts the Dam sensorType to input sensorType.
+ ///
+ /// Type of the sensor.
+ /// sensorType as integer
+ public static uint ConvertToInputSensorType(SensorType sensorType)
+ {
+ var translationTable = new Dictionary()
+ {
+ {SensorType.PiezometricHead, SensorTypePiezometricHead},
+ {SensorType.PolderLevel, SensorTypePolderLevel},
+ {SensorType.WaterLevel, SensorTypeWaterLevel}
+ };
+ return translationTable[sensorType];
+ }
+
+ ///
+ /// Constants for translating to Enums DataSourceTypeSensors
+ ///
+ public const uint DataSourceTypeSensorsIgnore = 0;
+ public const uint DataSourceTypeSensorsLocationData = 1;
+ public const uint DataSourceTypeSensorsSensor = 2;
+
+ ///
+ /// Converts the Dam DataSourceTypeSensors to input DataSourceTypeSensors.
+ ///
+ /// The data source type sensors.
+ ///
+ /// DataSourceTypeSensors
+ ///
+ public static DataSourceTypeSensors ConvertToDataSourceTypeSensors(uint dataSourceTypeSensors)
+ {
+ var translationTable = new Dictionary()
+ {
+ {DataSourceTypeSensorsIgnore, DataSourceTypeSensors.Ignore},
+ {DataSourceTypeSensorsLocationData, DataSourceTypeSensors.LocationData},
+ {DataSourceTypeSensorsSensor, DataSourceTypeSensors.Sensor}
+ };
+ return translationTable[dataSourceTypeSensors];
+ }
+
+ ///
+ /// Converts the Dam DataSourceType to input DataSourceType.
+ ///
+ /// The data source type sensors.
+ ///
+ /// DataSourceType as integer
+ ///
+ public static uint ConvertToInputDataSourceTypeSensors(DataSourceTypeSensors dataSourceTypeSensors)
+ {
+ var translationTable = new Dictionary()
+ {
+ {DataSourceTypeSensors.Ignore, DataSourceTypeSensorsIgnore},
+ {DataSourceTypeSensors.LocationData, DataSourceTypeSensorsLocationData},
+ {DataSourceTypeSensors.Sensor, DataSourceTypeSensorsSensor}
+ };
+ return translationTable[dataSourceTypeSensors];
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/IO/FailureMechanismeParamatersMStabXmlHandler.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/IO/FailureMechanismeParamatersMStabXmlHandler.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/IO/FailureMechanismeParamatersMStabXmlHandler.cs (revision 3305)
@@ -0,0 +1,99 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Deltares.Geotechnics;
+using Deltares.Geotechnics.Converter;
+using Deltares.Geotechnics.SurfaceLines;
+using Deltares.Standard.IO.Xml;
+using Deltares.Standard.Reflection;
+
+namespace Deltares.Dam.Data.IO
+{
+ ///
+ /// This handler is responsible for handling an object which has been created with the SurfaceLine type.
+ /// Since the old SurfaceLine has been refactored, this handler will convert the old SurfaceLine to a SurfaceLine2.
+ ///
+ public class FailureMechanismeParamatersMStabXmlHandler : IXmlHandler
+ {
+ public void SetVersion(string version)
+ {
+ }
+
+
+ ///
+ /// This method returns true for a type and the
+ /// property.
+ ///
+ /// The type to check for.
+ /// The property of the type to check for
+ /// True if type is and property is "SurfaceLine"
+ public bool CanHandle(Type type, string property)
+ {
+ return type == typeof(FailureMechanismeParamatersMStab) && property == StaticReflection.GetMemberName(x => x.SurfaceLine);
+ }
+
+ ///
+ /// Not implemented for this class.
+ ///
+ ///
+ ///
+ ///
+ public void Handle(object target, string value, object[] objects)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// If the is an old and the is a
+ /// , the will be converted to the new
+ /// and the property is set for the target.
+ ///
+ /// The target to set the handle the value for
+ /// The value to handle
+ public void HandleObject(object target, object value)
+ {
+ var oldSurfaceLine = value as BaseSurfaceLine;
+ if (null != oldSurfaceLine)
+ {
+ ((FailureMechanismeParamatersMStab)target).SurfaceLine = (new OldSurfaceLineToNewConverter()).Convert(oldSurfaceLine);
+ }
+ }
+
+ public bool CanHandle(Type type)
+ {
+ return false;
+ }
+
+ public Type GetFormerPropertyType(Type type, string property)
+ {
+ return null;
+ }
+
+ public void Handle(object target, string property, object value, object[] objects)
+ {
+ }
+
+ public void Upgrade(object[] targets)
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeWrongValueException.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeWrongValueException.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/AttributeWrongValueException.cs (revision 3305)
@@ -0,0 +1,44 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Deltares.Maps
+{
+ [Serializable]
+ public class AttributeWrongValueException : Exception
+ {
+ private const string MessagePattern =
+ "The value {0} of attribute {1} is wrong (beyond its limits ({2} - {3})). Please check the specified value(s).";
+
+ public AttributeWrongValueException(string attributeName, double value, double min, double max) :
+ base(string.Format(MessagePattern, value, attributeName, min, max))
+ {
+ }
+
+ protected AttributeWrongValueException(
+ SerializationInfo info,
+ StreamingContext context) : base(info, context)
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/NonExistentLocationException.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/NonExistentLocationException.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/NonExistentLocationException.cs (revision 3305)
@@ -0,0 +1,39 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+
+namespace Deltares.Dam.Data
+{
+
+ [Serializable]
+ public class NonExistentLocationException : Exception
+ {
+ public NonExistentLocationException()
+ {
+ }
+
+ public NonExistentLocationException(string locationId, string messageFormat)
+ : base(string.Format(messageFormat, locationId))
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/Configuration/DataAttribute.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/Configuration/DataAttribute.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/Configuration/DataAttribute.cs (revision 3305)
@@ -0,0 +1,46 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+
+namespace Deltares.Dam.Data.DataPlugins.Configuration
+{
+ public class DataAttribute
+ {
+ [XmlAttribute("Id")]
+ public string AttributeId { get; set; }
+
+ [XmlAttribute("Name")]
+ public string AttributeName { get; set; }
+
+ [XmlAttribute("DataSource")]
+ public string DataSource { get; set; }
+
+ public override string ToString()
+ {
+ return AttributeId + "|" + AttributeName + "|" + DataSource;
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/IFeatureCollection.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/IFeatureCollection.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/IFeatureCollection.cs (revision 3305)
@@ -0,0 +1,49 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Collections.Generic;
+
+namespace Deltares.Maps
+{
+ public interface IFeatureCollection
+ {
+ void Add(IFeature feature);
+
+ void Add(IEnumerable features);
+
+ void Remove(IFeature feature);
+
+ void Clear();
+
+ // Gets the feature count
+ int Count { get; }
+ }
+
+ public interface IFeatureCollection : IFeatureCollection
+ where T : IFeature
+ {
+ void Add(T feature);
+
+ void Add(IEnumerable features);
+
+ void Remove(T feature);
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ParameterMissingException.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ParameterMissingException.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ParameterMissingException.cs (revision 3305)
@@ -0,0 +1,48 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Deltares.Dam.Data
+{
+
+ [Serializable]
+ public class ParameterMissingException : Exception
+ {
+ public ParameterMissingException(string messageFormat)
+ : base(messageFormat, null)
+ {
+ }
+
+ public ParameterMissingException(string messageFormat, Exception inner)
+ : base(string.Format(messageFormat), inner)
+ {
+ }
+
+ protected ParameterMissingException(
+ SerializationInfo info,
+ StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParser.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParser.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvParser.cs (revision 3305)
@@ -0,0 +1,237 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.IO;
+using System.Text.RegularExpressions;
+
+namespace Deltares.Dam.Data
+{
+
+ public static class CsvParser
+ {
+ ///
+ /// Parses the header of an csv import file
+ ///
+ /// The header string
+ /// The regular expression
+ /// An array of strings containing the header names
+ public static string[] ParseHeader(string header, Regex splitter)
+ {
+ ThrowHelper.ThrowIfStringArgumentNullOrEmpty(header, StringResourceNames.CsvHeaderNullOrEmpty);
+ ThrowHelper.ThrowIfArgumentNull(splitter, "splitter", StringResourceNames.CsvSplitterPatternNotValid);
+ ThrowHelper.ThrowIfStringArgumentNullOrEmpty(splitter.ToString(), StringResourceNames.CsvSplitterPatternNotValid);
+
+ return splitter.Split(header);
+ }
+
+ ///
+ /// This regex splits comma or semicolon separated lists of optionally quoted strings. It handles quoted delimiters and escaped quotes.
+ /// Whitespace inside quotes is preserved, outside is eaten.
+ /// See: http://regexlib.com/REDetails.aspx?regexp_id=1325
+ ///
+ public static string CsvSplitPatternCommaAndSemicolonCombined =
+ @"\s*[;,]\s*(?!(?<=(?:^|[;,])\s*""(?:[^""]|""""|\\"")*[;,]\s*)(?:[^""]|""""|\\"")*""\s*(?:[;,]|$))";
+
+ public static string CsvSplitPatternSemicolonOnly =
+ @"\s*[;]\s*(?!(?<=(?:^|[;])\s*""(?:[^""]|""""|\\"")*[;]\s*)(?:[^""]|""""|\\"")*""\s*(?:[;]|$))";
+
+ public static string CsvSplitPatternCommaOnly =
+ @"\s*[,]\s*(?!(?<=(?:^|[,])\s*""(?:[^""]|""""|\\"")*[,]\s*)(?:[^""]|""""|\\"")*""\s*(?:[,]|$))";
+
+ ///
+ /// Loads entities of an specific type from a csv file
+ ///
+ /// The type to construct
+ /// The object materializer (property setters)
+ /// The file name to parse
+ /// A sequance containing materialized intances of the type to construct from the csv data
+ public static IEnumerable LoadFromCsvFile(this ObjectMaterializer setter, string fileName)
+ where T : new()
+ {
+ return LoadFromCsvFile(setter, fileName, true);
+ }
+
+ ///
+ /// Loads entities of an specific type from a csv file. Also returns the parsed headers
+ ///
+ /// The type to construct
+ /// The object materializer (property setters)
+ /// The file name to parse
+ /// A sequance containing materialized intances of the type to construct from the csv data
+ public static IEnumerable LoadFromCsvFile(this ObjectMaterializer setter, string fileName, ref string[] headers)
+ where T : new()
+ {
+ // Assemble headers that are available in headerline
+ headers = new string[] { };
+ var headerInfoHasBeenParsed = false;
+ var splitter = new Regex(CsvSplitPatternSemicolonOnly, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+ using (var sr = new StreamReader(fileName))
+ {
+ while (!sr.EndOfStream && !headerInfoHasBeenParsed)
+ {
+ if (!headerInfoHasBeenParsed)
+ {
+ headers = ParseHeader(sr.ReadLine(), splitter);
+ headerInfoHasBeenParsed = true;
+ continue;
+ }
+ }
+ }
+
+ // Do the actual load of the data
+ return LoadFromCsvFile(setter, fileName, true);
+ }
+
+ ///
+ /// Loads entities of an specific type from a csv file
+ ///
+ /// The type to construct
+ /// The object materializer (property setters)
+ /// The file name to parse
+ /// The regular expression for splitting the items in a string
+ /// A sequance containing materialized intances of the type to construct from the csv data
+ public static IEnumerable LoadFromCsvFile(this ObjectMaterializer setter, string fileName, string splitPattern)
+ where T : new()
+ {
+ return LoadFromCsvFile(setter, fileName, true, splitPattern);
+ }
+
+ ///
+ /// Loads entities of an specific type from a csv file
+ ///
+ /// The type to construct
+ /// The object materializer (property setters)
+ /// The file name to parse
+ /// Indicates if the first line in the csv file contains the header info
+ /// A sequance containing materialized intances of the type to construct from the csv data
+ public static IEnumerable LoadFromCsvFile(this ObjectMaterializer setter, string fileName, bool headerInfoInFirstLine)
+ where T : new()
+ {
+ return LoadFromCsvFile(setter, fileName, true, CsvSplitPatternSemicolonOnly);
+ }
+
+ ///
+ /// Loads entities of an specific type from a csv file
+ ///
+ /// The type to construct
+ /// The object materializer (property setters)
+ /// The file name to parse
+ /// Indicates if the first line in the csv file contains the header info
+ /// The regular expression for splitting the items in a string
+ /// A sequance containing materialized intances of the type to construct from the csv data
+ public static IEnumerable LoadFromCsvFile(this ObjectMaterializer materializer, string fileName, bool headerInfoInFirstLine, string splitPattern)
+ where T : new()
+ {
+ ThrowHelper.ThrowIfStringArgumentNullOrEmpty(fileName, StringResourceNames.CsvFileNotValid);
+ ThrowHelper.ThrowIfFileNotExist(fileName, StringResourceNames.CsvFileNotFound);
+ ThrowHelper.ThrowIfStringArgumentNullOrEmpty(splitPattern, StringResourceNames.CsvSplitterPatternNotValid);
+ ThrowHelper.ThrowIfArgumentNull(materializer, nameof(materializer), StringResourceNames.CsvObjectMaterializerNotValid);
+ ThrowHelper.ThrowWhenConditionIsTrue(
+ materializer,
+ StringResourceNames.CsvObjectMaterializerNotValid,
+ c => materializer.Count == 0,
+ r => new CsvParserException(ThrowHelper.GetResourceString(r)));
+
+
+ var splitter = new Regex(splitPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+
+ using (var sr = new StreamReader(fileName))
+ {
+ var headers = new string[] { };
+ var headerInfoHasBeenParsed = false;
+
+ // the first line item count will be used as an extra check for each
+ // next row to parse. If the count doesn match
+ var firstLineItemCount = 0;
+ while (!sr.EndOfStream)
+ {
+ if (headerInfoInFirstLine && !headerInfoHasBeenParsed)
+ {
+ headers = ParseHeader(sr.ReadLine(), splitter);
+ headerInfoHasBeenParsed = true;
+ firstLineItemCount = headers.Length;
+
+ foreach (string key in materializer.MappingKeys)
+ {
+ if (materializer.IsRequired(key) && !headers.Contains(key))
+ throw new CsvParserException(string.Format("The mapped key '{0}' doesn't exist in the header of csv file '{1}'", key, fileName));
+ }
+
+ continue;
+ }
+
+ var items = splitter.Split(sr.ReadLine());
+ if (firstLineItemCount == 0)
+ firstLineItemCount = items.Length;
+
+ // TODO: Add a message to some log that this line could not be parsed
+ // For now just throw an exception
+ if (items.Length != firstLineItemCount)
+ throw new CsvParserException(string.Format("The number of items parsed in the current line don't match with the number of the first line in csv file '{0}'", fileName));
+
+ var entity = new T();
+ try
+ {
+ if (headers.Length > 0)
+ {
+ for (var i = 0; i < items.Length; i++)
+ {
+ // Only call the materializer when the is a match between the
+ // columns declared in the csv and the materializer
+ if (materializer.MappingKeys.Contains(headers[i]))
+ materializer[headers[i]](entity, items[i]);
+ }
+ }
+ else
+ {
+ for (var i = 0; i < items.Length; i++)
+ {
+ materializer[i](entity, items[i]);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new CsvParserException(String.Format("Error parsing CSV file. Check if no empty lines or columns are defined in file '{0}. (Parser error is: '{1}')", fileName, e.Message));
+ }
+
+ yield return entity;
+ }
+ }
+ }
+
+ public static IEnumerable Lines(this StreamReader source)
+ {
+ string line;
+
+ if (source == null)
+ throw new ArgumentNullException("source");
+
+ while ((line = source.ReadLine()) != null)
+ {
+ yield return line;
+ }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ModelFactors.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ModelFactors.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/ModelFactors.cs (revision 3305)
@@ -0,0 +1,53 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Xml.Serialization;
+
+namespace Deltares.Dam.Data
+{
+ public class ModelFactors
+ {
+ private double defaultSafetyFactorStabilityInnerSlope = 1.0;
+ private double defaultSafetyFactorStabilityOuterSlope = 1.0;
+ private double defaultSafetyFactorPiping = 1.0;
+ private double defaultUpliftCriterionStability = 1.2;
+ private double defaultUpliftCriterionPiping = 1.2;
+
+ ///
+ /// Constructor
+ ///
+ public ModelFactors()
+ {
+ RequiredSafetyFactorStabilityInnerSlope = defaultSafetyFactorStabilityInnerSlope;
+ RequiredSafetyFactorStabilityOuterSlope = defaultSafetyFactorStabilityOuterSlope;
+ RequiredSafetyFactorPiping = defaultSafetyFactorPiping;
+ UpliftCriterionStability = defaultUpliftCriterionStability;
+ UpliftCriterionPiping = defaultUpliftCriterionPiping;
+ }
+
+ public double RequiredSafetyFactorStabilityInnerSlope { get; set; }
+ public double RequiredSafetyFactorStabilityOuterSlope { get; set; }
+ public double RequiredSafetyFactorPiping { get; set; }
+ public double UpliftCriterionStability { get; set; }
+ public double UpliftCriterionPiping { get; set; }
+
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/TestData/Gemeenten.prj
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/TestData/Gemeenten.prj (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/TestData/Gemeenten.prj (revision 3305)
@@ -0,0 +1 @@
+PROJCS["Rijksdriehoekstelsel_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",155000.0],PARAMETER["False_Northing",463000.0],PARAMETER["Central_Meridian",5.38763888888889],PARAMETER["Scale_Factor",0.9999079],PARAMETER["Latitude_Of_Origin",52.15616055555555],UNIT["Meter",1.0]]
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/SurfaceLineCsvColumnNames.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/SurfaceLineCsvColumnNames.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/SurfaceLineCsvColumnNames.cs (revision 3305)
@@ -0,0 +1,37 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Deltares.Dam.Data.CsvImporters
+{
+ ///
+ /// Defines column name definitions used for importing csv data surfacelines
+ ///
+ public static class SurfaceLineCsvColumnNames
+ {
+ // The following 2 fields point to the same data
+ // location_id is the preferred columnname
+ // Profielnaam is used for backward compatiblity
+ public const string LocationColumnName = "LocationId";
+ public const string ProfileNameColumnName = "Profielnaam";
+
+ public const string FirstXColumnName = "X1";
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/AssemblyInfo.cs.svn
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/AssemblyInfo.cs.svn (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/AssemblyInfo.cs.svn (revision 3305)
@@ -0,0 +1,16 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("Deltares.Dam.Data")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+
+[assembly: ComVisible(false)]
+[assembly: Guid("a6184ba6-b126-4783-b437-e987b511e09b")]
+
+[assembly: AssemblyVersion("17.1.0.SVNREV")]
+[assembly: AssemblyFileVersion("17.1.0.SVNREV")]
+
+[assembly: InternalsVisibleTo("Deltares.Dam.Tests")]
+[assembly: InternalsVisibleTo("Deltares.Dam.IntegrationTests")]
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/ShapeFileCreator.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/ShapeFileCreator.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/ShapeFileCreator.cs (revision 3305)
@@ -0,0 +1,101 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+using NetTopologySuite.IO;
+
+namespace Deltares.Maps
+{
+ ///
+ /// Wrapper class for writing repository data to ShapeFiles.
+ ///
+ public static class ShapeFileCreator
+ {
+ ///
+ /// Creates the three (mandatory) files (.dbf, .shx, .shp) belonging to shape files
+ /// and writes the feature data contained in the repository
+ ///
+ /// The output folder
+ /// The name of the file/layer (without extension)
+ /// The repository containing all data to be written to shapefiles
+ ///
+ /// If the files already exist they will be overriden
+ ///
+ ///
+ ///
+ /// When the name is empty or null. A valid name is required.
+ ///
+ ///
+ /// When the repository does not contain features.
+ ///
+ ///
+ /// When more then one geometry types is found in the repository
+ /// When the repository contains types which are currently not supported:
+ /// OgcGeometryType.Curve
+ /// OgcGeometryType.MultiCurve
+ /// OgcGeometryType.Surface
+ /// OgcGeometryType.MultiSurface
+ /// OgcGeometryType.Polygon
+ /// OgcGeometryType.MultiPolygon
+ /// OgcGeometryType.Geometry
+ /// OgcGeometryType.GeometryCollection
+ ///
+ public static void Create(string path, string name, IFeatureRepository repository)
+ {
+ if (string.IsNullOrEmpty(name) || name.Trim() == string.Empty)
+ {
+ throw new ArgumentNullException("name");
+ }
+
+ path = string.IsNullOrEmpty(path) || path.Trim() == "" || path.Trim() == "."
+ ? Directory.GetCurrentDirectory()
+ : path;
+
+ if (!Directory.Exists(path))
+ {
+ throw new DirectoryNotFoundException(path);
+ }
+
+ if (repository.Features.Count() == 0)
+ {
+ throw new ArgumentException(
+ "The feature repository doesn't contain features. It should contain at least one feature");
+ }
+
+ IFeature firstFeature = repository.Features.First();
+ var feature = new NetTopologySuite.Features.Feature(firstFeature.Geometry, firstFeature.Attributes);
+ List coll = repository.Features
+ .Select(f => new NetTopologySuite.Features.Feature(f.Geometry, f.Attributes))
+ .ToList();
+
+ DbaseFileHeader header = ShapefileDataWriter.GetHeader(feature, repository.Count);
+ var writer = new ShapefileDataWriter(path + name)
+ {
+ Header = header
+ };
+ writer.Write(coll);
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/Resources.Designer.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/Resources.Designer.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Properties/Resources.Designer.cs (revision 3305)
@@ -0,0 +1,639 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Deltares.Dam.Data.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Deltares.Dam.Data.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The column index of {0} defined on property {1} in the CSV export object class already exists.
+ ///
+ internal static string CsvColumnIndexAlreadyExists {
+ get {
+ return ResourceManager.GetString("CsvColumnIndexAlreadyExists", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Couldn't find the csv data file {0}.
+ ///
+ internal static string CsvFileNotFound {
+ get {
+ return ResourceManager.GetString("CsvFileNotFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The file name is not valid or empty.
+ ///
+ internal static string CsvFileNotValid {
+ get {
+ return ResourceManager.GetString("CsvFileNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The header in the import file is not valid.
+ ///
+ internal static string CsvHeaderNotValid {
+ get {
+ return ResourceManager.GetString("CsvHeaderNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The header in the import file is not valid.
+ ///
+ internal static string CsvHeaderNullOrEmpty {
+ get {
+ return ResourceManager.GetString("CsvHeaderNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The object materializer is not valid.
+ ///
+ internal static string CsvObjectMaterializerNotValid {
+ get {
+ return ResourceManager.GetString("CsvObjectMaterializerNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The given pattern to split the data values of the CSV files is not valid.
+ ///
+ internal static string CsvSplitterPatternNotValid {
+ get {
+ return ResourceManager.GetString("CsvSplitterPatternNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The data import argument is not valid.
+ ///
+ internal static string DataImportArgumentNull {
+ get {
+ return ResourceManager.GetString("DataImportArgumentNull", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The project should contain exactly 1 dike.
+ ///
+ internal static string DikeShouldContainExactly1Dike {
+ get {
+ return ResourceManager.GetString("DikeShouldContainExactly1Dike", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Cannot create or add the entity with the the given id because it already exist.
+ ///
+ internal static string EntityAlreadyExist {
+ get {
+ return ResourceManager.GetString("EntityAlreadyExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The factory argument is null but is a required.
+ ///
+ internal static string EntityFactoryArgumentNull {
+ get {
+ return ResourceManager.GetString("EntityFactoryArgumentNull", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The file name is not valid. Maybe due to a null or empty string and or invalid characters. Please use a valid file name.
+ ///
+ internal static string FileNameNotValid {
+ get {
+ return ResourceManager.GetString("FileNameNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The gauge id value is null or empty which is not allowed.
+ ///
+ internal static string GaugeIdArgumentNullOrEmpty {
+ get {
+ return ResourceManager.GetString("GaugeIdArgumentNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The imported data is not valid. Reason: {0}.
+ ///
+ internal static string ImportDataNotValid {
+ get {
+ return ResourceManager.GetString("ImportDataNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to This location does not have a soilprofile.
+ ///
+ internal static string ImportedLocationDoesntHaveSoilprofile {
+ get {
+ return ResourceManager.GetString("ImportedLocationDoesntHaveSoilprofile", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No points in location PL1 line. Please check if the PL1 line ID defined in the locations import file matches the ID's in the PL1 line import file.
+ ///
+ internal static string ImportedLocationDoesntHaveValidPL1Lines {
+ get {
+ return ResourceManager.GetString("ImportedLocationDoesntHaveValidPL1Lines", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No dike points in location surface line. Please check if the surface line ID defined in the locations import file matches the ID's in the surface line import file.
+ ///
+ internal static string ImportedLocationDoesntHaveValidSurfaceLines {
+ get {
+ return ResourceManager.GetString("ImportedLocationDoesntHaveValidSurfaceLines", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The import file {0} couldn't be found. This file is required..
+ ///
+ internal static string ImportFileNotExist {
+ get {
+ return ResourceManager.GetString("ImportFileNotExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The file which are required for the import are not validated.
+ ///
+ internal static string ImportFilesNotValidated {
+ get {
+ return ResourceManager.GetString("ImportFilesNotValidated", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The import folder {0} does not exist.
+ ///
+ internal static string ImportFolderNotExist {
+ get {
+ return ResourceManager.GetString("ImportFolderNotExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The import folder is not valid.
+ ///
+ internal static string ImportFolderNullOrEmpty {
+ get {
+ return ResourceManager.GetString("ImportFolderNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Location '{0}' has no segment..
+ ///
+ internal static string LocationHasNoSegment {
+ get {
+ return ResourceManager.GetString("LocationHasNoSegment", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The location id value is null or empty which is not allowed.
+ ///
+ internal static string LocationIdArgumentNullOrEmpty {
+ get {
+ return ResourceManager.GetString("LocationIdArgumentNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Location has an invalid name {0}.
+ ///
+ internal static string LocationInvalidName {
+ get {
+ return ResourceManager.GetString("LocationInvalidName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Couldn't find the MStab executable at location {0}.
+ ///
+ internal static string MStabExecutableFileNameNotFound {
+ get {
+ return ResourceManager.GetString("MStabExecutableFileNameNotFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No calculation type specified.
+ ///
+ internal static string NoCalculationTypeSpecified {
+ get {
+ return ResourceManager.GetString("NoCalculationTypeSpecified", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No dike defined in this project.
+ ///
+ internal static string NoDikeDefined {
+ get {
+ return ResourceManager.GetString("NoDikeDefined", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No locations defined in this project.
+ ///
+ internal static string NoLocationsDefined {
+ get {
+ return ResourceManager.GetString("NoLocationsDefined", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Location '{0}' does not exist in the location collection..
+ ///
+ internal static string NonExistentLocation {
+ get {
+ return ResourceManager.GetString("NonExistentLocation", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Location '{0}', scenario '{1}' has no river level.
+ ///
+ internal static string NoRiverLevel {
+ get {
+ return ResourceManager.GetString("NoRiverLevel", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Location '{0}', scenario '{1}' has no river level low.
+ ///
+ internal static string NoRiverLevelLow {
+ get {
+ return ResourceManager.GetString("NoRiverLevelLow", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No scenarios defined in location.
+ ///
+ internal static string NoScenariosDefinedInLocation {
+ get {
+ return ResourceManager.GetString("NoScenariosDefinedInLocation", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No soil profiles have been defined for location '{0}'..
+ ///
+ internal static string NoSoilProfileDefinedForLocation {
+ get {
+ return ResourceManager.GetString("NoSoilProfileDefinedForLocation", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No soilprofiles1D defined in this project.
+ ///
+ internal static string NoSoilprofiles1DDefinedInProject {
+ get {
+ return ResourceManager.GetString("NoSoilprofiles1DDefinedInProject", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No soils defined in this project.
+ ///
+ internal static string NoSoilsDefinedInProject {
+ get {
+ return ResourceManager.GetString("NoSoilsDefinedInProject", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to No surfacelines defined in this project.
+ ///
+ internal static string NoSurfaceLines {
+ get {
+ return ResourceManager.GetString("NoSurfaceLines", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Couldn't parse the file because it has no valid content.
+ ///
+ internal static string OutputFileHasNoContent {
+ get {
+ return ResourceManager.GetString("OutputFileHasNoContent", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The file name is not valid.
+ ///
+ internal static string OutputFileNameNotValid {
+ get {
+ return ResourceManager.GetString("OutputFileNameNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Couldn't find the output file {0}.
+ ///
+ internal static string OutputFileNotExist {
+ get {
+ return ResourceManager.GetString("OutputFileNotExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to PL1 has not been created.
+ ///
+ internal static string PL1NotCreated {
+ get {
+ return ResourceManager.GetString("PL1NotCreated", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Project file name is not valid.
+ ///
+ internal static string ProjectFileNameNullOrEmpty {
+ get {
+ return ResourceManager.GetString("ProjectFileNameNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Project file not found .
+ ///
+ internal static string ProjectFileNotExist {
+ get {
+ return ResourceManager.GetString("ProjectFileNotExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The required entity '{0}' with ID '{1}' doesn't exist.
+ ///
+ internal static string RequiredEntityDoesNotExist {
+ get {
+ return ResourceManager.GetString("RequiredEntityDoesNotExist", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The required parameter {0} which should be contained in object {1} is missing.
+ ///
+ internal static string RequiredParameterMissing {
+ get {
+ return ResourceManager.GetString("RequiredParameterMissing", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The segment id value is null or empty which is not allowed.
+ ///
+ internal static string SegmentIdArgumentNullOrEmpty {
+ get {
+ return ResourceManager.GetString("SegmentIdArgumentNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Segment has an invalid name {0}.
+ ///
+ internal static string SegmentInvalidName {
+ get {
+ return ResourceManager.GetString("SegmentInvalidName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Couldn't find the SlopeW (GeoStudio) executable at location {0}.
+ ///
+ internal static string SlopeWExecutableFileNameNotFound {
+ get {
+ return ResourceManager.GetString("SlopeWExecutableFileNameNotFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The soil material in the layer could not be converted to local type.
+ ///
+ internal static string SoilAttachedToLayerNotValid {
+ get {
+ return ResourceManager.GetString("SoilAttachedToLayerNotValid", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Soildatabase '{0}' is not found.
+ ///
+ internal static string SoildatabaseNotFound {
+ get {
+ return ResourceManager.GetString("SoildatabaseNotFound", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Soil has an invalid name {0}.
+ ///
+ internal static string SoilInvalidName {
+ get {
+ return ResourceManager.GetString("SoilInvalidName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The soil list is not yet created..
+ ///
+ internal static string SoilListIsNull {
+ get {
+ return ResourceManager.GetString("SoilListIsNull", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The soil profile name or id value is null or empty which is not allowed.
+ ///
+ internal static string SoilProfileIdArgumentNullOrEmpty {
+ get {
+ return ResourceManager.GetString("SoilProfileIdArgumentNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Soilprofile has an invalid name {0}.
+ ///
+ internal static string SoilProfileInvalidName {
+ get {
+ return ResourceManager.GetString("SoilProfileInvalidName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The soilprofile is not assigned.
+ ///
+ internal static string SoilProfileNotAssigned {
+ get {
+ return ResourceManager.GetString("SoilProfileNotAssigned", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Surfaceline '{0}' has no characteristic points.
+ ///
+ internal static string SurfaceLineHasNoCharacteristicPoints {
+ get {
+ return ResourceManager.GetString("SurfaceLineHasNoCharacteristicPoints", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Surfaceline '{0}' has no points.
+ ///
+ internal static string SurfaceLineHasNoPoints {
+ get {
+ return ResourceManager.GetString("SurfaceLineHasNoPoints", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The surface line id argument is null or empty but it is required.
+ ///
+ internal static string SurfaceLineIdArgumentNullOrEmpty {
+ get {
+ return ResourceManager.GetString("SurfaceLineIdArgumentNullOrEmpty", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Surfaceline has an invalid name {0}.
+ ///
+ internal static string SurfaceLineInvalidName {
+ get {
+ return ResourceManager.GetString("SurfaceLineInvalidName", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Surfaceline is not inside soil profile.
+ ///
+ internal static string SurfacelineIsNotInsideSoilprofile {
+ get {
+ return ResourceManager.GetString("SurfacelineIsNotInsideSoilprofile", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The surfaceline is not assigned.
+ ///
+ internal static string SurfaceLineNotAssigned {
+ get {
+ return ResourceManager.GetString("SurfaceLineNotAssigned", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The required characteristic point type '{0}' with coordinate '{1}' does not exist in the point collection of surfaceline '{2}'.
+ ///
+ internal static string SurfaceLinePointNotExtists {
+ get {
+ return ResourceManager.GetString("SurfaceLinePointNotExtists", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The top layer to be evaluated is not inside the soil profile.
+ ///
+ internal static string TopLayerToBeEvaluatedNotInsideSoilprofile {
+ get {
+ return ResourceManager.GetString("TopLayerToBeEvaluatedNotInsideSoilprofile", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Two sandlayers are mandatory in soil profile.
+ ///
+ internal static string TwoSandlayersRequiredInSoilProfile {
+ get {
+ return ResourceManager.GetString("TwoSandlayersRequiredInSoilProfile", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to The water level input file is not null or empty.
+ ///
+ internal static string WaterLevelInputFileNullOrEmpty {
+ get {
+ return ResourceManager.GetString("WaterLevelInputFileNullOrEmpty", resourceCulture);
+ }
+ }
+ }
+}
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/NotEqualSpecification.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/NotEqualSpecification.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Specifications/NotEqualSpecification.cs (revision 3305)
@@ -0,0 +1,44 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Deltares.Standard.Specifications
+{
+ public class NotEqualSpecification : ValueBoundSpecification
+ {
+ public NotEqualSpecification(string attributeName, TValue attributeValue)
+ : base(attributeName, attributeValue)
+ {
+ }
+
+ ///
+ /// Determines whether the candidate satisfies the specification.
+ ///
+ /// The candidate to test.
+ ///
+ /// true if the candidate satisfies the specification otherwise, false.
+ ///
+ public override bool IsSatisfiedBy(TCandidate candidate)
+ {
+ TValue actual = this.GetCandidateTValue(candidate);
+ return !(actual.Equals(this.AttributeValue));
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/CoverageFunction.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/CoverageFunction.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/CoverageFunction.cs (revision 3305)
@@ -0,0 +1,143 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using NetTopologySuite.Geometries;
+
+namespace Deltares.Maps
+{
+ public static class CoverageFunction
+ {
+ public static IEnumerable GetFeaturesCovering(this IFeatureRepository repository, double x, double y)
+ {
+ var pointToTest = new Point(x, y);
+ /*
+ return (from feature in repository.Features
+ let target = feature.Geometry
+ where (pointToTest.Within(target) || pointToTest.Touches(target)) || pointToTest.Intersects(target)
+ select feature);
+*/
+
+ /*
+ var e = pointToTest.EnvelopeInternal;
+ const int delta = 1;
+ var bbox = new Envelope(e.MinX - delta, e.MinY - delta, e.MaxX + delta, e.MaxY + delta);
+
+ var possibleMatches = repository.Query(bbox);
+
+ foreach (var feature in possibleMatches)
+ {
+ if (pointToTest.Within(feature.Geometry) || pointToTest.Touches(feature.Geometry) || pointToTest.Intersects(feature.Geometry))
+ {
+ yield return feature;
+ }
+ }
+*/
+
+ return repository
+ .Query(pointToTest)
+ .Where(feature =>
+ pointToTest.Within(feature.Geometry) ||
+ pointToTest.Touches(feature.Geometry) ||
+ pointToTest.Intersects(feature.Geometry));
+ }
+
+ public static Func GetCoverageFunc(this IFeatureRepository repository)
+ {
+ return GetCoverageFunc(repository, repository.SupportedAttributes);
+ }
+
+ public static Func GetCoverageFunc(this IFeatureRepository repository, string attributeName)
+ {
+ return GetCoverageFunc(repository, attributeName, repository.SupportedAttributes);
+ }
+
+ public static Func GetCoverageFunc(this IFeatureRepository repository, string attributeName,
+ IEnumerable supportedAttributeNames)
+ {
+ Func func = GetCoverageFunc(repository, supportedAttributeNames);
+ return (x, y) => func(attributeName, x, y);
+ }
+
+ public static Func GetCoverageFunc(IFeatureRepository repository,
+ IEnumerable supportedAttributeNames)
+ {
+ if (repository == null)
+ {
+ throw new ArgumentNullException("repository");
+ }
+
+ if (supportedAttributeNames == null)
+ {
+ throw new ArgumentNullException("supportedAttributeNames");
+ }
+
+ if (!supportedAttributeNames.Any())
+ {
+ throw new ArgumentException("The supported attribute list should at least contain one attribute",
+ "supportedAttributeNames");
+ }
+
+ int index = 0;
+ foreach (string attributeName in supportedAttributeNames)
+ {
+ if (string.IsNullOrEmpty(attributeName))
+ {
+ throw new ArgumentException(string.Format("An invalid attribute found at index {0}", index));
+ }
+ index++;
+ }
+
+ IEnumerable supportedAttributes = supportedAttributeNames.Select(a => a.ToLowerInvariant());
+
+ return (attributeName, x, y) =>
+ {
+ if (string.IsNullOrEmpty(attributeName))
+ {
+ throw new ArgumentNullException("attributeName");
+ }
+
+ string attrName = attributeName.ToLowerInvariant();
+ if (!supportedAttributes.Contains(attrName))
+ {
+ throw new AttributeMissingException(attributeName);
+ }
+
+ IEnumerable matches = GetFeaturesCovering(repository, x, y);
+
+ if (!matches.Any())
+ {
+ throw new FeatureCoverageException(string.Format("No geometries found covering point ({0} {1})", x, y));
+ }
+
+ if (matches.Count() > 1)
+ {
+ throw new FeatureCoverageException(string.Format("Multiple geometries found covering point ({0} {1})", x, y));
+ }
+
+ return matches.First().Attributes[attrName];
+ };
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/TestData/Gemeenten.qix
===================================================================
diff -u
Binary files differ
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Maps/Test/TestData/Gemeenten.sbx
===================================================================
diff -u
Binary files differ
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs (revision 3305)
@@ -0,0 +1,2393 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Xml.Serialization;
+using Deltares.Dam.Data.Sensors;
+using Deltares.Geographic;
+using Deltares.Geometry;
+using Deltares.Geotechnics.Converter;
+using Deltares.Geotechnics.Soils;
+using Deltares.Geotechnics.SurfaceLines;
+using Deltares.Geotechnics.Validation;
+using Deltares.Soilbase;
+using Deltares.Standard;
+using Deltares.Standard.Attributes;
+using Deltares.Standard.EventPublisher;
+using Deltares.Standard.Language;
+using Deltares.Standard.Units;
+using Deltares.Standard.Validation;
+
+namespace Deltares.Dam.Data
+{
+ internal static class LocationParameterNames
+ {
+ public const string DikeRingId = "DikeRingId";
+ public const string Description = "Description";
+ public const string XRd = "XRd";
+ public const string YRd = "YRd";
+ public const string SegmentId = "SegmentId";
+ public const string SurfaceLineId = "SurfaceLineId";
+ public const string PL1LineId = "PL1LineId";
+ public const string XSoilGeometry2DOrigin = "XSoilGeometry2DOrigin";
+ public const string DikeEmbankmentMaterial = "DikeEmbankmentMaterial";
+ public const string ShoulderEmbankmentMaterial = "ShoulderEmbankmentMaterial";
+ public const string DampingFactorPL3 = "DampingFactorPL3";
+ public const string DampingFactorPL4 = "DampingFactorPL4";
+ public const string PenetrationLength = "PenetrationLength";
+ public const string TrafficLoad = "TrafficLoad";
+ public const string TL_DegreeOfConsolidation = "TL_DegreeOfConsolidation";
+ public const string PLLineCreationMethod = "PLLineCreationMethod";
+ public const string StabilityShoulderGrowSlope = "StabilityShoulderGrowSlope";
+ public const string StabilityShoulderGrowDeltaX = "StabilityShoulderGrowDeltaX";
+ public const string StabilitySlopeAdaptionDeltaX = "StabilitySlopeAdaptionDeltaX";
+ public const string MinimalCircleDepth = "MinimalCircleDepth";
+ public const string DistanceToEntryPoint = "DistanceToEntryPoint";
+ public const string StabilityZoneType = "StabilityZoneType";
+ public const string ForbiddenZoneFactor = "ForbiddenZoneFactor";
+ public const string ZoneAreaRestSlopeCrestWidth = "ZoneAreaRestSlopeCrestWidth";
+ public const string StabilityDesignMethod = "StabilityDesignMethod";
+ public const string SlopeAdaptionStartCotangent = "SlopeAdaptionStartCotangent";
+ public const string SlopeAdaptionEndCotangent = "SlopeAdaptionEndCotangent";
+ public const string SlopeAdaptionStepCotangent = "SlopeAdaptionStepCotangent";
+ public const string SlopeDampingPiezometricHeightPolderSide = "SlopeDampingPiezometricHeightPolderSide";
+ public const string NewDepthDitch = "NewDepthDitch";
+ public const string NewDikeSlopeInside = "NewDikeSlopeInside";
+ public const string NewDikeSlopeOutside = "NewDikeSlopeOutside";
+ public const string NewDikeTopWidth = "NewDikeTopWidth";
+ public const string NewMaxHeightShoulderAsFraction = "NewMaxHeightShoulderAsFraction";
+ public const string NewMinDistanceDikeToeStartDitch = "NewMinDistanceDikeToeStartDitch";
+ public const string NewShoulderBaseSlope = "NewShoulderBaseSlope";
+ public const string NewShoulderTopSlope = "NewShoulderTopSlope";
+ public const string NewSlopeAngleDitch = "NewSlopeAngleDitch";
+ public const string NewWidthDitchBottom = "NewWidthDitchBottom";
+ public const string UseNewDikeSlopeInside = "UseNewDikeSlopeInside";
+ public const string UseNewDikeSlopeOutside = "UseNewDikeSlopeOutside";
+ public const string UseNewDikeTopWidth = "UseNewDikeTopWidth";
+ public const string UseNewDitchDefinition = "UseNewDitchDefinition";
+ public const string UseNewMaxHeightShoulderAsFraction = "UseNewMaxHeightShoulderAsFraction";
+ public const string UseNewMinDistanceDikeToeStartDitch = "UseNewMinDistanceDikeToeStartDitch";
+ public const string UseNewShoulderBaseSlope = "UseNewShoulderBaseSlope";
+ public const string UseNewShoulderTopSlope = "UseNewShoulderTopSlope";
+ public const string IntrusionVerticalWaterPressure = "IntrusionVerticalWaterPressure";
+ }
+
+ [TrackChanges]
+ public class Location : IVisibleEnabled, IGeographicPoint, IRepairer, IDomain, IDisposable
+ {
+ // Added initial value as these properties must be tested for real values on import
+ public const string AllCategory = "MainItems";
+ public const string DikeCategory = "Dike";
+ public const string WaterCategory = "Water levels";
+ public const string DesignCategory = "Design";
+ private const double newDikeTopWidthMinValue = 0.1;
+ private const double newDikeSlopeInsideMinValue = 0.01;
+ private const double newDikeSlopeOutsideMinValue = 0.01;
+ private const double penetrationLenghtMinValue = 0.00;
+ private static DamProjectType damProjectType = DamProjectType.Calamity;
+ private readonly List scenarios = new List();
+ private bool areLocalXZObjectsCreated = false;
+
+ // ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ //
+ // When adding properties below do not forget to add these properties to SetParameterFromNameValuePair and GetParametersAsNameValuePairs
+ //
+ // ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ private double dampingFactorPL3 = 0;
+ private double dampingFactorPL4 = 0;
+ private string description = "";
+ private string dikeEmbankmentMaterial = "";
+ private string dikeRingId = "";
+ private double distanceToEntryPoint = 0;
+ private double forbiddenZoneFactor = 1.0;
+ private IList gaugePLLines = new List();
+ private IList gauges = new List();
+ // Start of parameters that are also defined in modelparameters
+ private PL1Line localXZPL1Line;
+ private SurfaceLine2 localXzSurfaceLine;
+ private string mapForSoilGeometries2D = "";
+ private double minimalCircleDepth = 0;
+ private string name = "";
+ private double newDepthDitch = 1.0;
+ private double newDikeSlopeInside = 1.0/3.0; // as tangent
+ private double newDikeSlopeOutside = 1.0/3.0; // as tangent
+ private double newDikeTopWidth = 5.0;
+ private double newMaxHeightShoulderAsFraction = 2.0/3.0; // as tangent
+ private double newMinDistanceDikeToeStartDitch = 5.0;
+ private double newShoulderBaseSlope = 1.0/3.0; // as tangent
+ private double newShoulderTopSlope = 1.0/20.0; // as tangent
+ private double newSlopeAngleDitch = 1.0/0.5; // as tangent
+ private double newWidthDitchBottom = 1.0;
+ private PL1Line pL1Line;
+ private PLLineCreationMethod pLLineCreationMethod = PLLineCreationMethod.ExpertKnowledgeRRD;
+ private double penetrationLength = 0;
+ private bool redesignDikeHeight = true;
+ private bool redesignDikeShoulder = true;
+ private Segment segment;
+ private SensorLocation sensorLocation;
+ private string shoulderEmbankmentMaterial = "";
+ private double slopeAdaptionEndCotangent = 6.0;
+ private double slopeAdaptionStartCotangent = 3.0;
+ private double slopeAdaptionStepCotangent = 0.5;
+ private double slopeDampingPiezometricHeightPolderSide = 0.0;
+ private SoilSurfaceProfile soilSurfaceProfile = null;
+ private string soildatabaseName = "";
+ private StabilityDesignMethod stabilityDesignMethod = StabilityDesignMethod.OptimizedSlopeAndShoulderAdaption;
+ private double stabilityShoulderGrowDeltaX = 2.0;
+ private double stabilityShoulderGrowSlope = 1.0/3;
+ private double stabilitySlopeAdaptionDeltaX = 2.0;
+ private MStabZonesType stabilityZoneType = MStabZonesType.NoZones;
+
+ private SurfaceLine2 surfaceLine2;
+ private string surfaceLineId = "";
+ private double trafficLoad = 0;
+ private double? degreeOfConsolidation;
+ private bool useNewDikeSlopeInside;
+ private bool useNewDikeSlopeOutside;
+ private bool useNewDikeTopWidth;
+ private bool useNewDitchDefinition;
+ private bool useNewMaxHeightShoulderAsFraction;
+ private bool useNewMinDistanceDikeToeStartDitch;
+ private bool useNewShoulderBaseSlope;
+ private bool useNewShoulderTopSlope;
+ private double xRdDikeLine;
+ private double xSoilGeometry2DOrigin = 0;
+ private double xrd = 0;
+ private double yrd = 0;
+ private double zoneAreaRestSlopeCrestWidth = 3.0;
+
+ private IntrusionVerticalWaterPressureType? intrusionVerticalWaterPressure = IntrusionVerticalWaterPressureType.Standard;
+
+ public Location()
+ {
+ SoilList = null;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The name.
+ public Location(string name) : this()
+ {
+ this.name = name;
+ }
+
+ public bool HasSensorData
+ {
+ get
+ {
+ return sensorLocation != null;
+ }
+ }
+
+ [Browsable(false)]
+ [XmlOldName("SensorData")]
+ public virtual SensorLocation SensorLocation
+ {
+ get
+ {
+ return sensorLocation;
+ }
+ set
+ {
+ sensorLocation = value;
+ sensorLocation.Location = this;
+ }
+ }
+
+ [Browsable(false)]
+ public virtual bool AreLocalXZObjectsCreated
+ {
+ get
+ {
+ return areLocalXZObjectsCreated;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "AreLocalXZObjectsCreated");
+ areLocalXZObjectsCreated = value;
+ DataEventPublisher.AfterChange(this, "AreLocalXZObjectsCreated");
+ }
+ }
+
+ [Label("Name")]
+ [PropertyOrder(0, 1)]
+ [ReadOnly(true)]
+ [Category(AllCategory)]
+ public virtual string Name
+ {
+ get
+ {
+ return name;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "Name");
+ name = value;
+ DataEventPublisher.AfterChange(this, "Name");
+ }
+ }
+
+ [Label("Description")]
+ [Category(DikeCategory)]
+ [PropertyOrder(1, 10)]
+ public virtual string Description
+ {
+ get
+ {
+ return description;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "Description");
+ description = value;
+ DataEventPublisher.AfterChange(this, "Description");
+ }
+ }
+
+ [Unit(UnitType.Length)]
+ [Label("X location (RDS)")]
+ [Description("Location according to Rijksdriehoekstelsel")]
+ [Format("F3")]
+ [ReadOnly(true)]
+ [PropertyOrder(1, 1)]
+ [Category(AllCategory)]
+ public virtual double XRd
+ {
+ get
+ {
+ return xrd;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "XRd");
+ xrd = value;
+ DataEventPublisher.AfterChange(this, "XRd");
+ }
+ }
+
+ [Unit(UnitType.Length)]
+ [Label("Y location (RDS)")]
+ [Description("Location according to Rijksdriehoekstelsel")]
+ [Format("F3")]
+ [ReadOnly(true)]
+ [PropertyOrder(1, 1)]
+ [Category(AllCategory)]
+ public virtual double YRd
+ {
+ get
+ {
+ return yrd;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "YRd");
+ yrd = value;
+ DataEventPublisher.AfterChange(this, "YRd");
+ }
+ }
+
+ public virtual double XRdDikeLine
+ {
+ get
+ {
+ return xRdDikeLine;
+ }
+ set
+ {
+ this.SetAndNotify2(out xRdDikeLine, value, x => x.XRdDikeLine);
+ }
+ }
+
+ [Browsable(false)]
+ public virtual double XSoilGeometry2DOrigin
+ {
+ get
+ {
+ return xSoilGeometry2DOrigin;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "XSoilGeometry2DOrigin");
+ xSoilGeometry2DOrigin = value;
+ DataEventPublisher.AfterChange(this, "XSoilGeometry2DOrigin");
+ }
+ }
+
+ [Unit(UnitType.PressurePerLength)]
+ [Label("Traffic load")]
+ [Description("Traffic load")]
+ [Format("F3")]
+ [Category(DikeCategory)]
+ [PropertyOrder(1, 20)]
+ public virtual double TrafficLoad
+ {
+ get
+ {
+ return trafficLoad;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "TrafficLoad");
+ trafficLoad = value;
+ DataEventPublisher.AfterChange(this, "TrafficLoad");
+ }
+ }
+
+ [Unit(UnitType.Percentage)]
+ [Format("F3")]
+ [Category(DikeCategory)]
+ [PropertyOrder(1, 21)]
+ public virtual double? TL_DegreeOfConsolidation
+ {
+ get
+ {
+ return degreeOfConsolidation;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "TL_DegreeOfConsolidation");
+ degreeOfConsolidation = value;
+ DataEventPublisher.AfterChange(this, "TL_DegreeOfConsolidation");
+ }
+ }
+
+ [Browsable(false)]
+ public virtual PL1Line PL1Line
+ {
+ get
+ {
+ return pL1Line;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "PL1Line");
+ pL1Line = value;
+ DataEventPublisher.AfterChange(this, "PL1Line");
+ }
+ }
+
+ [Browsable(false)]
+ public virtual PL1Line LocalXZPL1Line
+ {
+ get
+ {
+ return localXZPL1Line;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "LocalXZPL1Line");
+ localXZPL1Line = value;
+ DataEventPublisher.AfterChange(this, "LocalXZPL1Line");
+ }
+ }
+
+ ///
+ /// TODO
+ ///
+ /// Composite relationship.
+ [Validate]
+ public virtual SurfaceLine2 LocalXZSurfaceLine2
+ {
+ get
+ {
+ return localXzSurfaceLine;
+ }
+ set
+ {
+ this.SetAndNotify2(out localXzSurfaceLine, value, l => l.LocalXZSurfaceLine2);
+ }
+ }
+
+ ///
+ /// Gets or sets the Segment
+ ///
+ [PropertyOrder(1, 6)]
+ [Label("Segment")]
+ [Category(DikeCategory)]
+ [ReadOnly(true)]
+ public virtual string SegmentId { get; set; }
+
+ ///
+ /// Gets or sets the Segment
+ ///
+ [Browsable(false)]
+ public virtual Segment Segment
+ {
+ get
+ {
+ return segment;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "Segment");
+ segment = value;
+ DataEventPublisher.AfterChange(this, "Segment");
+ }
+ }
+
+ ///
+ /// Gets or sets the surface line
+ ///
+ [Browsable(false)]
+ public virtual SurfaceLine2 SurfaceLine2
+ {
+ get
+ {
+ return surfaceLine2;
+ }
+ set
+ {
+ this.SetAndNotify2(out surfaceLine2, value, l => l.SurfaceLine2);
+ }
+ }
+
+ ///
+ ///
+ ///
+ [Unit(UnitType.Length)]
+ [Label("Minimum circle depth")]
+ [Format("F2")]
+ [PropertyOrder(4, 4)]
+ [Minimum(0)]
+ [Maximum(10000)]
+ [Category(DikeCategory)]
+ public virtual double MinimalCircleDepth
+ {
+ get
+ {
+ return minimalCircleDepth;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "MinimalCircleDepth");
+ minimalCircleDepth = value;
+ DataEventPublisher.AfterChange(this, "MinimalCircleDepth");
+ }
+ }
+
+ [Unit(UnitType.Length)]
+ [Label("Distance to Entrypoint")]
+ [Description("Distance from toe of dike to entry point of river in deep sandlayer")]
+ [Format("F2")]
+ [PropertyOrder(2, 12)]
+ public virtual double DistanceToEntryPoint
+ {
+ get
+ {
+ return distanceToEntryPoint;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "DistanceToEntryPoint");
+ distanceToEntryPoint = value;
+ DataEventPublisher.AfterChange(this, "DistanceToEntryPoint");
+ }
+ }
+
+ [Label("Slope damping factor")]
+ [Description("The tangent of the slope damping for piezometric height polderSide (for PL3 and PL4)")]
+ [Format("F3")]
+ [Category(WaterCategory)]
+ [PropertyOrder(2, 14)]
+ public virtual double SlopeDampingPiezometricHeightPolderSide
+ {
+ get
+ {
+ return slopeDampingPiezometricHeightPolderSide;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "SlopeDampingPiezometricHeightPolderSide");
+ slopeDampingPiezometricHeightPolderSide = value;
+ DataEventPublisher.AfterChange(this, "SlopeDampingPiezometricHeightPolderSide");
+ }
+ }
+
+ [Label("Dike")]
+ [ReadOnly(true)]
+ [Category(DikeCategory)]
+ [PropertyOrder(1, 4)]
+ public string DikeRingId
+ {
+ get
+ {
+ return dikeRingId;
+ }
+ set
+ {
+ dikeRingId = value;
+ }
+ }
+
+ [Browsable(false)]
+ public string SurfaceLineId
+ {
+ get
+ {
+ return surfaceLineId;
+ }
+ set
+ {
+ surfaceLineId = value;
+ }
+ }
+
+ [Browsable(false)]
+ public string SoildatabaseName
+ {
+ get
+ {
+ return soildatabaseName;
+ }
+ set
+ {
+ soildatabaseName = value;
+ }
+ }
+
+ [Browsable(false)]
+ public SoilList SoilList { get; set; }
+
+ [Browsable(false)]
+ [XmlIgnore]
+ public SoilbaseDB SoilbaseDB
+ {
+ get
+ {
+ if (SoildatabaseName == null || !File.Exists(SoildatabaseName))
+ {
+ throw new DikeException(String.Format("The soil database '{0}' cannot be found", SoildatabaseName));
+ }
+ return SoilbaseDB.Create(SoildatabaseName);
+ }
+ }
+
+ [Browsable(false)]
+ public string MapForSoilGeometries2D
+ {
+ get
+ {
+ return mapForSoilGeometries2D;
+ }
+ set
+ {
+ mapForSoilGeometries2D = value;
+ }
+ }
+
+ [Browsable(false)]
+ public virtual IList Gauges
+ {
+ get
+ {
+ return gauges;
+ }
+ set
+ {
+ gauges = value;
+ }
+ }
+
+ [Browsable(false)]
+ public virtual IList GaugePLLines
+ {
+ get
+ {
+ return gaugePLLines;
+ }
+ set
+ {
+ gaugePLLines = value;
+ }
+ }
+
+ [Browsable(false)]
+ public bool UsesGauges
+ {
+ get
+ {
+ return GaugePLLines != null && GaugePLLines.Count > 0 && Gauges != null;
+ }
+ }
+
+ [Browsable(false)]
+ public double GaugeMissVal { get; set; }
+
+ [Label("Redesign dike height")]
+ [PropertyOrder(7, 1)]
+ [Category(DesignCategory)]
+ public bool RedesignDikeHeight
+ {
+ get
+ {
+ return redesignDikeHeight;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "RedesignDikeHeight");
+ redesignDikeHeight = value;
+ DataEventPublisher.AfterChange(this, "RedesignDikeHeight");
+ }
+ }
+
+ [Label("Redesign dike shoulder")]
+ [PropertyOrder(7, 2)]
+ [Category(DesignCategory)]
+ public bool RedesignDikeShoulder
+ {
+ get
+ {
+ return redesignDikeShoulder;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "RedesignDikeShoulder");
+ redesignDikeShoulder = value;
+ DataEventPublisher.AfterChange(this, "RedesignDikeShoulder");
+ }
+ }
+
+ [Label("Stability design method")]
+ [PropertyOrder(7, 3)]
+ [Category(DesignCategory)]
+ public StabilityDesignMethod StabilityDesignMethod
+ {
+ get
+ {
+ return stabilityDesignMethod;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilityDesignMethod");
+ stabilityDesignMethod = value;
+ DataEventPublisher.AfterChange(this, "StabilityDesignMethod");
+ }
+ }
+
+ [Label("Start value for design of slope")]
+ [PropertyOrder(7, 4)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double SlopeAdaptionStartCotangent
+ {
+ get
+ {
+ return slopeAdaptionStartCotangent;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "SlopeAdaptionStartCotangent");
+ slopeAdaptionStartCotangent = value;
+ DataEventPublisher.AfterChange(this, "SlopeAdaptionStartCotangent");
+ }
+ }
+
+ [Label("End value for design of slope")]
+ [PropertyOrder(7, 5)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double SlopeAdaptionEndCotangent
+ {
+ get
+ {
+ return slopeAdaptionEndCotangent;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "SlopeAdaptionEndCotangent");
+ slopeAdaptionEndCotangent = value;
+ DataEventPublisher.AfterChange(this, "SlopeAdaptionEndCotangent");
+ }
+ }
+
+ [Label("Step value for design of slope")]
+ [PropertyOrder(7, 6)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double SlopeAdaptionStepCotangent
+ {
+ get
+ {
+ return slopeAdaptionStepCotangent;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "SlopeAdaptionStepCotangent");
+ slopeAdaptionStepCotangent = value;
+ DataEventPublisher.AfterChange(this, "SlopeAdaptionStepCotangent");
+ }
+ }
+
+ [Description("Use the value for new width of dike top")]
+ [PropertyOrder(7, 7)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewDikeTopWidth
+ {
+ get
+ {
+ return useNewDikeTopWidth;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewDikeTopWidth");
+ useNewDikeTopWidth = value;
+ DataEventPublisher.AfterChange(this, "UseNewDikeTopWidth");
+ }
+ }
+
+ [Description("Value for new width of dike top")]
+ [PropertyOrder(7, 8)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewDikeTopWidth
+ {
+ get
+ {
+ return newDikeTopWidth;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewDikeTopWidth");
+ newDikeTopWidth = value;
+ DataEventPublisher.AfterChange(this, "NewDikeTopWidth");
+ }
+ }
+
+ [Description("Use the value for new angle of the inside slope")]
+ [PropertyOrder(7, 9)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewDikeSlopeInside
+ {
+ get
+ {
+ return useNewDikeSlopeInside;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewDikeSlopeInside");
+ useNewDikeSlopeInside = value;
+ DataEventPublisher.AfterChange(this, "UseNewDikeSlopeInside");
+ }
+ }
+
+ [Description("Value for new angle of the inside slope")]
+ [PropertyOrder(7, 10)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewDikeSlopeInside
+ {
+ get
+ {
+ return newDikeSlopeInside;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewDikeSlopeInside");
+ newDikeSlopeInside = value;
+ DataEventPublisher.AfterChange(this, "NewDikeSlopeInside");
+ }
+ }
+
+ [Description("Use the value for new angle of the outside slope")]
+ [PropertyOrder(7, 11)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewDikeSlopeOutside
+ {
+ get
+ {
+ return useNewDikeSlopeOutside;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewDikeSlopeOutside");
+ useNewDikeSlopeOutside = value;
+ DataEventPublisher.AfterChange(this, "UseNewDikeSlopeOutside");
+ }
+ }
+
+ [Description("Value for new angle of the outside slope")]
+ [PropertyOrder(7, 12)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewDikeSlopeOutside
+ {
+ get
+ {
+ return newDikeSlopeOutside;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewDikeSlopeOutside");
+ newDikeSlopeOutside = value;
+ DataEventPublisher.AfterChange(this, "NewDikeSlopeOutside");
+ }
+ }
+
+ [Description("Use the value for new angle of the top slope of shoulder")]
+ [PropertyOrder(7, 13)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewShoulderTopSlope
+ {
+ get
+ {
+ return useNewShoulderTopSlope;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewShoulderTopSlope");
+ useNewShoulderTopSlope = value;
+ DataEventPublisher.AfterChange(this, "UseNewShoulderTopSlope");
+ }
+ }
+
+ [Description("Value for new angle of the top slope of shoulder")]
+ [PropertyOrder(7, 14)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewShoulderTopSlope
+ {
+ get
+ {
+ return newShoulderTopSlope;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewShoulderTopSlope");
+ newShoulderTopSlope = value;
+ DataEventPublisher.AfterChange(this, "NewShoulderTopSlope");
+ }
+ }
+
+ [Description("Use the value for new angle of the base slope of shoulder")]
+ [PropertyOrder(7, 15)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewShoulderBaseSlope
+ {
+ get
+ {
+ return useNewShoulderBaseSlope;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewShoulderBaseSlope");
+ useNewShoulderBaseSlope = value;
+ DataEventPublisher.AfterChange(this, "UseNewShoulderBaseSlope");
+ }
+ }
+
+ [Description("Value for new angle of the base slope of shoulder")]
+ [PropertyOrder(7, 16)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewShoulderBaseSlope
+ {
+ get
+ {
+ return newShoulderBaseSlope;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewShoulderBaseSlope");
+ newShoulderBaseSlope = value;
+ DataEventPublisher.AfterChange(this, "NewShoulderBaseSlope");
+ }
+ }
+
+ [Label("Use the value for new allowed height of shoulder as fraction of dike height")]
+ [PropertyOrder(7, 17)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewMaxHeightShoulderAsFraction
+ {
+ get
+ {
+ return useNewMaxHeightShoulderAsFraction;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewMaxHeightShoulderAsFraction");
+ useNewMaxHeightShoulderAsFraction = value;
+ DataEventPublisher.AfterChange(this, "UseNewMaxHeightShoulderAsFraction");
+ }
+ }
+
+ [Description("Value for new allowed height of shoulder as fraction of dike height")]
+ [PropertyOrder(7, 18)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewMaxHeightShoulderAsFraction
+ {
+ get
+ {
+ return newMaxHeightShoulderAsFraction;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewMaxHeightShoulderAsFraction");
+ newMaxHeightShoulderAsFraction = value;
+ DataEventPublisher.AfterChange(this, "NewMaxHeightShoulderAsFraction");
+ }
+ }
+
+ [Description("Use the value for new minimum distance dike toe - start ditch")]
+ [PropertyOrder(7, 19)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewMinDistanceDikeToeStartDitch
+ {
+ get
+ {
+ return useNewMinDistanceDikeToeStartDitch;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewMinDistanceDikeToeStartDitch");
+ useNewMinDistanceDikeToeStartDitch = value;
+ DataEventPublisher.AfterChange(this, "UseNewMinDistanceDikeToeStartDitch");
+ }
+ }
+
+ [Description("Value for new minimum distance dike toe - start ditch")]
+ [PropertyOrder(7, 20)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewMinDistanceDikeToeStartDitch
+ {
+ get
+ {
+ return newMinDistanceDikeToeStartDitch;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewMinDistanceDikeToeStartDitch");
+ newMinDistanceDikeToeStartDitch = value;
+ DataEventPublisher.AfterChange(this, "NewMinDistanceDikeToeStartDitch");
+ }
+ }
+
+ [Description("Use the values for new ditch definition")]
+ [PropertyOrder(7, 21)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public bool UseNewDitchDefinition
+ {
+ get
+ {
+ return useNewDitchDefinition;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "UseNewDitchDefinition");
+ useNewDitchDefinition = value;
+ DataEventPublisher.AfterChange(this, "UseNewDitchDefinition");
+ }
+ }
+
+ [Description("Value for new width of ditch bottom")]
+ [PropertyOrder(7, 22)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewWidthDitchBottom
+ {
+ get
+ {
+ return newWidthDitchBottom;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewWidthDitchBottom");
+ newWidthDitchBottom = value;
+ DataEventPublisher.AfterChange(this, "NewWidthDitchBottom");
+ }
+ }
+
+ [Description("Value for new angle of ditch slopes")]
+ [PropertyOrder(7, 23)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewSlopeAngleDitch
+ {
+ get
+ {
+ return newSlopeAngleDitch;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "newSlopeAngleDitch");
+ newSlopeAngleDitch = value;
+ DataEventPublisher.AfterChange(this, "newSlopeAngleDitch");
+ }
+ }
+
+ [Description("Value for new depth of ditch bottom")]
+ [PropertyOrder(7, 24)]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ public double NewDepthDitch
+ {
+ get
+ {
+ return newDepthDitch;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "NewDepthDitch");
+ newDepthDitch = value;
+ DataEventPublisher.AfterChange(this, "NewDepthDitch");
+ }
+ }
+
+ [ReadOnly(true)]
+ [Validate]
+ public List Scenarios
+ {
+ get
+ {
+ return scenarios;
+ }
+ }
+
+ [Browsable(false)]
+ [XmlIgnore]
+ public static DamProjectType DamProjectType
+ {
+ get
+ {
+ return damProjectType;
+ }
+ set
+ {
+ damProjectType = value;
+ }
+ }
+
+ #region IGeographic Members
+
+ [Label("Zone type")]
+ [Description("Type of zone to be used in stability calculations")]
+ [PropertyOrder(4, 10)]
+ [Category(AllCategory)]
+ public MStabZonesType StabilityZoneType
+ {
+ get
+ {
+ return stabilityZoneType;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilityZoneType");
+ stabilityZoneType = value;
+ DataEventPublisher.AfterChange(this, "StabilityZoneType");
+ }
+ }
+
+ [Label("Forbidden Zone Factor")]
+ [Description("Factor of zone to be used in stability calculations")]
+ [Format("F2")]
+ [Unit(UnitType.None)]
+ [Minimum(0.0)]
+ [Maximum(1.0)]
+ [PropertyOrder(4, 11)]
+ [Category(AllCategory)]
+ public double ForbiddenZoneFactor
+ {
+ get
+ {
+ return forbiddenZoneFactor;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "ForbiddenZoneFactor");
+ forbiddenZoneFactor = value;
+ DataEventPublisher.AfterChange(this, "ForbiddenZoneFactor");
+ }
+ }
+
+ [Label("Zone Area Rest Slope Crest Width")]
+ [Description("Zone Area Rest Slope Crest Width")]
+ [Format("F2")]
+ [Unit(UnitType.Length)]
+ [Minimum(0.1)]
+ [PropertyOrder(4, 12)]
+ [Category(AllCategory)]
+ public double ZoneAreaRestSlopeCrestWidth
+ {
+ get
+ {
+ return zoneAreaRestSlopeCrestWidth;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "ZoneAreaRestSlopeCrestWidth");
+ zoneAreaRestSlopeCrestWidth = value;
+ DataEventPublisher.AfterChange(this, "ZoneAreaRestSlopeCrestWidth");
+ }
+ }
+
+ [XmlIgnore]
+ [Browsable(false)]
+ public double X
+ {
+ get
+ {
+ return XRd;
+ }
+ set
+ {
+ XRd = value;
+ }
+ }
+
+ [XmlIgnore]
+ [Browsable(false)]
+ public double Y
+ {
+ get
+ {
+ return YRd;
+ }
+ set
+ {
+ YRd = value;
+ }
+ }
+
+ ///
+ /// Checks whether the required safety (stability inner slope) is given as that is needed to work with zone areas.
+ ///
+ ///
+ [Validate]
+ public ValidationResult[] IsRequiredSafetySetForZoneTypeArea()
+ {
+ if (stabilityZoneType == MStabZonesType.ZoneAreas)
+ {
+ // For design projects, the safetey must be defined per scenario, not per location
+ if (DamProjectType == DamProjectType.Design && scenarios != null && scenarios.Count > 0)
+ {
+ foreach (var scenario in scenarios)
+ {
+ if (scenario.RequiredSafetyFactorStabilityInnerSlope == null)
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ LocalizationManager.GetTranslatedText(this, "NoRequiredSafetyForZonesScenario"),
+ scenario, "StabilityZoneType", "ZoneTypeSafety", null)
+ };
+ }
+ }
+ }
+ return new ValidationResult[0];
+ }
+
+ [Validate]
+ public ValidationResult[] ValidateDikeEmbankmentMaterial()
+ {
+ if (DamProjectType == DamProjectType.Design &&
+ DamProjectCalculationSpecification.SelectedAnalysisType == AnalysisType.AdaptGeometry &&
+ !HasValidDikeEmbankmentMaterial())
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ LocalizationManager.GetTranslatedText(this, "NoDikeEmbankmentMaterial"),
+ this)
+ };
+ }
+ else
+ {
+ return new ValidationResult[0];
+ }
+ }
+
+ [Validate]
+ public ValidationResult[] ValidateLocationNewDikeTopWidth()
+ {
+ if (DamProjectType == DamProjectType.Design)
+ {
+ if ((UseNewDikeTopWidth) && (NewDikeTopWidth < newDikeTopWidthMinValue))
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeTopWidthRangeError"), newDikeTopWidthMinValue), this, "NewDikeTopWidth", "AssignMinValue", this)
+ };
+ }
+ }
+ return new ValidationResult[0];
+ }
+
+ [Validate]
+ public ValidationResult[] ValidateLocationNewDikeSlopeInside()
+ {
+ if (DamProjectType == DamProjectType.Design)
+ {
+ if ((UseNewDikeSlopeInside) && (NewDikeSlopeInside < newDikeSlopeInsideMinValue))
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeSlopeInsideRangeError"), newDikeSlopeInsideMinValue), this, "NewDikeSlopeInside", "AssignMinValue", this)
+ };
+ }
+ }
+ return new ValidationResult[0];
+ }
+
+
+ [Validate]
+ public ValidationResult[] ValidateLocationNewDikeSlopeOutside()
+ {
+ if (DamProjectType == DamProjectType.Design)
+ {
+ if ((UseNewDikeSlopeOutside) && (NewDikeSlopeOutside < newDikeSlopeOutsideMinValue))
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ String.Format(LocalizationManager.GetTranslatedText(this, "NewDikeSlopeOutsideRangeError"), newDikeSlopeOutsideMinValue), this, "NewDikeSlopeOutside", "AssignMinValue", this)
+ };
+ }
+ }
+ return new ValidationResult[0];
+ }
+
+ ///
+ /// Validates the use of the penetration length.
+ ///
+ /// Validation result
+ [Validate]
+ public ValidationResult[] ValidateLocationUseOfPenetrationLength()
+ {
+ if (PenetrationLength > 0)
+ {
+ // It may be used on 1D geometries
+ if (!String.IsNullOrEmpty(this.Segment.GetMostProbableGeometry2DName(FailureMechanismSystemType.StabilityInside)))
+ {
+ // It may be used on 2D geometries only if condition below is true
+ if (this.IntrusionVerticalWaterPressure != IntrusionVerticalWaterPressureType.SemiTimeDependent)
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error, String.Format(LocalizationManager.GetTranslatedText(this, "UseOfPenetrationLengthError"), penetrationLenghtMinValue), this, "PenetrationLength", "AssignMinValue", this)
+ };
+ }
+ }
+ }
+ return new ValidationResult[0];
+ }
+
+ [Validate]
+ public ValidationResult[] ValidateShoulderEmbankmentMaterial()
+ {
+ if (DamProjectType == DamProjectType.Design &&
+ DamProjectCalculationSpecification.SelectedAnalysisType == AnalysisType.AdaptGeometry &&
+ !HasValidShoulderEmbankmentMaterial())
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error, LocalizationManager.GetTranslatedText(this, "NoShoulderEmbankmentMaterial"), this)
+ };
+ }
+ else
+ {
+ return new ValidationResult[0];
+ }
+ }
+
+ ///
+ /// Validates the location has segment.
+ ///
+ ///
+ [Validate]
+ public ValidationResult[] ValidateLocationHasSegment()
+ {
+ if (Segment == null)
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ LocalizationManager.GetTranslatedText(this, "LocationHasNoSegment"),
+ this)
+ };
+ }
+ else
+ {
+ return new ValidationResult[0];
+ }
+ }
+
+ [Validate]
+ public ValidationResult[] ValidateDikeEmbankmentMaterialDefinedIfSurfacelineAboveSoilProfile()
+ {
+ if (IsSurfaceLineAboveSoilProfile() && !HasValidDikeEmbankmentMaterial())
+ {
+ return new[]
+ {
+ new ValidationResult(ValidationResultType.Error,
+ LocalizationManager.GetTranslatedText(this, "NoDikeEmbankmentMaterialAndNeeded"),
+ this)
+ };
+ }
+ else
+ {
+ return new ValidationResult[0];
+ }
+ }
+
+ ///
+ /// Check if DikeEmbankmentMaterial is defined and is available as soil
+ ///
+ ///
+ private bool HasValidDikeEmbankmentMaterial()
+ {
+ return !String.IsNullOrEmpty(DikeEmbankmentMaterial) && GetDikeEmbankmentSoil() != null;
+ }
+
+ ///
+ /// Check if ShoulderEmbankmentMaterial is defined and is available as soil
+ ///
+ ///
+ private bool HasValidShoulderEmbankmentMaterial()
+ {
+ return !String.IsNullOrEmpty(ShoulderEmbankmentMaterial) && GetShoulderEmbankmentSoil() != null;
+ }
+
+ ///
+ /// Determine if surfaceline is higher than any of the 1D soilprofiles
+ ///
+ ///
+ private bool IsSurfaceLineAboveSoilProfile()
+ {
+ bool isSurfaceLineAboveSoilProfile = false;
+ if (Segment != null)
+ {
+ foreach (var soilGeometryProbability in Segment.SoilProfileProbabilities)
+ {
+ SoilProfile1D soilProfile = soilGeometryProbability.SoilProfile;
+ if (soilProfile != null)
+ {
+ isSurfaceLineAboveSoilProfile = isSurfaceLineAboveSoilProfile || (LocalXZSurfaceLine2.Geometry.GetMaxZ() > soilGeometryProbability.SoilProfile.TopLevel);
+ }
+ }
+ }
+ return isSurfaceLineAboveSoilProfile;
+ }
+
+ #endregion
+
+ #region Design parameters
+
+ [Label("Dike emb. material")]
+ [Description("Dike embankment material")]
+ [Category(AllCategory)]
+ [PropertyOrder(5, 1)]
+ public virtual string DikeEmbankmentMaterial
+ {
+ get
+ {
+ return dikeEmbankmentMaterial;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "DikeEmbankmentMaterial");
+ dikeEmbankmentMaterial = value;
+ DataEventPublisher.AfterChange(this, "DikeEmbankmentMaterial");
+ }
+ }
+
+ [Label("Shoulder emb. material")]
+ [Description("Shoulder embankment material")]
+ [Category(DesignCategory)]
+ [PropertyOrder(5, 2)]
+ public virtual string ShoulderEmbankmentMaterial
+ {
+ get
+ {
+ return shoulderEmbankmentMaterial;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "ShoulderEmbankmentMaterial");
+ shoulderEmbankmentMaterial = value;
+ DataEventPublisher.AfterChange(this, "ShoulderEmbankmentMaterial");
+ }
+ }
+
+ [Unit(UnitType.None)]
+ [Label("Shoulder growth slope")]
+ [Description("Shoulder growth slope for stability design")]
+ [Format("F4")]
+ [Category(DesignCategory)]
+ [PropertyOrder(5, 3)]
+ public virtual double StabilityShoulderGrowSlope
+ {
+ get
+ {
+ return stabilityShoulderGrowSlope;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilityShoulderGrowSlope");
+ stabilityShoulderGrowSlope = value;
+ DataEventPublisher.AfterChange(this, "StabilityShoulderGrowSlope");
+ }
+ }
+
+ [Unit(UnitType.Length)]
+ [Label("Shoulder growth delta X")]
+ [Description("Shoulder growth delta X for stability design")]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ [PropertyOrder(5, 4)]
+ public virtual double StabilityShoulderGrowDeltaX
+ {
+ get
+ {
+ return stabilityShoulderGrowDeltaX;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilityShoulderGrowDeltaX");
+ stabilityShoulderGrowDeltaX = value
+ ;
+ DataEventPublisher.AfterChange(this, "StabilityShoulderGrowDeltaX");
+ }
+ }
+
+ [Unit(UnitType.Length)]
+ [Label("Slope adaption delta X")]
+ [Description("Slope adaption delta X for stability design")]
+ [Format("F2")]
+ [Category(DesignCategory)]
+ [PropertyOrder(5, 5)]
+ public virtual double StabilitySlopeAdaptionDeltaX
+ {
+ get
+ {
+ return stabilitySlopeAdaptionDeltaX;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "StabilitySlopeAdaptionDeltaX");
+ stabilitySlopeAdaptionDeltaX = value;
+ DataEventPublisher.AfterChange(this, "StabilitySlopeAdaptionDeltaX");
+ }
+ }
+
+ #endregion
+
+ #region PLLine creation parameters
+
+ ///
+ /// Gets or sets the pl line creation method.
+ ///
+ ///
+ /// The pl line creation method.
+ ///
+ [Unit(UnitType.None)]
+ [Label("PL-Line creation")]
+ [Description("PL-Line creation method")]
+ [Format("F3")]
+ [Category(WaterCategory)]
+ [PropertyOrder(3, 1)]
+ public virtual PLLineCreationMethod PLLineCreationMethod
+ {
+ get
+ {
+ return pLLineCreationMethod;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "PLLineCreationMethod");
+ pLLineCreationMethod = value;
+ DataEventPublisher.AfterChange(this, "PLLineCreationMethod");
+ }
+ }
+
+ ///
+ /// Gets or sets the damping factor pl 3.
+ ///
+ ///
+ /// The damping factor pl 3.
+ ///
+ [Unit(UnitType.None)]
+ [Label("Damping factor PL3")]
+ [Description("Damping factor PL3")]
+ [Format("F3")]
+ [Category(WaterCategory)]
+ [PropertyOrder(2, 11)]
+ [Minimum(0.0)]
+ [Maximum(1.0)]
+ public virtual double DampingFactorPL3
+ {
+ get
+ {
+ return dampingFactorPL3;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "DampingFactorPL3");
+ dampingFactorPL3 = value;
+ DataEventPublisher.AfterChange(this, "DampingFactorPL3");
+ }
+ }
+
+ ///
+ /// Gets or sets the damping factor pl 4.
+ ///
+ ///
+ /// The damping factor pl 4.
+ ///
+ [Unit(UnitType.None)]
+ [Label("Damping factor PL4")]
+ [Description("Damping factor PL4")]
+ [Format("F3")]
+ [Category(WaterCategory)]
+ [PropertyOrder(2, 12)]
+ [Minimum(0.0)]
+ [Maximum(1.0)]
+ public virtual double DampingFactorPL4
+ {
+ get
+ {
+ return dampingFactorPL4;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "DampingFactorPL4");
+ dampingFactorPL4 = value;
+ DataEventPublisher.AfterChange(this, "DampingFactorPL4");
+ }
+ }
+
+ ///
+ /// Gets or sets the length of the penetration.
+ ///
+ ///
+ /// The length of the penetration.
+ ///
+ [Unit(UnitType.Length)]
+ [Label("Penetration length")]
+ [Description("Penetration Length (for PL4)")]
+ [Format("F3")]
+ [Category(WaterCategory)]
+ [Minimum(0.0)]
+ [PropertyOrder(2, 13)]
+ public virtual double PenetrationLength
+ {
+ get
+ {
+ return penetrationLength;
+ }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, "PenetrationLength");
+ penetrationLength = value;
+ DataEventPublisher.AfterChange(this, "PenetrationLength");
+ }
+ }
+
+ ///
+ /// Gets or sets the intrusion vertical water pressure.
+ ///
+ ///
+ /// The intrusion vertical water pressure.
+ ///
+ [Category(WaterCategory)]
+ [PropertyOrder(3, 18)]
+ public IntrusionVerticalWaterPressureType? IntrusionVerticalWaterPressure
+ {
+ get { return intrusionVerticalWaterPressure; }
+ set
+ {
+ DataEventPublisher.BeforeChange(this, x => x.IntrusionVerticalWaterPressure);
+ intrusionVerticalWaterPressure = value;
+ DataEventPublisher.AfterChange(this, x => x.IntrusionVerticalWaterPressure);
+ }
+ }
+ #endregion
+
+ ///
+ /// Sets the default values
+ ///
+ public void SetDefaultValues()
+ {
+ zoneAreaRestSlopeCrestWidth = 3.0;
+ }
+
+ ///
+ /// Assemble a list of key/value pairs with the relevant parameters for the location
+ ///
+ ///
+ public Dictionary GetParametersAsNameValuePairs()
+ {
+ var numberFormatInfo = new NumberFormatInfo();
+ numberFormatInfo.NumberDecimalSeparator = ".";
+ var nameValuePairs = new Dictionary();
+ nameValuePairs.Add(LocationParameterNames.DikeRingId, DikeRingId);
+ nameValuePairs.Add(LocationParameterNames.SurfaceLineId, SurfaceLineId);
+ nameValuePairs.Add(LocationParameterNames.Description, Description);
+ nameValuePairs.Add(LocationParameterNames.XRd, XRd.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.YRd, YRd.ToString(numberFormatInfo));
+ if (Segment != null)
+ {
+ nameValuePairs.Add(LocationParameterNames.SegmentId, Segment.Name);
+ }
+ else
+ {
+ nameValuePairs.Add(LocationParameterNames.SegmentId, SegmentId);
+ }
+ if (SurfaceLine2 != null)
+ {
+ nameValuePairs[LocationParameterNames.SurfaceLineId] = SurfaceLine2.Name;
+ }
+ if (PL1Line != null)
+ {
+ nameValuePairs.Add(LocationParameterNames.PL1LineId, PL1Line.Name);
+ }
+ nameValuePairs.Add(LocationParameterNames.XSoilGeometry2DOrigin, XSoilGeometry2DOrigin.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.DikeEmbankmentMaterial, DikeEmbankmentMaterial);
+ nameValuePairs.Add(LocationParameterNames.ShoulderEmbankmentMaterial, ShoulderEmbankmentMaterial);
+ nameValuePairs.Add(LocationParameterNames.DampingFactorPL3, DampingFactorPL3.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.DampingFactorPL4, DampingFactorPL4.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.PenetrationLength, PenetrationLength.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.PLLineCreationMethod, PLLineCreationMethod.ToString());
+ if (IntrusionVerticalWaterPressure.HasValue)
+ {
+ nameValuePairs.Add(LocationParameterNames.IntrusionVerticalWaterPressure,
+ IntrusionVerticalWaterPressure.Value.ToString());
+ }
+ nameValuePairs.Add(LocationParameterNames.StabilityShoulderGrowSlope, StabilityShoulderGrowSlope.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.StabilityShoulderGrowDeltaX, StabilityShoulderGrowDeltaX.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.StabilitySlopeAdaptionDeltaX, StabilitySlopeAdaptionDeltaX.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.TrafficLoad, TrafficLoad.ToString(numberFormatInfo));
+ if (TL_DegreeOfConsolidation.HasValue)
+ {
+ nameValuePairs.Add(LocationParameterNames.TL_DegreeOfConsolidation, TL_DegreeOfConsolidation.Value.ToString(numberFormatInfo));
+ }
+ nameValuePairs.Add(LocationParameterNames.MinimalCircleDepth, MinimalCircleDepth.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.DistanceToEntryPoint, DistanceToEntryPoint.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.StabilityZoneType, StabilityZoneType.ToString());
+ nameValuePairs.Add(LocationParameterNames.ForbiddenZoneFactor, ForbiddenZoneFactor.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.ZoneAreaRestSlopeCrestWidth, ZoneAreaRestSlopeCrestWidth.ToString(numberFormatInfo));
+
+ nameValuePairs.Add(LocationParameterNames.SlopeDampingPiezometricHeightPolderSide, SlopeDampingPiezometricHeightPolderSide.ToString(numberFormatInfo));
+
+ nameValuePairs.Add(LocationParameterNames.StabilityDesignMethod, StabilityDesignMethod.ToString());
+ nameValuePairs.Add(LocationParameterNames.SlopeAdaptionStartCotangent, SlopeAdaptionStartCotangent.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.SlopeAdaptionEndCotangent, SlopeAdaptionEndCotangent.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.SlopeAdaptionStepCotangent, SlopeAdaptionStepCotangent.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewDepthDitch, NewDepthDitch.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewDikeSlopeInside, NewDikeSlopeInside.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewDikeSlopeOutside, NewDikeSlopeOutside.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewDikeTopWidth, NewDikeTopWidth.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewMaxHeightShoulderAsFraction, NewMaxHeightShoulderAsFraction.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewMinDistanceDikeToeStartDitch, NewMinDistanceDikeToeStartDitch.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewShoulderBaseSlope, NewShoulderBaseSlope.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewShoulderTopSlope, NewShoulderTopSlope.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewSlopeAngleDitch, NewSlopeAngleDitch.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.NewWidthDitchBottom, NewWidthDitchBottom.ToString(numberFormatInfo));
+ nameValuePairs.Add(LocationParameterNames.UseNewDikeSlopeInside, UseNewDikeSlopeInside.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewDikeSlopeOutside, UseNewDikeSlopeOutside.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewDikeTopWidth, UseNewDikeTopWidth.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewDitchDefinition, UseNewDitchDefinition.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewMaxHeightShoulderAsFraction, UseNewMaxHeightShoulderAsFraction.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewMinDistanceDikeToeStartDitch, UseNewMinDistanceDikeToeStartDitch.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewShoulderBaseSlope, UseNewShoulderBaseSlope.ToString());
+ nameValuePairs.Add(LocationParameterNames.UseNewShoulderTopSlope, UseNewShoulderTopSlope.ToString());
+ return nameValuePairs;
+ }
+
+ public void AddNewSensorData()
+ {
+ var factory = new SensorFactory();
+ SensorLocation = factory.CreateSensorLocation(this);
+ }
+
+ [Validate]
+ public ValidationResult[] AscendingLocalXZSurfaceLine()
+ {
+ if (LocalXZSurfaceLine2 != null)
+ {
+ return new SurfaceLine2Validator().ValidateCharacteristicPointsAreOrdered(LocalXZSurfaceLine2).ToArray();
+ }
+ else
+ {
+ return new ValidationResult[0];
+ }
+ }
+
+ ///
+ /// Gets the dike embankment soil.
+ ///
+ ///
+ public Soil GetDikeEmbankmentSoil()
+ {
+ if (String.IsNullOrEmpty(SoildatabaseName) || String.IsNullOrEmpty(DikeEmbankmentMaterial))
+ {
+ return null;
+ }
+ else
+ {
+ return SoilList.GetSoilByName(DikeEmbankmentMaterial);
+ }
+ }
+
+ ///
+ /// Gets the shoulder embankment soil.
+ ///
+ ///
+ public Soil GetShoulderEmbankmentSoil()
+ {
+ if (String.IsNullOrEmpty(SoildatabaseName) || String.IsNullOrEmpty(ShoulderEmbankmentMaterial))
+ {
+ return null;
+ }
+ else
+ {
+ return SoilList.GetSoilByName(ShoulderEmbankmentMaterial);
+ }
+ }
+
+ ///
+ /// Gets the most probable profile. If there are no elements in the it returns null
+ /// and leave the handling over to the caller
+ ///
+ /// The soil profile
+ public SoilProfile1D GetMostProbableProfile(FailureMechanismSystemType? segmentFailureMechanismType)
+ {
+ if (Segment == null)
+ {
+ throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
+ }
+
+ return Segment.GetMostProbableProfile(segmentFailureMechanismType);
+ }
+
+ ///
+ /// Gets the most probable profile. If there are no elements in the it returns null
+ /// and leave the handling over to the caller
+ ///
+ /// The soil profile
+ public string GetMostProbableGeometry2DName(FailureMechanismSystemType? segmentFailureMechanismType)
+ {
+ if (Segment == null)
+ {
+ throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
+ }
+
+ return Segment.GetMostProbableGeometry2DName(segmentFailureMechanismType);
+ }
+
+ ///
+ /// Gets the soil profile probability.
+ ///
+ /// The soil profile.
+ /// Type of the segment failure mechanism.
+ ///
+ ///
+ public double? GetSoilProfileProbability(SoilProfile1D soilProfile, FailureMechanismSystemType? segmentFailureMechanismType)
+ {
+ if (Segment == null)
+ {
+ throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
+ }
+
+ return Segment.GetSoilProfileProbability(soilProfile, segmentFailureMechanismType);
+ }
+
+ ///
+ /// Gets the soil geometry2 d probability.
+ ///
+ /// Name of the soil geometry2 d.
+ /// Type of the segment failure mechanism.
+ ///
+ ///
+ public double? GetSoilGeometry2DProbability(string soilGeometry2DName, FailureMechanismSystemType? segmentFailureMechanismType)
+ {
+ if (Segment == null)
+ {
+ throw new ArgumentNullException(String.Format(ThrowHelper.GetResourceString(StringResourceNames.LocationHasNoSegment), Name));
+ }
+
+ return Segment.GetSoilGeometry2DProbability(soilGeometry2DName, segmentFailureMechanismType);
+ }
+
+ ///
+ /// Gets a sorted list of soil geometry probabilities for a certain failure mechanism type
+ ///
+ /// The failure mechanism type
+ /// List of geometry probabilities
+ public List GetGeometryProbabilities(FailureMechanismSystemType failureMechanismType)
+ {
+ var geometryProbabilities = new List();
+ if (Segment != null)
+ {
+ foreach (var existingGeometryProbability in Segment.SoilProfileProbabilities)
+ {
+ if (existingGeometryProbability.SegmentFailureMechanismType.HasValue && existingGeometryProbability.SegmentFailureMechanismType.Value == failureMechanismType)
+ {
+ geometryProbabilities.Add(existingGeometryProbability);
+ }
+ }
+
+ geometryProbabilities.Sort();
+ }
+ return geometryProbabilities;
+ }
+
+ ///
+ /// Gets the combination of the surface line and soil profile for a given failure mechanism and index
+ ///
+ /// Failure mechanism type
+ /// The index indicates the ranking in probability
+ /// The probability of the soil surface profile
+ /// The soil surface profile
+ public SoilSurfaceProfile GetSoilSurfaceProfile(FailureMechanismSystemType failureMechanismType, int index, out double probability)
+ {
+ List soilGeometryProbabilities = GetGeometryProbabilities(failureMechanismType);
+ SoilGeometryProbability soilGeometryProbability = index < soilGeometryProbabilities.Count ? soilGeometryProbabilities[index] : null;
+
+ SoilProfile1D originalProfile = soilGeometryProbability != null ? soilGeometryProbability.SoilProfile : null;
+ probability = soilGeometryProbability != null ? soilGeometryProbability.Probability : 0;
+
+ if (soilSurfaceProfile == null || originalProfile == null ||
+ !(soilSurfaceProfile.SoilProfile.Name == originalProfile.Name &&
+ soilSurfaceProfile.SoilProfile.LayerCount == originalProfile.LayerCount) ||
+ !(soilSurfaceProfile.SurfaceLine2.Name == LocalXZSurfaceLine2.Name &&
+ soilSurfaceProfile.SurfaceLine2.CharacteristicPoints.Count == LocalXZSurfaceLine2.CharacteristicPoints.Count))
+ {
+ Soil dikeSoil = SoilList.GetSoilByName(DikeEmbankmentMaterial);
+
+ if (soilSurfaceProfile == null)
+ {
+ soilSurfaceProfile = new SoilSurfaceProfile();
+ }
+ // Do not assign the orginal soilprofile, because it will be changed in the class SoilSurfaceProfile
+ SoilProfile1D soilProfile1D;
+ if (originalProfile == null)
+ {
+ soilProfile1D = new SoilProfile1D(SurfaceLine2.Geometry.GetMaxZ(), -10, dikeSoil);
+ }
+ else
+ {
+ soilProfile1D = new SoilProfile1D();
+ soilProfile1D.Assign(originalProfile);
+ }
+ soilSurfaceProfile.SoilProfile = soilProfile1D;
+ soilSurfaceProfile.SurfaceLine2 = LocalXZSurfaceLine2;
+ soilSurfaceProfile.DikeEmbankmentMaterial = GetDikeEmbankmentSoil();
+
+ foreach (SoilLayer2D layer in soilSurfaceProfile.Surfaces)
+ {
+ if (layer.Soil == null)
+ {
+ layer.Soil = dikeSoil;
+ }
+ }
+ }
+
+ return soilSurfaceProfile;
+ }
+
+ public void AlignBoundaryPointsOfPL1LineWithAdaptedSurfaceLine(SurfaceLine2 adaptedSurfaceLine)
+ {
+ if ((LocalXZPL1Line != null) && (LocalXZPL1Line.Points.Count > 1))
+ {
+ GeometryPoint lastPointPL1Line = LocalXZPL1Line.Points.Last();
+ GeometryPoint lastPointSurfaceLine = adaptedSurfaceLine.Geometry.Points.Last();
+ lastPointPL1Line.X = lastPointSurfaceLine.X;
+ GeometryPoint firstPointPL1Line = LocalXZPL1Line.Points.First();
+ GeometryPoint firstPointSurfaceLine = adaptedSurfaceLine.Geometry.Points.First();
+ firstPointPL1Line.X = firstPointSurfaceLine.X;
+ }
+ }
+
+ public void SetParameterFromNameValuePair(string parameterName, string parameterValue)
+ {
+ var numberFormatInfo = new NumberFormatInfo();
+ numberFormatInfo.NumberDecimalSeparator = ".";
+ if (parameterName.Equals(LocationParameterNames.DikeRingId))
+ {
+ DikeRingId = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.Description))
+ {
+ Description = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.XRd))
+ {
+ XRd = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.YRd))
+ {
+ YRd = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.SegmentId))
+ {
+ SegmentId = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.SurfaceLineId))
+ {
+ SurfaceLineId = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.XSoilGeometry2DOrigin))
+ {
+ XSoilGeometry2DOrigin = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.DikeEmbankmentMaterial))
+ {
+ DikeEmbankmentMaterial = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.ShoulderEmbankmentMaterial))
+ {
+ ShoulderEmbankmentMaterial = parameterValue;
+ }
+ if (parameterName.Equals(LocationParameterNames.DampingFactorPL3))
+ {
+ DampingFactorPL3 = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.DampingFactorPL4))
+ {
+ DampingFactorPL4 = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.PenetrationLength))
+ {
+ PenetrationLength = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.PLLineCreationMethod))
+ {
+ PLLineCreationMethod = (PLLineCreationMethod) Enum.Parse(typeof(PLLineCreationMethod), parameterValue);
+ }
+ if (parameterName.Equals(LocationParameterNames.IntrusionVerticalWaterPressure))
+ {
+ IntrusionVerticalWaterPressure =
+ (IntrusionVerticalWaterPressureType)
+ Enum.Parse(typeof (IntrusionVerticalWaterPressureType), parameterValue);
+
+ }
+ if (parameterName.Equals(LocationParameterNames.StabilityShoulderGrowSlope))
+ {
+ StabilityShoulderGrowSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.StabilityShoulderGrowDeltaX))
+ {
+ StabilityShoulderGrowDeltaX = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.StabilitySlopeAdaptionDeltaX))
+ {
+ StabilitySlopeAdaptionDeltaX = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.TrafficLoad))
+ {
+ TrafficLoad = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.TL_DegreeOfConsolidation))
+ {
+ TL_DegreeOfConsolidation = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.MinimalCircleDepth))
+ {
+ MinimalCircleDepth = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.DistanceToEntryPoint))
+ {
+ DistanceToEntryPoint = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.StabilityZoneType))
+ {
+ StabilityZoneType = (MStabZonesType) Enum.Parse(typeof(MStabZonesType), parameterValue);
+ }
+ if (parameterName.Equals(LocationParameterNames.ForbiddenZoneFactor))
+ {
+ ForbiddenZoneFactor = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.ZoneAreaRestSlopeCrestWidth))
+ {
+ ZoneAreaRestSlopeCrestWidth = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+
+ if (parameterName.Equals(LocationParameterNames.SlopeDampingPiezometricHeightPolderSide))
+ {
+ SlopeDampingPiezometricHeightPolderSide = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+
+ if (parameterName.Equals(LocationParameterNames.StabilityDesignMethod))
+ {
+ StabilityDesignMethod = (StabilityDesignMethod) Enum.Parse(typeof(StabilityDesignMethod), parameterValue);
+ }
+ if (parameterName.Equals(LocationParameterNames.SlopeAdaptionStartCotangent))
+ {
+ SlopeAdaptionStartCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.SlopeAdaptionEndCotangent))
+ {
+ SlopeAdaptionEndCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.SlopeAdaptionStepCotangent))
+ {
+ SlopeAdaptionStepCotangent = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+
+ if (parameterName.Equals(LocationParameterNames.NewDepthDitch))
+ {
+ NewDepthDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewDikeSlopeInside))
+ {
+ NewDikeSlopeInside = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewDikeSlopeOutside))
+ {
+ NewDikeSlopeOutside = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewDikeTopWidth))
+ {
+ NewDikeTopWidth = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewMaxHeightShoulderAsFraction))
+ {
+ NewMaxHeightShoulderAsFraction = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewMinDistanceDikeToeStartDitch))
+ {
+ NewMinDistanceDikeToeStartDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewShoulderBaseSlope))
+ {
+ NewShoulderBaseSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewShoulderTopSlope))
+ {
+ NewShoulderTopSlope = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewSlopeAngleDitch))
+ {
+ NewSlopeAngleDitch = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.NewWidthDitchBottom))
+ {
+ NewWidthDitchBottom = Convert.ToDouble(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewDikeSlopeInside))
+ {
+ UseNewDikeSlopeInside = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewDikeSlopeOutside))
+ {
+ UseNewDikeSlopeOutside = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewDikeTopWidth))
+ {
+ UseNewDikeTopWidth = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewDitchDefinition))
+ {
+ UseNewDitchDefinition = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewMaxHeightShoulderAsFraction))
+ {
+ UseNewMaxHeightShoulderAsFraction = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewMinDistanceDikeToeStartDitch))
+ {
+ UseNewMinDistanceDikeToeStartDitch = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewShoulderBaseSlope))
+ {
+ UseNewShoulderBaseSlope = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ if (parameterName.Equals(LocationParameterNames.UseNewShoulderTopSlope))
+ {
+ UseNewShoulderTopSlope = Convert.ToBoolean(parameterValue, numberFormatInfo);
+ }
+ }
+
+ #region IVisibleEnabled Members
+
+ public bool IsEnabled(string property)
+ {
+ return true;
+ }
+
+ public bool IsVisible(string property)
+ {
+ var isDesign = IsDesign();
+
+ // TODO: These string literals below should be replaced with the constants defined in LocationParameterNames
+ switch (property)
+ {
+ case "ShoulderEmbankmentMaterial":
+ return isDesign;
+ case "StabilityShoulderGrowSlope":
+ return isDesign;
+ case "StabilityShoulderGrowDeltaX":
+ return isDesign;
+ case "StabilitySlopeAdaptionDeltaX":
+ return isDesign;
+ case "IntrusionVerticalWaterPressure":
+ return true;
+ case "RedesignDikeHeight":
+ return isDesign;
+ case "RedesignDikeShoulder":
+ return isDesign;
+
+ // these will always be shown
+ case "StabilityDesignMethod":
+ return true;
+ case "SlopeAdaptionStartCotangent":
+ return true;
+ case "SlopeAdaptionEndCotangent":
+ return true;
+ case "SlopeAdaptionStepCotangent":
+ return true;
+ case "Name":
+ return true;
+ case "XRd":
+ return true;
+ case "YRd":
+ return true;
+ case "DikeRingId":
+ return true;
+ case "SegmentId":
+ return true;
+ case "Description":
+ return true;
+ case "TrafficLoad":
+ return true;
+ case "TL_DegreeOfConsolidation":
+ return true;
+ case "DampingFactorPL3":
+ return true;
+ case "DampingFactorPL4":
+ return true;
+ case "PenetrationLength":
+ return true;
+ case "SlopeDampingPiezometricHeightPolderSide":
+ return true;
+ case "PLLineCreationMethod":
+ return true;
+ case "MinimalCircleDepth":
+ return true;
+ case "StabilityZoneType":
+ return true;
+ case "DikeEmbankmentMaterial":
+ return true;
+
+ case "DistanceToEntryPoint":
+ return isDesign;
+ case "HasSensorData":
+ return false;
+ case "XRdDikeLine":
+ return false;
+ // The following design parameters are only visible for design option and when that design option does not involve the special Rijnland option.
+ case "NewDikeTopWidth":
+ case "UseNewDikeTopWidth":
+ case "NewDikeSlopeInside":
+ case "UseNewDikeSlopeInside":
+ case "NewDikeSlopeOutside":
+ case "UseNewDikeSlopeOutside":
+ case "NewShoulderTopSlope":
+ case "UseNewShoulderTopSlope":
+ case "NewShoulderBaseSlope":
+ case "UseNewShoulderBaseSlope":
+ case "NewMaxHeightShoulderAsFraction":
+ case "UseNewMaxHeightShoulderAsFraction":
+ case "NewMinDistanceDikeToeStartDitch":
+ case "UseNewMinDistanceDikeToeStartDitch":
+ case "UseNewDitchDefinition":
+ case "NewWidthDitchBottom":
+ case "NewDepthDitch":
+ case "NewSlopeAngleDitch":
+ return isDesign && StabilityDesignMethod != StabilityDesignMethod.SlopeAdaptionBeforeShoulderAdaption;
+ default:
+ return true;
+ }
+ }
+
+ private bool IsDesign()
+ {
+ bool isDesign = (DamProjectType == DamProjectType.Design);
+ return isDesign;
+ }
+
+ private bool ArePlLineCreationExpertKnowledgeParametersNeeded()
+ {
+ bool arePlLineCreationExpertKnowledgeParametersNeeded = PLLineCreationMethod ==
+ PLLineCreationMethod.ExpertKnowledgeRRD ||
+ PLLineCreationMethod ==
+ PLLineCreationMethod.GaugesWithFallbackToExpertKnowledgeRRD;
+ return arePlLineCreationExpertKnowledgeParametersNeeded;
+ }
+
+ #endregion
+
+ public override string ToString()
+ {
+ return Name;
+ }
+
+ public void Dispose()
+ {
+ if (surfaceLine != null)
+ {
+ surfaceLine.Dispose();
+ }
+ if (LocalXZSurfaceLine2 != null)
+ {
+ LocalXZSurfaceLine2.Dispose();
+ }
+ }
+
+ public ICollection GetDomain(string property)
+ {
+ switch (property)
+ {
+ case "PLLineCreationMethod":
+ return new[]
+ {
+ PLLineCreationMethod.ExpertKnowledgeRRD,
+ PLLineCreationMethod.ExpertKnowledgeLinearInDike,
+ };
+ case "IntrusionVerticalWaterPressure":
+ return new[]
+ {
+ this.Translate("Standard"),
+ this.Translate("Linear"),
+ this.Translate("FullHydroStatic"),
+ this.Translate("HydroStatic"),
+ this.Translate("SemiTimeDependent")
+ };
+ default:
+ return null;
+ }
+ }
+
+ public void Repair(object subject, string property, string id)
+ {
+ if (subject is Location)
+ {
+ if (id == "AssignMinValue" && property == "NewDikeTopWidth")
+ {
+ NewDikeTopWidth = newDikeTopWidthMinValue;
+ }
+ if (id == "AssignMinValue" && property == "NewDikeSlopeInside")
+ {
+ NewDikeSlopeInside = newDikeSlopeInsideMinValue;
+ }
+ if (id == "AssignMinValue" && property == "NewDikeSlopeOutside")
+ {
+ NewDikeSlopeOutside = newDikeSlopeOutsideMinValue;
+ }
+ if (id == "AssignMinValue" && property == "PenetrationLength")
+ {
+ PenetrationLength = penetrationLenghtMinValue;
+ }
+ }
+ }
+
+ public string GetRepairDescription(object subject, string property, string id)
+ {
+ if (id == "ZoneTypeSafety" && property == "StabilityZoneType")
+ {
+ return LocalizationManager.GetTranslatedText(this, "NoRequiredSafetyForZonesRepair");
+ }
+ if (id == "AssignMinValue")
+ {
+ return LocalizationManager.GetTranslatedText(this, "AssignMinValue");
+ }
+ if (id == "AssignMaxValue")
+ {
+ return LocalizationManager.GetTranslatedText(this, "AssignMaxValue");
+ }
+ return "";
+ }
+
+ #region Backwards compatibility
+
+ private SurfaceLine surfaceLine;
+
+ [Obsolete("Do not use this property; Only exists for backwards compatibility.", true)]
+ [Browsable(false)]
+ public virtual SurfaceLine LocalXZSurfaceLine
+ {
+ get
+ {
+ return null;
+ }
+ set
+ {
+ // Convert persisted 'old style surfaceline' into the new format, and discard the old one.
+ LocalXZSurfaceLine2 = new OldSurfaceLineToNewConverter().Convert(value);
+ value.Dispose();
+ }
+ }
+
+ ///
+ /// Gets or sets the surface line
+ ///
+ /// Aggregate relationship from .
+ [Browsable(false)]
+ [Obsolete("Do not use this property; Exists only for backwards compatibility.", true)]
+ public virtual SurfaceLine SurfaceLine
+ {
+ get
+ {
+ return surfaceLine;
+ }
+ set
+ {
+ surfaceLine = value;
+ }
+ }
+
+ ///
+ /// Allows this location instance to update its
+ /// property if an old-style surfaceline was persisted.
+ ///
+ /// The potential replacement candidate for a persisted
+ /// old-style surfaceline.
+ public void SetNewSurfaceLineIfMatchesWithOldPersistedSurfaceLine(SurfaceLine2 otherSurfaceline)
+ {
+ if (surfaceLine != null && Equals(otherSurfaceline.Name, surfaceLine.Name))
+ {
+ SurfaceLine2 = otherSurfaceline;
+
+ surfaceLine.Dispose();
+ surfaceLine = null;
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSeriesProcessor.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSeriesProcessor.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/TimeSeriesProcessor.cs (revision 3305)
@@ -0,0 +1,199 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using Deltares.Standard.Application;
+
+namespace Deltares.Dam.Data
+{
+ public abstract class TimeSeriesProcessor
+ {
+ internal readonly static LogHelper Logger = LogHelper.Create("Time Series Processor");
+
+ #region Constants
+
+ ///
+ /// Defines the default output file
+ ///
+ private const string DefaultOutputFileName = "output.xml";
+
+ /// e
+ /// Defines the water level location id used in the FEWS time serie
+ ///
+ public const string WaterLevelInputLocationID = "outside";
+
+ ///
+ /// Defines the parameter id of the water level defined in the FEWS time serie
+ ///
+ public const string WaterLevelInputParameterID = "Waterlevel";
+
+ ///
+ /// Defines the parameter id for water pressure used in the FEWS time serie
+ ///
+ public const string WaterPressureParameterID = "Waterpressure";
+
+ ///
+ /// Defines the sensor state missing value
+ ///
+ internal const double MissingValue = -999;
+
+ #endregion
+
+ public ICalculator Calculator { protected get; set; }
+
+ ///
+ /// Gets or sets the output parameter ID.
+ ///
+ /// This name or ID is used in the output (FEWS) time series
+ ///
+ /// The output parameter ID.
+ ///
+ public IEnumerable OutputParameters { get; set; }
+
+ ///
+ /// Sets the input time series, used in the calculations
+ ///
+ public TimeSerieCollection InputTimeSeriesCollection { protected get; set; }
+
+ ///
+ /// Gets or sets the output location ID colletion used for creating the output time series
+ ///
+ public virtual IEnumerable OutputLocations { get; set; }
+
+ ///
+ /// Gets or the output time series
+ ///
+ public TimeSerieCollection OutputTimeSeriesCollection { get; set; }
+
+ ///
+ /// Resets the monitoring point list
+ ///
+ public virtual void Initialize()
+ {
+ if (OutputTimeSeriesCollection == null)
+ OutputTimeSeriesCollection = InputTimeSeriesCollection.GetShallowCopy();
+ else
+ OutputTimeSeriesCollection.Clear();
+ }
+
+ ///
+ /// Loads the input time series.
+ ///
+ /// Name of the file.
+ public void LoadInputTimeSeries(string fileName)
+ {
+ ThrowHelper.ThrowIfFileNameNullOrEmpty(fileName);
+ try
+ {
+ // load the input time serie containing all water levels
+ InputTimeSeriesCollection = TimeSerieCollection.LoadFromFile(fileName);
+ }
+ catch (Exception e)
+ {
+ throw new InvalidOperationException("There was an error loading the input time series", e);
+ }
+ }
+
+ ///
+ /// Saves the output time series to the specified file
+ ///
+ ///
+ /// The output file that will contain the monitored and calculated results for each time entry
+ public void SaveResultsToFile(string fileName)
+ {
+ if (OutputTimeSeriesCollection == null)
+ throw new InvalidOperationException("No output time series collection to write");
+
+ if (string.IsNullOrWhiteSpace(fileName))
+ {
+ fileName = DefaultOutputFileName;
+ }
+
+ // save the time serie to the output file
+ OutputTimeSeriesCollection.Save(fileName);
+ }
+
+ ///
+ /// Processes the FEWS input time series files to ouput
+ /// time series
+ ///
+ public virtual void Process()
+ {
+ if (InputTimeSeriesCollection == null)
+ return;
+
+ if (OutputTimeSeriesCollection == null)
+ throw new InvalidOperationException("No output time series set to write the results to");
+
+ if (OutputLocations == null)
+ throw new InvalidOperationException("No output locations set. Set or override OutputLocations");
+
+ if (OutputParameters == null)
+ throw new InvalidOperationException("No output parameters set. Set or override OutputParameters");
+
+ try
+ {
+ // Process the time series entries for each sensor and set the
+ // value in the output time series
+ CreateOutputSeries();
+ }
+ catch (Exception e)
+ {
+ const string message = "There was an error processing the time series";
+ Logger.LogFatal(message, e);
+ throw new InvalidOperationException(message, e);
+ }
+ }
+
+ ///
+ /// Processes the actual input to the output collection. This is a template method which will
+ /// be called in the public ProcessSeries() method (if not overriden)
+ ///
+ protected virtual void CreateOutputSeries()
+ {
+ foreach (var timeSeries in InputTimeSeriesCollection.Series)
+ {
+ foreach (var location in OutputLocations)
+ {
+ foreach (var parameter in OutputParameters)
+ {
+ var copyOfSeries = timeSeries.GetShallowCopy();
+ foreach (var entry in timeSeries.Entries)
+ {
+ // get copy of the input entry
+ var copyOfEntry = entry.GetShallowCopy();
+ // calculate its value
+ copyOfEntry.Value = Calculator.Calculate(location, parameter) ?? MissingValue;
+
+ // set parameter and location id's and add the projected entry to the output
+ copyOfSeries.LocationId = location;
+ copyOfSeries.ParameterId = parameter;
+ copyOfSeries.Entries.Add(copyOfEntry);
+ }
+ // add the output series to the output collection
+ OutputTimeSeriesCollection.Series.Add(copyOfSeries);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/CalculationParametersDefinition.xsd
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/CalculationParametersDefinition.xsd (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Xsd/CalculationParametersDefinition.xsd (revision 3305)
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Scenario.cs
===================================================================
diff -u
--- DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Scenario.cs (revision 0)
+++ DamClients/DamLive/branches/DamLive 19.2/src/DamClientsLibrary/Deltares.Dam.Data/Scenario.cs (revision 3305)
@@ -0,0 +1,1204 @@
+// Copyright (C) Stichting Deltares 2019. All rights reserved.
+//
+// This file is part of the application DAM - Clients Library.
+//
+// DAM - UI is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.ComponentModel;
+using System.Globalization;
+using Deltares.Standard;
+using Deltares.Standard.EventPublisher;
+using Deltares.Standard.Language;
+using System.Collections.Generic;
+using System;
+using System.Collections.Specialized;
+using System.Linq.Expressions;
+using Deltares.Geotechnics.Soils;
+using Deltares.Geotechnics.SurfaceLines;
+using Deltares.Standard.Attributes;
+using Deltares.Standard.Units;
+using Deltares.Standard.Validation;
+
+namespace Deltares.Dam.Data
+{
+
+ ///
+ /// Does uplift occur or not
+ ///
+ public struct UpliftSituation
+ {
+ public bool IsUplift;
+ public double Pl3MinUplift;
+ public double Pl3HeadAdjusted;
+ public double Pl3LocationXMinUplift;
+ public double Pl4MinUplift;
+ public double Pl4HeadAdjusted;
+ public double Pl4LocationXMinUplift;
+ }
+
+ [Serializable]
+ public class ScenarioException : Exception
+ {
+ public ScenarioException(string message) : base(message)
+ {
+ }
+ }
+
+ ///
+ /// Calculation scenario class
+ ///
+ public class Scenario : IVisibleEnabled, IRepairer
+ {
+ #region Performance optimization: Extract expression so it only has to be generated once.
+
+ private static readonly Expression> ExpressionLocationScenarioId = x => x.LocationScenarioID;
+ private static readonly Expression> ExpressionRiverLevel = x => x.RiverLevel;
+ private static readonly Expression> ExpressionRiverLevelLow = x => x.RiverLevelLow;
+ private static readonly Expression> ExpressionDikeTableHeight = x => x.DikeTableHeight;
+ private static readonly Expression> ExpressionRequiredSafetyFactorStabilityInnerSlope = x => x.RequiredSafetyFactorStabilityInnerSlope;
+ private static readonly Expression> ExpressionRequiredSafetyFactorStabilityOuterSlope = x => x.RequiredSafetyFactorStabilityOuterSlope;
+ private static readonly Expression> ExpressionRequiredSafetyFactorPiping = x => x.RequiredSafetyFactorPiping;
+ private static readonly Expression> ExpressionUpliftCriterionPiping = x => x.UpliftCriterionPiping;
+ private static readonly Expression> ExpressionUpliftCriterionStability = x => x.UpliftCriterionStability;
+ private static readonly Expression> ExpressionPlLineOffsetBelowDikeTopAtRiver = x => x.PlLineOffsetBelowDikeTopAtRiver;
+ private static readonly Expression> ExpressionPlLineOffsetBelowDikeTopAtPolder = x => x.PlLineOffsetBelowDikeTopAtPolder;
+ private static readonly Expression> ExpressionPlLineOffsetBelowShoulderBaseInside = x => x.PlLineOffsetBelowShoulderBaseInside;
+ private static readonly Expression> ExpressionPlLineOffsetBelowDikeToeAtPolder = x => x.PlLineOffsetBelowDikeToeAtPolder;
+ private static readonly Expression> ExpressionUsePlLineOffsetBelowDikeCrestMiddle = x => x.UsePlLineOffsetBelowDikeCrestMiddle;
+ private static readonly Expression> ExpressionPlLineOffsetBelowDikeCrestMiddle = x => x.PlLineOffsetBelowDikeCrestMiddle;
+ private static readonly Expression> ExpressionUsePlLineOffsetFactorBelowShoulderCrest = x => x.UsePlLineOffsetFactorBelowShoulderCrest;
+ private static readonly Expression> ExpressionPlLineOffsetFactorBelowShoulderCrest = x => x.PlLineOffsetFactorBelowShoulderCrest;
+ private static readonly Expression> ExpressionHeadPl3 = x => x.HeadPl3;
+ private static readonly Expression> ExpressionHeadPl4 = x => x.HeadPl4;
+ private static readonly Expression> ExpressionPolderLevel = x => x.PolderLevel;
+ private static readonly Expression> ExpressionHeadPl2 = x => x.HeadPl2;
+
+ #endregion
+
+ private CalculationResult calculationResult = CalculationResult.NoRun;
+ private Location location = null;
+ private readonly List calculationResults = new List();
+
+ private Dictionary