Skip to content

Commit

Permalink
feat: add interval values parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ahanoff committed Sep 15, 2024
1 parent 7b114ce commit 57f6d22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/AEMO.MDFF.Tests/NEM12/BasicTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public async Task Test1()
case NMIDataDetailsRecord { NextScheduledReadDate: var nsrd }:
_testOutputHelper.WriteLine(nsrd.ToLongDateString());
break;
case IntervalDataRecord { IntervalValues: var ivs }:
_testOutputHelper.WriteLine(ivs.ToString());
break;
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/AEMO.MDFF/NEM12/Nem12Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@ private IntervalDataRecord ParseIntervalDataRecord(CsvDataReader csv, string cur
int intervalLength = _nmiIntervalLengths[currentNMI];
int expectedIntervals = 1440 / intervalLength; // 1440 minutes in a day

var intervalValues = new List<decimal>();
for (int i = 2; i < expectedIntervals + 2; i++)
{
intervalValues.Add(csv.GetDecimal(i));
}

return new IntervalDataRecord
{
IntervalDate = date
// TODO: parse interval values
IntervalDate = date,
IntervalValues = intervalValues
};
}

}

0 comments on commit 57f6d22

Please sign in to comment.