Replace CntrlComparison with LeafGasComparison
This commit is contained in:
@@ -6,17 +6,17 @@ using LeafWeb.Core.Utility;
|
||||
|
||||
namespace LeafWeb.Core.Parsers
|
||||
{
|
||||
public class CntrlComparisonParser : CsvParserBase
|
||||
public class LeafGasComparisonParser : CsvParserBase
|
||||
{
|
||||
public CntrlComparisonParser(FileSystemInfo csvFile) : base(csvFile)
|
||||
public LeafGasComparisonParser(FileSystemInfo csvFile) : base(csvFile)
|
||||
{
|
||||
}
|
||||
|
||||
public CntrlComparisonParser(byte[] fileContents) : base(fileContents)
|
||||
public LeafGasComparisonParser(byte[] fileContents) : base(fileContents)
|
||||
{
|
||||
}
|
||||
|
||||
public CntrlComparison[] Parse()
|
||||
public LeafGasComparison[] Parse()
|
||||
{
|
||||
var fittingTitles = GetNextCsvRowValues();
|
||||
if (fittingTitles == null)
|
||||
@@ -25,10 +25,10 @@ namespace LeafWeb.Core.Parsers
|
||||
if (fitUnits == null)
|
||||
throw new ParseException($"Could not read data units row on line number {CsvReader.Row}");
|
||||
|
||||
return ParseCntrlComparisonSet(fittingTitles).ToArray();
|
||||
return ParseLeafGasComparisonSet(fittingTitles).ToArray();
|
||||
}
|
||||
|
||||
private IEnumerable<CntrlComparison> ParseCntrlComparisonSet(string[] fittingTitles)
|
||||
private IEnumerable<LeafGasComparison> ParseLeafGasComparisonSet(string[] fittingTitles)
|
||||
{
|
||||
var endOfFile = false;
|
||||
while (!endOfFile)
|
||||
@@ -43,7 +43,7 @@ namespace LeafWeb.Core.Parsers
|
||||
throw new ParseException($"Encountered empty line while readding fitting info on line {CsvReader.Row}");
|
||||
if (values == null) // end of file
|
||||
yield break;
|
||||
if (ParsedObjectFactory<CntrlComparisonPhotosyntheticInfo>.IsPropertiesTitlesMatch(values))
|
||||
if (ParsedObjectFactory<LeafGasComparisonPhotosyntheticInfo>.IsPropertiesTitlesMatch(values))
|
||||
{
|
||||
photosyntheticTitles = values;
|
||||
break;
|
||||
@@ -66,13 +66,13 @@ namespace LeafWeb.Core.Parsers
|
||||
}
|
||||
|
||||
var fittingInfo =
|
||||
ParsedObjectFactory<CntrlComparisonFittingInfo>
|
||||
ParsedObjectFactory<LeafGasComparisonFittingInfo>
|
||||
.Create(fittingTitles, fittingValues.ToArray());
|
||||
var photosyntheticInfo =
|
||||
ParsedObjectFactory<CntrlComparisonPhotosyntheticInfo>
|
||||
ParsedObjectFactory<LeafGasComparisonPhotosyntheticInfo>
|
||||
.Create(photosyntheticTitles, photosyntheticValues.ToArray());
|
||||
|
||||
yield return new CntrlComparison
|
||||
yield return new LeafGasComparison
|
||||
{
|
||||
FittingInfo = fittingInfo,
|
||||
PhotosyntheticInfo = photosyntheticInfo
|
||||
Reference in New Issue
Block a user