| 525 | } |
| 526 | |
| 527 | bool RefrigerationSystem_Impl::addSecondarySystemLoad(const RefrigerationSecondarySystem& refrigerationSecondarySystem) { |
| 528 | // Enforce unicity |
| 529 | if (boost::optional<RefrigerationSystem> currentSystem = refrigerationSecondarySystem.system()) { |
| 530 | LOG(Warn, refrigerationSecondarySystem.briefDescription() |
| 531 | << " was removed from its existing RefrigerationSystem named '" << currentSystem->nameString() << "'."); |
| 532 | currentSystem->removeSecondarySystemLoad(refrigerationSecondarySystem); |
| 533 | } |
| 534 | boost::optional<ModelObjectList> modelObjectList = refrigerationTransferLoadList(); |
| 535 | return addTemplate<RefrigerationSecondarySystem>(refrigerationSecondarySystem, modelObjectList); |
| 536 | } |
| 537 | |
| 538 | void RefrigerationSystem_Impl::removeSecondarySystemLoad(const RefrigerationSecondarySystem& refrigerationSecondarySystem) { |
| 539 | boost::optional<ModelObjectList> modelObjectList = refrigerationTransferLoadList(); |