Make ZaaImporter use parameter and unit dictionaries.
This commit is contained in:
		| @@ -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 | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// Splits the <paramref name="text"/> into individual time points | ||||
|         /// and creates <see cref="LaurisTimePoint"/> objects from them. | ||||
|         /// </summary> | ||||
|         /// <param name="text">ZAA-formatted Lauris output to import.</param> | ||||
|         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 | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user