GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 84.2% 48 / 0 / 57
Functions: 88.9% 16 / 0 / 18
Branches: 49.0% 24 / 0 / 49

src/model/AvailabilityManagerLowTemperatureTurnOn.cpp
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 #include "AvailabilityManagerLowTemperatureTurnOn.hpp"
7 #include "AvailabilityManagerLowTemperatureTurnOn_Impl.hpp"
8 #include "Model.hpp"
9 #include "Node.hpp"
10 #include "Node_Impl.hpp"
11 #include <utilities/idd/IddEnums.hxx>
12 #include <utilities/idd/OS_AvailabilityManager_LowTemperatureTurnOn_FieldEnums.hxx>
13 #include "../utilities/units/Unit.hpp"
14 #include "../utilities/core/Assert.hpp"
15
16 namespace openstudio {
17 namespace model {
18
19 namespace detail {
20
21 9 AvailabilityManagerLowTemperatureTurnOn_Impl::AvailabilityManagerLowTemperatureTurnOn_Impl(const IdfObject& idfObject, Model_Impl* model,
22 9 bool keepHandle)
23 9 : AvailabilityManager_Impl(idfObject, model, keepHandle) {
24
4/6
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 9 times.
✗ Branch 13 not taken.
9 OS_ASSERT(idfObject.iddObject().type() == AvailabilityManagerLowTemperatureTurnOn::iddObjectType());
25 9 }
26
27 ✗ AvailabilityManagerLowTemperatureTurnOn_Impl::AvailabilityManagerLowTemperatureTurnOn_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
28 ✗ Model_Impl* model, bool keepHandle)
29 ✗ : AvailabilityManager_Impl(other, model, keepHandle) {
30 ✗ OS_ASSERT(other.iddObject().type() == AvailabilityManagerLowTemperatureTurnOn::iddObjectType());
31 ✗ }
32
33 10 AvailabilityManagerLowTemperatureTurnOn_Impl::AvailabilityManagerLowTemperatureTurnOn_Impl(
34 10 const AvailabilityManagerLowTemperatureTurnOn_Impl& other, Model_Impl* model, bool keepHandle)
35 10 : AvailabilityManager_Impl(other, model, keepHandle) {}
36
37 ✗ const std::vector<std::string>& AvailabilityManagerLowTemperatureTurnOn_Impl::outputVariableNames() const {
38 ✗ static const std::vector<std::string> result{"Availability Manager Low Temperature Turn On Control Status"};
39 ✗ return result;
40 ✗ }
41
42 5 IddObjectType AvailabilityManagerLowTemperatureTurnOn_Impl::iddObjectType() const {
43 5 return AvailabilityManagerLowTemperatureTurnOn::iddObjectType();
44 }
45
46 11 boost::optional<Node> AvailabilityManagerLowTemperatureTurnOn_Impl::sensorNode() const {
47
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 return getObject<ModelObject>().getModelObjectTarget<Node>(OS_AvailabilityManager_LowTemperatureTurnOnFields::SensorNodeName);
48 }
49
50 4 double AvailabilityManagerLowTemperatureTurnOn_Impl::temperature() const {
51
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<double> value = getDouble(OS_AvailabilityManager_LowTemperatureTurnOnFields::Temperature, true);
52
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
53
1/1
✓ Branch 1 taken 4 times.
8 return value.get();
54 }
55
56 4 bool AvailabilityManagerLowTemperatureTurnOn_Impl::setSensorNode(const Node& node) {
57
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 bool result = setPointer(OS_AvailabilityManager_LowTemperatureTurnOnFields::SensorNodeName, node.handle());
58 4 return result;
59 }
60
61 1 void AvailabilityManagerLowTemperatureTurnOn_Impl::resetSensorNode() {
62
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_AvailabilityManager_LowTemperatureTurnOnFields::SensorNodeName, "");
63
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
64 1 }
65
66 11 bool AvailabilityManagerLowTemperatureTurnOn_Impl::setTemperature(double temperature) {
67 11 bool result = setDouble(OS_AvailabilityManager_LowTemperatureTurnOnFields::Temperature, temperature);
68
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
11 OS_ASSERT(result);
69 11 return result;
70 }
71
72 } // namespace detail
73
74 9 AvailabilityManagerLowTemperatureTurnOn::AvailabilityManagerLowTemperatureTurnOn(const Model& model)
75 9 : AvailabilityManager(AvailabilityManagerLowTemperatureTurnOn::iddObjectType(), model) {
76
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 5 not taken.
9 OS_ASSERT(getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>());
77
78
1/1
✓ Branch 1 taken 9 times.
9 setTemperature(30);
79 9 }
80
81 7751 IddObjectType AvailabilityManagerLowTemperatureTurnOn::iddObjectType() {
82
1/1
✓ Branch 1 taken 7751 times.
7751 return {IddObjectType::OS_AvailabilityManager_LowTemperatureTurnOn};
83 }
84
85 11 boost::optional<Node> AvailabilityManagerLowTemperatureTurnOn::sensorNode() const {
86
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>()->sensorNode();
87 }
88
89 4 double AvailabilityManagerLowTemperatureTurnOn::temperature() const {
90
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>()->temperature();
91 }
92
93 4 bool AvailabilityManagerLowTemperatureTurnOn::setSensorNode(const Node& node) {
94
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>()->setSensorNode(node);
95 }
96
97 1 void AvailabilityManagerLowTemperatureTurnOn::resetSensorNode() {
98
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>()->resetSensorNode();
99 1 }
100
101 11 bool AvailabilityManagerLowTemperatureTurnOn::setTemperature(double temperature) {
102
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::AvailabilityManagerLowTemperatureTurnOn_Impl>()->setTemperature(temperature);
103 }
104
105 /// @cond
106 2 AvailabilityManagerLowTemperatureTurnOn::AvailabilityManagerLowTemperatureTurnOn(
107 2 std::shared_ptr<detail::AvailabilityManagerLowTemperatureTurnOn_Impl> impl)
108
1/1
✓ Branch 2 taken 2 times.
2 : AvailabilityManager(impl) {}
109 /// @endcond
110
111 } // namespace model
112 } // namespace openstudio
113