Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs =================================================================== diff -u -r9050ad5f3a80e630b2fcc092942a40d6343286a0 -rb899143d97a40bf0d0044d3960a335d6158e8f74 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision 9050ad5f3a80e630b2fcc092942a40d6343286a0) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.IO/HeightStructuresImporter.cs (.../HeightStructuresImporter.cs) (revision b899143d97a40bf0d0044d3960a335d6158e8f74) @@ -24,7 +24,6 @@ using System.Linq; using Core.Common.Base; using Ringtoets.Common.Data.AssessmentSection; -using Ringtoets.Common.IO; using Ringtoets.Common.IO.FileImporters; using Ringtoets.Common.IO.Structures; using Ringtoets.HeightStructures.Data; @@ -37,8 +36,6 @@ /// public class HeightStructuresImporter : StructuresImporter> { - private readonly ObservableList importTarget; - /// /// Creates a new instance of . /// @@ -49,10 +46,7 @@ /// Thrown when , /// or is null. public HeightStructuresImporter(ObservableList importTarget, ReferenceLine referenceLine, string filePath) - : base(importTarget, referenceLine, filePath) - { - this.importTarget = importTarget; - } + : base(importTarget, referenceLine, filePath) {} protected override void CreateSpecificStructures(ICollection structureLocations, Dictionary> groupedStructureParameterRows) @@ -61,10 +55,16 @@ foreach (HeightStructure heightStructure in importedHeightStructures) { - importTarget.Add(heightStructure); + ImportTarget.Add(heightStructure); } } + protected override void HandleUserCancellingImport() + { + log.Info(RingtoetsCommonIOResources.StructuresImporter_User_cancelled); + base.HandleUserCancellingImport(); + } + private IEnumerable CreateHeightStructures(IList structureLocations, Dictionary> groupedStructureParameterRows) { @@ -77,8 +77,8 @@ if (!groupedStructureParameterRows.ContainsKey(id)) { - log.WarnFormat(RingtoetsCommonIOResources.StructuresImporter_CreateSpecificStructures_no_structuresdata_for_location_0_, id); - log.ErrorFormat("Kunstwerk nummer {0} wordt overgeslagen.", i + 1); + log.WarnFormat(RingtoetsCommonIOResources.StructuresImporter_CreateSpecificStructures_no_structuresdata_for_Location_0_, id); + log.ErrorFormat(RingtoetsCommonIOResources.StructuresImporter_Structure_number_0_is_skipped, i + 1); continue; } @@ -91,6 +91,8 @@ continue; } + ConvertVarianceToStandardDeviation(structureParameterRows); + HeightStructure heightStructure = CreateHeightStructure(structureLocation, structureParameterRows); heightStructures.Add(heightStructure); } @@ -103,14 +105,15 @@ structureLocation.Name, structureLocation.Id, structureLocation.Point, - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE1").NumericalValue, - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE2").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE2").VarianceValue, - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE3").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE3").VarianceValue, - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE4").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE4").VarianceValue, //TODO: Ensure Coefficient of variation is properly set - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE5").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE5").VarianceValue, //TODO: Ensure Coefficient of variation is properly set - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE6").NumericalValue, - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE7").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE7").VarianceValue, //TODO: Ensure Coefficient of variation is properly set - structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE8").NumericalValue, structureParameterRows.First(row => row.ParameterId == "KW_HOOGTE8").VarianceValue); + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword1).NumericalValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword2).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword2).VarianceValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword3).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword3).VarianceValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword4).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword4).VarianceValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword5).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword5).VarianceValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword6).NumericalValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword7).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword7).VarianceValue, + structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword8).NumericalValue, structureParameterRows.First(row => row.ParameterId == StructureFilesKeywords.HeightStructureParameterKeyword8).VarianceValue + ); return heightStructure; } }