Fix up parsers
This commit is contained in:
@@ -11,6 +11,7 @@ namespace LeafWeb.Core.DAL
|
||||
public DbSet<LeafInputStatus> LeafInputStatus { get; set; }
|
||||
public DbSet<FluxnetSite> FluxnetSites { get; set; }
|
||||
public DbSet<PhotosynthesisType> PhotosynthesisTypes { get; set; }
|
||||
public DbSet<LeafOutputFile> LeafOutputFiles { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace LeafWeb.Core.Parsers
|
||||
{
|
||||
}
|
||||
|
||||
public LeafInputInfo Parse()
|
||||
public LeafInputData Parse()
|
||||
{
|
||||
// First 10 lines
|
||||
var leafInput = ParseLeafInput();
|
||||
@@ -33,7 +33,7 @@ namespace LeafWeb.Core.Parsers
|
||||
return leafInput;
|
||||
}
|
||||
|
||||
private LeafInputInfo ParseLeafInput()
|
||||
private LeafInputData ParseLeafInput()
|
||||
{
|
||||
var items = new List<string>();
|
||||
for (var i = 0; i < 10; i++)
|
||||
@@ -46,10 +46,10 @@ namespace LeafWeb.Core.Parsers
|
||||
throw new ParseException("Could not read first field on line number " + CsvReader.Row);
|
||||
items.Add(field);
|
||||
}
|
||||
return ParsedObjectFactory<LeafInputInfo>.Create(items.ToArray());
|
||||
return ParsedObjectFactory<LeafInputData>.Create(items.ToArray());
|
||||
}
|
||||
|
||||
private LeafInputSite ParseLeafInputSite()
|
||||
private LeafInputDataSite ParseLeafInputSite()
|
||||
{
|
||||
var titles = GetNextCsvRowValues();
|
||||
if (titles == null)
|
||||
@@ -67,10 +67,10 @@ namespace LeafWeb.Core.Parsers
|
||||
var item = Tuple.Create(titles[i], values[i]);
|
||||
items.Add(item);
|
||||
}
|
||||
return ParsedObjectFactory<LeafInputSite>.Create(items.ToArray());
|
||||
return ParsedObjectFactory<LeafInputDataSite>.Create(items.ToArray());
|
||||
}
|
||||
|
||||
private LeafInputPhotosynthetic ParseLeafInputPhotosynthetic()
|
||||
private LeafInputDataPhotosynthetic ParseLeafInputPhotosynthetic()
|
||||
{
|
||||
var titles = GetNextCsvRowValues();
|
||||
if (titles == null)
|
||||
@@ -88,10 +88,10 @@ namespace LeafWeb.Core.Parsers
|
||||
var item = Tuple.Create(titles[i], values[i]);
|
||||
items.Add(item);
|
||||
}
|
||||
return ParsedObjectFactory<LeafInputPhotosynthetic>.Create(items.ToArray());
|
||||
return ParsedObjectFactory<LeafInputDataPhotosynthetic>.Create(items.ToArray());
|
||||
}
|
||||
|
||||
private LeafInputData[] ParseLeafInputData()
|
||||
private LeafInputDataCurve[] ParseLeafInputData()
|
||||
{
|
||||
var titles = GetNextCsvRowValues();
|
||||
if (titles == null)
|
||||
@@ -108,10 +108,10 @@ namespace LeafWeb.Core.Parsers
|
||||
break;
|
||||
valueArrays.Add(values);
|
||||
}
|
||||
return ParsedObjectFactory<LeafInputData>.Create(titles, valueArrays.ToArray());
|
||||
return ParsedObjectFactory<LeafInputDataCurve>.Create(titles, valueArrays.ToArray());
|
||||
}
|
||||
|
||||
public static void ExportCsv(string filename, IEnumerable<LeafInputInfo> leafInputs)
|
||||
public static void ExportCsv(string filename, IEnumerable<LeafInputData> leafInputs)
|
||||
{
|
||||
using (var textWriter = new StreamWriter(filename))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user