src/model/ElectricEquipment.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 "ElectricEquipment.hpp" | ||
| 7 | #include "ElectricEquipment_Impl.hpp" | ||
| 8 | |||
| 9 | #include "ElectricEquipmentDefinition.hpp" | ||
| 10 | #include "ElectricEquipmentDefinition_Impl.hpp" | ||
| 11 | #include "Schedule.hpp" | ||
| 12 | #include "Schedule_Impl.hpp" | ||
| 13 | #include "Space.hpp" | ||
| 14 | #include "Space_Impl.hpp" | ||
| 15 | #include "SpaceType.hpp" | ||
| 16 | #include "SpaceType_Impl.hpp" | ||
| 17 | #include "DefaultScheduleSet.hpp" | ||
| 18 | #include "DefaultScheduleSet_Impl.hpp" | ||
| 19 | #include "LifeCycleCost.hpp" | ||
| 20 | #include "Model.hpp" | ||
| 21 | |||
| 22 | #include <utilities/idd/OS_ElectricEquipment_FieldEnums.hxx> | ||
| 23 | #include <utilities/idd/IddEnums.hxx> | ||
| 24 | |||
| 25 | #include "../utilities/core/Assert.hpp" | ||
| 26 | |||
| 27 | namespace openstudio { | ||
| 28 | namespace model { | ||
| 29 | |||
| 30 | namespace detail { | ||
| 31 | |||
| 32 | 1386 | ElectricEquipment_Impl::ElectricEquipment_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 33 | 1386 | : SpaceLoadInstance_Impl(idfObject, model, keepHandle) { | |
| 34 |
4/6✓ Branch 1 taken 1386 times.
✓ Branch 4 taken 1386 times.
✓ Branch 7 taken 1386 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1386 times.
✗ Branch 13 not taken.
|
1386 | OS_ASSERT(idfObject.iddObject().type() == ElectricEquipment::iddObjectType()); |
| 35 | 1386 | } | |
| 36 | |||
| 37 | 960 | ElectricEquipment_Impl::ElectricEquipment_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 38 | 960 | : SpaceLoadInstance_Impl(other, model, keepHandle) { | |
| 39 |
4/6✓ Branch 1 taken 960 times.
✓ Branch 4 taken 960 times.
✓ Branch 7 taken 960 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 960 times.
✗ Branch 13 not taken.
|
960 | OS_ASSERT(other.iddObject().type() == ElectricEquipment::iddObjectType()); |
| 40 | 960 | } | |
| 41 | |||
| 42 | 956 | ElectricEquipment_Impl::ElectricEquipment_Impl(const ElectricEquipment_Impl& other, Model_Impl* model, bool keepHandle) | |
| 43 | 956 | : SpaceLoadInstance_Impl(other, model, keepHandle) {} | |
| 44 | |||
| 45 | 2 | const std::vector<std::string>& ElectricEquipment_Impl::outputVariableNames() const { | |
| 46 | static const std::vector<std::string> result{ | ||
| 47 | "Electric Equipment Electricity Rate", | ||
| 48 | "Electric Equipment Electricity Energy", | ||
| 49 | "Electric Equipment Radiant Heating Energy", | ||
| 50 | "Electric Equipment Radiant Heating Rate", | ||
| 51 | "Electric Equipment Convective Heating Energy", | ||
| 52 | "Electric Equipment Convective Heating Rate", | ||
| 53 | "Electric Equipment Latent Gain Energy", | ||
| 54 | "Electric Equipment Latent Gain Rate", | ||
| 55 | "Electric Equipment Lost Heat Energy", | ||
| 56 | "Electric Equipment Lost Heat Rate", | ||
| 57 | "Electric Equipment Total Heating Energy", | ||
| 58 | "Electric Equipment Total Heating Rate" | ||
| 59 | |||
| 60 | // Reported in ThermalZone | ||
| 61 | //"Zone Electric Equipment Electricity Rate", | ||
| 62 | //"Zone Electric Equipment Electricity Energy", | ||
| 63 | //"Zone Electric Equipment Radiant Heating Energy", | ||
| 64 | //"Zone Electric Equipment Radiant Heating Rate", | ||
| 65 | //"Zone Electric Equipment Convective Heating Energy", | ||
| 66 | //"Zone Electric Equipment Convective Heating Rate", | ||
| 67 | //"Zone Electric Equipment Latent Gain Energy", | ||
| 68 | //"Zone Electric Equipment Latent Gain Rate", | ||
| 69 | //"Zone Electric Equipment Lost Heat Energy", | ||
| 70 | //"Zone Electric Equipment Lost Heat Rate", | ||
| 71 | //"Zone Electric Equipment Total Heating Energy", | ||
| 72 | //"Zone Electric Equipment Total Heating Rate" | ||
| 73 |
6/11✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 time.
✓ Branch 10 taken 12 times.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
16 | }; |
| 74 | 2 | return result; | |
| 75 | 3 | } | |
| 76 | |||
| 77 | 20 | IddObjectType ElectricEquipment_Impl::iddObjectType() const { | |
| 78 | 20 | return ElectricEquipment::iddObjectType(); | |
| 79 | } | ||
| 80 | |||
| 81 | ✗ | std::vector<ScheduleTypeKey> ElectricEquipment_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 82 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 83 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 84 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 85 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 86 | ✗ | if (std::find(b, e, OS_ElectricEquipmentFields::ScheduleName) != e) { | |
| 87 | ✗ | result.push_back(ScheduleTypeKey("ElectricEquipment", "Electric Equipment")); | |
| 88 | } | ||
| 89 | ✗ | return result; | |
| 90 | ✗ | } | |
| 91 | |||
| 92 | 27 | bool ElectricEquipment_Impl::hardSize() { | |
| 93 |
1/1✓ Branch 1 taken 27 times.
|
27 | boost::optional<Space> space = this->space(); |
| 94 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 27 times.
|
27 | if (!space) { |
| 95 | ✗ | return false; | |
| 96 | } | ||
| 97 | |||
| 98 |
1/1✓ Branch 1 taken 27 times.
|
27 | this->makeUnique(); |
| 99 | |||
| 100 |
1/1✓ Branch 1 taken 27 times.
|
27 | ElectricEquipmentDefinition electricEquipmentDefinition = this->electricEquipmentDefinition(); |
| 101 |
3/3✓ Branch 1 taken 27 times.
✓ Branch 8 taken 4 times.
✓ Branch 9 taken 27 times.
|
31 | for (LifeCycleCost& cost : electricEquipmentDefinition.lifeCycleCosts()) { |
| 102 |
1/1✓ Branch 1 taken 4 times.
|
4 | cost.convertToCostPerEach(); |
| 103 | 27 | } | |
| 104 | |||
| 105 |
1/1✓ Branch 1 taken 27 times.
|
27 | boost::optional<double> designLevel = electricEquipmentDefinition.designLevel(); |
| 106 |
2/2✓ Branch 0 taken 23 times.
✓ Branch 1 taken 4 times.
|
27 | if (designLevel) { |
| 107 | 23 | return true; | |
| 108 | } | ||
| 109 | |||
| 110 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> wattsperSpaceFloorArea = electricEquipmentDefinition.wattsperSpaceFloorArea(); |
| 111 |
1/2✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
|
4 | if (wattsperSpaceFloorArea) { |
| 112 |
4/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
|
4 | return electricEquipmentDefinition.setDesignLevel(*wattsperSpaceFloorArea * space->floorArea()); |
| 113 | } | ||
| 114 | |||
| 115 | ✗ | boost::optional<double> wattsperPerson = electricEquipmentDefinition.wattsperPerson(); | |
| 116 | ✗ | if (wattsperPerson) { | |
| 117 | ✗ | return electricEquipmentDefinition.setDesignLevel(*wattsperPerson * space->numberOfPeople()); | |
| 118 | } | ||
| 119 | |||
| 120 | ✗ | return false; | |
| 121 | 27 | } | |
| 122 | |||
| 123 | 37 | bool ElectricEquipment_Impl::hardApplySchedules() { | |
| 124 | 37 | bool result = false; | |
| 125 |
1/1✓ Branch 1 taken 37 times.
|
37 | boost::optional<Schedule> schedule = this->schedule(); |
| 126 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 34 times.
|
37 | if (schedule) { |
| 127 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | result = this->setSchedule(*schedule); |
| 128 | } | ||
| 129 | 37 | return result; | |
| 130 | 37 | } | |
| 131 | |||
| 132 | 411 | double ElectricEquipment_Impl::multiplier() const { | |
| 133 |
1/1✓ Branch 1 taken 411 times.
|
411 | boost::optional<double> value = getDouble(OS_ElectricEquipmentFields::Multiplier, true); |
| 134 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 411 times.
✗ Branch 4 not taken.
|
411 | OS_ASSERT(value); |
| 135 |
1/1✓ Branch 1 taken 411 times.
|
822 | return value.get(); |
| 136 | } | ||
| 137 | |||
| 138 | ✗ | bool ElectricEquipment_Impl::isMultiplierDefaulted() const { | |
| 139 | ✗ | return isEmpty(OS_ElectricEquipmentFields::Multiplier); | |
| 140 | } | ||
| 141 | |||
| 142 | 5 | bool ElectricEquipment_Impl::isAbsolute() const { | |
| 143 |
1/1✓ Branch 1 taken 5 times.
|
5 | ElectricEquipmentDefinition definition = electricEquipmentDefinition(); |
| 144 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 4 times.
|
10 | if (definition.designLevel()) { |
| 145 | 1 | return true; | |
| 146 | } | ||
| 147 | 4 | return false; | |
| 148 | 5 | } | |
| 149 | |||
| 150 | 114 | std::string ElectricEquipment_Impl::endUseSubcategory() const { | |
| 151 |
1/1✓ Branch 1 taken 114 times.
|
114 | boost::optional<std::string> value = getString(OS_ElectricEquipmentFields::EndUseSubcategory, true); |
| 152 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 114 times.
✗ Branch 4 not taken.
|
114 | OS_ASSERT(value); |
| 153 |
2/2✓ Branch 1 taken 114 times.
✓ Branch 4 taken 114 times.
|
228 | return value.get(); |
| 154 | 114 | } | |
| 155 | |||
| 156 | 282 | bool ElectricEquipment_Impl::isEndUseSubcategoryDefaulted() const { | |
| 157 | 282 | return isEmpty(OS_ElectricEquipmentFields::EndUseSubcategory); | |
| 158 | } | ||
| 159 | |||
| 160 | 5 | bool ElectricEquipment_Impl::setMultiplier(double multiplier) { | |
| 161 | 5 | bool result = setDouble(OS_ElectricEquipmentFields::Multiplier, multiplier); | |
| 162 | 5 | return result; | |
| 163 | } | ||
| 164 | |||
| 165 | ✗ | void ElectricEquipment_Impl::resetMultiplier() { | |
| 166 | ✗ | bool result = setString(OS_ElectricEquipmentFields::Multiplier, ""); | |
| 167 | ✗ | OS_ASSERT(result); | |
| 168 | ✗ | } | |
| 169 | |||
| 170 | 482 | bool ElectricEquipment_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) { | |
| 171 | 482 | bool result = setString(OS_ElectricEquipmentFields::EndUseSubcategory, endUseSubcategory); | |
| 172 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 482 times.
|
482 | OS_ASSERT(result); |
| 173 | 482 | return result; | |
| 174 | } | ||
| 175 | |||
| 176 | ✗ | void ElectricEquipment_Impl::resetEndUseSubcategory() { | |
| 177 | ✗ | bool result = setString(OS_ElectricEquipmentFields::EndUseSubcategory, ""); | |
| 178 | ✗ | OS_ASSERT(result); | |
| 179 | ✗ | } | |
| 180 | |||
| 181 | 2012 | int ElectricEquipment_Impl::spaceIndex() const { | |
| 182 | 2012 | return OS_ElectricEquipmentFields::SpaceorSpaceTypeName; | |
| 183 | } | ||
| 184 | |||
| 185 | 897 | int ElectricEquipment_Impl::definitionIndex() const { | |
| 186 | 897 | return OS_ElectricEquipmentFields::ElectricEquipmentDefinitionName; | |
| 187 | } | ||
| 188 | |||
| 189 | 321 | boost::optional<Schedule> ElectricEquipment_Impl::schedule() const { | |
| 190 |
2/2✓ Branch 1 taken 321 times.
✓ Branch 4 taken 321 times.
|
321 | boost::optional<Schedule> result = getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_ElectricEquipmentFields::ScheduleName); |
| 191 |
2/2✓ Branch 1 taken 298 times.
✓ Branch 2 taken 23 times.
|
321 | if (!result) { |
| 192 | // search upwards | ||
| 193 |
1/1✓ Branch 1 taken 298 times.
|
298 | OptionalSpace space = this->space(); |
| 194 |
1/1✓ Branch 1 taken 298 times.
|
298 | OptionalSpaceType spaceType = this->spaceType(); |
| 195 |
2/2✓ Branch 0 taken 152 times.
✓ Branch 1 taken 146 times.
|
298 | if (space) { |
| 196 |
3/3✓ Branch 1 taken 152 times.
✓ Branch 4 taken 152 times.
✓ Branch 7 taken 152 times.
|
152 | result = space->getDefaultSchedule(DefaultScheduleType::ElectricEquipmentSchedule); |
| 197 |
1/2✓ Branch 0 taken 146 times.
✗ Branch 1 not taken.
|
146 | } else if (spaceType) { |
| 198 |
3/3✓ Branch 1 taken 146 times.
✓ Branch 4 taken 146 times.
✓ Branch 7 taken 146 times.
|
146 | result = spaceType->getDefaultSchedule(DefaultScheduleType::ElectricEquipmentSchedule); |
| 199 | } | ||
| 200 | 298 | } | |
| 201 | 321 | return result; | |
| 202 | ✗ | } | |
| 203 | |||
| 204 | ✗ | bool ElectricEquipment_Impl::isScheduleDefaulted() const { | |
| 205 | ✗ | return isEmpty(OS_ElectricEquipmentFields::ScheduleName); | |
| 206 | } | ||
| 207 | |||
| 208 | 61 | bool ElectricEquipment_Impl::setSchedule(Schedule& schedule) { | |
| 209 |
3/3✓ Branch 1 taken 61 times.
✓ Branch 4 taken 61 times.
✓ Branch 7 taken 61 times.
|
244 | bool result = ModelObject_Impl::setSchedule(OS_ElectricEquipmentFields::ScheduleName, "ElectricEquipment", "Electric Equipment", schedule); |
| 210 | 61 | return result; | |
| 211 | } | ||
| 212 | |||
| 213 | ✗ | void ElectricEquipment_Impl::resetSchedule() { | |
| 214 | ✗ | this->setString(OS_ElectricEquipmentFields::ScheduleName, ""); | |
| 215 | ✗ | } | |
| 216 | |||
| 217 | 427 | ElectricEquipmentDefinition ElectricEquipment_Impl::electricEquipmentDefinition() const { | |
| 218 |
2/2✓ Branch 1 taken 427 times.
✓ Branch 4 taken 427 times.
|
427 | return this->definition().cast<ElectricEquipmentDefinition>(); |
| 219 | } | ||
| 220 | |||
| 221 | ✗ | bool ElectricEquipment_Impl::setElectricEquipmentDefinition(const ElectricEquipmentDefinition& definition) { | |
| 222 | ✗ | return this->setPointer(this->definitionIndex(), definition.handle()); | |
| 223 | } | ||
| 224 | |||
| 225 | ✗ | bool ElectricEquipment_Impl::setDefinition(const SpaceLoadDefinition& definition) { | |
| 226 | ✗ | bool result = false; | |
| 227 | ✗ | boost::optional<ElectricEquipmentDefinition> electricEquipmentDefinition = definition.optionalCast<ElectricEquipmentDefinition>(); | |
| 228 | ✗ | if (electricEquipmentDefinition) { | |
| 229 | ✗ | result = setElectricEquipmentDefinition(*electricEquipmentDefinition); | |
| 230 | } | ||
| 231 | ✗ | return result; | |
| 232 | ✗ | } | |
| 233 | |||
| 234 | ✗ | boost::optional<ModelObject> ElectricEquipment_Impl::scheduleAsModelObject() const { | |
| 235 | ✗ | OptionalModelObject result; | |
| 236 | ✗ | OptionalSchedule intermediate = schedule(); | |
| 237 | ✗ | if (intermediate) { | |
| 238 | ✗ | result = *intermediate; | |
| 239 | } | ||
| 240 | ✗ | return result; | |
| 241 | ✗ | } | |
| 242 | |||
| 243 | ✗ | boost::optional<ModelObject> ElectricEquipment_Impl::electricEquipmentDefinitionAsModelObject() const { | |
| 244 | ✗ | OptionalModelObject result = electricEquipmentDefinition(); | |
| 245 | ✗ | return result; | |
| 246 | } | ||
| 247 | |||
| 248 | ✗ | bool ElectricEquipment_Impl::setScheduleAsModelObject(const boost::optional<ModelObject>& modelObject) { | |
| 249 | ✗ | if (modelObject) { | |
| 250 | ✗ | OptionalSchedule intermediate = modelObject->optionalCast<Schedule>(); | |
| 251 | ✗ | if (intermediate) { | |
| 252 | ✗ | Schedule schedule(*intermediate); | |
| 253 | ✗ | return setSchedule(schedule); | |
| 254 | ✗ | } else { | |
| 255 | ✗ | return false; | |
| 256 | } | ||
| 257 | ✗ | } else { | |
| 258 | ✗ | resetSchedule(); | |
| 259 | } | ||
| 260 | ✗ | return true; | |
| 261 | } | ||
| 262 | |||
| 263 | ✗ | boost::optional<double> ElectricEquipment_Impl::designLevel() const { | |
| 264 | ✗ | OptionalDouble result = electricEquipmentDefinition().designLevel(); | |
| 265 | ✗ | if (result) { | |
| 266 | ✗ | return result.get() * multiplier(); | |
| 267 | } | ||
| 268 | ✗ | return result; | |
| 269 | } | ||
| 270 | |||
| 271 | ✗ | boost::optional<double> ElectricEquipment_Impl::powerPerFloorArea() const { | |
| 272 | ✗ | OptionalDouble result = electricEquipmentDefinition().wattsperSpaceFloorArea(); | |
| 273 | ✗ | if (result) { | |
| 274 | ✗ | return result.get() * multiplier(); | |
| 275 | } | ||
| 276 | ✗ | return result; | |
| 277 | } | ||
| 278 | |||
| 279 | ✗ | boost::optional<double> ElectricEquipment_Impl::powerPerPerson() const { | |
| 280 | ✗ | OptionalDouble result = electricEquipmentDefinition().wattsperPerson(); | |
| 281 | ✗ | if (result) { | |
| 282 | ✗ | return result.get() * multiplier(); | |
| 283 | } | ||
| 284 | ✗ | return result; | |
| 285 | } | ||
| 286 | |||
| 287 | 47 | double ElectricEquipment_Impl::getDesignLevel(double floorArea, double numPeople) const { | |
| 288 |
3/3✓ Branch 1 taken 47 times.
✓ Branch 4 taken 47 times.
✓ Branch 7 taken 47 times.
|
47 | return electricEquipmentDefinition().getDesignLevel(floorArea, numPeople) * multiplier(); |
| 289 | } | ||
| 290 | |||
| 291 | 60 | double ElectricEquipment_Impl::getPowerPerFloorArea(double floorArea, double numPeople) const { | |
| 292 |
3/3✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
✓ Branch 7 taken 60 times.
|
60 | return electricEquipmentDefinition().getPowerPerFloorArea(floorArea, numPeople) * multiplier(); |
| 293 | } | ||
| 294 | |||
| 295 | 5 | double ElectricEquipment_Impl::getPowerPerPerson(double floorArea, double numPeople) const { | |
| 296 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
|
5 | return electricEquipmentDefinition().getPowerPerPerson(floorArea, numPeople) * multiplier(); |
| 297 | } | ||
| 298 | |||
| 299 | ✗ | bool ElectricEquipment_Impl::setElectricEquipmentDefinitionAsModelObject(const boost::optional<ModelObject>& modelObject) { | |
| 300 | ✗ | if (modelObject) { | |
| 301 | ✗ | OptionalElectricEquipmentDefinition intermediate = modelObject->optionalCast<ElectricEquipmentDefinition>(); | |
| 302 | ✗ | if (intermediate) { | |
| 303 | ✗ | return setElectricEquipmentDefinition(*intermediate); | |
| 304 | } | ||
| 305 | ✗ | } | |
| 306 | ✗ | return false; | |
| 307 | } | ||
| 308 | |||
| 309 | ✗ | boost::optional<ModelObject> SpaceLoadInstance_Impl::definitionAsModelObject() const { | |
| 310 | ✗ | OptionalModelObject result = definition(); | |
| 311 | ✗ | return result; | |
| 312 | } | ||
| 313 | |||
| 314 | ✗ | bool SpaceLoadInstance_Impl::setDefinitionAsModelObject(const boost::optional<ModelObject>& modelObject) { | |
| 315 | ✗ | if (modelObject) { | |
| 316 | ✗ | OptionalSpaceLoadDefinition intermediate = modelObject->optionalCast<SpaceLoadDefinition>(); | |
| 317 | ✗ | if (intermediate) { | |
| 318 | ✗ | return setDefinition(*intermediate); | |
| 319 | } | ||
| 320 | ✗ | } | |
| 321 | ✗ | return false; | |
| 322 | } | ||
| 323 | |||
| 324 | ✗ | std::vector<EMSActuatorNames> ElectricEquipment_Impl::emsActuatorNames() const { | |
| 325 | ✗ | std::vector<EMSActuatorNames> actuators{{"ElectricEquipment", "Electricity Rate"}}; | |
| 326 | ✗ | return actuators; | |
| 327 | ✗ | } | |
| 328 | |||
| 329 | ✗ | std::vector<std::string> ElectricEquipment_Impl::emsInternalVariableNames() const { | |
| 330 | ✗ | std::vector<std::string> types{"Plug and Process Power Design Level"}; | |
| 331 | ✗ | return types; | |
| 332 | ✗ | } | |
| 333 | |||
| 334 | } // namespace detail | ||
| 335 | |||
| 336 | 424 | ElectricEquipment::ElectricEquipment(const ElectricEquipmentDefinition& electricEquipmentDefinition) | |
| 337 | 424 | : SpaceLoadInstance(ElectricEquipment::iddObjectType(), electricEquipmentDefinition) { | |
| 338 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 424 times.
✗ Branch 5 not taken.
|
424 | OS_ASSERT(getImpl<detail::ElectricEquipment_Impl>()); |
| 339 | |||
| 340 | /* | ||
| 341 | *Schedule sch = this->model().alwaysOnDiscreteSchedule(); | ||
| 342 | *bool test = this->setSchedule(sch); | ||
| 343 | *OS_ASSERT(test); | ||
| 344 | *test = this->setMultiplier(1.0); | ||
| 345 | *OS_ASSERT(test); | ||
| 346 | */ | ||
| 347 |
2/2✓ Branch 1 taken 424 times.
✓ Branch 4 taken 424 times.
|
424 | bool test = this->setEndUseSubcategory("General"); |
| 348 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 424 times.
✗ Branch 3 not taken.
|
424 | OS_ASSERT(test); |
| 349 | 424 | } | |
| 350 | |||
| 351 | 13728 | IddObjectType ElectricEquipment::iddObjectType() { | |
| 352 |
1/1✓ Branch 1 taken 13728 times.
|
13728 | IddObjectType result(IddObjectType::OS_ElectricEquipment); |
| 353 | 13728 | return result; | |
| 354 | } | ||
| 355 | |||
| 356 | 114 | std::string ElectricEquipment::endUseSubcategory() const { | |
| 357 |
1/1✓ Branch 3 taken 114 times.
|
114 | return getImpl<detail::ElectricEquipment_Impl>()->endUseSubcategory(); |
| 358 | } | ||
| 359 | |||
| 360 | 282 | bool ElectricEquipment::isEndUseSubcategoryDefaulted() const { | |
| 361 |
1/1✓ Branch 3 taken 282 times.
|
282 | return getImpl<detail::ElectricEquipment_Impl>()->isEndUseSubcategoryDefaulted(); |
| 362 | } | ||
| 363 | |||
| 364 | 5 | bool ElectricEquipment::setMultiplier(double multiplier) { | |
| 365 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::ElectricEquipment_Impl>()->setMultiplier(multiplier); |
| 366 | } | ||
| 367 | |||
| 368 | ✗ | void ElectricEquipment::resetMultiplier() { | |
| 369 | ✗ | getImpl<detail::ElectricEquipment_Impl>()->resetMultiplier(); | |
| 370 | ✗ | } | |
| 371 | |||
| 372 | 482 | bool ElectricEquipment::setEndUseSubcategory(const std::string& endUseSubcategory) { | |
| 373 |
1/1✓ Branch 3 taken 482 times.
|
482 | return getImpl<detail::ElectricEquipment_Impl>()->setEndUseSubcategory(endUseSubcategory); |
| 374 | } | ||
| 375 | |||
| 376 | ✗ | void ElectricEquipment::resetEndUseSubcategory() { | |
| 377 | ✗ | getImpl<detail::ElectricEquipment_Impl>()->resetEndUseSubcategory(); | |
| 378 | ✗ | } | |
| 379 | |||
| 380 | 284 | boost::optional<Schedule> ElectricEquipment::schedule() const { | |
| 381 |
1/1✓ Branch 3 taken 284 times.
|
284 | return getImpl<detail::ElectricEquipment_Impl>()->schedule(); |
| 382 | } | ||
| 383 | |||
| 384 | ✗ | bool ElectricEquipment::isScheduleDefaulted() const { | |
| 385 | ✗ | return getImpl<detail::ElectricEquipment_Impl>()->isScheduleDefaulted(); | |
| 386 | } | ||
| 387 | |||
| 388 | 58 | bool ElectricEquipment::setSchedule(Schedule& schedule) { | |
| 389 |
1/1✓ Branch 3 taken 58 times.
|
58 | return getImpl<detail::ElectricEquipment_Impl>()->setSchedule(schedule); |
| 390 | } | ||
| 391 | |||
| 392 | ✗ | void ElectricEquipment::resetSchedule() { | |
| 393 | ✗ | getImpl<detail::ElectricEquipment_Impl>()->resetSchedule(); | |
| 394 | ✗ | } | |
| 395 | |||
| 396 | 283 | ElectricEquipmentDefinition ElectricEquipment::electricEquipmentDefinition() const { | |
| 397 |
1/1✓ Branch 3 taken 283 times.
|
283 | return getImpl<detail::ElectricEquipment_Impl>()->electricEquipmentDefinition(); |
| 398 | } | ||
| 399 | |||
| 400 | ✗ | bool ElectricEquipment::setElectricEquipmentDefinition(const ElectricEquipmentDefinition& electricEquipmentDefinition) { | |
| 401 | ✗ | return getImpl<detail::ElectricEquipment_Impl>()->setElectricEquipmentDefinition(electricEquipmentDefinition); | |
| 402 | } | ||
| 403 | |||
| 404 | ✗ | boost::optional<double> ElectricEquipment::designLevel() const { | |
| 405 | ✗ | return getImpl<detail::ElectricEquipment_Impl>()->designLevel(); | |
| 406 | } | ||
| 407 | |||
| 408 | ✗ | boost::optional<double> ElectricEquipment::powerPerFloorArea() const { | |
| 409 | ✗ | return getImpl<detail::ElectricEquipment_Impl>()->powerPerFloorArea(); | |
| 410 | } | ||
| 411 | |||
| 412 | ✗ | boost::optional<double> ElectricEquipment::powerPerPerson() const { | |
| 413 | ✗ | return getImpl<detail::ElectricEquipment_Impl>()->powerPerPerson(); | |
| 414 | } | ||
| 415 | |||
| 416 | 47 | double ElectricEquipment::getDesignLevel(double floorArea, double numPeople) const { | |
| 417 |
1/1✓ Branch 3 taken 47 times.
|
47 | return getImpl<detail::ElectricEquipment_Impl>()->getDesignLevel(floorArea, numPeople); |
| 418 | } | ||
| 419 | |||
| 420 | 60 | double ElectricEquipment::getPowerPerFloorArea(double floorArea, double numPeople) const { | |
| 421 |
1/1✓ Branch 3 taken 60 times.
|
60 | return getImpl<detail::ElectricEquipment_Impl>()->getPowerPerFloorArea(floorArea, numPeople); |
| 422 | } | ||
| 423 | |||
| 424 | 5 | double ElectricEquipment::getPowerPerPerson(double floorArea, double numPeople) const { | |
| 425 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::ElectricEquipment_Impl>()->getPowerPerPerson(floorArea, numPeople); |
| 426 | } | ||
| 427 | |||
| 428 | /// @cond | ||
| 429 |
1/1✓ Branch 3 taken 1097 times.
|
1097 | ElectricEquipment::ElectricEquipment(std::shared_ptr<detail::ElectricEquipment_Impl> impl) : SpaceLoadInstance(std::move(impl)) {} |
| 430 | /// @endcond | ||
| 431 | |||
| 432 | } // namespace model | ||
| 433 | } // namespace openstudio | ||
| 434 |