NREL/OpenStudio — pull request #635 by mbadams5 (2013-11-08 14:10:23+00:00)
Title: Add new AirLoopHVAC::addBranchForZone overload

Add new AirLoopHVAC::addBranchForZone(ThermalZone & thermalZone, StraightComponent & airTerminal) overload.

This fixes an issue with the Ruby and Python bindings where you can not pass an Air Terminal to addBranchForZone() without first casting it to optional.

@kbenne @asparke2
All model unit tests pass and ruby test code passes.

The following code will reproduce the error before this fix.

===Ruby===
m = OpenStudio::Model::Model.new()
s = m.alwaysOnDiscreteSchedule()
coil = OpenStudio::Model::CoilHeatingWater.new(m, s)
terminal = OpenStudio::Model::AirTerminalSingleDuctVAVReheat.new(m,s,coil)
coil2 = OpenStudio::Model::CoilHeatingWater.new(m, s)
terminal2 = OpenStudio::Model::AirTerminalSingleDuctVAVReheat.new(m,s,coil2)
air_loop = OpenStudio::Model::AirLoopHVAC.new(m)
thermal_zone = OpenStudio::Model::ThermalZone.new(m)
thermal_zone2 = OpenStudio::Model::ThermalZone.new(m)

#fails before fix, works with new overload
air_loop.addBranchForZone(thermal_zone, terminal)

terminal_straight_component = terminal2.to_StraightComponent()

#works before and after fix
air_loop.addBranchForZone(thermal_zone2, terminal_straight_component)

===ERROR MESSAGE===
ArgumentError: Wrong arguments for overloaded method 'AirLoopHVAC.addBranchForZone'.
Possible C/C++ prototypes are:
bool AirLoopHVAC.addBranchForZone(openstudio::model::ThermalZone &thermalZone, boost::optional< openstudio::model::StraightComponent > optAirTerminal)
bool AirLoopHVAC.addBranchForZone(openstudio::model::ThermalZone &thermalZone)