Skip to content

Commit

Permalink
check on each system type separately to see if it exists in input xml
Browse files Browse the repository at this point in the history
  • Loading branch information
kflemin authored and haneslinger committed Feb 7, 2024
1 parent 1f1e09c commit 3f389b0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/buildingsync/model_articulation/facility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,25 @@ def read_and_create_initial_systems
end
end
end
# check that the system types from below were found, if not initialize?
# TODO: double check that this makes sense and isn't hiding a data error (some systems could be present but not others?)
if !@systems_map.key?('HVACSystem')
hvac_xml = @g.add_hvac_system_to_facility(@base_xml)
@hvac_system = HVACSystem.new(hvac_xml, @ns)
@systems_map['HVACSystem'] = []
@systems_map['HVACSystem'] << BuildingSync::HVACSystem.new(hvac_xml, @ns)
end
if !@systems_map.key?('LoadsSystem')
@load_system = LoadsSystem.new
@systems_map['LoadsSystem'] = []
@systems_map['LoadsSystem'] << LoadsSystem.new
end
if !@systems_map.key?('LightingSystem')
lighting_xml = @g.add_lighting_system_to_facility(@base_xml)
@lighting_system = LightingSystemType.new(lighting_xml, @ns)
@systems_map['LightingSystem'] = []
@systems_map['LightingSystem'] << LightingSystemType.new(lighting_xml, @ns)
end
else
hvac_xml = @g.add_hvac_system_to_facility(@base_xml)
lighting_xml = @g.add_lighting_system_to_facility(@base_xml)
Expand Down Expand Up @@ -305,6 +324,7 @@ def create_building_systems(main_output_dir:, zone_hash: nil, hvac_delivery_type
# Make the open_studio_system_standard applier
open_studio_system_standard = determine_open_studio_system_standard
OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Facility.create_building_system', "Building Standard with template: #{template}.")
puts "BuildingSync.Facility.create_building_system - Standard Template set to: #{open_studio_system_standard}"

# add internal loads to space types
if add_space_type_loads
Expand Down

0 comments on commit 3f389b0

Please sign in to comment.