GCC Code Coverage Report


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

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