MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / addToSourceSideNode

Method addToSourceSideNode

src/model/WaterHeaterStratified.cpp:1282–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1280 }
1281
1282 bool WaterHeaterStratified_Impl::addToSourceSideNode(Node& node) {
1283 auto thisModelObject = getObject<ModelObject>();
1284 auto t_plantLoop = node.plantLoop();
1285
1286 boost::optional<unsigned> componentInletPort = demandInletPort();
1287 boost::optional<unsigned> componentOutletPort = demandOutletPort();
1288
1289 boost::optional<HVACComponent> systemStartComponent;
1290 boost::optional<HVACComponent> systemEndComponent;
1291
1292 if (node.getImpl<Node_Impl>()->isConnected(thisModelObject)) {
1293 return false;
1294 }
1295
1296 if (t_plantLoop) {
1297 if (t_plantLoop->supplyComponent(node.handle())) {
1298
1299 systemStartComponent = t_plantLoop->supplyInletNode();
1300 systemEndComponent = t_plantLoop->supplyOutletNode();
1301
1302 removeFromSourceSidePlantLoop();
1303 } else if (t_plantLoop->demandComponent(node.handle())) {
1304 systemStartComponent = t_plantLoop->demandInletNode();
1305 systemEndComponent = t_plantLoop->demandOutletNode();
1306
1307 removeFromSourceSidePlantLoop();
1308 }
1309 }
1310
1311 if (systemStartComponent && systemEndComponent && componentOutletPort && componentInletPort) {
1312 return HVACComponent_Impl::addToNode(node, systemStartComponent.get(), systemEndComponent.get(), componentInletPort.get(),
1313 componentOutletPort.get());
1314 }
1315
1316 return false;
1317 }
1318
1319 // Name aliases
1320

Callers 1

addToNodeMethod · 0.95

Calls 10

isConnectedMethod · 0.80
supplyComponentMethod · 0.80
demandComponentMethod · 0.80
plantLoopMethod · 0.45
handleMethod · 0.45
supplyInletNodeMethod · 0.45
supplyOutletNodeMethod · 0.45
demandInletNodeMethod · 0.45
demandOutletNodeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected