Make ZaaImporter use parameter and unit dictionaries.
This commit is contained in:
		| @@ -22,6 +22,7 @@ using System.Linq; | |||||||
| using System.Text; | using System.Text; | ||||||
| using Bovender.Extensions; | using Bovender.Extensions; | ||||||
| using zaaReloaded2.LabModel; | using zaaReloaded2.LabModel; | ||||||
|  | using zaaReloaded2.Dictionaries; | ||||||
|  |  | ||||||
| namespace zaaReloaded2.Importer.ZaaImporter | 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) |         public void Import(string text) | ||||||
|         { |         { | ||||||
|             string[] paragraphs = text.Split( |             string[] paragraphs = text.Split( | ||||||
| @@ -86,16 +92,32 @@ namespace zaaReloaded2.Importer.ZaaImporter | |||||||
|                 } |                 } | ||||||
|  |  | ||||||
|                 Laboratory.AddTimePoint( |                 Laboratory.AddTimePoint( | ||||||
|                     new LaurisTimePoint(paragraphs.Slice(start, i - start + 1)) |                     new LaurisTimePoint( | ||||||
|  |                         paragraphs.Slice(start, i - start + 1), | ||||||
|  |                         _parameters, | ||||||
|  |                         _units | ||||||
|  |                         ) | ||||||
|                     ); |                     ); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         #endregion |         #endregion | ||||||
|  |  | ||||||
|  |         #region Constructor | ||||||
|  |  | ||||||
|  |         public ZaaImporter() | ||||||
|  |         { | ||||||
|  |             _parameters = new ParameterDictionary(); | ||||||
|  |             _units = new UnitDictionary(); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         #endregion | ||||||
|  |  | ||||||
|         #region Fields |         #region Fields | ||||||
|  |  | ||||||
|         Laboratory _laboratory; |         Laboratory _laboratory; | ||||||
|  |         ParameterDictionary _parameters; | ||||||
|  |         UnitDictionary _units; | ||||||
|  |  | ||||||
|         #endregion |         #endregion | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user