GCC Code Coverage Report


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

src/model/Lights.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_LIGHTS_HPP
7 #define MODEL_LIGHTS_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadInstance.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class Schedule;
16 class LightsDefinition;
17
18 namespace detail {
19
20 class Lights_Impl;
21
22 } // namespace detail
23
24 /** Lights is a SpaceLoadInstance that wraps the OpenStudio IDD object 'OS:Lights'.
25 * \sa LightsDefinition */
26 class MODEL_API Lights : public SpaceLoadInstance
27 {
28 public:
29 /** @name Constructors and Destructors */
30 //@{
31
32 explicit Lights(const LightsDefinition& lightsDefinition);
33
34 2514 virtual ~Lights() override = default;
35 // Default the copy and move operators because the virtual dtor is explicit
36 34 Lights(const Lights& other) = default;
37 987 Lights(Lights&& other) = default;
38 ✗ Lights& operator=(const Lights&) = default;
39 70 Lights& operator=(Lights&&) = default;
40
41 //@}
42
43 static IddObjectType iddObjectType();
44
45 /** @name Getters */
46 //@{
47
48 /** Gets the LightsDefinition object. */
49 LightsDefinition lightsDefinition() const;
50
51 /** Returns the (fractional) lighting schedule. If this object does not
52 * specify a schedule this function will search the hierarchy. */
53 boost::optional<Schedule> schedule() const;
54
55 /** Returns true if this object does not specify a schedule directly. */
56 bool isScheduleDefaulted() const;
57
58 double fractionReplaceable() const;
59
60 bool isFractionReplaceableDefaulted() const;
61
62 std::string endUseSubcategory() const;
63
64 bool isEndUseSubcategoryDefaulted() const;
65
66 //@}
67 /** @name Setters */
68 //@{
69
70 /** Sets the LightsDefinition object. */
71 bool setLightsDefinition(const LightsDefinition& definition);
72
73 /** Sets the (fractional) Schedule. */
74 bool setSchedule(Schedule& schedule);
75
76 /** Resets the (fractional) Schedule. */
77 void resetSchedule();
78
79 bool setFractionReplaceable(double fractionReplaceable);
80
81 void resetFractionReplaceable();
82
83 bool setMultiplier(double multiplier);
84
85 void resetMultiplier();
86
87 bool setEndUseSubcategory(const std::string& endUseSubcategory);
88
89 void resetEndUseSubcategory();
90
91 //@}
92 /** @name Other */
93 //@{
94
95 /** Returns the lightingLevel if possible based on the underlying data of
96 * lightsDefinition(). */
97 boost::optional<double> lightingLevel() const;
98
99 /** Returns the powerPerFloorArea if possible based on the underlying data of
100 * lightsDefinition(). */
101 boost::optional<double> powerPerFloorArea() const;
102
103 /** Returns the powerPerPerson if possible based on the underlying data of
104 * lightsDefinition(). */
105 boost::optional<double> powerPerPerson() const;
106
107 /** Returns the lighting level represented by this instance, assuming floorArea (m^2) and
108 * numPeople. */
109 double getLightingPower(double floorArea, double numPeople) const;
110
111 /** Returns the watts/m^2 represented by this instance, assuming floorArea (m^2) and
112 * numPeople. */
113 double getPowerPerFloorArea(double floorArea, double numPeople) const;
114
115 /** Returns the watts/person represented by this instance, assuming floorArea (m^2) and
116 * numPeople. */
117 double getPowerPerPerson(double floorArea, double numPeople) const;
118
119 //@}
120 protected:
121 /// @cond
122 using ImplType = detail::Lights_Impl;
123
124 friend class Model;
125 friend class openstudio::IdfObject;
126
127 explicit Lights(std::shared_ptr<detail::Lights_Impl> impl);
128
129 /// @endcond
130 private:
131 REGISTER_LOGGER("openstudio.model.Lights");
132 };
133
134 /** \relates Lights*/
135 using OptionalLights = boost::optional<Lights>;
136
137 /** \relates Lights*/
138 using LightsVector = std::vector<Lights>;
139
140 } // namespace model
141 } // namespace openstudio
142
143 #endif // MODEL_LIGHTS_HPP
144