GCC Code Coverage Report


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

src/model/ZoneHVACEquipmentList.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_ZONEHVACEQUIPMENTLIST_HPP
7 #define MODEL_ZONEHVACEQUIPMENTLIST_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11 #include "../utilities/core/Deprecated.hpp"
12
13 namespace openstudio {
14 namespace model {
15
16 namespace detail {
17
18 class ZoneHVACEquipmentList_Impl;
19
20 } // namespace detail
21
22 class ThermalZone;
23
24 /** ZoneHVACEquipmentList is a ModelObject that wraps the OpenStudio IDD object 'OS:ZoneHVAC:EquipmentList'. */
25 class MODEL_API ZoneHVACEquipmentList : public ModelObject
26 {
27 public:
28 explicit ZoneHVACEquipmentList(const ThermalZone& thermalZone);
29
30 12712 virtual ~ZoneHVACEquipmentList() override = default;
31 // Default the copy and move operators because the virtual dtor is explicit
32 4818 ZoneHVACEquipmentList(const ZoneHVACEquipmentList& other) = default;
33 2979 ZoneHVACEquipmentList(ZoneHVACEquipmentList&& other) = default;
34 ✗ ZoneHVACEquipmentList& operator=(const ZoneHVACEquipmentList&) = default;
35 ✗ ZoneHVACEquipmentList& operator=(ZoneHVACEquipmentList&&) = default;
36
37 static IddObjectType iddObjectType();
38
39 static std::vector<std::string> loadDistributionSchemeValues();
40
41 static std::vector<std::string> validLoadDistributionSchemeValues();
42
43 std::string loadDistributionScheme() const;
44
45 bool setLoadDistributionScheme(const std::string& scheme);
46
47 /** Add new equipment setting the heating and cooling priorities
48 * to the next available priority level.
49 * Air terminals associated with AirLoopHVAC will be moved to first priority.
50 * This method is relatively dumb. It will add any model object to the list
51 * even if it is not hvac equipment. That might change in the future.
52 */
53 bool addEquipment(const ModelObject& equipment);
54
55 /** Remove equipment from the EquipmentList.
56 * This will not remove the equipment from the model or
57 * disconnect any node connections. Use only if you know what you are doing.
58 */
59 bool removeEquipment(const ModelObject& equipment);
60
61 /** Set cooling priority of equipment.
62 * Returns false when equipment is not in the ZoneHVACEquipmentList
63 */
64 bool setCoolingPriority(const ModelObject& equipment, unsigned priority);
65
66 /** Set heating or no-load priority of equipment.
67 * Returns false when equipment is not in the ZoneHVACEquipmentList
68 */
69 bool setHeatingPriority(const ModelObject& equipment, unsigned priority);
70
71 /** Return all equipment. Order is undetermined. */
72 std::vector<ModelObject> equipment() const;
73
74 /** Return all equipment. Order is determined by heating priority.
75 * Equipment having a Heating Priority of 0 is filtered out (unavailable)
76 */
77 std::vector<ModelObject> equipmentInHeatingOrder() const;
78
79 /** Return all equipment. Order is determined by cooling priority
80 * Equipment having a Cooling Priority of 0 is filtered out (unavailable)
81 */
82 std::vector<ModelObject> equipmentInCoolingOrder() const;
83
84 ThermalZone thermalZone() const;
85
86 // TODO: JM 2019-02-25 These should actually return a boost::optional<unsigned> in case the equipment isn't actually part of the list...
87 /** Return the heating or no-load priority for equipment */
88 unsigned heatingPriority(const ModelObject& equipment) const;
89
90 /** Return the cooling priority for equipment */
91 unsigned coolingPriority(const ModelObject& equipment) const;
92
93 /** Return the Sequential Cooling Fraction of equipment.
94 * Returns nothing if when equipment is not in the ZoneHVACEquipmentList, its heating priority is zero,
95 * or the loadDistributionScheme isn't 'Sequential'
96 */
97 OS_DEPRECATED(2, 9, 0) boost::optional<double> sequentialCoolingFraction(const ModelObject& equipment) const;
98
99 /** Return the Sequential Cooling Fraction Schedule of equipment.
100 * Returns nothing if when equipment is not in the ZoneHVACEquipmentList, its heating priority is zero,
101 * or the loadDistributionScheme isn't 'Sequential'
102 */
103 boost::optional<Schedule> sequentialCoolingFractionSchedule(const ModelObject& equipment) const;
104
105 /** Return the Sequential Heating Fraction of equipment.
106 * Returns nothing if when equipment is not in the ZoneHVACEquipmentList, its cooling priority is zero,
107 * or the loadDistributionScheme isn't 'Sequential'
108 */
109 OS_DEPRECATED(2, 9, 0) boost::optional<double> sequentialHeatingFraction(const ModelObject& equipment) const;
110
111 /** Return the Sequential Heating Fraction Schedule of equipment.
112 * Returns nothing if when equipment is not in the ZoneHVACEquipmentList, its cooling priority is zero,
113 * or the loadDistributionScheme isn't 'Sequential'
114 */
115 boost::optional<Schedule> sequentialHeatingFractionSchedule(const ModelObject& equipment) const;
116
117 /** Set the Sequential Cooling Fraction Schedule Constant of equipment.
118 * Returns false when equipment is not in the ZoneHVACEquipmentList, its cooling priority is zero,
119 * or the loadDistributionScheme isn't 'Sequential'
120 */
121 OS_DEPRECATED(2, 9, 0) bool setSequentialCoolingFraction(const ModelObject& equipment, double fraction);
122
123 /** Set the Sequential Cooling Fraction Schedule of equipment.
124 * Returns false when equipement is not in the ZoneHVACEquipmentList, its cooling priority is zero,
125 * or the loadDistributionScheme isn't 'Sequential'
126 */
127 bool setSequentialCoolingFractionSchedule(const ModelObject& equipment, Schedule& schedule);
128
129 /** Set the Sequential Heating Fraction Schedule Constant of equipment.
130 * Returns false when equipment is not in the ZoneHVACEquipmentList, its heating priority is zero,
131 * or the loadDistributionScheme isn't 'Sequential'
132 */
133 OS_DEPRECATED(2, 9, 0) bool setSequentialHeatingFraction(const ModelObject& equipment, double fraction);
134
135 /** Set the Sequential Heating Fraction Schedule of equipment.
136 * Returns false when equipment is not in the ZoneHVACEquipmentList, its heating priority is zero,
137 * or the loadDistributionScheme isn't 'Sequential'
138 */
139 bool setSequentialHeatingFractionSchedule(const ModelObject& equipment, Schedule& schedule);
140
141 protected:
142 /// @cond
143
144 using ImplType = detail::ZoneHVACEquipmentList_Impl;
145
146 explicit ZoneHVACEquipmentList(std::shared_ptr<detail::ZoneHVACEquipmentList_Impl> impl);
147
148 friend class detail::ZoneHVACEquipmentList_Impl;
149 friend class Model;
150 friend class IdfObject;
151 friend class openstudio::detail::IdfObject_Impl;
152
153 /// @endcond
154
155 private:
156 REGISTER_LOGGER("openstudio.model.ZoneHVACEquipmentList");
157 };
158
159 /** \relates ZoneHVACEquipmentList*/
160 using OptionalZoneHVACEquipmentList = boost::optional<ZoneHVACEquipmentList>;
161
162 /** \relates ZoneHVACEquipmentList*/
163 using ZoneHVACEquipmentListVector = std::vector<ZoneHVACEquipmentList>;
164
165 } // namespace model
166 } // namespace openstudio
167
168 #endif // MODEL_ZONEHVACEQUIPMENTLIST_HPP
169