GCC Code Coverage Report


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

src/model/SetpointManager_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_SETPOINTMANAGER_IMPL_HPP
7 #define MODEL_SETPOINTMANAGER_IMPL_HPP
8
9 #include "HVACComponent_Impl.hpp"
10 #include <boost/optional.hpp>
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class MODEL_API SetpointManager_Impl : public HVACComponent_Impl
18 {
19 public:
20 SetpointManager_Impl(IddObjectType type, Model_Impl* model);
21
22 SetpointManager_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
23
24 SetpointManager_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
25
26 SetpointManager_Impl(const SetpointManager_Impl& other, Model_Impl* model, bool keepHandles);
27
28 1885 virtual ~SetpointManager_Impl() override = default;
29
30 /** This method will delete any existing SPM with the same controlVariable, and check if placing the SPM is allowed:
31 * <ul>
32 * <li>Airside: only allows placement of the SPM on the supply side of an AirLoopHVAC,
33 * or the node of an AirLoopHVACOutdoorAirSystem EXCEPT on the outdoorAirNode or reliefAirNode</li>
34 * <li>Waterside: if isAllowedOnPlantLoop() returns true, it will allow connection on the supply side,
35 * or the demand side EXCEPT between the demand splitter and demand mixer (i.e. not allowed on a demand branch)</li>
36 * </ul>.
37 */
38 virtual bool addToNode(Node& node) override;
39
40 virtual std::vector<openstudio::IdfObject> remove() override;
41
42 virtual ModelObject clone(Model model) const override;
43
44 virtual const std::vector<std::string>& outputVariableNames() const override;
45
46 virtual boost::optional<ParentObject> parent() const override;
47
48 virtual std::vector<ModelObject> children() const override;
49
50 virtual std::string controlVariable() const = 0;
51
52 virtual bool setControlVariable(const std::string& value) = 0;
53
54 virtual boost::optional<Node> setpointNode() const = 0;
55
56 virtual boost::optional<AirLoopHVAC> airLoopHVAC() const override;
57
58 virtual boost::optional<PlantLoop> plantLoop() const override;
59
60 virtual boost::optional<Loop> loop() const override;
61
62 virtual boost::optional<AirLoopHVACOutdoorAirSystem> airLoopHVACOutdoorAirSystem() const override;
63
64 /** Defaults to false. Must be overriden by derived classes that can be actually placed on a PlantLoop to return true.
65 * If true, addToNode will allow connection on a PlantLoop (supply side, or demand side EXCEPT between splitter and mixer) */
66 virtual bool isAllowedOnPlantLoop() const;
67
68 virtual ComponentType componentType() const override;
69 virtual std::vector<FuelType> coolingFuelTypes() const override;
70 virtual std::vector<FuelType> heatingFuelTypes() const override;
71 virtual std::vector<AppGFuelType> appGHeatingFuelTypes() const override;
72
73 private:
74 /** This is used to set the field SetpointNodeName.
75 * Use addToNode to add a setpoint manager to a node. */
76 virtual bool setSetpointNode(const Node& node) = 0;
77
78 /** This is used to reset the field SetpointNodeName. */
79 virtual void resetSetpointNode() = 0;
80
81 − REGISTER_LOGGER("openstudio.model.SetpointManager");
82 };
83
84 } // namespace detail
85
86 } // namespace model
87
88 } // namespace openstudio
89
90 #endif // MODEL_SETPOINTMANAGER_IMPL_HPP
91