| 262 | } |
| 263 | |
| 264 | std::vector<IdfObject> AirLoopHVACReturnPlenum_Impl::remove() { |
| 265 | Model t_model = model(); |
| 266 | |
| 267 | if (boost::optional<AirLoopHVAC> t_airLoopHVAC = airLoopHVAC()) { |
| 268 | AirLoopHVACZoneMixer zoneMixer = t_airLoopHVAC->zoneMixer(); |
| 269 | std::vector<ModelObject> t_inletModelObjects = inletModelObjects(); |
| 270 | |
| 271 | for (auto it = t_inletModelObjects.rbegin(); it != t_inletModelObjects.rend(); ++it) { |
| 272 | unsigned branchIndex = branchIndexForInletModelObject(*it); |
| 273 | unsigned t_inletPort = inletPort(branchIndex); |
| 274 | unsigned connectedObjectOutletPort = connectedObjectPort(t_inletPort).get(); |
| 275 | |
| 276 | t_model.connect(*it, connectedObjectOutletPort, zoneMixer, zoneMixer.nextInletPort()); |
| 277 | } |
| 278 | |
| 279 | boost::optional<ModelObject> mo = outletModelObject(); |
| 280 | OS_ASSERT(mo); |
| 281 | boost::optional<Node> node = mo->optionalCast<Node>(); |
| 282 | OS_ASSERT(node); |
| 283 | zoneMixer.removePortForBranch(zoneMixer.branchIndexForInletModelObject(node.get())); |
| 284 | node->remove(); |
| 285 | } else { |
| 286 | auto outlet = outletModelObject(); |
| 287 | auto h = handle(); |
| 288 | |
| 289 | auto zoneHVAC = t_model.getModelObjects<ZoneHVACComponent>(); |
| 290 | for (auto& hvac : zoneHVAC) { |
| 291 | auto plenum = hvac.returnPlenum(); |
| 292 | if (plenum && (plenum->handle() == h)) { |
| 293 | hvac.removeReturnPlenum(); |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | if (outlet) { |
| 298 | outlet->remove(); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | return Mixer_Impl::remove(); |
| 303 | } |
| 304 | |
| 305 | // If every zone on the plenum has exactly one piece of equipment |
| 306 | // and that equipment is a ZoneHVACIdealLoadsAirSystem |
nothing calls this directly
no test coverage detected