| 419 | } |
| 420 | |
| 421 | bool RefrigerationSystem_Impl::addWalkin(const RefrigerationWalkIn& refrigerationWalkin) { |
| 422 | // From 9.2 IO ref: |
| 423 | // > This list may contain a combination of case and walk-in names OR a list of air chiller names. |
| 424 | // > Air chillers may not be included in any list that also includes cases or walk-ins. |
| 425 | if (!this->airChillers().empty()) { |
| 426 | LOG(Warn, "You cannot mix RefigerationCase/RefrigerationWalkins with RefrigerationAirChillers, occurred for " << briefDescription()); |
| 427 | return false; |
| 428 | } |
| 429 | |
| 430 | // Enforce unicity |
| 431 | if (boost::optional<RefrigerationSystem> currentSystem = refrigerationWalkin.system()) { |
| 432 | LOG(Warn, refrigerationWalkin.briefDescription() |
| 433 | << " was removed from its existing RefrigerationSystem named '" << currentSystem->nameString() << "'."); |
| 434 | currentSystem->removeWalkin(refrigerationWalkin); |
| 435 | } |
| 436 | |
| 437 | boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList(); |
| 438 | return addTemplate<RefrigerationWalkIn>(refrigerationWalkin, modelObjectList); |
| 439 | } |
| 440 | |
| 441 | void RefrigerationSystem_Impl::removeWalkin(const RefrigerationWalkIn& refrigerationWalkin) { |
| 442 | boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList(); |