Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check on each system type separately to see if it exists in input xml #149

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading