Class: Honeybee::EnergyWindowFrame

Inherits:
ModelObject show all
Defined in:
lib/honeybee/material/frame.rb,
lib/to_openstudio/material/frame.rb

Instance Attribute Summary

Attributes inherited from ModelObject

#errors, #openstudio_object, #warnings

Instance Method Summary collapse

Methods inherited from ModelObject

#allowable_types, clean_identifier, clean_name, #initialize, #method_missing, read_from_disk, truncate

Constructor Details

This class inherits a constructor from Honeybee::ModelObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Honeybee::ModelObject

Instance Method Details

#defaultsObject



37
38
39
# File 'lib/honeybee/material/frame.rb', line 37

def defaults
  @@schema[:components][:schemas][:EnergyWindowFrame][:properties]
end

#find_existing_openstudio_object(openstudio_model) ⇒ Object



39
40
41
42
43
# File 'lib/to_openstudio/material/frame.rb', line 39

def find_existing_openstudio_object(openstudio_model)
  object = openstudio_model.getWindowPropertyFrameAndDividerByName(@hash[:identifier])
  return object.get if object.is_initialized
  nil
end

#to_openstudio(openstudio_model) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/to_openstudio/material/frame.rb', line 45

def to_openstudio(openstudio_model)
  # create frame OpenStudio material
  os_frame_mat = OpenStudio::Model::WindowPropertyFrameAndDivider.new(openstudio_model)
  os_frame_mat.setName(@hash[:identifier])
  unless @hash[:display_name].nil?
    os_frame_mat.setDisplayName(@hash[:display_name])
  end
  os_frame_mat.setFrameWidth(@hash[:width])
  os_frame_mat.setFrameConductance(@hash[:conductance])

  # assign edge_to_center_ratio if it exists
  if @hash[:edge_to_center_ratio]
    os_frame_mat.setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance(
        @hash[:edge_to_center_ratio])
  else
    os_frame_mat.setRatioOfFrameEdgeGlassConductanceToCenterOfGlassConductance(
        defaults[:edge_to_center_ratio][:default])
  end

  # assign outside_projection if it exists
  if @hash[:outside_projection]
    os_frame_mat.setFrameOutsideProjection(@hash[:outside_projection])
  else
    os_frame_mat.setFrameOutsideProjection(defaults[:outside_projection][:default])
  end

  # assign inside_projection if it exists
  if @hash[:inside_projection]
    os_frame_mat.setFrameInsideProjection(@hash[:inside_projection])
  else
    os_frame_mat.setFrameInsideProjection(defaults[:inside_projection][:default])
  end

  # assign thermal absorptance if it exists
  if @hash[:thermal_absorptance]
    os_frame_mat.setFrameThermalHemisphericalEmissivity(@hash[:thermal_absorptance])
  else
    os_frame_mat.setFrameThermalHemisphericalEmissivity(defaults[:thermal_absorptance][:default])
  end

  # assign solar absorptance if it exists
  if @hash[:solar_absorptance]
    os_frame_mat.setFrameSolarAbsorptance(@hash[:solar_absorptance])
  else
    os_frame_mat.setFrameSolarAbsorptance(defaults[:solar_absorptance][:default])
  end

  # assign visible absorptance if it exists
  if @hash[:visible_absorptance]
    os_frame_mat.setFrameVisibleAbsorptance(@hash[:visible_absorptance])
  else
    os_frame_mat.setFrameVisibleAbsorptance(defaults[:visible_absorptance][:default])
  end

  os_frame_mat
end