class URBANopt::Reporting::DefaultReports::QAQC

QAQC flags for each feature

Attributes

domestic_hot_water[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

end_use_by_category[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

envelope_r_value[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

eui_reasonableness[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

internal_loads[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

mechanical_system_efficiency[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

mechanical_system_part_load_efficiency[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

schedules[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

simultaneous_heating_and_cooling[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

supply_and_zone_air_temperature[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

total_qaqc_flags[RW]

Hash - Hash of flags raised by QAQC measure for this feature during this reporting period

Public Class Methods

new(hash = {}) click to toggle source

QAQC class initialize quaqc attributes: :eui_reasonableness,:end_use_by_category,+:mechanical_system_part_load_efficiency, +:simultaneous_heating_and_cooling , +:internal_loads , +:schedules, +:envelope_r_value, +:domestic_hot_water , +:mechanical_system_efficiency , +:supply_and_zone_air_temperature, +:total_qaqc_flags

parameters:
  • hash - Hash - A hash containing qaqc attributes listed above.

# File lib/urbanopt/reporting/default_reports/qaqc_flags.rb, line 33
def initialize(hash = {})
  hash.delete_if { |k, v| v.nil? }
  hash = defaults.merge(hash)

  @eui_reasonableness = hash[:eui_reasonableness]
  @end_use_by_category = hash[:end_use_by_category]
  @mechanical_system_part_load_efficiency = hash[:mechanical_system_part_load_efficiency]
  @simultaneous_heating_and_cooling = hash[:simultaneous_heating_and_cooling]
  @supply_and_zone_air_temperature = hash[:supply_and_zone_air_temperature]
  @internal_loads = hash[:internal_loads]
  @schedules = hash[:schedules]
  @envelope_r_value = hash[:envelope_r_value]
  @domestic_hot_water = hash[:domestic_hot_water]
  @mechanical_system_efficiency = hash[:mechanical_system_efficiency]
  @total_qaqc_flags = hash[:total_qaqc_flags]


  # initialize class variables @@validator and @@schema
  @@validator ||= Validator.new
  @@schema ||= @@validator.schema

end

Public Instance Methods

add_qaqc_flags(other) click to toggle source

Merges qaqc_flags objects to each other by summing up values.

parameters:

other - QAQC - An object of Program class.

# File lib/urbanopt/reporting/default_reports/qaqc_flags.rb, line 128
def add_qaqc_flags(other)

  @eui_reasonableness = add_values(@eui_reasonableness, other.eui_reasonableness)
  @end_use_by_category = add_values(@end_use_by_category, other.end_use_by_category)
  @mechanical_system_part_load_efficiency = add_values(@mechanical_system_part_load_efficiency, other.mechanical_system_part_load_efficiency)
  @simultaneous_heating_and_cooling = add_values(@simultaneous_heating_and_cooling, other.simultaneous_heating_and_cooling)
  @supply_and_zone_air_temperature = add_values(@supply_and_zone_air_temperature, other.supply_and_zone_air_temperature)
  @internal_loads = add_values(@internal_loads, other.internal_loads)
  @schedules = add_values(@schedules, other.schedules)
  @envelope_r_value = add_values(@envelope_r_value, other.envelope_r_value)
  @domestic_hot_water = add_values(@domestic_hot_water, other.domestic_hot_water)
  @mechanical_system_efficiency = add_values(@mechanical_system_efficiency, other.mechanical_system_efficiency)
  @total_qaqc_flags = add_values(@total_qaqc_flags, other.total_qaqc_flags)

end
defaults() click to toggle source

Assigns default values if values do not exist.

# File lib/urbanopt/reporting/default_reports/qaqc_flags.rb, line 60
def defaults
  hash = {}

  hash[:eui_reasonableness] = nil
  hash[:end_use_by_category] = nil
  hash[:mechanical_system_part_load_efficiency] = nil
  hash[:simultaneous_heating_and_cooling] = nil
  hash[:supply_and_zone_air_temperature] = nil
  hash[:internal_loads] = nil
  hash[:schedules] = nil
  hash[:envelope_r_value] = nil
  hash[:domestic_hot_water] = nil
  hash[:mechanical_system_efficiency] = nil
  hash[:total_qaqc_flags] = nil


  return hash
end
to_hash() click to toggle source

Convert to a Hash equivalent for JSON serialization

# File lib/urbanopt/reporting/default_reports/qaqc_flags.rb, line 81
def to_hash
  result = {}

  result[:eui_reasonableness] = @eui_reasonableness
  result[:end_use_by_category] = @end_use_by_category
  result[:mechanical_system_part_load_efficiency] = @mechanical_system_part_load_efficiency
  result[:simultaneous_heating_and_cooling] = @simultaneous_heating_and_cooling
  result[:supply_and_zone_air_temperature] = @supply_and_zone_air_temperature
  result[:internal_loads] = @internal_loads
  result[:schedules] = @schedules
  result[:envelope_r_value] = @envelope_r_value
  result[:domestic_hot_water] = @domestic_hot_water
  result[:mechanical_system_efficiency] = @mechanical_system_efficiency
  result[:total_qaqc_flags] = @total_qaqc_flags

  # validate program properties against schema
  if @@validator.validate(@@schema[:definitions][:qaqc_flags][:properties], result).any?
    raise "qaqc properties does not match schema: #{@@validator.validate(@@schema[:definitions][:qaqc_flags][:properties], result)}"
  end

  return result

end