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

Method addToNode

src/model/WaterToWaterComponent.cpp:143–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 bool WaterToWaterComponent_Impl::addToNode(Node& node) {
144 auto _model = node.model();
145 auto thisModelObject = getObject<ModelObject>();
146 auto t_plantLoop = node.plantLoop();
147
148 boost::optional<unsigned> componentInletPort;
149 boost::optional<unsigned> componentOutletPort;
150
151 boost::optional<HVACComponent> systemStartComponent;
152 boost::optional<HVACComponent> systemEndComponent;
153
154 if (node.getImpl<Node_Impl>()->isConnected(thisModelObject)) {
155 return false;
156 }
157
158 if (t_plantLoop) {
159 if (t_plantLoop->supplyComponent(node.handle())) {
160
161 systemStartComponent = t_plantLoop->supplyInletNode();
162 systemEndComponent = t_plantLoop->supplyOutletNode();
163 componentInletPort = supplyInletPort();
164 componentOutletPort = supplyOutletPort();
165
166 removeFromPlantLoop();
167 } else if (t_plantLoop->demandComponent(node.handle())) {
168
169 systemStartComponent = t_plantLoop->demandInletNode();
170 systemEndComponent = t_plantLoop->demandOutletNode();
171 componentInletPort = demandInletPort();
172 componentOutletPort = demandOutletPort();
173
174 removeFromSecondaryPlantLoop();
175 }
176 }
177
178 if (systemStartComponent && systemEndComponent && componentOutletPort && componentInletPort) {
179 return HVACComponent_Impl::addToNode(node, systemStartComponent.get(), systemEndComponent.get(), componentInletPort.get(),
180 componentOutletPort.get());
181 } else {
182 return false;
183 }
184 }
185
186 ModelObject WaterToWaterComponent_Impl::clone(Model model) const {
187 auto mo = HVACComponent_Impl::clone(model).cast<WaterToWaterComponent>();

Callers

nothing calls this directly

Calls 11

isConnectedMethod · 0.80
supplyComponentMethod · 0.80
demandComponentMethod · 0.80
modelMethod · 0.45
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