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

fix(ironbug): Report the Ironbug stderr to the user #320

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/measures/from_honeybee_model/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
require 'fileutils'
require 'pathname'
require 'json'
require 'open3'

# start the measure
class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
Expand Down Expand Up @@ -133,7 +134,12 @@ def run(model, runner, user_arguments)
model.save(osm_path, true)
# call the Ironbug console to add the HVAC to the OSM
ironbug_exe = '"' + $ironbug_exe + '"'
system(ironbug_exe + ' "' + osm_path + '" "' + hvac_json_path + '"')
ib_cmd = ironbug_exe + ' "' + osm_path + '" "' + hvac_json_path + '"'
stdout, stderr, status = Open3.capture3(ib_cmd)
if status.exitstatus != 0
runner.registerError('Failed to apply IronBug HVAC:' + stderr)
return false
end
# load the new model
translator = OpenStudio::OSVersion::VersionTranslator.new
o_model = translator.loadModel(osm_path)
Expand Down