From a847c1f8ba4c46cb9d6413dee574db00c6c9fdb7 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sat, 11 Jul 2015 16:58:18 +0200 Subject: [PATCH] Make ZaaImporter use parameter and unit dictionaries. --- .../Importer/ZaaImporter/ZaaImporter.cs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/zaaReloaded2/Importer/ZaaImporter/ZaaImporter.cs b/zaaReloaded2/Importer/ZaaImporter/ZaaImporter.cs index cec5a2f..61cb58d 100755 --- a/zaaReloaded2/Importer/ZaaImporter/ZaaImporter.cs +++ b/zaaReloaded2/Importer/ZaaImporter/ZaaImporter.cs @@ -22,6 +22,7 @@ using System.Linq; using System.Text; using Bovender.Extensions; using zaaReloaded2.LabModel; +using zaaReloaded2.Dictionaries; namespace zaaReloaded2.Importer.ZaaImporter { @@ -51,6 +52,11 @@ namespace zaaReloaded2.Importer.ZaaImporter } } + /// + /// Splits the into individual time points + /// and creates objects from them. + /// + /// ZAA-formatted Lauris output to import. public void Import(string text) { string[] paragraphs = text.Split( @@ -86,16 +92,32 @@ namespace zaaReloaded2.Importer.ZaaImporter } Laboratory.AddTimePoint( - new LaurisTimePoint(paragraphs.Slice(start, i - start + 1)) + new LaurisTimePoint( + paragraphs.Slice(start, i - start + 1), + _parameters, + _units + ) ); } } #endregion + #region Constructor + + public ZaaImporter() + { + _parameters = new ParameterDictionary(); + _units = new UnitDictionary(); + } + + #endregion + #region Fields Laboratory _laboratory; + ParameterDictionary _parameters; + UnitDictionary _units; #endregion }