lib/measures/HardSizeHvac/measure.rb in openstudio-calibration-0.5.0 vs lib/measures/HardSizeHvac/measure.rb in openstudio-calibration-0.5.1
- old
+ new
@@ -64,16 +64,18 @@
# define what happens when the measure is run
def run(model, runner, user_arguments)
super(model, runner, user_arguments)
- # Require the HVAC sizing library
- # require_relative 'resources/HVACSizing.Model'
+ # Make the standard applier
+ standard = Standard.build('90.1-2004') # template choice doesn't matter
- # Run a sizing run and attach the resulting
- # sql file to the model. Hard sizing methods
- # won't work unless the model has a sql file.
- model.runSizingRun(Dir.pwd.to_s)
+ # Perform a sizing run (2.5.1 and later)
+ sizing_run_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/SR1').to_s
+ runner.registerInfo("Performing sizing run at #{sizing_run_path}.")
+ if standard.model_run_sizing_run(model, sizing_run_path) == false
+ return false
+ end
# Hard sizing every object in the model.
model.applySizingValues
# Log the openstudio-standards messages to the runner