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

Method addAirChiller

src/model/RefrigerationSystem.cpp:451–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449 }
450
451 bool RefrigerationSystem_Impl::addAirChiller(const RefrigerationAirChiller& refrigerationAirChiller) {
452 // From 9.2 IO ref:
453 // > This list may contain a combination of case and walk-in names OR a list of air chiller names.
454 // > Air chillers may not be included in any list that also includes cases or walk-ins.
455 if (boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList()) {
456 std::vector<ModelObject> modelObjects = modelObjectList->modelObjects();
457
458 for (const auto& elem : modelObjects) {
459 if (elem.optionalCast<RefrigerationWalkIn>() || elem.optionalCast<RefrigerationCase>()) {
460 LOG(Warn, "You cannot mix RefigerationCase/RefrigerationWalkins with RefrigerationAirChillers, occurred for " << briefDescription());
461 return false;
462 }
463 }
464 }
465
466 // Enforce unicity
467 if (boost::optional<RefrigerationSystem> currentSystem = refrigerationAirChiller.system()) {
468 LOG(Warn, refrigerationAirChiller.briefDescription()
469 << " was removed from its existing RefrigerationSystem named '" << currentSystem->nameString() << "'.");
470 currentSystem->removeAirChiller(refrigerationAirChiller);
471 }
472
473 boost::optional<ModelObjectList> modelObjectList = refrigeratedCaseAndWalkInList();
474 return addTemplate<RefrigerationAirChiller>(refrigerationAirChiller, modelObjectList);
475 }
476
477 void RefrigerationSystem_Impl::removeAirChiller(const RefrigerationAirChiller& refrigerationAirChiller) {
478 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 5

briefDescriptionMethod · 0.80
nameStringMethod · 0.80
modelObjectsMethod · 0.45
systemMethod · 0.45
removeAirChillerMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36