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 #4869 - Handle AirToAirComponents (ERVs) when cloning AirLoopHVACOutdoorAirSystem #4872

Merged
merged 7 commits into from
Jun 29, 2023
8 changes: 3 additions & 5 deletions src/model/AirLoopHVAC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ namespace model {
ModelObjectVector modelObjects;
modelObjects = supplyComponents(openstudio::IddObjectType::OS_AirLoopHVAC_OutdoorAirSystem);
if (modelObjects.size() == 1) {
if (OptionalAirLoopHVACOutdoorAirSystem oaSystem = modelObjects.front().optionalCast<AirLoopHVACOutdoorAirSystem>()) {
result = oaSystem;
}
return modelObjects.front().optionalCast<AirLoopHVACOutdoorAirSystem>();
}

return result;
Expand Down Expand Up @@ -900,9 +898,9 @@ namespace model {
return {demandComps.begin(), end};
}

std::vector<ModelObject> AirLoopHVAC_Impl::oaComponents(openstudio::IddObjectType /*type*/) const {
std::vector<ModelObject> AirLoopHVAC_Impl::oaComponents(openstudio::IddObjectType type) const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like ignoring type argument might have been a bug in its own right.

if (airLoopHVACOutdoorAirSystem()) {
return airLoopHVACOutdoorAirSystem()->components();
return airLoopHVACOutdoorAirSystem()->components(type);
} else {
return {};
}
Expand Down
Loading