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