GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 60.0% 3 / 0 / 5
Functions: 60.0% 3 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/LightsDefinition.hpp
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 #ifndef MODEL_LIGHTSDEFINITION_HPP
7 #define MODEL_LIGHTSDEFINITION_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadDefinition.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class LightsDefinition_Impl;
18
19 } // namespace detail
20
21 /** LightsDefinition is a SpaceLoadDefinition that wraps the OpenStudio IDD object
22 * 'OS_Lights_Definition'. Its fields are derived from the EnergyPlus IDD object
23 * 'Lights'. \sa Lights
24 */
25 class MODEL_API LightsDefinition : public SpaceLoadDefinition
26 {
27
28 public:
29 /** @name Constructors and Destructors */
30 //@{
31
32 explicit LightsDefinition(const Model& model);
33
34 915 virtual ~LightsDefinition() override = default;
35 // Default the copy and move operators because the virtual dtor is explicit
36 ✗ LightsDefinition(const LightsDefinition& other) = default;
37 18 LightsDefinition(LightsDefinition&& other) = default;
38 ✗ LightsDefinition& operator=(const LightsDefinition&) = default;
39 1 LightsDefinition& operator=(LightsDefinition&&) = default;
40
41 //@}
42
43 static IddObjectType iddObjectType();
44
45 static std::vector<std::string> validDesignLevelCalculationMethodValues();
46
47 /** @name Getters */
48 //@{
49
50 std::string designLevelCalculationMethod() const;
51 boost::optional<double> lightingLevel() const;
52 boost::optional<double> wattsperSpaceFloorArea() const;
53 boost::optional<double> wattsperPerson() const;
54
55 double fractionRadiant() const;
56 bool isFractionRadiantDefaulted() const;
57
58 double fractionVisible() const;
59 bool isFractionVisibleDefaulted() const;
60
61 double returnAirFraction() const;
62 bool isReturnAirFractionDefaulted() const;
63
64 bool returnAirFractionCalculatedfromPlenumTemperature() const;
65 bool isReturnAirFractionCalculatedfromPlenumTemperatureDefaulted() const;
66
67 double returnAirFractionFunctionofPlenumTemperatureCoefficient1() const;
68 bool isReturnAirFractionFunctionofPlenumTemperatureCoefficient1Defaulted() const;
69
70 double returnAirFractionFunctionofPlenumTemperatureCoefficient2() const;
71 bool isReturnAirFractionFunctionofPlenumTemperatureCoefficient2Defaulted() const;
72
73 //@}
74 /** @name Setters */
75 //@{
76
77 /// Sets designLevelCalculationMethod to 'LightingLevel', clears wattsperSpaceFloorArea
78 /// and wattsperPerson, and sets lightingLevel.
79 bool setLightingLevel(double lightingLevel);
80
81 /// Sets designLevelCalculationMethod to 'Watts/Area', clears lightingLevel
82 /// and wattsperPerson, and sets wattsperSpaceFloorArea.
83 bool setWattsperSpaceFloorArea(double wattsperSpaceFloorArea);
84
85 /// Sets designLevelCalculationMethod to 'Watts/Person', clears lightingLevel
86 /// and wattsperSpaceFloorArea, and sets wattsperPerson.
87 bool setWattsperPerson(double wattsperPerson);
88
89 bool setFractionRadiant(double fractionRadiant);
90 void resetFractionRadiant();
91
92 bool setFractionVisible(double fractionVisible);
93 void resetFractionVisible();
94
95 bool setReturnAirFraction(double returnAirFraction);
96 void resetReturnAirFraction();
97
98 bool setReturnAirFractionCalculatedfromPlenumTemperature(bool returnAirFractionCalculatedfromPlenumTemperature);
99 void resetReturnAirFractionCalculatedfromPlenumTemperature();
100
101 bool setReturnAirFractionFunctionofPlenumTemperatureCoefficient1(double returnAirFractionFunctionofPlenumTemperatureCoefficient1);
102 void resetReturnAirFractionFunctionofPlenumTemperatureCoefficient1();
103
104 bool setReturnAirFractionFunctionofPlenumTemperatureCoefficient2(double returnAirFractionFunctionofPlenumTemperatureCoefficient2);
105 void resetReturnAirFractionFunctionofPlenumTemperatureCoefficient2();
106
107 //@}
108 /** @name Other */
109 //@{
110
111 /** Returns the lighting level represented by this definition, assuming floorArea (m^2) and
112 * numPeople. */
113 double getLightingPower(double floorArea, double numPeople) const;
114
115 /** Returns the watts/m^2 represented by this definition, assuming floorArea (m^2) and
116 * numPeople. */
117 double getPowerPerFloorArea(double floorArea, double numPeople) const;
118
119 /** Returns the watts/person represented by this definition, assuming floorArea (m^2) and
120 * numPeople. */
121 double getPowerPerPerson(double floorArea, double numPeople) const;
122
123 /** If method is a \link validDesignLevelCalculationMethodValues valid design level
124 * calculation method \endlink, changes this definition to an equivalent lighting level, under
125 * the assumptions of floorArea (m^2) and numPeople. */
126 bool setDesignLevelCalculationMethod(const std::string& method, double floorArea, double numPeople);
127
128 //@}
129 protected:
130 /// @cond
131 using ImplType = detail::LightsDefinition_Impl;
132
133 friend class Model;
134 friend class openstudio::IdfObject;
135
136 explicit LightsDefinition(std::shared_ptr<detail::LightsDefinition_Impl> impl);
137
138 /// @endcond
139 private:
140 REGISTER_LOGGER("openstudio.model.LightsDefinition");
141 };
142
143 /** \relates LightsDefinition*/
144 using OptionalLightsDefinition = boost::optional<LightsDefinition>;
145
146 /** \relates LightsDefinition*/
147 using LightsDefinitionVector = std::vector<LightsDefinition>;
148
149 } // namespace model
150 } // namespace openstudio
151
152 #endif // MODEL_LIGHTSDEFINITION_HPP
153