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

Method remove

src/model/PlantLoop.cpp:97–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 std::vector<openstudio::IdfObject> PlantLoop_Impl::remove() {
98 sizingPlant().remove();
99
100 ModelObjectVector modelObjects;
101 ModelObjectVector::iterator it;
102
103 availabilityManagerAssignmentList().remove();
104
105 modelObjects = supplyComponents();
106 for (it = modelObjects.begin(); it != modelObjects.end(); ++it) {
107 if (boost::optional<WaterToWaterComponent> comp = it->optionalCast<WaterToWaterComponent>()) {
108 comp->removeFromPlantLoop();
109 if (!comp->secondaryPlantLoop()) {
110 comp->remove();
111 }
112 }
113 }
114
115 modelObjects = demandComponents();
116 for (it = modelObjects.begin(); it != modelObjects.end(); ++it) {
117 if (boost::optional<WaterToWaterComponent> comp = it->optionalCast<WaterToWaterComponent>()) {
118 comp->removeFromSecondaryPlantLoop();
119 if (!comp->plantLoop()) {
120 comp->remove();
121 }
122 } else if (boost::optional<WaterToAirComponent> comp = it->optionalCast<WaterToAirComponent>()) {
123 comp->removeFromPlantLoop();
124 if (!comp->airLoopHVAC()) {
125 comp->remove();
126 }
127 }
128 }
129
130 modelObjects = components();
131
132 std::vector<openstudio::IdfObject> idfObjects = ModelObject_Impl::remove();
133
134 for (it = modelObjects.begin(); it != modelObjects.end(); ++it) {
135 if (boost::optional<HVACComponent> comp = it->optionalCast<HVACComponent>()) {
136 comp->disconnect();
137 }
138 it->remove();
139 }
140
141 return idfObjects;
142 }
143
144 IddObjectType PlantLoop_Impl::iddObjectType() const {
145 return PlantLoop::iddObjectType();

Callers 2

Calls 8

beginMethod · 0.80
endMethod · 0.45
removeFromPlantLoopMethod · 0.45
secondaryPlantLoopMethod · 0.45
plantLoopMethod · 0.45
airLoopHVACMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected