GCC Code Coverage Report


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

src/model/Lights_Impl.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_IMPL_HPP
7 #define MODEL_LIGHTS_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadInstance_Impl.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class Schedule;
16 class LightsDefinition;
17 class Lights;
18
19 namespace detail {
20
21 /** Lights_Impl is a SpaceLoadInstance_Impl that is the implementation class for Lights.*/
22 class MODEL_API Lights_Impl : public SpaceLoadInstance_Impl
23 {
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 Lights_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
29
30 Lights_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
31
32 Lights_Impl(const Lights_Impl& other, Model_Impl* model, bool keepHandle);
33
34 2932 virtual ~Lights_Impl() override = default;
35
36 //@}
37 /** @name Virtual Methods */
38 //@{
39
40 virtual const std::vector<std::string>& outputVariableNames() const override;
41
42 virtual IddObjectType iddObjectType() const override;
43
44 virtual std::vector<ScheduleTypeKey> getScheduleTypeKeys(const Schedule& schedule) const override;
45
46 virtual bool hardSize() override;
47
48 virtual bool hardApplySchedules() override;
49
50 virtual double multiplier() const override;
51
52 virtual bool isMultiplierDefaulted() const override;
53
54 virtual bool isAbsolute() const override;
55
56 //@}
57 /** @name Getters */
58 //@{
59
60 /** Gets the LightsDefinition object. */
61 LightsDefinition lightsDefinition() const;
62
63 /** Returns the (fractional) lighting schedule. If this object does not
64 * specify a schedule this function will search the hierarchy. */
65 boost::optional<Schedule> schedule() const;
66
67 /** Returns true if this object does not specify a schedule directly. */
68 bool isScheduleDefaulted() const;
69
70 double fractionReplaceable() const;
71
72 bool isFractionReplaceableDefaulted() const;
73
74 std::string endUseSubcategory() const;
75
76 bool isEndUseSubcategoryDefaulted() const;
77
78 //@}
79 /** @name Setters */
80 //@{
81
82 /** Sets the LightsDefinition object. */
83 bool setLightsDefinition(const LightsDefinition& definition);
84
85 /** Sets the definition of this instance. */
86 virtual bool setDefinition(const SpaceLoadDefinition& definition) override;
87
88 /** Sets the (fractional) Schedule. */
89 bool setSchedule(Schedule& schedule);
90
91 /** Resets the (fractional) Schedule. */
92 void resetSchedule();
93
94 bool setFractionReplaceable(double fractionReplaceable);
95
96 void resetFractionReplaceable();
97
98 bool setMultiplier(double multiplier);
99
100 void resetMultiplier();
101
102 bool setEndUseSubcategory(const std::string& endUseSubcategory);
103
104 void resetEndUseSubcategory();
105
106 //@}
107 /** @name Other */
108 //@{
109
110 boost::optional<double> lightingLevel() const;
111
112 boost::optional<double> powerPerFloorArea() const;
113
114 boost::optional<double> powerPerPerson() const;
115
116 /** Returns the lighting level represented by this instance, assuming floorArea (m^2) and
117 * numPeople. */
118 double getLightingPower(double floorArea, double numPeople) const;
119
120 /** Returns the watts/m^2 represented by this instance, assuming floorArea (m^2) and
121 * numPeople. */
122 double getPowerPerFloorArea(double floorArea, double numPeople) const;
123
124 /** Returns the watts/person represented by this instance, assuming floorArea (m^2) and
125 * numPeople. */
126 double getPowerPerPerson(double floorArea, double numPeople) const;
127
128 /** Returns the output variable related to lights that actually use the Zone key **/
129 const std::vector<std::string>& zoneLevelOutputVariableNames() const;
130
131 virtual std::vector<EMSActuatorNames> emsActuatorNames() const override;
132
133 virtual std::vector<std::string> emsInternalVariableNames() const override;
134
135 //@}
136 protected:
137 // index of the space name
138 virtual int spaceIndex() const override;
139
140 // index of the definition name
141 virtual int definitionIndex() const override;
142
143 private:
144 REGISTER_LOGGER("openstudio.model.Lights");
145
146 boost::optional<ModelObject> scheduleAsModelObject() const;
147 boost::optional<ModelObject> lightsDefinitionAsModelObject() const;
148
149 bool setScheduleAsModelObject(const boost::optional<ModelObject>& modelObject);
150 bool setLightsDefinitionAsModelObject(const boost::optional<ModelObject>& modelObject);
151 };
152
153 } // namespace detail
154
155 } // namespace model
156 } // namespace openstudio
157
158 #endif // MODEL_LIGHTS_IMPL_HPP
159