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/GasEquipmentDefinition.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_GASEQUIPMENTDEFINITION_HPP
7 #define MODEL_GASEQUIPMENTDEFINITION_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadDefinition.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class GasEquipmentDefinition_Impl;
18
19 } // namespace detail
20
21 /** GasEquipmentDefinition is a SpaceLoadDefinition that wraps the OpenStudio IDD object
22 * 'OS_GasEquipment_Definition'. Its fields are derived from the EnergyPlus IDD object
23 * 'GasEquipment'. \sa GasEquipmentDefinition
24 */
25 class MODEL_API GasEquipmentDefinition : public SpaceLoadDefinition
26 {
27 public:
28 /** @name Constructors and Destructors */
29 //@{
30
31 explicit GasEquipmentDefinition(const Model& model);
32
33 71 virtual ~GasEquipmentDefinition() override = default;
34 // Default the copy and move operators because the virtual dtor is explicit
35 ✗ GasEquipmentDefinition(const GasEquipmentDefinition& other) = default;
36 1 GasEquipmentDefinition(GasEquipmentDefinition&& other) = default;
37 ✗ GasEquipmentDefinition& operator=(const GasEquipmentDefinition&) = default;
38 ✗ GasEquipmentDefinition& operator=(GasEquipmentDefinition&&) = default;
39
40 //@}
41 /** @name Static Methods */
42 //@{
43
44 static IddObjectType iddObjectType();
45
46 static std::vector<std::string> validDesignLevelCalculationMethodValues();
47
48 //@}
49 /** @name Getters */
50 //@{
51
52 std::string designLevelCalculationMethod() const;
53 boost::optional<double> designLevel() const;
54 boost::optional<double> wattsperSpaceFloorArea() const;
55 boost::optional<double> wattsperPerson() const;
56
57 double fractionLatent() const;
58 bool isFractionLatentDefaulted() const;
59
60 double fractionRadiant() const;
61 bool isFractionRadiantDefaulted() const;
62
63 double fractionLost() const;
64 bool isFractionLostDefaulted() const;
65
66 double carbonDioxideGenerationRate() const;
67 bool isCarbonDioxideGenerationRateDefaulted() const;
68
69 //@}
70 /** @name Setters */
71 //@{
72
73 /** Also sets designLevelCalculationMethod accordingly. */
74 bool setDesignLevel(double designLevel);
75
76 /** Also sets designLevelCalculationMethod accordingly. */
77 bool setWattsperSpaceFloorArea(double wattsperSpaceFloorArea);
78
79 /** Also sets designLevelCalculationMethod accordingly. */
80 bool setWattsperPerson(double wattsperPerson);
81
82 bool setFractionLatent(double fractionLatent);
83 void resetFractionLatent();
84
85 bool setFractionRadiant(double fractionRadiant);
86 void resetFractionRadiant();
87
88 bool setFractionLost(double fractionLost);
89 void resetFractionLost();
90
91 bool setCarbonDioxideGenerationRate(double carbonDioxideGenerationRate);
92 void resetCarbonDioxideGenerationRate();
93
94 //@}
95 /** @name Other */
96 //@{
97
98 /** Returns the design level represented by this definition, assuming floorArea (m^2) and
99 * numPeople. */
100 double getDesignLevel(double floorArea, double numPeople) const;
101
102 /** Returns the watts/m^2 represented by this definition, assuming floorArea (m^2) and
103 * numPeople. */
104 double getPowerPerFloorArea(double floorArea, double numPeople) const;
105
106 /** Returns the watts/person represented by this definition, assuming floorArea (m^2) and
107 * numPeople. */
108 double getPowerPerPerson(double floorArea, double numPeople) const;
109
110 /** If method is a \link validDesignLevelCalculationMethodValues valid design level
111 * calculation method \endlink, changes this definition to an equivalent power level, under
112 * the assumptions of floorArea (m^2) and numPeople. */
113 bool setDesignLevelCalculationMethod(const std::string& method, double floorArea, double numPeople);
114
115 //@}
116 protected:
117 /// @cond
118 using ImplType = detail::GasEquipmentDefinition_Impl;
119
120 friend class Model;
121 friend class openstudio::IdfObject;
122
123 explicit GasEquipmentDefinition(std::shared_ptr<detail::GasEquipmentDefinition_Impl> impl);
124
125 /// @endcond
126 private:
127 REGISTER_LOGGER("openstudio.model.GasEquipmentDefinition");
128 };
129
130 /** \relates GasEquipmentDefinition*/
131 using OptionalGasEquipmentDefinition = boost::optional<GasEquipmentDefinition>;
132
133 /** \relates GasEquipmentDefinition*/
134 using GasEquipmentDefinitionVector = std::vector<GasEquipmentDefinition>;
135
136 } // namespace model
137 } // namespace openstudio
138
139 #endif // MODEL_GASEQUIPMENTDEFINITION_HPP
140