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

Method addToSourceSideNode

src/model/WaterHeaterMixed.cpp:1296–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1294 }
1295
1296 bool WaterHeaterMixed_Impl::addToSourceSideNode(Node& node) {
1297 auto thisModelObject = getObject<ModelObject>();
1298 auto t_plantLoop = node.plantLoop();
1299
1300 boost::optional<unsigned> componentInletPort = demandInletPort();
1301 boost::optional<unsigned> componentOutletPort = demandOutletPort();
1302
1303 boost::optional<HVACComponent> systemStartComponent;
1304 boost::optional<HVACComponent> systemEndComponent;
1305
1306 if (node.getImpl<Node_Impl>()->isConnected(thisModelObject)) {
1307 return false;
1308 }
1309
1310 if (t_plantLoop) {
1311 if (t_plantLoop->supplyComponent(node.handle())) {
1312
1313 systemStartComponent = t_plantLoop->supplyInletNode();
1314 systemEndComponent = t_plantLoop->supplyOutletNode();
1315
1316 removeFromSourceSidePlantLoop();
1317 } else if (t_plantLoop->demandComponent(node.handle())) {
1318 systemStartComponent = t_plantLoop->demandInletNode();
1319 systemEndComponent = t_plantLoop->demandOutletNode();
1320
1321 removeFromSourceSidePlantLoop();
1322 }
1323 }
1324
1325 if (systemStartComponent && systemEndComponent && componentOutletPort && componentInletPort) {
1326 return HVACComponent_Impl::addToNode(node, systemStartComponent.get(), systemEndComponent.get(), componentInletPort.get(),
1327 componentOutletPort.get());
1328 }
1329
1330 return false;
1331 }
1332
1333 // Name aliases
1334

Callers 3

addToNodeMethod · 0.95
TEST_FFunction · 0.45
TEST_FFunction · 0.45

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 2

TEST_FFunction · 0.36
TEST_FFunction · 0.36