Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterIrisTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterIrisTests.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/DataPluginImporterIrisTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterIrisTests.cs (.../trunk/src/Dam/Tests/DataPluginImporterIrisTests.cs) (revision 2168) @@ -1,12 +1,24 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011 Deltares. All rights reserved. -// -// Tom The -// tom.the@deltares.nl -// 05-04-2011 -// Test for importing MGeobase data in DataPlugin -//----------------------------------------------------------------------- +// 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 Deltares.Dam.Data; using Deltares.Dam.Data.DataPlugins.Configuration; using Deltares.Geometry; @@ -56,8 +68,8 @@ public void CanRetrieveCharacteristicPointsFromIris() { const double cToleranceCoordinate = 0.001; - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, location02_4Id); IList surfaceLinePoints = dataPluginImporter.GetSurfaceLinePoints(dikeRingId, surfaceline02_4Id); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs (.../FillXmlInputFromDamUi.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/FillXmlInputFromDamUi.cs (.../FillXmlInputFromDamUi.cs) (revision 2168) @@ -22,14 +22,12 @@ using System; using System.Collections.Generic; using System.Linq; -using Deltares.Dam.Data.Properties; using Deltares.Dam.Data.Sensors; using Deltares.DamEngine.Io; using Deltares.DamEngine.Io.XmlInput; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; using Soil = Deltares.Geotechnics.Soils.Soil; -using SoilProfile1D = Deltares.DamEngine.Io.XmlInput.SoilProfile1D; using SurfaceLine = Deltares.DamEngine.Io.XmlInput.SurfaceLine; namespace Deltares.Dam.Data.DamEngineIo Index: DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/FactoryForStabilityTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/FactoryForStabilityTests.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/TestHelper/FactoryForStabilityTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/FactoryForStabilityTests.cs (.../trunk/src/Dam/Tests/TestHelper/FactoryForStabilityTests.cs) (revision 2168) @@ -1,12 +1,23 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011 Deltares. All rights reserved. -// -// B.S.T.I.M. The -// tom.the@deltares.nl -// 03-02-2011 -// Factory class to create objects for stability tests -//----------------------------------------------------------------------- +// 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 Deltares.Geometry; using Deltares.Geotechnics; @@ -59,7 +70,6 @@ { Location location = new Location(); location.Name = "LocationName"; - location.DamType = DamType.Regional; location.DikeEmbankmentMaterial = "OB1"; location.ShoulderEmbankmentMaterial = "OB2"; location.SoildatabaseName = Path.Combine(@".\", cSoilDatabaseName); @@ -82,7 +92,6 @@ { Scenario scenario = new Scenario(); scenario.Location = location; - scenario.Location.DamType = DamType.Regional; scenario.Location.Name = "LocationName"; scenario.Location.DikeEmbankmentMaterial = "OB1"; scenario.Location.ShoulderEmbankmentMaterial = "OB2"; Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs (.../Location.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Location.cs (.../Location.cs) (revision 2168) @@ -48,7 +48,6 @@ { internal static class LocationParameterNames { - public const string DamType = "DamType"; public const string DikeRingId = "DikeRingId"; public const string Description = "Description"; public const string XRd = "XRd"; @@ -146,7 +145,6 @@ // When adding properties below do not forget to add these properties to SetParameterFromNameValuePair and GetParametersAsNameValuePairs // // ATTENTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - private DamType damType = DamType.Primary; private double dampingFactorPL3 = 0; private double dampingFactorPL4 = 0; private string description = ""; @@ -733,22 +731,6 @@ } } - [Label("Dike type")] - [ReadOnly(true)] - [Category(DikeCategory)] - [PropertyOrder(1, 5)] - public DamType DamType - { - get - { - return damType; - } - set - { - damType = value; - } - } - [Label("Dike")] [ReadOnly(true)] [Category(DikeCategory)] @@ -2228,12 +2210,8 @@ #endregion /// - /// Sets the default values; taking into account which DamProjectType and DamType is set + /// Sets the default values /// - /// Type of the dam. - /// Type of the dam project. - // TODO fix hiding parameter (e.g. use field instead of parameter) - // TODO possibly set this when setting a damType and damProjectType for this location public void SetDefaultValues() { zoneAreaRestSlopeCrestWidth = 3.0; @@ -2248,7 +2226,6 @@ var numberFormatInfo = new NumberFormatInfo(); numberFormatInfo.NumberDecimalSeparator = "."; var nameValuePairs = new Dictionary(); - nameValuePairs.Add(LocationParameterNames.DamType, DamType.ToString()); nameValuePairs.Add(LocationParameterNames.DikeRingId, DikeRingId); nameValuePairs.Add(LocationParameterNames.SurfaceLineId, SurfaceLineId); nameValuePairs.Add(LocationParameterNames.Description, Description); @@ -2588,10 +2565,6 @@ { var numberFormatInfo = new NumberFormatInfo(); numberFormatInfo.NumberDecimalSeparator = "."; - if (parameterName.Equals(LocationParameterNames.DamType)) - { - DamType = (DamType) Enum.Parse(typeof(DamType), parameterValue); - } if (parameterName.Equals(LocationParameterNames.DikeRingId)) { DikeRingId = parameterValue; @@ -2968,8 +2941,6 @@ return true; case "YRd": return true; - case "DamType": - return true; case "DikeRingId": return true; case "SegmentId": Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterDataShapeFilesTests.cs =================================================================== diff -u -r2153 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterDataShapeFilesTests.cs (.../DataPluginImporterDataShapeFilesTests.cs) (revision 2153) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterDataShapeFilesTests.cs (.../DataPluginImporterDataShapeFilesTests.cs) (revision 2168) @@ -36,7 +36,6 @@ { const string DirectoryWithCsvFiles = @"..\..\..\data\Dam\Waterboards\Groot Salland\Binnenwaarts\"; const string DirectoryWithDataShapeFiles = @"..\..\..\data\Dam\Waterboards\Groot Salland\Binnenwaarts\GWS\gis-customdata\ShapeFiles\"; - private const string Location186Id = "dwp18_6"; private const string Location275Id = "dwp27_5"; private const string Location475Id = "dwp47_5"; List srcDataSources; @@ -84,8 +83,8 @@ [Test] public void CanRetrieveTrafficLoadFromDataShapeFile() { - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List { dikeRingId }, null); IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location275Id); var nameValueParameters = locationDetails as NameValueParameter[] ?? locationDetails.ToArray(); @@ -109,8 +108,8 @@ [Category(Categories.Slow)] public void CanRetrievePenetrationLengthFromDataShapeFile() { - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List { dikeRingId }, null); IEnumerable locationDetails = dataPluginImporter.GetLocationDetails(dikeRingId, Location275Id); Assert.AreEqual("-1.5", locationDetails.First( Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/IO/CombineImportedData.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/IO/CombineImportedData.cs (.../CombineImportedData.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/IO/CombineImportedData.cs (.../CombineImportedData.cs) (revision 2168) @@ -24,7 +24,6 @@ using System.Linq; using Deltares.Dam.Data.CsvImporters; -using Deltares.Dam.Data.Importers; using Deltares.Geotechnics.Exception; using Deltares.Geotechnics.GeotechnicalGeometry; using Deltares.Geotechnics.Soils; @@ -669,8 +668,6 @@ location.SurfaceLineId = locationRecord.SurfaceLineId; location.SegmentId = locationRecord.SegmentId; - location.DamType = locationRecord.DamType; - if (locationRecord.DikeRingId != null) { location.DikeRingId = locationRecord.DikeRingId; Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterMGeobaseTests.cs =================================================================== diff -u -r1498 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterMGeobaseTests.cs (.../DataPluginImporterMGeobaseTests.cs) (revision 1498) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterMGeobaseTests.cs (.../DataPluginImporterMGeobaseTests.cs) (revision 2168) @@ -59,7 +59,7 @@ // Check if soil materials available string dikeRingId = "AutoCreate"; var dikeRingIds = new List {dikeRingId}; - dataMGBPluginImporter.ImportDataForDikeRings(dikeRingIds, DamType.Primary, null); + dataMGBPluginImporter.ImportDataForDikeRings(dikeRingIds, null); IEnumerable soil1DIdList = dataMGBPluginImporter.GetSoilIdList(dikeRingId); Assert.AreEqual(27, soil1DIdList.Count()); IEnumerable soilDetails = dataMGBPluginImporter.GetSoilDetails(dikeRingId, soilKleiDuin); @@ -75,7 +75,7 @@ { string dikeRingId = "AutoCreate"; var dikeRingIds = new List { dikeRingId }; - dataMGBPluginImporter.ImportDataForDikeRings(dikeRingIds, DamType.Primary, null); + dataMGBPluginImporter.ImportDataForDikeRings(dikeRingIds, null); IEnumerable soilProfileIdList = dataMGBPluginImporter.GetSoilProfile1DIdList(dikeRingId); Assert.AreEqual(3, soilProfileIdList.Count()); DpSoilProfile soilProfile = dataMGBPluginImporter.GetSoilProfile1DDetails(dikeRingId, soilProfileIdList.ElementAt(0)); Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterBackgroundTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterBackgroundTests.cs (.../DataPluginImporterBackgroundTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterBackgroundTests.cs (.../DataPluginImporterBackgroundTests.cs) (revision 2168) @@ -86,7 +86,7 @@ // Precondition : Importer has read all data public void ImporterGetIdList_InvokedOnClient_ReturnsNonEmptyList() { - importer.ImportDataForDikeRings(null, DamType.Primary, null); + importer.ImportDataForDikeRings(null, null); var idlist = importer.MapGeometryIdList; Assert.IsNotNull(idlist); Assert.IsTrue(idlist.Any()); @@ -98,7 +98,7 @@ // Precondition : Importer has read all data public void ImporterGetGeometry_InvokedOnClient_ReturnsGeometry() { - importer.ImportDataForDikeRings(null, DamType.Primary, null); + importer.ImportDataForDikeRings(null, null); var idlist = importer.MapGeometryIdList; Assert.IsNotNull(importer.GetMapGeometry(idlist.ElementAt(0))); } @@ -109,7 +109,7 @@ // Precondition : Importer has read all data public void ImporterGetGeometryAttributes_InvokedOnClient_ReturnsAttributeList() { - importer.ImportDataForDikeRings(null, DamType.Primary, null); + importer.ImportDataForDikeRings(null, null); var idlist = importer.MapGeometryIdList; Assert.IsNotNull(importer.GetMapGeometryAttributes(idlist.ElementAt(0))); } Index: DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/ProjectLoader.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/ProjectLoader.cs (.../ProjectLoader.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/TestHelper/ProjectLoader.cs (.../ProjectLoader.cs) (revision 2168) @@ -43,7 +43,7 @@ csvSource, soilSource }}; - damProject.Import(projectDataFolder, container, new[] { "Dike from CSV" }, DamType.Regional, DamProjectType.Design, null); + damProject.Import(projectDataFolder, container, new[] { "Dike from CSV" }, DamProjectType.Design, null); return damProject.DamProjectData; } Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporter.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporter.cs (.../CsvImporter.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporter.cs (.../CsvImporter.cs) (revision 2168) @@ -22,7 +22,6 @@ using System; using System.Collections.Generic; using System.IO; -using Deltares.Standard; using Deltares.Standard.Logging; namespace Deltares.Dam.Data.CsvImporters @@ -126,8 +125,7 @@ /// Imports the locations. /// /// Name of the file. - /// The DamType is not (yet) read from the csv file; we assign the specified DamType to all locations that are read - private void ImportLocations(string fileName, DamType damType) + private void ImportLocations(string fileName) { // Locations are optional, so check if the locations are available before trying to import if (File.Exists(fileName)) @@ -140,11 +138,7 @@ { LogMessage logmessage = new LogMessage(LogMessageType.Error, this, errorMessage); errorMessages.Add(logmessage); - } - foreach (var locationRecord in locationRecords) - { - locationRecord.DamType = damType; - } + } } catch (CsvImporterSegmentsException e) { @@ -286,14 +280,13 @@ /// The CSV dir. /// if set to true [is import only locations]. /// The progress. - /// The DamType is not (yet) read from the csv file; we assign the specified DamType to all locations that are read /// Type of the dam project. public void ImportCsvDataFromDirectory(string csvDir, bool isImportOnlyLocations, - DamEngine.Data.Standard.Calculation.ProgressDelegate progress, DamType damType, DamProjectType damProjectType) + DamEngine.Data.Standard.Calculation.ProgressDelegate progress, DamProjectType damProjectType) { folderName = csvDir; if (progress != null) progress(0.03); - ImportLocations(LocationsFileName, damType); + ImportLocations(LocationsFileName); if (!isImportOnlyLocations) { if (progress != null) progress(0.08); Index: DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs =================================================================== diff -u -r2153 -r2168 --- DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 2153) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 2168) @@ -1026,8 +1026,7 @@ damNewProjectData = new DAMNewProjectData { DamProjectType = DamProjectType.Design, - DamDataSourceFileName = this.damProject.DamProjectData.DamDataSourceFileName, - DamType = DamType.Regional + DamDataSourceFileName = this.damProject.DamProjectData.DamDataSourceFileName }; var dlg = new DamNewProjectDialog { DamNewProjectData = damNewProjectData }; dlg.Visible = false; @@ -1067,7 +1066,7 @@ // ATTENTION: Do not stop DataEventPublisher because it is needed to determine the source of the data with DataSourceManager DataSourceManager.StartListening(); - this.damProject.Import(damProjectFolder, dataSourceContainer, this.damNewProjectData.SelectedDikeRingIds, this.damNewProjectData.DamType, + this.damProject.Import(damProjectFolder, dataSourceContainer, this.damNewProjectData.SelectedDikeRingIds, this.damNewProjectData.DamProjectType, this.progressDelegate); // Importing data creates a new DamProjectData object so the values set in the dialog have to be reset. Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileAttributeMap.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileAttributeMap.cs (.../LocationShapeFileAttributeMap.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileAttributeMap.cs (.../LocationShapeFileAttributeMap.cs) (revision 2168) @@ -32,7 +32,7 @@ #region Attribute ID Constants /// - /// location_id (dikering_id, damType) Location.shp LocationId (DikeringiD, DamType string, string, string + /// location_id /// public const string LocationAttributeId = LocationCsvColumnNames.LocationColumnName; @@ -42,11 +42,6 @@ public const string DikeRingAttributeId = LocationCsvColumnNames.DikeRingColumnName; /// - /// DamType - /// - public const string DamTypeAttributeId = "DamType"; - - /// /// crosssection /// CustomShape /// crosssection.shp @@ -761,7 +756,6 @@ ConstructionalMap = new Dictionary() { {LocationAttributeId.ToLower(), new LocationAttributeMapping() { File = LocationShapeFileName, Id = LocationAttributeId, Name = "LocationId"}}, - {DamTypeAttributeId.ToLower(), new LocationAttributeMapping() { File = LocationShapeFileName, Id = DamTypeAttributeId, Name = "DamType"}}, {DikeRingAttributeId.ToLower(), new LocationAttributeMapping() { File = LocationShapeFileName, Id = DikeRingAttributeId, Name = "DikeringId"}}, {CrossSectionAttributId.ToLower(), new LocationAttributeMapping() { File = "crosssection.shp", Id = CrossSectionAttributId, Name = "LocationId"}} }; @@ -774,7 +768,6 @@ get { yield return LocationAttributeId.ToLower(); - yield return DamTypeAttributeId.ToLower(); yield return DikeRingAttributeId.ToLower(); //yield return SegmentAttributeId.ToLower(); yield return CrossSectionAttributId.ToLower(); Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterCsvTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterCsvTests.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/DataPluginImporterCsvTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterCsvTests.cs (.../trunk/src/Dam/Tests/DataPluginImporterCsvTests.cs) (revision 2168) @@ -1,12 +1,24 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011 Deltares. All rights reserved. -// -// Tom The -// tom.the@deltares.nl -// 28-03-2011 -// Test for importing CSV-files in DataPlugin -//----------------------------------------------------------------------- +// 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 Deltares.Dam.Data.DataPlugins.Configuration; using Deltares.Geometry; using Deltares.Standard.TestUtils; @@ -49,21 +61,21 @@ [Category(Categories.Slow)] public void CanImportDikeData() { - IEnumerable dikeList = dataPluginImporter.GetDikeRingIdList(DamType.Primary); + IEnumerable dikeList = dataPluginImporter.GetDikeRingIdList(); Assert.AreEqual(1, dikeList.Count()); string dikeRingId = dikeList.FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(dikeList, DamType.Primary, null); + dataPluginImporter.ImportDataForDikeRings(dikeList, null); Info dikeInfo = dataPluginImporter.GetDikeRingInfo(dikeRingId); Assert.AreEqual("dijkring10", dikeInfo.Name); } [Test] public void CanRetrieveLocationData() { - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); - IEnumerable locationIdList = dataPluginImporter.GetLocationIdList(dikeRingId, DamType.Primary); + IEnumerable locationIdList = dataPluginImporter.GetLocationIdList(dikeRingId); Assert.AreEqual(24, locationIdList.Count()); Info locationInfo = dataPluginImporter.GetLocationInfo(dikeRingId, location18_6Id); @@ -82,8 +94,8 @@ [Test] public void CanRetrieveSegmentData() { - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); IEnumerable segmentIdList = dataPluginImporter.GetSegmentIdList(dikeRingId); Assert.AreEqual(24, segmentIdList.Count()); @@ -108,8 +120,8 @@ const double cToleranceCoordinate = 0.001; // Check if surfacelines available - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); IEnumerable surfaceLineIdList = dataPluginImporter.GetSurfaceLineIdList(dikeRingId); Assert.AreEqual(24, surfaceLineIdList.Count()); @@ -145,8 +157,8 @@ const double cToleranceCoordinate = 0.001; // Check if soilprofiles available - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); IEnumerable soilProfile1DIdList = dataPluginImporter.GetSoilProfile1DIdList(dikeRingId); Assert.AreEqual(26, soilProfile1DIdList.Count()); @@ -163,53 +175,12 @@ } [Test] - [Ignore("Not yet implemented in new csv importer")] - public void CanRetrieveNonWaterRetainingObjects() - { - const double cToleranceDimension = 0.001; - - // Check if NonWaterRetainingObjects available - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); - - IEnumerable nonWaterRetainingObjects = dataPluginImporter.GetNonWaterRetainingObjectList(dikeRingId); - Assert.AreEqual(2, nonWaterRetainingObjects.Count()); - - NonWaterRetainingObject nonWaterRetainingObject = nonWaterRetainingObjects.First(); - Assert.AreEqual("NWO1", nonWaterRetainingObject.NwoId); - Assert.AreEqual(NonWaterRetainingObjectCategory.Main, nonWaterRetainingObject.Category); - Assert.AreEqual(NonWaterRetainingObjectType.GasMain, nonWaterRetainingObject.Type); - Assert.AreEqual(PhreaticAdaptionType.MakeEmpty, nonWaterRetainingObject.PhreaticAdaption); - Assert.AreEqual(2, nonWaterRetainingObject.H1, cToleranceDimension); - Assert.AreEqual(2, nonWaterRetainingObject.H2, cToleranceDimension); - Assert.AreEqual(2, nonWaterRetainingObject.N1, cToleranceDimension); - Assert.AreEqual(2, nonWaterRetainingObject.N2, cToleranceDimension); - Assert.AreEqual(1, nonWaterRetainingObject.B, cToleranceDimension); - Assert.AreEqual(0.25, nonWaterRetainingObject.StepSizeX, cToleranceDimension); - Assert.AreEqual(1000, nonWaterRetainingObject.MaxDistanceFromToe, cToleranceDimension); - - nonWaterRetainingObject = nonWaterRetainingObjects.Last(); - Assert.AreEqual("NWO2", nonWaterRetainingObject.NwoId); - Assert.AreEqual(NonWaterRetainingObjectCategory.Tree, nonWaterRetainingObject.Category); - Assert.AreEqual(NonWaterRetainingObjectType.Oak, nonWaterRetainingObject.Type); - Assert.AreEqual(PhreaticAdaptionType.None, nonWaterRetainingObject.PhreaticAdaption); - Assert.AreEqual(1.5, nonWaterRetainingObject.H1, cToleranceDimension); - Assert.AreEqual(1.5, nonWaterRetainingObject.H2, cToleranceDimension); - Assert.AreEqual(2, nonWaterRetainingObject.N1, cToleranceDimension); - Assert.AreEqual(2, nonWaterRetainingObject.N2, cToleranceDimension); - Assert.AreEqual(1.2, nonWaterRetainingObject.B, cToleranceDimension); - Assert.AreEqual(0.5, nonWaterRetainingObject.StepSizeX, cToleranceDimension); - Assert.AreEqual(12.5, nonWaterRetainingObject.MaxDistanceFromToe, cToleranceDimension); - } - - [Test] public void CanRetrieveScenarios() { const double cToleranceDimension = 0.001; - // Check if NonWaterRetainingObjects available - string dikeRingId = dataPluginImporter.GetDikeRingIdList(DamType.Primary).FirstOrDefault(); - dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, DamType.Primary, null); + string dikeRingId = dataPluginImporter.GetDikeRingIdList().FirstOrDefault(); + dataPluginImporter.ImportDataForDikeRings(new List() { dikeRingId }, null); List scenarioList = dataPluginImporter.GetScenarioList(dikeRingId, location18_6Id).ToList(); Assert.AreEqual(1, scenarioList.Count()); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/IDataPlugin.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/IDataPlugin.cs (.../IDataPlugin.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/IDataPlugin.cs (.../IDataPlugin.cs) (revision 2168) @@ -76,16 +76,16 @@ void SetDataSources(string dataFolder, IEnumerable dataSources); - IEnumerable GetDikeRingIdList(DamType damType); + IEnumerable GetDikeRingIdList(); - void ImportDataForDikeRings(IEnumerable dikeRingIds, DamType damType, + void ImportDataForDikeRings(IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress); Info GetDikeRingInfo(string dikeRingId); IEnumerable GetDikeParameters(string dikeRingId); - IEnumerable GetLocationIdList(string dikeRingId, DamType damType); + IEnumerable GetLocationIdList(string dikeRingId); Info GetLocationInfo(string dikeRingId, string locationId); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/UISupport/DAMNewProjectData.cs =================================================================== diff -u -r2154 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/UISupport/DAMNewProjectData.cs (.../DAMNewProjectData.cs) (revision 2154) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/UISupport/DAMNewProjectData.cs (.../DAMNewProjectData.cs) (revision 2168) @@ -37,7 +37,6 @@ private string damDataSourceFileName; private string damProjectFileName; private string sensorConfigurationFileName; - private DamType damType = DamType.Primary; private List selectedDikeRingIds = new List(); private string dataSourceEsriProjection; private string dataSourceProjectionName; @@ -95,21 +94,7 @@ } } - [Label("Dike type")] - [Description("Indicates the type of dike")] [XmlIgnore] - public DamType DamType - { - get { return damType; } - set - { - DataEventPublisher.BeforeChange(this, "DamType"); - damType = value; - DataEventPublisher.AfterChange(this, "DamType"); - } - } - - [XmlIgnore] public string DataSourceEsriProjection { get { return dataSourceEsriProjection; } Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs =================================================================== diff -u -r2153 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 2153) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 2168) @@ -34,14 +34,6 @@ LFM = 5 } - public enum DamType - { - [Label("Primary dike")] - Primary, - [Label("Regional dike")] - Regional - } - public enum DamProjectType { Calamity, Index: DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterDotSpatialTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterDotSpatialTests.cs (.../LocationShapeFileImporterDotSpatialTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterDotSpatialTests.cs (.../LocationShapeFileImporterDotSpatialTests.cs) (revision 2168) @@ -37,9 +37,8 @@ const string locationFilename = @"..\..\..\data\Dam\Waterboards\HHNK\shapefiles\LocationID.shp"; var configuredAttributes = new List(); configuredAttributes.Add(new DataAttribute{AttributeId = "location_id", AttributeName = "LOCATIONID", DataSource = ""}); - configuredAttributes.Add(new DataAttribute { AttributeId = "damtype", AttributeName = "DAMTYPE", DataSource = "" }); configuredAttributes.Add(new DataAttribute { AttributeId = "dikering_id", AttributeName = "DIKERINGID", DataSource = "" }); - List locations = LocationShapeFileImporterDotSpatial.ImportLocations(locationFilename, DamType.Regional, configuredAttributes); + List locations = LocationShapeFileImporterDotSpatial.ImportLocations(locationFilename, configuredAttributes); var count = locations.Count; foreach (var location in locations) Index: DamClients/DamUI/trunk/src/Dam/Tests/Sensors/SensorImportFromExcelSheetTest.cs =================================================================== diff -u -r1664 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/Sensors/SensorImportFromExcelSheetTest.cs (.../SensorImportFromExcelSheetTest.cs) (revision 1664) +++ DamClients/DamUI/trunk/src/Dam/Tests/Sensors/SensorImportFromExcelSheetTest.cs (.../SensorImportFromExcelSheetTest.cs) (revision 2168) @@ -70,9 +70,9 @@ var dataSourceContainer = DataSourceContainer.Deserialize(definitionFilename); string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; - IList dikeList = WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + IList dikeList = WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); damProject.DamProjectData.WaterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null); + dikeList, DamProjectType.Calamity, null); damProject.AssignGeometry2DMapnameIfNotAssigned(Path.Combine(damImportFolder, dataSourceContainer.MapSoilProfile2D)); var dike = damProject.DamProjectData.WaterBoard.Dikes.First(); Index: DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTest.cs =================================================================== diff -u -r2135 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTest.cs (.../WaterBoardImporterTest.cs) (revision 2135) +++ DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTest.cs (.../WaterBoardImporterTest.cs) (revision 2168) @@ -51,7 +51,7 @@ string damProjectFolder = Path.GetDirectoryName(definitionFilename); // var dikeRingIds = waterBoardImporter.ImportDikeRingIds(damProjectFolder, dataSourceContainer); var selectedDikeRingIds = new List() { dikeRingId_HD_Bernisse }; - damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamType.Primary, DamProjectType.Calamity, null); + damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamProjectType.Calamity, null); Assert.AreEqual(1, damProject.DamProjectData.WaterBoard.Dikes.Count); Assert.AreEqual(dikeRingId_HD_Bernisse, damProject.DamProjectData.WaterBoard.Dikes[0].Name); @@ -72,7 +72,7 @@ string damProjectFolder = Path.GetDirectoryName(definitionFilename); // var dikeRingIds = waterBoardImporter.ImportDikeRingIds(damProjectFolder, dataSourceContainer); var selectedDikeRingIds = new List() { dikeRingId_HD_Bernisse }; - damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamType.Primary, DamProjectType.Calamity, null); + damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamProjectType.Calamity, null); Assert.AreEqual(1, damProject.DamProjectData.WaterBoard.Dikes.Count); Assert.AreEqual(dikeRingId_HD_Bernisse, damProject.DamProjectData.WaterBoard.Dikes[0].Name); @@ -93,7 +93,7 @@ string damProjectFolder = Path.GetDirectoryName(definitionFilename); // var dikeRingIds = waterBoardImporter.ImportDikeRingIds(damProjectFolder, dataSourceContainer); var selectedDikeRingIds = new List() { dikeRingId_Hempolder }; - damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamType.Primary, DamProjectType.Calamity, null); + damProject.Import(damProjectFolder, dataSourceContainer, selectedDikeRingIds, DamProjectType.Calamity, null); Assert.AreEqual(1, damProject.DamProjectData.WaterBoard.Dikes.Count); Assert.AreEqual(dikeRingId_Hempolder, damProject.DamProjectData.WaterBoard.Dikes[0].Name); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporter.cs =================================================================== diff -u -r2135 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporter.cs (.../LocationShapeFileImporter.cs) (revision 2135) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporter.cs (.../LocationShapeFileImporter.cs) (revision 2168) @@ -112,10 +112,6 @@ var configuredAttribute = configuredAttributes.Single(a => a.AttributeId.Equals(locationAttrId, StringComparison.InvariantCultureIgnoreCase)); var locationMapping = LocationShapeFileAttributeMap.GetAttributeMapping(configuredAttribute, locationAttrId); - const string damTypeAttrId = LocationShapeFileAttributeMap.DamTypeAttributeId; - configuredAttribute = configuredAttributes.SingleOrDefault(a => a.AttributeId.Equals(damTypeAttrId, StringComparison.InvariantCultureIgnoreCase)); - var damTypeMapping = LocationShapeFileAttributeMap.GetAttributeMapping(configuredAttribute, damTypeAttrId); - const string dikeRingAttrId = LocationShapeFileAttributeMap.DikeRingAttributeId; configuredAttribute = configuredAttributes.SingleOrDefault(a => a.AttributeId.Equals(dikeRingAttrId, StringComparison.InvariantCultureIgnoreCase)); var dikeRingMapping = LocationShapeFileAttributeMap.GetAttributeMapping(configuredAttribute, dikeRingAttrId); @@ -124,8 +120,7 @@ { var locationIDValue = feature.Attributes[locationMapping.Name].ToString(); var dikeRingIdValue = feature.Attributes[dikeRingMapping.Name].ToString(); - var damTypeValue = LocationImportHelper.ToDamType(feature.Attributes[damTypeMapping.Name]); - + var location = this.locations.FirstOrDefault(l => l.Name == locationIDValue); if (location == null) { @@ -134,7 +129,6 @@ this.locations.Add(location); } location.Name = locationIDValue; - location.DamType = damTypeValue; location.DikeRingId = dikeRingIdValue; location.XRd = feature.Geometry.Coordinate.X; location.YRd = feature.Geometry.Coordinate.Y; Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs =================================================================== diff -u -r2153 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs (.../DamProject.cs) (revision 2153) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamProject.cs (.../DamProject.cs) (revision 2168) @@ -111,7 +111,7 @@ } } - public object ImportWithDefinitionFile(string fileName, DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + public object ImportWithDefinitionFile(string fileName, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { var dataSourceContainer = DataSourceContainer.Deserialize(fileName); ProjectFileName = fileName; @@ -121,11 +121,11 @@ // import var waterBoard = WaterBoardImporter.ImportAllData( - definitionFileProjectFolder, dataSourceContainer, damType, damProjectType, + definitionFileProjectFolder, dataSourceContainer, damProjectType, progress, out logMessages); //var importer = new WaterBoardImporter(); //var waterBoard = importer.ImportAllData( - // definitionFileProjectFolder, dataSourceContainer, damType, progress); + // definitionFileProjectFolder, dataSourceContainer, progress); //logMessages = importer.importLogMessages.ToList(); // create data @@ -152,12 +152,11 @@ /// The data folder. /// The data source container. /// The dike ring ids. - /// Type of the dam. /// Type of the dam project. /// The progress. /// public object Import(string dataFolder, DataSourceContainer dataSourceContainer, - IEnumerable dikeRingIds, DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + IEnumerable dikeRingIds, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { var damProjectFolder = Path.GetDirectoryName(projectFileName); @@ -167,7 +166,7 @@ // import var waterBoard = WaterBoardImporter.ImportDataForDikeRings( damProjectFolder, dataFolder, dataSourceContainer, - dikeRingIds, damType, damProjectType, progress, out logMessages); + dikeRingIds, damProjectType, progress, out logMessages); // create data DamProjectData = new DamProjectData { WaterBoard = waterBoard, DataSourceEsriProjection = dataSourceContainer.DataSourceEsriProjection }; Index: DamClients/DamUI/trunk/src/Dam/Tests/DamIntegrationTestHelper.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DamIntegrationTestHelper.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/DamIntegrationTestHelper.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DamIntegrationTestHelper.cs (.../trunk/src/Dam/Tests/DamIntegrationTestHelper.cs) (revision 2168) @@ -1,10 +1,28 @@ -using System; +// 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.Collections.Generic; using System.IO; -using System.Text; using Deltares.Dam.Data; using Deltares.Dam.Data.DataPlugins.Configuration; -using Deltares.Dam.Data.Importers; namespace Deltares.Dam.Tests { @@ -28,7 +46,7 @@ var container = new DataSourceContainer(); container.DataSourceList.AddRange(new[] {source, soilSource}); - damProject.Import(cFolderName, container, new [] {"Dike from CSV"}, DamType.Regional, DamProjectType.Design, null); + damProject.Import(cFolderName, container, new [] {"Dike from CSV"}, DamProjectType.Design, null); return damProject.DamProjectData; } Index: DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterTest.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterTest.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/Importers/LocationShapeFileImporterTest.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/Importers/LocationShapeFileImporterTest.cs (.../trunk/src/Dam/Tests/Importers/LocationShapeFileImporterTest.cs) (revision 2168) @@ -1,3 +1,24 @@ +// 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.Collections.Generic; using System.Linq; using Deltares.Dam.Data; @@ -44,17 +65,14 @@ repository = mocks.DynamicMock(); var lm = LocationShapeFileAttributeMap.GetAttributeMapping(LocationShapeFileAttributeMap.LocationAttributeId); - var dtm = LocationShapeFileAttributeMap.GetAttributeMapping(LocationShapeFileAttributeMap.DamTypeAttributeId); var drm = LocationShapeFileAttributeMap.GetAttributeMapping(LocationShapeFileAttributeMap.DikeRingAttributeId); loc3 = Feature.Create(new Coordinate(1, 1)); loc3.AddAttribute(lm.Name, "loc3"); - loc3.AddAttribute(dtm.Name, "regional"); loc3.AddAttribute(drm.Name, "ring5"); loc4 = Feature.Create(new Coordinate(2, 2)); loc4.AddAttribute(lm.Name, "loc4"); - loc4.AddAttribute(dtm.Name, "primary"); loc4.AddAttribute(drm.Name, "ring5"); } @@ -98,8 +116,7 @@ var configuredAttributes = new List { new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.LocationAttributeId, AttributeName = locAttributeName }, - new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DikeRingAttributeId, AttributeName = dridAttributeName }, - new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DamTypeAttributeId, AttributeName = dtAttributeName } + new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DikeRingAttributeId, AttributeName = dridAttributeName } }; this.importer = new LocationShapeFileImporter(locations, configuredAttributes) @@ -132,15 +149,13 @@ var configuredAttributes = new List { new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.LocationAttributeId }, - new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DikeRingAttributeId }, - new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DamTypeAttributeId } + new DataAttribute() { AttributeId = LocationShapeFileAttributeMap.DikeRingAttributeId } }; // Add existing location to test if that is handled correctly using (var location = new Location() { Name = "loc3", - DamType = DamType.Regional, DikeRingId = "ring5", XRd = 111.11, YRd = 222.22 Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporterDotSpatial.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporterDotSpatial.cs (.../LocationShapeFileImporterDotSpatial.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationShapeFileImporterDotSpatial.cs (.../LocationShapeFileImporterDotSpatial.cs) (revision 2168) @@ -44,11 +44,10 @@ public class LocationShapeFileImporterDotSpatial { - public static List ImportLocations(string fileName, DamType damType, IEnumerable configuredAttributes) + public static List ImportLocations(string fileName, IEnumerable configuredAttributes) { // Determine column headers conform the attribute mappings string locationIdHeader = LocationShapeFileAttributeMap.LocationAttributeId; - string damTypeHeader = LocationShapeFileAttributeMap.DamTypeAttributeId; string dikeRingIdHeader = LocationShapeFileAttributeMap.DikeRingAttributeId; DataAttribute configuredAttribute = configuredAttributes.SingleOrDefault(a => a.AttributeId.Equals(LocationShapeFileAttributeMap.LocationAttributeId, StringComparison.InvariantCultureIgnoreCase)); @@ -60,16 +59,6 @@ } } - configuredAttribute = configuredAttributes.SingleOrDefault(a => a.AttributeId.Equals(LocationShapeFileAttributeMap.DamTypeAttributeId, - StringComparison.InvariantCultureIgnoreCase)); - if (configuredAttribute != null) - { - if (configuredAttribute.AttributeName != null) - { - damTypeHeader = configuredAttribute.AttributeName; - } - } - configuredAttribute = configuredAttributes.SingleOrDefault(a => a.AttributeId.Equals(LocationShapeFileAttributeMap.DikeRingAttributeId, StringComparison.InvariantCultureIgnoreCase)); if (configuredAttribute != null) @@ -85,20 +74,13 @@ { IFeatureSet fs = FeatureSet.Open(fileName); - var damTypeTranslationTable = new Dictionary() - { - {"primary", DamType.Primary}, - {"regional", DamType.Regional} - }; - //!!! this line is necessary otherwise the code doesn't work //this will load the attribute table of the layer into memory. fs.FillAttributes(); var locations = new List(); // Determine the column indices conform the column headers int colLocationId = -1; - int colDamType = -1; int colDikeRingId = -1; DataColumn[] columns = fs.GetColumns(); for (int i = 0; i < columns.Count(); i++) @@ -107,10 +89,6 @@ { colLocationId = i; } - if (damTypeHeader.Equals(columns[i].ToString(), StringComparison.InvariantCultureIgnoreCase)) - { - colDamType = i; - } if (dikeRingIdHeader.Equals(columns[i].ToString(), StringComparison.InvariantCultureIgnoreCase)) { colDikeRingId = i; @@ -140,28 +118,15 @@ var dikeRingIdNotFoundError = LocalizationManager.GetTranslatedText(typeof(LocationShapeFileImporterDotSpatial), "dikeRingIdNotFoundError"); throw new LocationShapeFileImporterDotSpatialException(String.Format("{0} : {1} {2}", fileName, dikeRingIdNotFoundError, dikeRingIdHeader)); } - if (colDamType >= 0) + if (location.Name.HasValidStringValue()) { - string key = feature.DataRow.ItemArray[colDamType].ToString().ToLowerInvariant(); - location.DamType = key.ToEnumType(damTypeTranslationTable); + locations.Add(location); } else { - var damTypeNotFoundError = LocalizationManager.GetTranslatedText(typeof(LocationShapeFileImporterDotSpatial), "damTypeNotFoundError"); - throw new LocationShapeFileImporterDotSpatialException(String.Format("{0} : {1} {2}", fileName, damTypeNotFoundError, damTypeHeader)); + // Discard location: + location.Dispose(); } - if (location.DamType == damType) - { - if (location.Name.HasValidStringValue()) - { - locations.Add(location); - } - else - { - // Discard location: - location.Dispose(); - } - } } return locations; } Index: DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTests.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/WaterBoardImporterTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/WaterBoardImporterTests.cs (.../trunk/src/Dam/Tests/WaterBoardImporterTests.cs) (revision 2168) @@ -1,12 +1,23 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011 Deltares. All rights reserved. -// -// Tom The -// tom.the@deltares.nl -// 05-04-2011 -// Tests for Import Waterboard data -//----------------------------------------------------------------------- +// 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.Collections.Generic; using System.IO; @@ -63,7 +74,7 @@ const double cTolerance = 0.00001; const double cToleranceCoordinate = 0.00001; SetupForCsvFilesImport(); - using (var waterBoard = WaterBoardImporter.ImportAllData("", dataSourceContainer, DamType.Primary, DamProjectType.Calamity, null)) + using (var waterBoard = WaterBoardImporter.ImportAllData("", dataSourceContainer, DamProjectType.Calamity, null)) { // Check Dike Assert.AreEqual(1, waterBoard.Dikes.Count); @@ -139,11 +150,11 @@ string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; IList dikeList = - WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); using (WaterBoard waterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null)) + dikeList, DamProjectType.Calamity, null)) { - //WaterBoard waterBoard = WaterBoardImporter.ImportAllData(damImportFolder, dataSourceContainer, DamType.Primary, null); + //WaterBoard waterBoard = WaterBoardImporter.ImportAllData(damImportFolder, dataSourceContainer, null); // Check Dike Assert.AreEqual(1, waterBoard.Dikes.Count); @@ -184,9 +195,9 @@ dataSourceContainer = DataSourceContainer.Deserialize(definitionFilename); string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; - IList dikeList = WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + IList dikeList = WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); damProject.DamProjectData.WaterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null); + dikeList, DamProjectType.Calamity, null); damProject.AssignGeometry2DMapnameIfNotAssigned(Path.Combine(damImportFolder, dataSourceContainer.MapSoilProfile2D)); // Save the data @@ -212,11 +223,11 @@ string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; IList dikeList = - WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); using (WaterBoard waterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null)) + dikeList, DamProjectType.Calamity, null)) { - //WaterBoard waterBoard = WaterBoardImporter.ImportAllData(damImportFolder, dataSourceContainer, DamType.Primary, null); + //WaterBoard waterBoard = WaterBoardImporter.ImportAllData(damImportFolder, dataSourceContainer, null); // Check Dike Assert.AreEqual(1, waterBoard.Dikes.Count); @@ -242,11 +253,11 @@ string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; IList dikeList = - WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); using(WaterBoard waterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null)) + dikeList, DamProjectType.Calamity, null)) using (WaterBoard referenceWaterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null)) + dikeList, DamProjectType.Calamity, null)) { // If profiles are defined as relative profiles, new absolute profiles will be generated for each location if (dataSourceContainer.IsImportAsRelativeProfiles) @@ -313,9 +324,9 @@ string damImportFolder = Path.GetDirectoryName(definitionFilename); List importLogMessages; IList dikeList = - WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamType.Primary, DamProjectType.Calamity, out importLogMessages).ToList(); + WaterBoardImporter.ImportDikeRingIds(damImportFolder, dataSourceContainer, DamProjectType.Calamity, out importLogMessages).ToList(); using (WaterBoard waterBoard = WaterBoardImporter.ImportDataForDikeRings("", damImportFolder, dataSourceContainer, - dikeList, DamType.Primary, DamProjectType.Calamity, null)) + dikeList, DamProjectType.Calamity, null)) { // Check Dike Assert.AreEqual(1, waterBoard.Dikes.Count); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationImportHelper.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationImportHelper.cs (.../LocationImportHelper.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/Importers/LocationImportHelper.cs (.../LocationImportHelper.cs) (revision 2168) @@ -61,29 +61,6 @@ return key.ToEnumType(soilTypeTranslationTable); } - public static DamType ToDamType(object value) - { - if (value == null) - throw new ArgumentNullException("value"); - - return ToDamType(value.ToString()); - } - - public static DamType ToDamType(string value) - { - if (string.IsNullOrEmpty(value) || value.Trim() == "") - throw new ArgumentException("value"); - - var translationTable = new Dictionary() - { - {"regional", DamType.Regional}, - {"primary", DamType.Primary} - }; - - var key = value.ToLowerInvariant(); - return key.ToEnumType(translationTable); - } - internal static DistributionType ToDistribution(object value) { if (value == null) Index: DamClients/DamUI/trunk/src/Dam/Tests/LoadCompatiblityTest.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/Dam/Tests/LoadCompatiblityTest.cs (.../LoadCompatiblityTest.cs) (revision 2168) @@ -26,8 +26,6 @@ using Deltares.Dam.Data; using Deltares.Dam.TestHelper; -using Deltares.Geometry; -using Deltares.Geotechnics.GeotechnicalGeometry; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; using Deltares.Standard.TestUtils; @@ -87,7 +85,6 @@ Location location = new Location { AreLocalXZObjectsCreated = true, - DamType = DamType.Regional, Name = "TPL_Hempolder_0100", DikeRingId = "TPL_Hempolder", Description = "", Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/ImportDirector.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/ImportDirector.cs (.../ImportDirector.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/ImportDirector.cs (.../ImportDirector.cs) (revision 2168) @@ -20,7 +20,6 @@ // All rights reserved. using Deltares.Dam.Data.DataPlugins.Configuration; -using Deltares.Standard; namespace Deltares.Dam.Data { @@ -39,7 +38,7 @@ } }; - damProject.Import(importFolder, container, new[] { "Dike from CSV" }, DamType.Regional, DamProjectType.Design, progress); + damProject.Import(importFolder, container, new[] { "Dike from CSV" }, DamProjectType.Design, progress); return damProject.DamProjectData.WaterBoard; } Index: DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.Designer.cs =================================================================== diff -u -r2088 -r2168 --- DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.Designer.cs (.../DamNewProjectDialog.Designer.cs) (revision 2088) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.Designer.cs (.../DamNewProjectDialog.Designer.cs) (revision 2168) @@ -51,11 +51,12 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DamNewProjectDialog)); this.ProjectSpecificationsGroupControl = new DevExpress.XtraEditors.GroupControl(); - this.damTypeGroup = new DevExpress.XtraEditors.RadioGroup(); + this.SensorConfigurationFilenameButton = new DevExpress.XtraEditors.SimpleButton(); + this.SensorConfigurationFilenameLabel = new DevExpress.XtraEditors.LabelControl(); + this.SensorConfigurationFilenameTextEdit = new DevExpress.XtraEditors.TextEdit(); this.DestinationProjectFilenameButton = new DevExpress.XtraEditors.SimpleButton(); this.DestinationProjectFilenameLabel = new DevExpress.XtraEditors.LabelControl(); this.DestinationProjectFilenameTextEdit = new DevExpress.XtraEditors.TextEdit(); - this.DikeRingtypeLabel = new DevExpress.XtraEditors.LabelControl(); this.DatasourcesFileNameButton = new DevExpress.XtraEditors.SimpleButton(); this.DatasourcesFileNameLabel = new DevExpress.XtraEditors.LabelControl(); this.DatasourcesFileNameEdit = new DevExpress.XtraEditors.TextEdit(); @@ -70,12 +71,9 @@ this.SelectDikeRingsLabel = new DevExpress.XtraEditors.LabelControl(); this.projectionGroupControl = new DevExpress.XtraEditors.GroupControl(); this.projectionMemoEdit = new DevExpress.XtraEditors.MemoEdit(); - this.SensorConfigurationFilenameButton = new DevExpress.XtraEditors.SimpleButton(); - this.SensorConfigurationFilenameLabel = new DevExpress.XtraEditors.LabelControl(); - this.SensorConfigurationFilenameTextEdit = new DevExpress.XtraEditors.TextEdit(); ((System.ComponentModel.ISupportInitialize)(this.ProjectSpecificationsGroupControl)).BeginInit(); this.ProjectSpecificationsGroupControl.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.damTypeGroup.Properties)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SensorConfigurationFilenameTextEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DestinationProjectFilenameTextEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DatasourcesFileNameEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DamCalculationTypeComboBox.Properties)).BeginInit(); @@ -85,7 +83,6 @@ ((System.ComponentModel.ISupportInitialize)(this.projectionGroupControl)).BeginInit(); this.projectionGroupControl.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.projectionMemoEdit.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.SensorConfigurationFilenameTextEdit.Properties)).BeginInit(); this.SuspendLayout(); // // ProjectSpecificationsGroupControl @@ -94,107 +91,119 @@ this.ProjectSpecificationsGroupControl.Controls.Add(this.SensorConfigurationFilenameButton); this.ProjectSpecificationsGroupControl.Controls.Add(this.SensorConfigurationFilenameLabel); this.ProjectSpecificationsGroupControl.Controls.Add(this.SensorConfigurationFilenameTextEdit); - this.ProjectSpecificationsGroupControl.Controls.Add(this.damTypeGroup); this.ProjectSpecificationsGroupControl.Controls.Add(this.DestinationProjectFilenameButton); this.ProjectSpecificationsGroupControl.Controls.Add(this.DestinationProjectFilenameLabel); this.ProjectSpecificationsGroupControl.Controls.Add(this.DestinationProjectFilenameTextEdit); - this.ProjectSpecificationsGroupControl.Controls.Add(this.DikeRingtypeLabel); this.ProjectSpecificationsGroupControl.Controls.Add(this.DatasourcesFileNameButton); this.ProjectSpecificationsGroupControl.Controls.Add(this.DatasourcesFileNameLabel); this.ProjectSpecificationsGroupControl.Controls.Add(this.DatasourcesFileNameEdit); this.ProjectSpecificationsGroupControl.Controls.Add(this.DamCalculationTypeLabel); this.ProjectSpecificationsGroupControl.Controls.Add(this.DamCalculationTypeComboBox); this.ProjectSpecificationsGroupControl.Dock = System.Windows.Forms.DockStyle.Top; this.ProjectSpecificationsGroupControl.Location = new System.Drawing.Point(0, 0); + this.ProjectSpecificationsGroupControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.ProjectSpecificationsGroupControl.Name = "ProjectSpecificationsGroupControl"; - this.ProjectSpecificationsGroupControl.Size = new System.Drawing.Size(493, 276); + this.ProjectSpecificationsGroupControl.Size = new System.Drawing.Size(657, 277); this.ProjectSpecificationsGroupControl.TabIndex = 4; this.ProjectSpecificationsGroupControl.Text = "Project specification"; // - // damTypeGroup + // SensorConfigurationFilenameButton // - this.damTypeGroup.Location = new System.Drawing.Point(134, 66); - this.damTypeGroup.Margin = new System.Windows.Forms.Padding(18, 3, 3, 3); - this.damTypeGroup.Name = "damTypeGroup"; - this.damTypeGroup.Properties.AllowMouseWheel = false; - this.damTypeGroup.Properties.Appearance.BackColor = System.Drawing.SystemColors.Control; - this.damTypeGroup.Properties.Appearance.Options.UseBackColor = true; - this.damTypeGroup.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; - this.damTypeGroup.Properties.Columns = 1; - this.damTypeGroup.Size = new System.Drawing.Size(345, 48); - this.damTypeGroup.TabIndex = 15; - this.damTypeGroup.SelectedIndexChanged += new System.EventHandler(this.damTypeGroup_SelectedIndexChanged); - this.damTypeGroup.PropertiesChanged += new System.EventHandler(this.damTypeGroup_PropertiesChanged); - this.damTypeGroup.EditValueChanged += new System.EventHandler(this.damTypeGroup_EditValueChanged); + this.SensorConfigurationFilenameButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.SensorConfigurationFilenameButton.Location = new System.Drawing.Point(596, 219); + this.SensorConfigurationFilenameButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.SensorConfigurationFilenameButton.Name = "SensorConfigurationFilenameButton"; + this.SensorConfigurationFilenameButton.Size = new System.Drawing.Size(45, 28); + this.SensorConfigurationFilenameButton.TabIndex = 18; + this.SensorConfigurationFilenameButton.Text = "..."; + this.SensorConfigurationFilenameButton.Click += new System.EventHandler(this.SensorConfigurationFilenameButton_Click); // + // SensorConfigurationFilenameLabel + // + this.SensorConfigurationFilenameLabel.Location = new System.Drawing.Point(16, 198); + this.SensorConfigurationFilenameLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.SensorConfigurationFilenameLabel.Name = "SensorConfigurationFilenameLabel"; + this.SensorConfigurationFilenameLabel.Size = new System.Drawing.Size(91, 16); + this.SensorConfigurationFilenameLabel.TabIndex = 16; + this.SensorConfigurationFilenameLabel.Text = "DAM project file"; + // + // SensorConfigurationFilenameTextEdit + // + this.SensorConfigurationFilenameTextEdit.AllowDrop = true; + this.SensorConfigurationFilenameTextEdit.Location = new System.Drawing.Point(16, 223); + this.SensorConfigurationFilenameTextEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.SensorConfigurationFilenameTextEdit.Name = "SensorConfigurationFilenameTextEdit"; + this.SensorConfigurationFilenameTextEdit.Size = new System.Drawing.Size(572, 22); + this.SensorConfigurationFilenameTextEdit.TabIndex = 17; + // // DestinationProjectFilenameButton // this.DestinationProjectFilenameButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.DestinationProjectFilenameButton.Location = new System.Drawing.Point(447, 182); + this.DestinationProjectFilenameButton.Location = new System.Drawing.Point(596, 164); + this.DestinationProjectFilenameButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DestinationProjectFilenameButton.Name = "DestinationProjectFilenameButton"; - this.DestinationProjectFilenameButton.Size = new System.Drawing.Size(34, 23); + this.DestinationProjectFilenameButton.Size = new System.Drawing.Size(45, 28); this.DestinationProjectFilenameButton.TabIndex = 14; this.DestinationProjectFilenameButton.Text = "..."; this.DestinationProjectFilenameButton.Click += new System.EventHandler(this.DestinationProjectFilenameButtonClick); // // DestinationProjectFilenameLabel // - this.DestinationProjectFilenameLabel.Location = new System.Drawing.Point(12, 166); + this.DestinationProjectFilenameLabel.Location = new System.Drawing.Point(16, 144); + this.DestinationProjectFilenameLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DestinationProjectFilenameLabel.Name = "DestinationProjectFilenameLabel"; - this.DestinationProjectFilenameLabel.Size = new System.Drawing.Size(76, 13); + this.DestinationProjectFilenameLabel.Size = new System.Drawing.Size(91, 16); this.DestinationProjectFilenameLabel.TabIndex = 12; this.DestinationProjectFilenameLabel.Text = "DAM project file"; // // DestinationProjectFilenameTextEdit // this.DestinationProjectFilenameTextEdit.AllowDrop = true; - this.DestinationProjectFilenameTextEdit.Location = new System.Drawing.Point(12, 185); + this.DestinationProjectFilenameTextEdit.Location = new System.Drawing.Point(16, 168); + this.DestinationProjectFilenameTextEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DestinationProjectFilenameTextEdit.Name = "DestinationProjectFilenameTextEdit"; - this.DestinationProjectFilenameTextEdit.Size = new System.Drawing.Size(429, 20); + this.DestinationProjectFilenameTextEdit.Size = new System.Drawing.Size(572, 22); this.DestinationProjectFilenameTextEdit.TabIndex = 13; // - // DikeRingtypeLabel - // - this.DikeRingtypeLabel.Location = new System.Drawing.Point(12, 66); - this.DikeRingtypeLabel.Name = "DikeRingtypeLabel"; - this.DikeRingtypeLabel.Size = new System.Drawing.Size(45, 13); - this.DikeRingtypeLabel.TabIndex = 4; - this.DikeRingtypeLabel.Text = "Dike type"; - // // DatasourcesFileNameButton // this.DatasourcesFileNameButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.DatasourcesFileNameButton.Location = new System.Drawing.Point(447, 137); + this.DatasourcesFileNameButton.Location = new System.Drawing.Point(596, 109); + this.DatasourcesFileNameButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DatasourcesFileNameButton.Name = "DatasourcesFileNameButton"; - this.DatasourcesFileNameButton.Size = new System.Drawing.Size(34, 23); + this.DatasourcesFileNameButton.Size = new System.Drawing.Size(45, 28); this.DatasourcesFileNameButton.TabIndex = 8; this.DatasourcesFileNameButton.Text = "..."; this.DatasourcesFileNameButton.Click += new System.EventHandler(this.DatasourcesFileNameButtonClick); // // DatasourcesFileNameLabel // - this.DatasourcesFileNameLabel.Location = new System.Drawing.Point(12, 121); + this.DatasourcesFileNameLabel.Location = new System.Drawing.Point(16, 89); + this.DatasourcesFileNameLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DatasourcesFileNameLabel.Name = "DatasourcesFileNameLabel"; - this.DatasourcesFileNameLabel.Size = new System.Drawing.Size(101, 13); + this.DatasourcesFileNameLabel.Size = new System.Drawing.Size(120, 16); this.DatasourcesFileNameLabel.TabIndex = 6; this.DatasourcesFileNameLabel.Text = "DAM datasources file"; // // DatasourcesFileNameEdit // this.DatasourcesFileNameEdit.AllowDrop = true; - this.DatasourcesFileNameEdit.Location = new System.Drawing.Point(12, 140); + this.DatasourcesFileNameEdit.Location = new System.Drawing.Point(16, 112); + this.DatasourcesFileNameEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DatasourcesFileNameEdit.Name = "DatasourcesFileNameEdit"; - this.DatasourcesFileNameEdit.Size = new System.Drawing.Size(429, 20); + this.DatasourcesFileNameEdit.Size = new System.Drawing.Size(572, 22); this.DatasourcesFileNameEdit.TabIndex = 7; this.DatasourcesFileNameEdit.Modified += new System.EventHandler(this.DatasourcesFileNameEditModified); // // DamCalculationTypeLabel // - this.DamCalculationTypeLabel.Location = new System.Drawing.Point(12, 43); + this.DamCalculationTypeLabel.Location = new System.Drawing.Point(16, 53); + this.DamCalculationTypeLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DamCalculationTypeLabel.Name = "DamCalculationTypeLabel"; - this.DamCalculationTypeLabel.Size = new System.Drawing.Size(77, 13); + this.DamCalculationTypeLabel.Size = new System.Drawing.Size(90, 16); this.DamCalculationTypeLabel.TabIndex = 3; this.DamCalculationTypeLabel.Text = "Calculation type"; // @@ -203,11 +212,12 @@ this.DamCalculationTypeComboBox.AllowDrop = true; this.DamCalculationTypeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.DamCalculationTypeComboBox.Location = new System.Drawing.Point(132, 40); + this.DamCalculationTypeComboBox.Location = new System.Drawing.Point(176, 49); + this.DamCalculationTypeComboBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DamCalculationTypeComboBox.Name = "DamCalculationTypeComboBox"; this.DamCalculationTypeComboBox.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); - this.DamCalculationTypeComboBox.Size = new System.Drawing.Size(349, 20); + this.DamCalculationTypeComboBox.Size = new System.Drawing.Size(465, 22); this.DamCalculationTypeComboBox.TabIndex = 2; // // panelControl1 @@ -217,18 +227,20 @@ this.panelControl1.Controls.Add(this.cancelButton); this.panelControl1.Controls.Add(this.okButton); this.panelControl1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panelControl1.Location = new System.Drawing.Point(0, 579); + this.panelControl1.Location = new System.Drawing.Point(0, 652); + this.panelControl1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.panelControl1.Name = "panelControl1"; - this.panelControl1.Size = new System.Drawing.Size(493, 35); + this.panelControl1.Size = new System.Drawing.Size(657, 43); this.panelControl1.TabIndex = 5; // // ProjectionButton // this.ProjectionButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); - this.ProjectionButton.Location = new System.Drawing.Point(17, 5); + this.ProjectionButton.Location = new System.Drawing.Point(23, 6); + this.ProjectionButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.ProjectionButton.Name = "ProjectionButton"; - this.ProjectionButton.Size = new System.Drawing.Size(85, 22); + this.ProjectionButton.Size = new System.Drawing.Size(113, 27); this.ProjectionButton.TabIndex = 6; this.ProjectionButton.Text = "Projection..."; this.ProjectionButton.Click += new System.EventHandler(this.ProjectionButton_Click); @@ -238,9 +250,10 @@ this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(402, 5); + this.cancelButton.Location = new System.Drawing.Point(536, 6); + this.cancelButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 22); + this.cancelButton.Size = new System.Drawing.Size(100, 27); this.cancelButton.TabIndex = 1; this.cancelButton.Text = "Cancel"; // @@ -249,85 +262,64 @@ this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - this.okButton.Location = new System.Drawing.Point(321, 5); + this.okButton.Location = new System.Drawing.Point(428, 6); + this.okButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(75, 22); + this.okButton.Size = new System.Drawing.Size(100, 27); this.okButton.TabIndex = 0; this.okButton.Text = "Ok"; this.okButton.Click += new System.EventHandler(this.OkButtonClick); // // DikeRingsCheckedListBox // - this.DikeRingsCheckedListBox.Location = new System.Drawing.Point(12, 305); + this.DikeRingsCheckedListBox.Location = new System.Drawing.Point(16, 312); + this.DikeRingsCheckedListBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.DikeRingsCheckedListBox.Name = "DikeRingsCheckedListBox"; this.DikeRingsCheckedListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.DikeRingsCheckedListBox.Size = new System.Drawing.Size(467, 184); + this.DikeRingsCheckedListBox.Size = new System.Drawing.Size(623, 226); this.DikeRingsCheckedListBox.TabIndex = 6; // // SelectDikeRingsLabel // - this.SelectDikeRingsLabel.Location = new System.Drawing.Point(12, 286); + this.SelectDikeRingsLabel.Location = new System.Drawing.Point(16, 289); + this.SelectDikeRingsLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.SelectDikeRingsLabel.Name = "SelectDikeRingsLabel"; - this.SelectDikeRingsLabel.Size = new System.Drawing.Size(74, 13); + this.SelectDikeRingsLabel.Size = new System.Drawing.Size(90, 16); this.SelectDikeRingsLabel.TabIndex = 7; this.SelectDikeRingsLabel.Text = "Select dikerings"; // // projectionGroupControl // this.projectionGroupControl.Controls.Add(this.projectionMemoEdit); - this.projectionGroupControl.Location = new System.Drawing.Point(12, 496); + this.projectionGroupControl.Location = new System.Drawing.Point(16, 547); + this.projectionGroupControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.projectionGroupControl.Name = "projectionGroupControl"; - this.projectionGroupControl.Size = new System.Drawing.Size(467, 77); + this.projectionGroupControl.Size = new System.Drawing.Size(623, 95); this.projectionGroupControl.TabIndex = 8; this.projectionGroupControl.Text = "Projection"; // // projectionMemoEdit // this.projectionMemoEdit.EditValue = ""; - this.projectionMemoEdit.Location = new System.Drawing.Point(10, 27); + this.projectionMemoEdit.Location = new System.Drawing.Point(13, 33); + this.projectionMemoEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.projectionMemoEdit.Name = "projectionMemoEdit"; - this.projectionMemoEdit.Size = new System.Drawing.Size(444, 40); + this.projectionMemoEdit.Size = new System.Drawing.Size(592, 49); this.projectionMemoEdit.TabIndex = 0; // - // SensorConfigurationFilenameButton - // - this.SensorConfigurationFilenameButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.SensorConfigurationFilenameButton.Location = new System.Drawing.Point(447, 227); - this.SensorConfigurationFilenameButton.Name = "SensorConfigurationFilenameButton"; - this.SensorConfigurationFilenameButton.Size = new System.Drawing.Size(34, 23); - this.SensorConfigurationFilenameButton.TabIndex = 18; - this.SensorConfigurationFilenameButton.Text = "..."; - this.SensorConfigurationFilenameButton.Click += new System.EventHandler(this.SensorConfigurationFilenameButton_Click); - // - // SensorConfigurationFilenameLabel - // - this.SensorConfigurationFilenameLabel.Location = new System.Drawing.Point(12, 210); - this.SensorConfigurationFilenameLabel.Name = "SensorConfigurationFilenameLabel"; - this.SensorConfigurationFilenameLabel.Size = new System.Drawing.Size(76, 13); - this.SensorConfigurationFilenameLabel.TabIndex = 16; - this.SensorConfigurationFilenameLabel.Text = "DAM project file"; - // - // SensorConfigurationFilenameTextEdit - // - this.SensorConfigurationFilenameTextEdit.AllowDrop = true; - this.SensorConfigurationFilenameTextEdit.Location = new System.Drawing.Point(12, 230); - this.SensorConfigurationFilenameTextEdit.Name = "SensorConfigurationFilenameTextEdit"; - this.SensorConfigurationFilenameTextEdit.Size = new System.Drawing.Size(429, 20); - this.SensorConfigurationFilenameTextEdit.TabIndex = 17; - // // DamNewProjectDialog // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(493, 614); + this.ClientSize = new System.Drawing.Size(657, 695); this.Controls.Add(this.projectionGroupControl); this.Controls.Add(this.SelectDikeRingsLabel); this.Controls.Add(this.DikeRingsCheckedListBox); this.Controls.Add(this.ProjectSpecificationsGroupControl); this.Controls.Add(this.panelControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "DamNewProjectDialog"; @@ -336,7 +328,7 @@ ((System.ComponentModel.ISupportInitialize)(this.ProjectSpecificationsGroupControl)).EndInit(); this.ProjectSpecificationsGroupControl.ResumeLayout(false); this.ProjectSpecificationsGroupControl.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.damTypeGroup.Properties)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SensorConfigurationFilenameTextEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DestinationProjectFilenameTextEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DatasourcesFileNameEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DamCalculationTypeComboBox.Properties)).EndInit(); @@ -346,7 +338,6 @@ ((System.ComponentModel.ISupportInitialize)(this.projectionGroupControl)).EndInit(); this.projectionGroupControl.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.projectionMemoEdit.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.SensorConfigurationFilenameTextEdit.Properties)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -364,13 +355,11 @@ private DevExpress.XtraEditors.PanelControl panelControl1; private DevExpress.XtraEditors.SimpleButton cancelButton; private DevExpress.XtraEditors.SimpleButton okButton; - private DevExpress.XtraEditors.LabelControl DikeRingtypeLabel; private DevExpress.XtraEditors.CheckedListBoxControl DikeRingsCheckedListBox; private DevExpress.XtraEditors.LabelControl SelectDikeRingsLabel; private DevExpress.XtraEditors.SimpleButton DestinationProjectFilenameButton; private DevExpress.XtraEditors.LabelControl DestinationProjectFilenameLabel; private DevExpress.XtraEditors.TextEdit DestinationProjectFilenameTextEdit; - private DevExpress.XtraEditors.RadioGroup damTypeGroup; private DevExpress.XtraEditors.SimpleButton ProjectionButton; private DevExpress.XtraEditors.GroupControl projectionGroupControl; private DevExpress.XtraEditors.MemoEdit projectionMemoEdit; Index: DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.cs =================================================================== diff -u -r2135 -r2168 --- DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.cs (.../DamNewProjectDialog.cs) (revision 2135) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamNewProjectDialog.cs (.../DamNewProjectDialog.cs) (revision 2168) @@ -47,8 +47,7 @@ { private DAMNewProjectData damNewProjectData; private string currentSourceFileName = ""; - private DamType currentDamType = DamType.Primary; - + /// /// Constructor /// @@ -64,10 +63,6 @@ // Project type BindSupport.BindTextAndValue(this, this.DamCalculationTypeLabel, this.DamCalculationTypeComboBox, typeof(DAMNewProjectData), "DamProjectType"); - // Calculation type - BindSupport.Bind(this, this.DikeRingtypeLabel, typeof(DAMNewProjectData), "DamType", BindingType.Label); - BindSupport.Bind(damTypeGroup, damTypeGroup, d => d.DamType); - // DAM datasources file BindSupport.BindTextAndValue(this, this.DatasourcesFileNameLabel, this.DatasourcesFileNameEdit, typeof(DAMNewProjectData), "DamDataSourceFileName"); @@ -120,7 +115,6 @@ } DatasourcesFileNameUpdated(); BindSupport.Assign(this, value); - BindSupport.Assign(damTypeGroup, damNewProjectData); } } @@ -317,7 +311,7 @@ { if (!string.IsNullOrWhiteSpace(sourceFileName) && File.Exists(sourceFileName)) { - if (!currentSourceFileName.Equals(sourceFileName) || (currentDamType != this.DamNewProjectData.DamType)) + if (!currentSourceFileName.Equals(sourceFileName)) { DataSourceContainer dataSourceContainer = DataSourceContainer.Deserialize(sourceFileName); UpdateDikeRingCheckedListbox(sourceFileName, dataSourceContainer); @@ -367,7 +361,7 @@ DataEventPublisher.InvokeWithoutPublishingEvents(() => { dikeRingIds = WaterBoardImporter.ImportDikeRingIds( - damProjectFolder, dataSourceContainer, this.DamNewProjectData.DamType, + damProjectFolder, dataSourceContainer, this.DamNewProjectData.DamProjectType, out importLogMessages).ToList(); }); @@ -388,8 +382,7 @@ } LocalizedMessageBox.ShowTranslatedText(openingMessage + paragraphSepatator + output); } - currentSourceFileName = sourceFileName; - currentDamType = this.DamNewProjectData.DamType; + currentSourceFileName = sourceFileName; } /// @@ -414,53 +407,6 @@ } /// - /// Handles the PropertiesChanged event of the damTypeGroup control. - /// - /// The source of the event. - /// The instance containing the event data. - private void damTypeGroup_PropertiesChanged(object sender, EventArgs e) - { - AdjustLineSpacingOfItems(); - } - - /// - /// Adjusts the line spacing of items. Set it to 1.5 times normal spacing. - /// In RadioGroupBinding.SetDomain the default (single) spacing is used. - /// Defining a minimal height will overrule that setting. - /// - private void AdjustLineSpacingOfItems() - { - int minHeight = 0; - int itemCount = damTypeGroup.Properties.Items.Count; - if (itemCount > 1) - { - minHeight = itemCount * 24; - } - damTypeGroup.MinimumSize = new Size(320, minHeight); - } - - /// - /// Handles the EditValueChanged event of the damTypeGroup control. - /// - /// The source of the event. - /// The instance containing the event data. - private void damTypeGroup_EditValueChanged(object sender, EventArgs e) - { - string sourceFileName = DamNewProjectData.DamDataSourceFileName; - UpdateControlsForDataSource(sourceFileName); - } - - /// - /// Handles the SelectedIndexChanged event of the damTypeGroup control. - /// - /// The source of the event. - /// The instance containing the event data. - private void damTypeGroup_SelectedIndexChanged(object sender, EventArgs e) - { - Deltares.Dam.Data.Location.DamProjectType = DamNewProjectData.DamProjectType; - } - - /// /// Handles the Click event of the SensorConfigurationFilenameButton control. /// /// The source of the event. Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardImporter.cs =================================================================== diff -u -r2089 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardImporter.cs (.../WaterBoardImporter.cs) (revision 2089) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/WaterBoardImporter.cs (.../WaterBoardImporter.cs) (revision 2168) @@ -58,7 +58,6 @@ private readonly WaterBoard waterBoard = new WaterBoard(); - private readonly DamType damType; private readonly DamProjectType damProjectType; private readonly List importCsvLogMessages = new List(); @@ -84,7 +83,7 @@ get { importCsvLogMessages.Clear(); - var dikeRingIdList = importer.GetDikeRingIdList(damType).ToList(); + var dikeRingIdList = importer.GetDikeRingIdList().ToList(); importCsvLogMessages.AddRange(importer.ImportLogMessages); return dikeRingIdList; } @@ -124,14 +123,12 @@ /// /// The data folder. /// The data source container. - /// Type of the dam. /// Type of the dam project. - private WaterBoardImporter(string dataFolder, DataSourceContainer dataSourceContainer, DamType damType, DamProjectType damProjectType) + private WaterBoardImporter(string dataFolder, DataSourceContainer dataSourceContainer, DamProjectType damProjectType) { this.damProjectType = damProjectType; importer = CreateDataPlugin(dataFolder, dataSourceContainer); importer.DamProjectType = damProjectType; - this.damType = damType; } /// @@ -154,14 +151,13 @@ /// /// The data folder. /// The data source container. - /// Type of the dam. /// Type of the dam project. /// The import log messages. /// public static IEnumerable ImportDikeRingIds( - string dataFolder, DataSourceContainer dataSourceContainer, DamType damType, DamProjectType damProjectType, out List importLogMessages) + string dataFolder, DataSourceContainer dataSourceContainer, DamProjectType damProjectType, out List importLogMessages) { - var importer = new WaterBoardImporter(dataFolder, dataSourceContainer, damType, damProjectType); + var importer = new WaterBoardImporter(dataFolder, dataSourceContainer, damProjectType); var allDikeRingIds = importer.AllDikeRingIDs; importLogMessages = new List(importer.ImportCsvLogMessages); @@ -174,19 +170,18 @@ /// /// The data folder. /// The data source container. - /// Type of the dam. /// Type of the dam project. /// The progress. /// The log messages. /// public static WaterBoard ImportAllData(string dataFolder, - DataSourceContainer dataSourceContainer, DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress, + DataSourceContainer dataSourceContainer, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress, out List logMessages) { var importer = CreateDataPlugin(dataFolder, dataSourceContainer); - var dikeRingIds = importer.GetDikeRingIdList(damType); + var dikeRingIds = importer.GetDikeRingIdList(); WaterBoard waterboard = ImportDataForDikeRings("", dataFolder, dataSourceContainer, - dikeRingIds, damType, damProjectType, progress, out logMessages); + dikeRingIds, damProjectType, progress, out logMessages); return waterboard; } @@ -195,15 +190,14 @@ /// /// The data folder. /// The data source container. - /// Type of the dam. /// Type of the dam project. /// The progress. /// public static WaterBoard ImportAllData(string dataFolder, - DataSourceContainer dataSourceContainer, DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + DataSourceContainer dataSourceContainer, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { List dummy; - return ImportAllData(dataFolder, dataSourceContainer, damType, damProjectType, progress, out dummy); + return ImportAllData(dataFolder, dataSourceContainer, damProjectType, progress, out dummy); } /// @@ -213,17 +207,16 @@ /// The data folder. /// The data source container. /// The dike ring ids. - /// Type of the dam. /// Type of the dam project. /// The progress. /// public static WaterBoard ImportDataForDikeRings(string damProjectFolder, string dataFolder, DataSourceContainer dataSourceContainer, IEnumerable dikeRingIds, - DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { List dummy; return ImportDataForDikeRings(damProjectFolder, dataFolder, dataSourceContainer, - dikeRingIds, damType, damProjectType, progress, out dummy); + dikeRingIds, damProjectType, progress, out dummy); } /// @@ -233,16 +226,15 @@ /// The data folder. /// The data source container. /// The dike ring ids. - /// Type of the dam. /// Type of the dam project. /// The progress. /// The log messages. /// public static WaterBoard ImportDataForDikeRings(string damProjectFolder, string dataFolder, DataSourceContainer dataSourceContainer, IEnumerable dikeRingIds, - DamType damType, DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress, out List logMessages) + DamProjectType damProjectType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress, out List logMessages) { - var importer = new WaterBoardImporter(dataFolder, dataSourceContainer, damType, damProjectType); + var importer = new WaterBoardImporter(dataFolder, dataSourceContainer, damProjectType); logMessages = new List(); WaterBoard waterBoard = new WaterBoard(); @@ -315,7 +307,7 @@ { // if no dike ring IDs specified, take all return dikeRingIds == null - ? importer.GetDikeRingIdList(damType).ToList() + ? importer.GetDikeRingIdList().ToList() : (dikeRingIds as List ?? dikeRingIds.ToList()); } @@ -471,7 +463,7 @@ private bool ImportDikes(IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { // Import dikes - importer.ImportDataForDikeRings(dikeRingIds, damType, progress); + importer.ImportDataForDikeRings(dikeRingIds, progress); // add log messages ImportCsvLogMessages.AddRange(importer.ImportLogMessages); @@ -542,7 +534,7 @@ /// The dike. private void ImportLocations(string dikeRingId, Dike dike) { - var locationIdList = importer.GetLocationIdList(dikeRingId, damType); + var locationIdList = importer.GetLocationIdList(dikeRingId); foreach (string locationId in locationIdList) { Index: DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterTests.cs =================================================================== diff -u -r875 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterTests.cs (.../DataPluginImporterTests.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DataPluginImporterTests.cs (.../DataPluginImporterTests.cs) (revision 2168) @@ -79,7 +79,7 @@ }; var dataPluginImporter = new DataPluginImporter(); dataPluginImporter.SetDataSources("", srcDataSources); - dataPluginImporter.ImportDataForDikeRings(null, DamType.Primary, null); + dataPluginImporter.ImportDataForDikeRings(null, null); var info = dataPluginImporter.WaterBoardInfo; if (LocalizationManager.CurrentLanguage == LanguageType.Dutch) Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporterLocations.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporterLocations.cs (.../CsvImporterLocations.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/CsvImporters/CsvImporterLocations.cs (.../CsvImporterLocations.cs) (revision 2168) @@ -40,8 +40,6 @@ public class LocationRecord { public int LocationRecordId { get; set; } - public DamType DamType { get; set; } - public string LocationId { get; set; } public string SurfaceLineId { get; set; } public string SegmentId { get; set; } Index: DamClients/DamUI/trunk/src/Dam/Tests/CsvImporterTestsNew.cs =================================================================== diff -u -r2163 -r2168 --- DamClients/DamUI/trunk/src/Dam/Tests/CsvImporterTestsNew.cs (.../CsvImporterTestsNew.cs) (revision 2163) +++ DamClients/DamUI/trunk/src/Dam/Tests/CsvImporterTestsNew.cs (.../CsvImporterTestsNew.cs) (revision 2168) @@ -964,12 +964,10 @@ new DataAttribute { AttributeId = "location_id", AttributeName = "LOCATIONID", DataSource = "" }, new DataAttribute - { AttributeId = "damtype", AttributeName = "DAMTYPE", DataSource = "" }, - new DataAttribute { AttributeId = "dikering_id", AttributeName = "DIKERINGID", DataSource = "" } }; var locations = LocationShapeFileImporterDotSpatial.ImportLocations( - locationFilename, DamType.Regional, configuredAttributes); + locationFilename, configuredAttributes); foreach (var location in locations) { damProjectData.WaterBoard.Dikes[0].Locations.Add(location); @@ -978,7 +976,7 @@ { DamEngine.Data.Standard.Calculation.ProgressDelegate progress = null; var csvImporter = new CsvImporter(); - csvImporter.ImportCsvDataFromDirectory(testDataFolder, false, progress, DamType.Regional, DamProjectType.Design); + csvImporter.ImportCsvDataFromDirectory(testDataFolder, false, progress, DamProjectType.Design); foreach (var errormessage in csvImporter.ErrorMessages) { LogManager.Messages.Add(errormessage); @@ -1060,7 +1058,7 @@ const string testDataFolder = @"TestData\CsvData\Full1DProject\csvfiles"; DamEngine.Data.Standard.Calculation.ProgressDelegate progress = null; var csvImporter = new CsvImporter(); - csvImporter.ImportCsvDataFromDirectory(testDataFolder, false, progress, DamType.Regional, DamProjectType.Design); + csvImporter.ImportCsvDataFromDirectory(testDataFolder, false, progress, DamProjectType.Design); foreach (var errormessage in csvImporter.ErrorMessages) { LogManager.Messages.Add(errormessage); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs =================================================================== diff -u -r2135 -r2168 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs (.../DataPluginImporter.cs) (revision 2135) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DataPlugins/DataPluginImporter.cs (.../DataPluginImporter.cs) (revision 2168) @@ -387,24 +387,22 @@ /// /// Gets the dike ring identifier list. /// - /// Type of the dam. /// - public IEnumerable GetDikeRingIdList(DamType damType) + public IEnumerable GetDikeRingIdList() { - ImportDikeRingAndLocationData(damType); + ImportDikeRingAndLocationData(); return waterBoard.Dikes.Select(dike => dike.Name); } /// /// Imports the data for dike rings. /// /// The dike ring ids. - /// Type of the dam. /// The progress. - public void ImportDataForDikeRings(IEnumerable dikeRingIds, DamType damType, + public void ImportDataForDikeRings(IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { - ImportAllData(dikeRingIds, damType, progress); + ImportAllData(dikeRingIds, progress); } /// @@ -452,11 +450,10 @@ /// Gets the location identifier list. /// /// The dike ring identifier. - /// Type of the dam. /// - public IEnumerable GetLocationIdList(string dikeRingId, DamType damType) + public IEnumerable GetLocationIdList(string dikeRingId) { - ImportDikeRingAndLocationData(damType); + ImportDikeRingAndLocationData(); var dike = GetDike(dikeRingId); return dike.Locations.Select(location => location.Name); } @@ -799,17 +796,16 @@ /// Import all csv files /// /// - /// The DamType is not (yet) read from the csv file; we assign the specified DamType to all locations that are read /// /// /// - private CsvImporter ImportCsvFiles(string importFolder, DamType damType, + private CsvImporter ImportCsvFiles(string importFolder, ImportMode importMode, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { DataSourceManager.CurrentSource = DataSourceSystemType.Csv; var csvImporter = new CsvImporter(); bool isImportOnlyLocations = (importMode == ImportMode.DikeRingAndLocationData); - csvImporter.ImportCsvDataFromDirectory(importFolder, isImportOnlyLocations, progress, damType, damProjectType); + csvImporter.ImportCsvDataFromDirectory(importFolder, isImportOnlyLocations, progress, damProjectType); // add messages var messages = csvImporter.ErrorMessages; @@ -956,10 +952,9 @@ /// /// /// - /// /// private void ImportDataShapeFiles(string importFolder, IEnumerable dataAttributes, - ImportMode importMode, IEnumerable dikeRingIds, DamType damType, + ImportMode importMode, IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { DataSourceManager.CurrentSource = DataSourceSystemType.Gis; @@ -1009,20 +1004,17 @@ string id = newDikeRingId; foreach (Location location in locationList.Where(location => location.DikeRingId == id)) { - if (location.DamType == damType) + // Replace if location exists else add + Location existingLocation = dike.Locations.FirstOrDefault(l => l.Name == location.Name); + if (existingLocation != null) { - // Replace if location exists else add - Location existingLocation = dike.Locations.FirstOrDefault(l => l.Name == location.Name); - if (existingLocation != null) - { - int indexExistingLocation = dike.Locations.IndexOf(existingLocation); - dike.Locations[indexExistingLocation] = location; - } - else - { - dike.Locations.Add(location); - } + int indexExistingLocation = dike.Locations.IndexOf(existingLocation); + dike.Locations[indexExistingLocation] = location; } + else + { + dike.Locations.Add(location); + } } } } @@ -1102,13 +1094,13 @@ /// /// Import only Dikering and location id's /// - private void ImportDikeRingAndLocationData(DamType damType) + private void ImportDikeRingAndLocationData() { if (isDikeRingAndLocationDataImported || isAllDataImported) return; foreach (var dataSource in DataSources) { - ImportDikeRingAndLocationData(dataSource, damType); + ImportDikeRingAndLocationData(dataSource); } isDikeRingAndLocationDataImported = true; @@ -1135,17 +1127,16 @@ /// Imports the dike ring and location data. /// /// The data source. - /// Type of the dam. /// - private void ImportDikeRingAndLocationData(DataSource dataSource, DamType damType) + private void ImportDikeRingAndLocationData(DataSource dataSource) { var dataLocation = GetDataLocation(dataSource); switch (dataSource.DataSourceType) { case DataSourceType.CsvFiles: // New importer - var csvImporter = ImportCsvFiles(dataLocation, damType, ImportMode.DikeRingAndLocationData, null); + var csvImporter = ImportCsvFiles(dataLocation, ImportMode.DikeRingAndLocationData, null); var combineImportedData = new CombineImportedData { WaterBoard = waterBoard, @@ -1155,7 +1146,7 @@ break; case DataSourceType.DataShapeFiles: - ImportShapeFile(dataLocation, damType); + ImportShapeFile(dataLocation); break; case DataSourceType.Iris: case DataSourceType.BackgroundShapeFiles: @@ -1171,13 +1162,12 @@ /// Imports the data. /// /// The data source. - /// Type of the dam. /// The dike ring identifier list. /// The import mode. /// The progress. /// The CSV importer. /// - private void ImportData2(DataSource dataSource, DamType damType, + private void ImportData2(DataSource dataSource, IEnumerable dikeRingIdList, ImportMode importMode, DamEngine.Data.Standard.Calculation.ProgressDelegate progress, ref CsvImporter csvImporter) { @@ -1187,7 +1177,7 @@ { case DataSourceType.CsvFiles: // New importer - csvImporter = ImportCsvFiles(dataLocation, damType, importMode, progress); + csvImporter = ImportCsvFiles(dataLocation, importMode, progress); if (csvImporter != null && csvImporter.LocationRecords.Count > 0) { // This is to support projects which have defined locations in locations.csv @@ -1201,7 +1191,7 @@ ImportIrisFiles(dataLocation); break; case DataSourceType.DataShapeFiles: - ImportDataShapeFiles(dataLocation, attributes, importMode, dikeRingIdList, damType, progress); + ImportDataShapeFiles(dataLocation, attributes, importMode, dikeRingIdList, progress); break; case DataSourceType.BackgroundShapeFiles: if (importMode == ImportMode.All) @@ -1224,8 +1214,7 @@ /// Imports the shape file. /// /// The data location. - /// Type of the dam. - private void ImportShapeFile(string dataLocation, DamType damType) + private void ImportShapeFile(string dataLocation) { // get locations var configuredAttribute = @@ -1238,7 +1227,7 @@ } var locations = LocationShapeFileImporterDotSpatial.ImportLocations( - Path.Combine(dataLocation, configuredAttribute.DataSource), damType, attributes); + Path.Combine(dataLocation, configuredAttribute.DataSource), attributes); // Split locations in several dikes based on DikeRingid var newDikeRings = locations.Select(l => l.DikeRingId).Distinct(); @@ -1259,22 +1248,21 @@ /// Imports all data. /// /// The dike ring ids. - /// Type of the dam. /// The progress. - private void ImportAllData(IEnumerable dikeRingIds, DamType damType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + private void ImportAllData(IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { // do nothing if all data is already imported if (isAllDataImported) return; - ImportData(ImportMode.All, dikeRingIds, damType, progress); + ImportData(ImportMode.All, dikeRingIds, progress); isAllDataImported = true; } /// /// Import all data /// - private void ImportData(ImportMode importMode, IEnumerable dikeRingIds, DamType damType, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) + private void ImportData(ImportMode importMode, IEnumerable dikeRingIds, DamEngine.Data.Standard.Calculation.ProgressDelegate progress) { ThrowIfNoDataDefinitions(); if (!isDikeRingAndLocationDataImported) @@ -1292,7 +1280,7 @@ csvDataAdded = false; foreach (var dataSource in DataSources) { - ImportData2(dataSource, damType, dikeRingIdList, importMode, progress, ref csvImporter); + ImportData2(dataSource, dikeRingIdList, importMode, progress, ref csvImporter); } if (!csvDataAdded)