From 10b58ddc87386dac492af3f1220ade592488a4ad Mon Sep 17 00:00:00 2001 From: Joel Courtney Date: Thu, 31 Mar 2016 17:49:23 +1100 Subject: [PATCH] 0.1.24 bugfixes --- Gemfile.lock | 4 ++-- lib/aemo/nem12.rb | 34 +++++++++++++++++++++++++++++++++- lib/aemo/version.rb | 2 +- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index aa9420d..7f677e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - aemo (0.1.19) - activesupport (~> 4.2, >= 4.2.6) + aemo (0.1.24) + activesupport (~> 4.2, >= 4.2.0) httparty (~> 0.13, >= 0.13.1) json (~> 1.8) multi_xml (~> 0.5, >= 0.5.2) diff --git a/lib/aemo/nem12.rb b/lib/aemo/nem12.rb index 8621e96..8b34d49 100644 --- a/lib/aemo/nem12.rb +++ b/lib/aemo/nem12.rb @@ -4,7 +4,7 @@ module AEMO # Namespace for classes and modules that handle AEMO Gem NEM12 interactions # @since 0.1.4 - module NEM12 + class NEM12 # As per AEMO NEM12 Specification # http://www.aemo.com.au/Consultations/National-Electricity-Market/Open/~/media/Files/Other/consultations/nem/Meter%20Data%20File%20Format%20Specification%20NEM12_NEM13/MDFF_Specification_NEM12_NEM13_Final_v102_clean.ashx RECORD_INDICATORS = { @@ -226,6 +226,38 @@ module NEM12 } + DATA_STREAM_SUFFIX = { + # Averaged Data Streams + 'A' => { :stream => 'Average', :description => 'Import', :units => 'kWh' }, + 'D' => { :stream => 'Average', :description => 'Export', :units => 'kWh' }, + 'J' => { :stream => 'Average', :description => 'Import', :units => 'kVArh' }, + 'P' => { :stream => 'Average', :description => 'Export', :units => 'kVArh' }, + 'S' => { :stream => 'Average', :description => '', :units => 'kVAh' }, + # Master Data Streams + 'B' => { :stream => 'Master', :description => 'Import', :units => 'kWh' }, + 'E' => { :stream => 'Master', :description => 'Export', :units => 'kWh' }, + 'K' => { :stream => 'Master', :description => 'Import', :units => 'kVArh' }, + 'Q' => { :stream => 'Master', :description => 'Export', :units => 'kVArh' }, + 'T' => { :stream => 'Master', :description => '', :units => 'kVAh' }, + 'G' => { :stream => 'Master', :description => 'Power Factor', :units => 'PF' }, + 'H' => { :stream => 'Master', :description => 'Q Metering', :units => 'Qh' }, + 'M' => { :stream => 'Master', :description => 'Par Metering', :units => 'parh' }, + 'V' => { :stream => 'Master', :description => 'Volts or V2h or Amps or A2h', :units => '' }, + # Check Meter Streams + 'C' => { :stream => 'Check', :description => 'Import', :units => 'kWh' }, + 'F' => { :stream => 'Check', :description => 'Export', :units => 'kWh' }, + 'L' => { :stream => 'Check', :description => 'Import', :units => 'kVArh' }, + 'R' => { :stream => 'Check', :description => 'Export', :units => 'kVArh' }, + 'U' => { :stream => 'Check', :description => '', :units => 'kVAh' }, + 'Y' => { :stream => 'Check', :description => 'Q Metering', :units => 'Qh' }, + 'W' => { :stream => 'Check', :description => 'Par Metering Path', :units => '' }, + 'Z' => { :stream => 'Check', :description => 'Volts or V2h or Amps or A2h', :units => '' }, + # Net Meter Streams + # AEMO: NOTE THAT D AND J ARE PREVIOUSLY DEFINED + # 'D' => { :stream => 'Net', :description => 'Net', :units => 'kWh' }, + # 'J' => { :stream => 'Net', :description => 'Net', :units => 'kVArh' } + } + @file_contents = nil @header = nil @nmi_data_details = [] diff --git a/lib/aemo/version.rb b/lib/aemo/version.rb index 5cfcff7..9060d79 100644 --- a/lib/aemo/version.rb +++ b/lib/aemo/version.rb @@ -22,7 +22,7 @@ # @author Joel Courtney module AEMO # aemo version - VERSION = '0.1.23' + VERSION = '0.1.24' # aemo version split amongst different revisions MAJOR_VERSION, MINOR_VERSION, REVISION = VERSION.split('.').map(&:to_i)