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