| 485 | } |
| 486 | |
| 487 | bool RefrigerationSystem_Impl::addCompressor(const RefrigerationCompressor& refrigerationCompressor) { |
| 488 | // Enforce unicity |
| 489 | if (boost::optional<RefrigerationSystem> currentSystem = refrigerationCompressor.system()) { |
| 490 | LOG(Warn, refrigerationCompressor.briefDescription() |
| 491 | << " was removed from its existing RefrigerationSystem (non High Stage) named '" << currentSystem->nameString() << "'."); |
| 492 | currentSystem->removeCompressor(refrigerationCompressor); |
| 493 | } |
| 494 | |
| 495 | return compressorList().addModelObject(refrigerationCompressor); |
| 496 | } |
| 497 | |
| 498 | void RefrigerationSystem_Impl::removeCompressor(const RefrigerationCompressor& refrigerationCompressor) { |
| 499 | compressorList().removeModelObject(refrigerationCompressor); |