GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 55.2% 48 / 0 / 87
Functions: 100.0% 1 / 0 / 1
Branches: 42.2% 86 / 0 / 204

src/energyplus/ForwardTranslator/ForwardTranslateCurveTriquadratic.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 "../ForwardTranslator.hpp"
7
8 #include "../../model/CurveTriquadratic.hpp"
9 #include "../../model/CurveTriquadratic_Impl.hpp"
10
11 #include "../../utilities/core/Assert.hpp"
12
13 #include <utilities/idd/Curve_Triquadratic_FieldEnums.hxx>
14 #include <utilities/idd/IddEnums.hxx>
15
16 using namespace openstudio::model;
17 using namespace std;
18
19 namespace openstudio {
20 namespace energyplus {
21
22 8 boost::optional<IdfObject> ForwardTranslator::translateCurveTriquadratic(CurveTriquadratic& modelObject) {
23
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 IdfObject idfObject(IddObjectType::Curve_Triquadratic);
24
25
1/1
✓ Branch 1 taken 8 times.
8 m_idfObjects.push_back(idfObject);
26
27 8 OptionalString s;
28 8 OptionalDouble d;
29
30
2/3
✓ Branch 1 taken 8 times.
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
16 if ((s = modelObject.name())) {
31
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 idfObject.setName(*s);
32 }
33
34
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient1Constant())) {
35 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient1Constant, *d);
36 }
37
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient2xPOW2())) {
38 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient2x_POW_2, *d);
39 }
40
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient3x())) {
41 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient3x, *d);
42 }
43
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient4yPOW2())) {
44 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient4y_POW_2, *d);
45 }
46
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient5y())) {
47 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient5y, *d);
48 }
49
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient6zPOW2())) {
50 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient6z_POW_2, *d);
51 }
52
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient7z())) {
53 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient7z, *d);
54 }
55
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient8xPOW2TIMESYPOW2())) {
56 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient8x_POW_2_TIMES_y_POW_2, *d);
57 }
58
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient9xTIMESY())) {
59 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient9x_TIMES_y, *d);
60 }
61
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient10xTIMESYPOW2())) {
62 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient10x_TIMES_y_POW_2, *d);
63 }
64
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient11xPOW2TIMESY())) {
65 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient11x_POW_2_TIMES_y, *d);
66 }
67
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient12xPOW2TIMESZPOW2())) {
68 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient12x_POW_2_TIMES_z_POW_2, *d);
69 }
70
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient13xTIMESZ())) {
71 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient13x_TIMES_z, *d);
72 }
73
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient14xTIMESZPOW2())) {
74 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient14x_TIMES_z_POW_2, *d);
75 }
76
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient15xPOW2TIMESZ())) {
77 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient15x_POW_2_TIMES_z, *d);
78 }
79
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient16yPOW2TIMESZPOW2())) {
80 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient16y_POW_2_TIMES_z_POW_2, *d);
81 }
82
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient17yTIMESZ())) {
83 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient17y_TIMES_z, *d);
84 }
85
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient18yTIMESZPOW2())) {
86 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient18y_TIMES_z_POW_2, *d);
87 }
88
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient19yPOW2TIMESZ())) {
89 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient19y_POW_2_TIMES_z, *d);
90 }
91
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient20xPOW2TIMESYPOW2TIMESZPOW2())) {
92 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient20x_POW_2_TIMES_y_POW_2_TIMES_z_POW_2, *d);
93 }
94
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient21xPOW2TIMESYPOW2TIMESZ())) {
95 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient21x_POW_2_TIMES_y_POW_2_TIMES_z, *d);
96 }
97
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient22xPOW2TIMESYTIMESZPOW2())) {
98 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient22x_POW_2_TIMES_y_TIMES_z_POW_2, *d);
99 }
100
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient23xTIMESYPOW2TIMESZPOW2())) {
101 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient23x_TIMES_y_POW_2_TIMES_z_POW_2, *d);
102 }
103
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient24xPOW2TIMESYTIMESZ())) {
104 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient24x_POW_2_TIMES_y_TIMES_z, *d);
105 }
106
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient25xTIMESYPOW2TIMESZ())) {
107 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient25x_TIMES_y_POW_2_TIMES_z, *d);
108 }
109
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient26xTIMESYTIMESZPOW2())) {
110 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient26x_TIMES_y_TIMES_z_POW_2, *d);
111 }
112
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.coefficient27xTIMESYTIMESZ())) {
113 ✗ idfObject.setDouble(Curve_TriquadraticFields::Coefficient27x_TIMES_y_TIMES_z, *d);
114 }
115
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.minimumValueofx())) {
116 ✗ idfObject.setDouble(Curve_TriquadraticFields::MinimumValueofx, *d);
117 }
118
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.maximumValueofx())) {
119 ✗ idfObject.setDouble(Curve_TriquadraticFields::MaximumValueofx, *d);
120 }
121
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.minimumValueofy())) {
122 ✗ idfObject.setDouble(Curve_TriquadraticFields::MinimumValueofy, *d);
123 }
124
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.maximumValueofy())) {
125 ✗ idfObject.setDouble(Curve_TriquadraticFields::MaximumValueofy, *d);
126 }
127
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.minimumValueofz())) {
128 ✗ idfObject.setDouble(Curve_TriquadraticFields::MinimumValueofz, *d);
129 }
130
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.maximumValueofz())) {
131 ✗ idfObject.setDouble(Curve_TriquadraticFields::MaximumValueofz, *d);
132 }
133
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.minimumCurveOutput())) {
134 ✗ idfObject.setDouble(Curve_TriquadraticFields::MinimumCurveOutput, *d);
135 }
136
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
16 if ((d = modelObject.maximumCurveOutput())) {
137 ✗ idfObject.setDouble(Curve_TriquadraticFields::MaximumCurveOutput, *d);
138 }
139
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
8 if (!modelObject.isInputUnitTypeforXDefaulted()) {
140 ✗ idfObject.setString(Curve_TriquadraticFields::InputUnitTypeforX, modelObject.inputUnitTypeforX());
141 }
142
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
8 if (!modelObject.isInputUnitTypeforYDefaulted()) {
143 ✗ idfObject.setString(Curve_TriquadraticFields::InputUnitTypeforY, modelObject.inputUnitTypeforY());
144 }
145
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
8 if (!modelObject.isInputUnitTypeforZDefaulted()) {
146 ✗ idfObject.setString(Curve_TriquadraticFields::InputUnitTypeforZ, modelObject.inputUnitTypeforZ());
147 }
148
2/3
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 8 times.
8 if (!modelObject.isOutputUnitTypeDefaulted()) {
149 ✗ idfObject.setString(Curve_TriquadraticFields::OutputUnitType, modelObject.outputUnitType());
150 }
151
152
1/1
✓ Branch 1 taken 8 times.
16 return idfObject;
153 8 }
154
155 } // namespace energyplus
156 } // namespace openstudio
157