| 389 | } |
| 390 | |
| 391 | bool RefrigerationSystem_Impl::addCase(const RefrigerationCase& refrigerationCase) { |
| 392 | // From 9.2 IO ref: |
| 393 | // > This list may contain a combination of case and walk-in names OR a list of air chiller names. |
| 394 | // > Air chillers may not be included in any list that also includes cases or walk-ins. |
| 395 | if (!this->airChillers().empty()) { |
| 396 | LOG(Warn, "You cannot mix RefigerationCase/RefrigerationWalkins with RefrigerationAirChillers, occurred for " << briefDescription()); |
| 397 | return false; |
| 398 | } |
| 399 | |
| 400 | // Enforce unicity |
| 401 | if (boost::optional<RefrigerationSystem> currentSystem = refrigerationCase.system()) { |
| 402 | LOG(Warn, refrigerationCase.briefDescription() |
| 403 | << " was removed from its existing RefrigerationSystem named '" << currentSystem->nameString() << "'."); |
| 404 | currentSystem->removeCase(refrigerationCase); |
| 405 | } |
| 406 | |
| 407 | boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList(); |
| 408 | return addTemplate<RefrigerationCase>(refrigerationCase, modelObjectList); |
| 409 | } |
| 410 | |
| 411 | void RefrigerationSystem_Impl::removeCase(const RefrigerationCase& refrigerationCase) { |
| 412 | boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList(); |