Class: NECB2015

Inherits:
NECB2011 show all
Defined in:
lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb

Overview

This class holds methods that apply NECB2011 rules.

Technical References:

Instance Method Summary collapse

Constructor Details

#initializeNECB2015


8
9
10
11
12
# File 'lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb', line 8

def initialize
  super()
  @template = self.class.name
  @standards_data = self.load_standards_database_new()
end

Instance Method Details

#load_standards_database_newObject


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/openstudio-standards/standards/necb/necb_2015/necb_2015.rb', line 14

def load_standards_database_new()
  #load NECB2011 data.
  super()  #replace template to 2015 for all tables.
  #puts JSON.pretty_generate( @standards_data['tables'] )

  @standards_data['tables'].each do |table|
    puts table['name']
    table['table'].each do |row|
      ["lighting_standard", "ventilation_standard", "template"].each do |item|
        row[item].gsub!('NECB2011', 'NECB2015') unless row[item].nil?
      end
    end
  end

  #needed for compatibility of standards database format
  @standards_data['tables'].each do |table|
    @standards_data[table['name']] = table
  end
  return @standards_data
end