MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / addCase

Method addCase

src/model/RefrigerationSystem.cpp:391–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers 6

addToSystemMethod · 0.45
addToSecondarySystemMethod · 0.45
addToCompressorRackMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 6

airChillersMethod · 0.95
briefDescriptionMethod · 0.80
nameStringMethod · 0.80
emptyMethod · 0.45
systemMethod · 0.45
removeCaseMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36