src/model/AirLoopHVACDedicatedOutdoorAirSystem.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "AirLoopHVACDedicatedOutdoorAirSystem.hpp" | ||
| 7 | #include "AirLoopHVACDedicatedOutdoorAirSystem_Impl.hpp" | ||
| 8 | #include "AirLoopHVACOutdoorAirSystem.hpp" | ||
| 9 | #include "AirLoopHVACOutdoorAirSystem_Impl.hpp" | ||
| 10 | #include "Schedule.hpp" | ||
| 11 | #include "Schedule_Impl.hpp" | ||
| 12 | #include "AirLoopHVAC.hpp" | ||
| 13 | #include "AirLoopHVAC_Impl.hpp" | ||
| 14 | #include "Model.hpp" | ||
| 15 | #include "Model_Impl.hpp" | ||
| 16 | #include "ModelExtensibleGroup.hpp" | ||
| 17 | #include "ScheduleTypeLimits.hpp" | ||
| 18 | #include "ScheduleTypeRegistry.hpp" | ||
| 19 | |||
| 20 | #include <utilities/idd/IddFactory.hxx> | ||
| 21 | #include <utilities/idd/IddEnums.hxx> | ||
| 22 | #include <utilities/idd/OS_AirLoopHVAC_DedicatedOutdoorAirSystem_FieldEnums.hxx> | ||
| 23 | |||
| 24 | #include "../utilities/idf/IdfExtensibleGroup.hpp" | ||
| 25 | #include "../utilities/idf/WorkspaceExtensibleGroup.hpp" | ||
| 26 | |||
| 27 | #include "../utilities/units/Unit.hpp" | ||
| 28 | |||
| 29 | #include "../utilities/core/Assert.hpp" | ||
| 30 | |||
| 31 | namespace openstudio { | ||
| 32 | namespace model { | ||
| 33 | |||
| 34 | namespace detail { | ||
| 35 | |||
| 36 | 15 | AirLoopHVACDedicatedOutdoorAirSystem_Impl::AirLoopHVACDedicatedOutdoorAirSystem_Impl(const IdfObject& idfObject, Model_Impl* model, | |
| 37 | 15 | bool keepHandle) | |
| 38 | 15 | : ModelObject_Impl(idfObject, model, keepHandle) { | |
| 39 |
4/6✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 15 times.
✗ Branch 13 not taken.
|
15 | OS_ASSERT(idfObject.iddObject().type() == AirLoopHVACDedicatedOutdoorAirSystem::iddObjectType()); |
| 40 | 15 | } | |
| 41 | |||
| 42 | ✗ | AirLoopHVACDedicatedOutdoorAirSystem_Impl::AirLoopHVACDedicatedOutdoorAirSystem_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 43 | ✗ | Model_Impl* model, bool keepHandle) | |
| 44 | ✗ | : ModelObject_Impl(other, model, keepHandle) { | |
| 45 | ✗ | OS_ASSERT(other.iddObject().type() == AirLoopHVACDedicatedOutdoorAirSystem::iddObjectType()); | |
| 46 | ✗ | } | |
| 47 | |||
| 48 | 7 | AirLoopHVACDedicatedOutdoorAirSystem_Impl::AirLoopHVACDedicatedOutdoorAirSystem_Impl(const AirLoopHVACDedicatedOutdoorAirSystem_Impl& other, | |
| 49 | 7 | Model_Impl* model, bool keepHandle) | |
| 50 | 7 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 51 | |||
| 52 | 1 | ModelObject AirLoopHVACDedicatedOutdoorAirSystem_Impl::clone(Model model) const { | |
| 53 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | ModelObject result = ModelObject_Impl::clone(model); |
| 54 | |||
| 55 |
1/1✓ Branch 1 taken 1 time.
|
1 | Model m = this->model(); |
| 56 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | if (model == m) { |
| 57 | // cloned into same model, erase reference to parent | ||
| 58 | // this object is now invalid but having two objects point to same outdoor air system would also be invalid | ||
| 59 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | result.setString(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::OutdoorAirSystem, ""); |
| 60 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
1 | LOG(Warn, "Cloning the AirLoopHVACDedicatedOutdoorAirSystem resets the Outdoor Air System attached to it while it is a required field. " |
| 61 | "You should call `setOutdoorAirSystem(OutdoorAirSystem&)` on the clone"); | ||
| 62 | } | ||
| 63 | |||
| 64 | 2 | return result; | |
| 65 | 1 | } | |
| 66 | |||
| 67 | // Get all output variable names that could be associated with this object. | ||
| 68 | ✗ | const std::vector<std::string>& AirLoopHVACDedicatedOutdoorAirSystem_Impl::outputVariableNames() const { | |
| 69 | ✗ | static const std::vector<std::string> result; | |
| 70 | // Not Appropriate: No variables available | ||
| 71 | ✗ | return result; | |
| 72 | } | ||
| 73 | |||
| 74 | ✗ | IddObjectType AirLoopHVACDedicatedOutdoorAirSystem_Impl::iddObjectType() const { | |
| 75 | ✗ | return AirLoopHVACDedicatedOutdoorAirSystem::iddObjectType(); | |
| 76 | } | ||
| 77 | |||
| 78 | ✗ | std::vector<ScheduleTypeKey> AirLoopHVACDedicatedOutdoorAirSystem_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 79 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 80 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 81 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 82 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 83 | ✗ | if (std::find(b, e, OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::AvailabilitySchedule) != e) { | |
| 84 | ✗ | result.push_back(ScheduleTypeKey("AirLoopHVACDedicatedOutdoorAirSystem", "Availability Schedule")); | |
| 85 | } | ||
| 86 | ✗ | return result; | |
| 87 | ✗ | } | |
| 88 | |||
| 89 | 12 | AirLoopHVACOutdoorAirSystem AirLoopHVACDedicatedOutdoorAirSystem_Impl::airLoopHVACOutdoorAirSystem() const { | |
| 90 | boost::optional<AirLoopHVACOutdoorAirSystem> oaSystem = | ||
| 91 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | getObject<ModelObject>().getModelObjectTarget<AirLoopHVACOutdoorAirSystem>(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::OutdoorAirSystem); |
| 92 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
✗ Branch 4 not taken.
|
12 | OS_ASSERT(oaSystem); |
| 93 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
24 | return oaSystem.get(); |
| 94 | 12 | } | |
| 95 | |||
| 96 | 7 | Schedule AirLoopHVACDedicatedOutdoorAirSystem_Impl::availabilitySchedule() const { | |
| 97 | boost::optional<Schedule> schedule = | ||
| 98 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::AvailabilitySchedule); |
| 99 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(schedule); |
| 100 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
14 | return schedule.get(); |
| 101 | 7 | } | |
| 102 | |||
| 103 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem_Impl::preheatDesignTemperature() const { | |
| 104 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PreheatDesignTemperature, true); |
| 105 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 106 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 107 | } | ||
| 108 | |||
| 109 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem_Impl::preheatDesignHumidityRatio() const { | |
| 110 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PreheatDesignHumidityRatio, true); |
| 111 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 112 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 113 | } | ||
| 114 | |||
| 115 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem_Impl::precoolDesignTemperature() const { | |
| 116 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PrecoolDesignTemperature, true); |
| 117 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 118 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 119 | } | ||
| 120 | |||
| 121 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem_Impl::precoolDesignHumidityRatio() const { | |
| 122 |
1/1✓ Branch 1 taken 7 times.
|
7 | boost::optional<double> value = getDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PrecoolDesignHumidityRatio, true); |
| 123 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
|
7 | OS_ASSERT(value); |
| 124 |
1/1✓ Branch 1 taken 7 times.
|
14 | return value.get(); |
| 125 | } | ||
| 126 | |||
| 127 | 16 | unsigned int AirLoopHVACDedicatedOutdoorAirSystem_Impl::numberofAirLoops() const { | |
| 128 | 16 | return numExtensibleGroups(); | |
| 129 | } | ||
| 130 | |||
| 131 | 22 | std::vector<AirLoopHVAC> AirLoopHVACDedicatedOutdoorAirSystem_Impl::airLoops() const { | |
| 132 | 22 | std::vector<AirLoopHVAC> result; | |
| 133 |
1/1✓ Branch 1 taken 22 times.
|
22 | auto groups = extensibleGroups(); |
| 134 |
2/2✓ Branch 5 taken 17 times.
✓ Branch 6 taken 22 times.
|
39 | for (const auto& group : groups) { |
| 135 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | auto target = group.cast<WorkspaceExtensibleGroup>().getTarget(OS_AirLoopHVAC_DedicatedOutdoorAirSystemExtensibleFields::AirLoop); |
| 136 |
1/2✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
|
17 | if (target) { |
| 137 |
3/4✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
✓ Branch 6 taken 17 times.
✗ Branch 7 not taken.
|
34 | if (auto airLoop = target->optionalCast<AirLoopHVAC>()) { |
| 138 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | result.push_back(airLoop.get()); |
| 139 | 17 | } | |
| 140 | } | ||
| 141 | 17 | } | |
| 142 | 44 | return result; | |
| 143 | 22 | } | |
| 144 | |||
| 145 | 20 | boost::optional<unsigned> AirLoopHVACDedicatedOutdoorAirSystem_Impl::airLoopIndex(const AirLoopHVAC& airLoopHVAC) const { | |
| 146 | |||
| 147 | 20 | boost::optional<unsigned> result; | |
| 148 | |||
| 149 |
2/2✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
|
20 | auto egs = castVector<WorkspaceExtensibleGroup>(extensibleGroups()); |
| 150 |
2/2✓ Branch 1 taken 20 times.
✓ Branch 4 taken 20 times.
|
20 | auto h = openstudio::toString(airLoopHVAC.handle()); |
| 151 |
1/1✓ Branch 3 taken 20 times.
|
20 | auto it = std::find_if(egs.begin(), egs.end(), [&](const WorkspaceExtensibleGroup& eg) { |
| 152 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | return (eg.getField(OS_AirLoopHVAC_DedicatedOutdoorAirSystemExtensibleFields::AirLoop).get() == h); |
| 153 | }); | ||
| 154 | |||
| 155 | // If found, we compute the index by using std::distance between the start of vector and the iterator returned by std::find_if | ||
| 156 |
2/2✓ Branch 2 taken 1 time.
✓ Branch 3 taken 19 times.
|
20 | if (it != egs.end()) { |
| 157 |
1/1✓ Branch 2 taken 1 time.
|
2 | result = std::distance(egs.begin(), it) + 1; |
| 158 | } | ||
| 159 | |||
| 160 | 20 | return result; | |
| 161 | 20 | } | |
| 162 | |||
| 163 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setAirLoopHVACOutdoorAirSystem(const AirLoopHVACOutdoorAirSystem& airLoopHVACOutdoorAirSystem) { | |
| 164 |
1/1✓ Branch 1 taken 16 times.
|
16 | boost::optional<AirLoopHVACDedicatedOutdoorAirSystem> currentDOAS = airLoopHVACOutdoorAirSystem.airLoopHVACDedicatedOutdoorAirSystem(); |
| 165 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | if (currentDOAS) { |
| 166 | ✗ | if (currentDOAS->handle() == this->handle()) { | |
| 167 | ✗ | return true; | |
| 168 | } | ||
| 169 | ✗ | currentDOAS->remove(); | |
| 170 | } | ||
| 171 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
16 | return setPointer(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::OutdoorAirSystem, airLoopHVACOutdoorAirSystem.handle()); |
| 172 | 16 | } | |
| 173 | |||
| 174 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setAvailabilitySchedule(Schedule& schedule) { | |
| 175 |
3/3✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
✓ Branch 7 taken 16 times.
|
64 | bool result = setSchedule(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::AvailabilitySchedule, "AirLoopHVACDedicatedOutdoorAirSystem", |
| 176 | "Availability Schedule", schedule); | ||
| 177 | 16 | return result; | |
| 178 | } | ||
| 179 | |||
| 180 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setPreheatDesignTemperature(double preheatDesignTemperature) { | |
| 181 | 16 | bool result = setDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PreheatDesignTemperature, preheatDesignTemperature); | |
| 182 | 16 | return result; | |
| 183 | } | ||
| 184 | |||
| 185 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setPreheatDesignHumidityRatio(double preheatDesignHumidityRatio) { | |
| 186 | 16 | bool result = setDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PreheatDesignHumidityRatio, preheatDesignHumidityRatio); | |
| 187 | 16 | return result; | |
| 188 | } | ||
| 189 | |||
| 190 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setPrecoolDesignTemperature(double precoolDesignTemperature) { | |
| 191 | 16 | bool result = setDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PrecoolDesignTemperature, precoolDesignTemperature); | |
| 192 | 16 | return result; | |
| 193 | } | ||
| 194 | |||
| 195 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::setPrecoolDesignHumidityRatio(double precoolDesignHumidityRatio) { | |
| 196 | 16 | bool result = setDouble(OS_AirLoopHVAC_DedicatedOutdoorAirSystemFields::PrecoolDesignHumidityRatio, precoolDesignHumidityRatio); | |
| 197 | 16 | return result; | |
| 198 | } | ||
| 199 | |||
| 200 | 22 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::addAirLoop(const AirLoopHVAC& airLoopHVAC) { | |
| 201 | // Check if airLoopHVAC already has a doas | ||
| 202 |
3/3✓ Branch 1 taken 22 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 19 times.
|
44 | if (boost::optional<AirLoopHVACDedicatedOutdoorAirSystem> doas = airLoopHVAC.airLoopHVACDedicatedOutdoorAirSystem()) { |
| 203 |
11/11✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
✓ Branch 16 taken 3 times.
✓ Branch 19 taken 3 times.
✓ Branch 22 taken 3 times.
✓ Branch 27 taken 3 times.
✓ Branch 30 taken 3 times.
✓ Branch 33 taken 3 times.
|
3 | LOG(Warn, "For " << airLoopHVAC.nameString() << ", " << briefDescription() << " already exists."); |
| 204 | 3 | return true; | |
| 205 | 22 | } | |
| 206 | |||
| 207 | // Check if airLoopHVAC already exists | ||
| 208 |
1/1✓ Branch 1 taken 19 times.
|
19 | boost::optional<unsigned> _existingIndex = airLoopIndex(airLoopHVAC); |
| 209 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
|
19 | if (_existingIndex) { |
| 210 | ✗ | LOG(Warn, "For " << briefDescription() << ", AirLoopHVAC already exists."); | |
| 211 | ✗ | return true; | |
| 212 | } | ||
| 213 | |||
| 214 | bool result; | ||
| 215 | |||
| 216 |
3/3✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 19 times.
|
19 | auto eg = getObject<ModelObject>().pushExtensibleGroup().cast<WorkspaceExtensibleGroup>(); |
| 217 |
2/2✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
|
19 | bool airloop = eg.setPointer(OS_AirLoopHVAC_DedicatedOutdoorAirSystemExtensibleFields::AirLoop, airLoopHVAC.handle()); |
| 218 |
1/2✓ Branch 0 taken 19 times.
✗ Branch 1 not taken.
|
19 | if (airloop) { |
| 219 | 19 | result = true; | |
| 220 | } else { | ||
| 221 | // Something went wrong | ||
| 222 | // So erase the new extensible group | ||
| 223 | ✗ | getObject<ModelObject>().eraseExtensibleGroup(eg.groupIndex()); | |
| 224 | ✗ | result = false; | |
| 225 | } | ||
| 226 | 19 | return result; | |
| 227 | 19 | } | |
| 228 | |||
| 229 | 1 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::removeAirLoop(const AirLoopHVAC& airLoopHVAC) { | |
| 230 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<unsigned> idx = airLoopIndex(airLoopHVAC); |
| 231 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!idx) { |
| 232 | ✗ | LOG(Warn, "For " << briefDescription() << " cannot remove air loop " << airLoopHVAC.briefDescription() << " since it is not part of it."); | |
| 233 | ✗ | return false; | |
| 234 | } | ||
| 235 | |||
| 236 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | return removeAirLoop(idx.get()); |
| 237 | } | ||
| 238 | |||
| 239 | 3 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::removeAirLoop(unsigned groupIndex) { | |
| 240 | 3 | bool result = false; | |
| 241 |
5/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 1 time.
|
3 | if ((groupIndex > 0) && (groupIndex <= numberofAirLoops())) { |
| 242 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | getObject<ModelObject>().eraseExtensibleGroup(groupIndex - 1); |
| 243 | 2 | result = true; | |
| 244 | } | ||
| 245 | 3 | return result; | |
| 246 | } | ||
| 247 | |||
| 248 | 2 | void AirLoopHVACDedicatedOutdoorAirSystem_Impl::removeAllAirLoops() { | |
| 249 |
1/1✓ Branch 1 taken 2 times.
|
2 | clearExtensibleGroups(); |
| 250 | 2 | } | |
| 251 | |||
| 252 | 4 | std::vector<openstudio::IdfObject> AirLoopHVACDedicatedOutdoorAirSystem_Impl::remove() { | |
| 253 | |||
| 254 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | airLoopHVACOutdoorAirSystem().remove(); |
| 255 | |||
| 256 | 4 | return ModelObject_Impl::remove(); | |
| 257 | } | ||
| 258 | |||
| 259 | 7 | bool AirLoopHVACDedicatedOutdoorAirSystem_Impl::addAirLoops(const std::vector<AirLoopHVAC>& airLoopHVACs) { | |
| 260 | 7 | bool ok = true; | |
| 261 |
2/2✓ Branch 4 taken 13 times.
✓ Branch 5 taken 7 times.
|
20 | for (const AirLoopHVAC& airLoopHVAC : airLoopHVACs) { |
| 262 |
1/1✓ Branch 1 taken 13 times.
|
13 | ok &= addAirLoop(airLoopHVAC); |
| 263 | } | ||
| 264 | 7 | return ok; | |
| 265 | } | ||
| 266 | |||
| 267 | } // namespace detail | ||
| 268 | |||
| 269 | 15 | AirLoopHVACDedicatedOutdoorAirSystem::AirLoopHVACDedicatedOutdoorAirSystem(const AirLoopHVACOutdoorAirSystem& airLoopHVACOutdoorAirSystem) | |
| 270 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | : ModelObject(AirLoopHVACDedicatedOutdoorAirSystem::iddObjectType(), airLoopHVACOutdoorAirSystem.model()) { |
| 271 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 15 times.
✗ Branch 5 not taken.
|
15 | OS_ASSERT(getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()); |
| 272 | |||
| 273 |
1/1✓ Branch 1 taken 15 times.
|
15 | setAirLoopHVACOutdoorAirSystem(airLoopHVACOutdoorAirSystem); |
| 274 | { | ||
| 275 |
2/2✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
|
15 | auto schedule = airLoopHVACOutdoorAirSystem.model().alwaysOnDiscreteSchedule(); |
| 276 |
1/1✓ Branch 1 taken 15 times.
|
15 | setAvailabilitySchedule(schedule); |
| 277 | 15 | } | |
| 278 |
1/1✓ Branch 1 taken 15 times.
|
15 | setPreheatDesignTemperature(4.5); |
| 279 |
1/1✓ Branch 1 taken 15 times.
|
15 | setPreheatDesignHumidityRatio(0.004); |
| 280 |
1/1✓ Branch 1 taken 15 times.
|
15 | setPrecoolDesignTemperature(17.5); |
| 281 |
1/1✓ Branch 1 taken 15 times.
|
15 | setPrecoolDesignHumidityRatio(0.012); |
| 282 | 15 | } | |
| 283 | |||
| 284 | 8743 | IddObjectType AirLoopHVACDedicatedOutdoorAirSystem::iddObjectType() { | |
| 285 |
1/1✓ Branch 1 taken 8743 times.
|
8743 | return {IddObjectType::OS_AirLoopHVAC_DedicatedOutdoorAirSystem}; |
| 286 | } | ||
| 287 | |||
| 288 | 8 | AirLoopHVACOutdoorAirSystem AirLoopHVACDedicatedOutdoorAirSystem::airLoopHVACOutdoorAirSystem() const { | |
| 289 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->airLoopHVACOutdoorAirSystem(); |
| 290 | } | ||
| 291 | |||
| 292 | 7 | Schedule AirLoopHVACDedicatedOutdoorAirSystem::availabilitySchedule() const { | |
| 293 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->availabilitySchedule(); |
| 294 | } | ||
| 295 | |||
| 296 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem::preheatDesignTemperature() const { | |
| 297 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->preheatDesignTemperature(); |
| 298 | } | ||
| 299 | |||
| 300 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem::preheatDesignHumidityRatio() const { | |
| 301 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->preheatDesignHumidityRatio(); |
| 302 | } | ||
| 303 | |||
| 304 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem::precoolDesignTemperature() const { | |
| 305 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->precoolDesignTemperature(); |
| 306 | } | ||
| 307 | |||
| 308 | 7 | double AirLoopHVACDedicatedOutdoorAirSystem::precoolDesignHumidityRatio() const { | |
| 309 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->precoolDesignHumidityRatio(); |
| 310 | } | ||
| 311 | |||
| 312 | 14 | unsigned int AirLoopHVACDedicatedOutdoorAirSystem::numberofAirLoops() const { | |
| 313 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->numberofAirLoops(); |
| 314 | } | ||
| 315 | |||
| 316 | 22 | std::vector<AirLoopHVAC> AirLoopHVACDedicatedOutdoorAirSystem::airLoops() const { | |
| 317 |
1/1✓ Branch 3 taken 22 times.
|
22 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->airLoops(); |
| 318 | } | ||
| 319 | |||
| 320 | ✗ | boost::optional<unsigned> AirLoopHVACDedicatedOutdoorAirSystem::airLoopIndex(const AirLoopHVAC& airLoopHVAC) const { | |
| 321 | ✗ | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->airLoopIndex(airLoopHVAC); | |
| 322 | } | ||
| 323 | |||
| 324 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setAirLoopHVACOutdoorAirSystem(const AirLoopHVACOutdoorAirSystem& airLoopHVACOutdoorAirSystem) { | |
| 325 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setAirLoopHVACOutdoorAirSystem(airLoopHVACOutdoorAirSystem); |
| 326 | } | ||
| 327 | |||
| 328 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setAvailabilitySchedule(Schedule& schedule) { | |
| 329 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setAvailabilitySchedule(schedule); |
| 330 | } | ||
| 331 | |||
| 332 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setPreheatDesignTemperature(double preheatDesignTemperature) { | |
| 333 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setPreheatDesignTemperature(preheatDesignTemperature); |
| 334 | } | ||
| 335 | |||
| 336 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setPreheatDesignHumidityRatio(double preheatDesignHumidityRatio) { | |
| 337 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setPreheatDesignHumidityRatio(preheatDesignHumidityRatio); |
| 338 | } | ||
| 339 | |||
| 340 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setPrecoolDesignTemperature(double precoolDesignTemperature) { | |
| 341 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setPrecoolDesignTemperature(precoolDesignTemperature); |
| 342 | } | ||
| 343 | |||
| 344 | 16 | bool AirLoopHVACDedicatedOutdoorAirSystem::setPrecoolDesignHumidityRatio(double precoolDesignHumidityRatio) { | |
| 345 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->setPrecoolDesignHumidityRatio(precoolDesignHumidityRatio); |
| 346 | } | ||
| 347 | |||
| 348 | 9 | bool AirLoopHVACDedicatedOutdoorAirSystem::addAirLoop(const AirLoopHVAC& airLoopHVAC) { | |
| 349 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->addAirLoop(airLoopHVAC); |
| 350 | } | ||
| 351 | |||
| 352 | 1 | bool AirLoopHVACDedicatedOutdoorAirSystem::removeAirLoop(const AirLoopHVAC& airLoopHVAC) { | |
| 353 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->removeAirLoop(airLoopHVAC); |
| 354 | } | ||
| 355 | |||
| 356 | 2 | bool AirLoopHVACDedicatedOutdoorAirSystem::removeAirLoop(unsigned groupIndex) { | |
| 357 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->removeAirLoop(groupIndex); |
| 358 | } | ||
| 359 | |||
| 360 | 2 | void AirLoopHVACDedicatedOutdoorAirSystem::removeAllAirLoops() { | |
| 361 |
1/1✓ Branch 3 taken 2 times.
|
2 | getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->removeAllAirLoops(); |
| 362 | 2 | } | |
| 363 | |||
| 364 | 7 | bool AirLoopHVACDedicatedOutdoorAirSystem::addAirLoops(const std::vector<AirLoopHVAC>& airLoopHVACs) { | |
| 365 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl>()->addAirLoops(airLoopHVACs); |
| 366 | } | ||
| 367 | |||
| 368 | /// @cond | ||
| 369 | 37 | AirLoopHVACDedicatedOutdoorAirSystem::AirLoopHVACDedicatedOutdoorAirSystem(std::shared_ptr<detail::AirLoopHVACDedicatedOutdoorAirSystem_Impl> impl) | |
| 370 |
1/1✓ Branch 3 taken 37 times.
|
37 | : ModelObject(std::move(impl)) {} |
| 371 | /// @endcond | ||
| 372 | |||
| 373 | } // namespace model | ||
| 374 | } // namespace openstudio | ||
| 375 |