GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 59.7% 40 / 0 / 67
Functions: 58.3% 14 / 0 / 24
Branches: 45.5% 20 / 0 / 44

src/model/OutputControlReportingTolerances.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 "OutputControlReportingTolerances.hpp"
7 #include "OutputControlReportingTolerances_Impl.hpp"
8
9 #include <utilities/idd/OS_OutputControl_ReportingTolerances_FieldEnums.hxx>
10 #include <utilities/idd/IddEnums.hxx>
11
12 #include "../utilities/units/Unit.hpp"
13
14 #include "../utilities/core/Assert.hpp"
15
16 namespace openstudio {
17 namespace model {
18
19 namespace detail {
20
21 22 OutputControlReportingTolerances_Impl::OutputControlReportingTolerances_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
22 22 : ModelObject_Impl(idfObject, model, keepHandle) {
23
4/6
✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
✓ Branch 7 taken 22 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 22 times.
✗ Branch 13 not taken.
22 OS_ASSERT(idfObject.iddObject().type() == OutputControlReportingTolerances::iddObjectType());
24 22 }
25
26 15 OutputControlReportingTolerances_Impl::OutputControlReportingTolerances_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
27 15 Model_Impl* model, bool keepHandle)
28 15 : ModelObject_Impl(other, model, keepHandle) {
29
4/6
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 15 times.
✗ Branch 13 not taken.
15 OS_ASSERT(other.iddObject().type() == OutputControlReportingTolerances::iddObjectType());
30 15 }
31
32 48 OutputControlReportingTolerances_Impl::OutputControlReportingTolerances_Impl(const OutputControlReportingTolerances_Impl& other,
33 48 Model_Impl* model, bool keepHandle)
34 48 : ModelObject_Impl(other, model, keepHandle) {}
35
36 ✗ const std::vector<std::string>& OutputControlReportingTolerances_Impl::outputVariableNames() const {
37 ✗ static const std::vector<std::string> result;
38 ✗ return result;
39 }
40
41 ✗ IddObjectType OutputControlReportingTolerances_Impl::iddObjectType() const {
42 ✗ return OutputControlReportingTolerances::iddObjectType();
43 }
44
45 13 double OutputControlReportingTolerances_Impl::toleranceforTimeHeatingSetpointNotMet() const {
46
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<double> value = getDouble(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeHeatingSetpointNotMet, true);
47
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
✗ Branch 4 not taken.
13 OS_ASSERT(value);
48
1/1
✓ Branch 1 taken 13 times.
26 return value.get();
49 }
50
51 ✗ bool OutputControlReportingTolerances_Impl::isToleranceforTimeHeatingSetpointNotMetDefaulted() const {
52 ✗ return isEmpty(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeHeatingSetpointNotMet);
53 }
54
55 13 double OutputControlReportingTolerances_Impl::toleranceforTimeCoolingSetpointNotMet() const {
56
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<double> value = getDouble(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeCoolingSetpointNotMet, true);
57
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
✗ Branch 4 not taken.
13 OS_ASSERT(value);
58
1/1
✓ Branch 1 taken 13 times.
26 return value.get();
59 }
60
61 ✗ bool OutputControlReportingTolerances_Impl::isToleranceforTimeCoolingSetpointNotMetDefaulted() const {
62 ✗ return isEmpty(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeCoolingSetpointNotMet);
63 }
64
65 5 bool OutputControlReportingTolerances_Impl::setToleranceforTimeHeatingSetpointNotMet(double toleranceforTimeHeatingSetpointNotMet) {
66 bool result =
67 5 setDouble(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeHeatingSetpointNotMet, toleranceforTimeHeatingSetpointNotMet);
68 5 return result;
69 }
70
71 ✗ void OutputControlReportingTolerances_Impl::resetToleranceforTimeHeatingSetpointNotMet() {
72 ✗ bool result = setString(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeHeatingSetpointNotMet, "");
73 ✗ OS_ASSERT(result);
74 ✗ }
75
76 5 bool OutputControlReportingTolerances_Impl::setToleranceforTimeCoolingSetpointNotMet(double toleranceforTimeCoolingSetpointNotMet) {
77 bool result =
78 5 setDouble(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeCoolingSetpointNotMet, toleranceforTimeCoolingSetpointNotMet);
79 5 return result;
80 }
81
82 ✗ void OutputControlReportingTolerances_Impl::resetToleranceforTimeCoolingSetpointNotMet() {
83 ✗ bool result = setString(OS_OutputControl_ReportingTolerancesFields::ToleranceforTimeCoolingSetpointNotMet, "");
84 ✗ OS_ASSERT(result);
85 ✗ }
86
87 } // namespace detail
88
89 7788 IddObjectType OutputControlReportingTolerances::iddObjectType() {
90
1/1
✓ Branch 1 taken 7788 times.
7788 return {IddObjectType::OS_OutputControl_ReportingTolerances};
91 }
92
93 13 double OutputControlReportingTolerances::toleranceforTimeHeatingSetpointNotMet() const {
94
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::OutputControlReportingTolerances_Impl>()->toleranceforTimeHeatingSetpointNotMet();
95 }
96
97 ✗ bool OutputControlReportingTolerances::isToleranceforTimeHeatingSetpointNotMetDefaulted() const {
98 ✗ return getImpl<detail::OutputControlReportingTolerances_Impl>()->isToleranceforTimeHeatingSetpointNotMetDefaulted();
99 }
100
101 13 double OutputControlReportingTolerances::toleranceforTimeCoolingSetpointNotMet() const {
102
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::OutputControlReportingTolerances_Impl>()->toleranceforTimeCoolingSetpointNotMet();
103 }
104
105 ✗ bool OutputControlReportingTolerances::isToleranceforTimeCoolingSetpointNotMetDefaulted() const {
106 ✗ return getImpl<detail::OutputControlReportingTolerances_Impl>()->isToleranceforTimeCoolingSetpointNotMetDefaulted();
107 }
108
109 5 bool OutputControlReportingTolerances::setToleranceforTimeHeatingSetpointNotMet(double toleranceforTimeHeatingSetpointNotMet) {
110
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::OutputControlReportingTolerances_Impl>()->setToleranceforTimeHeatingSetpointNotMet(toleranceforTimeHeatingSetpointNotMet);
111 }
112
113 ✗ void OutputControlReportingTolerances::resetToleranceforTimeHeatingSetpointNotMet() {
114 ✗ getImpl<detail::OutputControlReportingTolerances_Impl>()->resetToleranceforTimeHeatingSetpointNotMet();
115 ✗ }
116
117 5 bool OutputControlReportingTolerances::setToleranceforTimeCoolingSetpointNotMet(double toleranceforTimeCoolingSetpointNotMet) {
118
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::OutputControlReportingTolerances_Impl>()->setToleranceforTimeCoolingSetpointNotMet(toleranceforTimeCoolingSetpointNotMet);
119 }
120
121 ✗ void OutputControlReportingTolerances::resetToleranceforTimeCoolingSetpointNotMet() {
122 ✗ getImpl<detail::OutputControlReportingTolerances_Impl>()->resetToleranceforTimeCoolingSetpointNotMet();
123 ✗ }
124
125 /// @cond
126 17 OutputControlReportingTolerances::OutputControlReportingTolerances(std::shared_ptr<detail::OutputControlReportingTolerances_Impl> impl)
127
1/1
✓ Branch 3 taken 17 times.
17 : ModelObject(std::move(impl)) {}
128 7 OutputControlReportingTolerances::OutputControlReportingTolerances(Model& model)
129 7 : ModelObject(OutputControlReportingTolerances::iddObjectType(), model) {}
130
131 /// @endcond
132
133 } // namespace model
134 } // namespace openstudio
135