Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationCalculationsWriter.cs =================================================================== diff -u -re9357a3fefe5ebe77bb3d40c44048b49d28bfcd2 -r3fa2200f5ad050d55eec5b00f3ef2e7084a0c223 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationCalculationsWriter.cs (.../DuneLocationCalculationsWriter.cs) (revision e9357a3fefe5ebe77bb3d40c44048b49d28bfcd2) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.IO/DuneLocationCalculationsWriter.cs (.../DuneLocationCalculationsWriter.cs) (revision 3fa2200f5ad050d55eec5b00f3ef2e7084a0c223) @@ -26,6 +26,7 @@ using System.Text; using Core.Common.Base.Data; using Core.Common.IO.Exceptions; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.DuneErosion.Data; using Ringtoets.DuneErosion.IO.Properties; using CoreCommonUtilResources = Core.Common.Util.Properties.Resources; @@ -43,16 +44,16 @@ /// /// Writes dune location calculations to a bnd file. /// - /// The dune location calculations to be written to the file. + /// The dune location calculations to be written to the file. /// The path to the file. /// Thrown when any parameter is null. /// Thrown when unable to write to . - public static void WriteDuneLocationCalculations(IEnumerable duneLocationCalculations, + public static void WriteDuneLocationCalculations(IEnumerable exportableDuneLocationCalculations, string filePath) { - if (duneLocationCalculations == null) + if (exportableDuneLocationCalculations == null) { - throw new ArgumentNullException(nameof(duneLocationCalculations)); + throw new ArgumentNullException(nameof(exportableDuneLocationCalculations)); } if (filePath == null) @@ -61,11 +62,12 @@ } var stringBuilder = new StringBuilder(Resources.DuneLocationCalculationsWriter_WriteDuneLocationCalculations_HeaderLine + Environment.NewLine); + stringBuilder.AppendLine(Resources.DuneLocationCalculationsWriter_WriteDuneLocationCalculations_DisplayNameLine); stringBuilder.AppendLine(Resources.DuneLocationCalculationsWriter_WriteDuneLocationCalculations_UnitsLine); try { - foreach (DuneLocationCalculation calculation in duneLocationCalculations) + foreach (ExportableDuneLocationCalculation calculation in exportableDuneLocationCalculations) { stringBuilder.AppendLine(CreateCsvLine(calculation)); } @@ -78,18 +80,21 @@ } } - private static string CreateCsvLine(DuneLocationCalculation calculation) + private static string CreateCsvLine(ExportableDuneLocationCalculation calculation) { - DuneLocation duneLocation = calculation.DuneLocation; + DuneLocation duneLocation = calculation.Calculation.DuneLocation; var stringComponents = new List { duneLocation.CoastalAreaId.ToString(null, CultureInfo.InvariantCulture), duneLocation.Offset.ToString(DuneErosionDataResources.DuneLocation_Offset_format, CultureInfo.InvariantCulture), Resources.DuneLocationCalculationsWriter_CreateCsvLine_Parameter_without_value, - duneLocation.D50.ToString(null, CultureInfo.InvariantCulture) + duneLocation.D50.ToString(null, CultureInfo.InvariantCulture), + calculation.CategoryBoundaryName + " (Pfdsn = " + new NoProbabilityValueDoubleConverter().ConvertToInvariantString(calculation.Norm) + " jaar)", + calculation.CategoryBoundaryName, + calculation.Norm.ToString(CultureInfo.InvariantCulture) }; - stringComponents.InsertRange(2, GetOutputValues(calculation.Output)); + stringComponents.InsertRange(2, GetOutputValues(calculation.Calculation.Output)); return string.Join(separator, stringComponents); }