Skip to content

Commit

Permalink
update measures
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhou601 committed Oct 4, 2024
1 parent 8edc860 commit 37aac01
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>2ecbdcc0-d0e3-4c8f-b8f8-a839e9bdbee1</version_id>
<version_modified>2024-10-04T17:02:56Z</version_modified>
<version_id>d81e4aaa-3c8f-450e-84f9-b2aab461ebb2</version_id>
<version_modified>2024-10-04T21:15:24Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -183,7 +183,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>E1E63AE7</checksum>
<checksum>1D9A5E79</checksum>
</file>
<file>
<filename>airflow.rb</filename>
Expand Down Expand Up @@ -345,7 +345,7 @@
<filename>geometry.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>7E3D612D</checksum>
<checksum>83A8258E</checksum>
</file>
<file>
<filename>hotwater_appliances.rb</filename>
Expand All @@ -357,7 +357,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>278B0E8F</checksum>
<checksum>C25F839C</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand All @@ -375,7 +375,7 @@
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>9A5ABED7</checksum>
<checksum>00C7FBC2</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand Down Expand Up @@ -447,7 +447,7 @@
<filename>model.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>6933774F</checksum>
<checksum>46B2B024</checksum>
</file>
<file>
<filename>output.rb</filename>
Expand Down
14 changes: 10 additions & 4 deletions HPXMLtoOpenStudio/resources/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ def self.merge_unit_models(model, hpxml_osm_map, common_surface_id_map)
end
end

unit_surface_to_obj_index_map = {}
unit_model_mapping = {}
unit_surface_to_obj_index_map = {} # map of unit model surface handle to whole building model object index
unit_model_map = {} # map of OS surface handle to OS adjacent surface handle (at unit model workspace)
hpxml_osm_map.each_with_index do |(hpxml_bldg, unit_model), unit_number|
Geometry.shift_surfaces(unit_model, unit_number)
prefix_object_names(unit_model, unit_number)
Expand All @@ -789,15 +789,17 @@ def self.merge_unit_models(model, hpxml_osm_map, common_surface_id_map)
# Should be stored in the map, store the unit model object mapping
next unless common_surface_id_map.keys.include? surface.id
next unless common_surface_id_map.keys.include? surface.sameas_id

current_surface_handle = common_surface_id_map[surface.id]
adjacent_surface_handle = common_surface_id_map[surface.sameas_id]
unit_model_mapping[current_surface_handle] = adjacent_surface_handle
unit_model_map[current_surface_handle] = adjacent_surface_handle
end

# Handle remaining (non-unique) objects now
unit_model.objects.each do |obj|
next if unit_number > 0 && obj.to_Building.is_initialized
next if unique_handles_to_skip.include? obj.handle.to_s

unit_model_obj_index = unit_model_objects.size
if common_surface_id_map.values.include? obj.handle
unit_surface_to_obj_index_map[obj.handle] = unit_model_obj_index
Expand All @@ -819,13 +821,17 @@ def self.merge_unit_models(model, hpxml_osm_map, common_surface_id_map)
end
end
end
return if unit_surface_to_obj_index_map.empty?

model_objects.each_with_index do |obj, index|
next unless unit_surface_to_obj_index_map.values.include? index

unit_surface_handle = unit_model_objects[index].handle
surface = obj.to_Surface.get
adjacent_surface_index = unit_surface_to_obj_index_map[unit_model_mapping[unit_surface_handle]]
adjacent_surface_index = unit_surface_to_obj_index_map[unit_model_map[unit_surface_handle]]
adjacent_surface = model_objects[adjacent_surface_index].to_Surface.get
next if surface.adjacentSurface.is_initialized

surface.setAdjacentSurface(adjacent_surface)
# Need to set the same construction to make OS working
adjacent_surface.setConstruction(surface.construction.get)
Expand Down
10 changes: 2 additions & 8 deletions ReportUtilityBills/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>report_utility_bills</name>
<uid>ca88a425-e59a-4bc4-af51-c7e7d1e960fe</uid>
<version_id>105d1f2f-ea3f-4225-b340-4ea362671b8a</version_id>
<version_modified>2024-10-01T18:47:20Z</version_modified>
<version_id>30741a05-2999-41a9-a8e9-3e5fc2bb1bb0</version_id>
<version_modified>2024-10-04T21:15:27Z</version_modified>
<xml_checksum>15BF4E57</xml_checksum>
<class_name>ReportUtilityBills</class_name>
<display_name>Utility Bills Report</display_name>
Expand Down Expand Up @@ -182,12 +182,6 @@
<usage_type>script</usage_type>
<checksum>CC656203</checksum>
</file>
<file>
<filename>detailed_rates/Adams Electric Cooperative Inc - Rate Schedule T1 TOD (Effective 2013-02-01).json</filename>
<filetype>json</filetype>
<usage_type>resource</usage_type>
<checksum>8E644347</checksum>
</file>
<file>
<filename>detailed_rates/README.md</filename>
<filetype>md</filetype>
Expand Down

0 comments on commit 37aac01

Please sign in to comment.