| 143 | } |
| 144 | |
| 145 | bool CentralHeatPumpSystem_Impl::addToNode(Node& node) { |
| 146 | boost::optional<PlantLoop> t_plantLoop = node.plantLoop(); |
| 147 | |
| 148 | // If trying to add to a node that is on the supply side of a plant loop |
| 149 | if (t_plantLoop) { |
| 150 | if (t_plantLoop->supplyComponent(node.handle())) { |
| 151 | // If there is already a cooling Plant Loop |
| 152 | boost::optional<PlantLoop> coolingPlant = this->coolingPlantLoop(); |
| 153 | if (coolingPlant) { |
| 154 | // And it's not the same as the node's loop |
| 155 | if (t_plantLoop.get() != coolingPlant.get()) { |
| 156 | // And if there is no heatingPlantLoop (tertiary) |
| 157 | boost::optional<PlantLoop> heatingPlant = this->heatingPlantLoop(); |
| 158 | if (!heatingPlant) { |
| 159 | // Then try to add it to the tertiary one |
| 160 | LOG(Warn, "Calling addToTertiaryNode to connect it to the tertiary (=heating) loop for " << briefDescription()); |
| 161 | return this->addToTertiaryNode(node); |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | // All other cases, call the base class implementation |
| 169 | return WaterToWaterComponent_Impl::addToNode(node); |
| 170 | } |
| 171 | |
| 172 | bool CentralHeatPumpSystem_Impl::addToTertiaryNode(Node& node) { |
| 173 | auto _model = node.model(); |
nothing calls this directly
no test coverage detected