Skip to content

Commit

Permalink
fix(from_OS): Ensure Import IDF/OSM/gbXML always has display_name
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jun 20, 2024
1 parent 8dbc329 commit 15b731d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/from_openstudio/geometry/aperture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def self.from_sub_surface(sub_surface, site_transformation)
hash = {}
hash[:type] = 'Aperture'
hash[:identifier] = clean_identifier(sub_surface.nameString)
hash[:display_name] = clean_name(sub_surface.nameString)
unless sub_surface.displayName.empty?
hash[:display_name] = (sub_surface.displayName.get).force_encoding("UTF-8")
else
hash[:display_name] = sub_surface.nameString
end
hash[:user_data] = {handle: sub_surface.handle.to_s}
hash[:properties] = properties_from_sub_surface(sub_surface)
hash[:geometry] = geometry_from_sub_surface(sub_surface, site_transformation)
Expand Down
2 changes: 2 additions & 0 deletions lib/from_openstudio/geometry/door.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def self.from_sub_surface(sub_surface, site_transformation)
hash[:identifier] = clean_identifier(sub_surface.nameString)
unless sub_surface.displayName.empty?
hash[:display_name] = (sub_surface.displayName.get).force_encoding("UTF-8")
else
hash[:display_name] = sub_surface.nameString
end
hash[:user_data] = {handle: sub_surface.handle.to_s}
hash[:properties] = properties_from_sub_surface(sub_surface)
Expand Down
2 changes: 2 additions & 0 deletions lib/from_openstudio/geometry/face.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def self.from_surface(surface, site_transformation)
hash[:identifier] = clean_identifier(surface.nameString)
unless surface.displayName.empty?
hash[:display_name] = (surface.displayName.get).force_encoding("UTF-8")
else
hash[:display_name] = surface.nameString
end
hash[:user_data] = {handle: surface.handle.to_s}
hash[:properties] = properties_from_surface(surface)
Expand Down
2 changes: 2 additions & 0 deletions lib/from_openstudio/geometry/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def self.from_space(space)
hash[:identifier] = clean_identifier(space.nameString)
unless space.displayName.empty?
hash[:display_name] = (space.displayName.get).force_encoding("UTF-8")
else
hash[:display_name] = space.nameString
end
hash[:user_data] = {space: space.handle.to_s}
hash[:properties] = properties_from_space(space)
Expand Down
2 changes: 2 additions & 0 deletions lib/from_openstudio/geometry/shade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def self.from_shading_surface(shading_surface, site_transformation)
hash[:identifier] = clean_identifier(shading_surface.nameString)
unless shading_surface.displayName.empty?
hash[:display_name] = (shading_surface.displayName.get).force_encoding("UTF-8")
else
hash[:display_name] = shading_surface.nameString
end
hash[:user_data] = {handle: shading_surface.handle.to_s}
hash[:properties] = properties_from_shading_surface(shading_surface)
Expand Down

0 comments on commit 15b731d

Please # to comment.