Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add interval values parsing #12

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
};
}

}
Loading