GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 38 / 0 / 38
Functions: 100.0% 1 / 0 / 1
Branches: 86.6% 71 / 0 / 82

src/energyplus/ReverseTranslator/ReverseTranslateCurveBiquadratic.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 "../ReverseTranslator.hpp"
7
8 #include "../../model/CurveBiquadratic.hpp"
9 #include "../../model/CurveBiquadratic_Impl.hpp"
10
11 #include <utilities/idd/Curve_Biquadratic_FieldEnums.hxx>
12
13 using namespace openstudio::model;
14
15 namespace openstudio {
16 namespace energyplus {
17
18 70 boost::optional<ModelObject> ReverseTranslator::translateCurveBiquadratic(const WorkspaceObject& workspaceObject) {
19
1/1
✓ Branch 1 taken 70 times.
70 CurveBiquadratic curve(m_model);
20
21 70 OptionalString s;
22 70 OptionalDouble d;
23
24
2/3
✓ Branch 1 taken 70 times.
✓ Branch 5 taken 70 times.
✗ Branch 6 not taken.
140 if ((s = workspaceObject.name())) {
25
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setName(*s);
26 }
27
28
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient1Constant))) {
29
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient1Constant(*d);
30 }
31
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient2x))) {
32
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient2x(*d);
33 }
34
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient3x_POW_2))) {
35
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient3xPOW2(*d);
36 }
37
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient4y))) {
38
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient4y(*d);
39 }
40
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient5y_POW_2))) {
41
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient5yPOW2(*d);
42 }
43
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::Coefficient6x_TIMES_y))) {
44
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setCoefficient6xTIMESY(*d);
45 }
46
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MinimumValueofx))) {
47
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setMinimumValueofx(*d);
48 }
49
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MaximumValueofx))) {
50
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setMaximumValueofx(*d);
51 }
52
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MinimumValueofy))) {
53
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setMinimumValueofy(*d);
54 }
55
2/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 70 times.
✗ Branch 4 not taken.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MaximumValueofy))) {
56
2/2
✓ Branch 1 taken 70 times.
✓ Branch 4 taken 70 times.
70 curve.setMaximumValueofy(*d);
57 }
58
3/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 26 times.
✓ Branch 4 taken 44 times.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MinimumCurveOutput))) {
59
2/2
✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
26 curve.setMinimumCurveOutput(*d);
60 }
61
3/3
✓ Branch 1 taken 70 times.
✓ Branch 3 taken 26 times.
✓ Branch 4 taken 44 times.
140 if ((d = workspaceObject.getDouble(Curve_BiquadraticFields::MaximumCurveOutput))) {
62
2/2
✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
26 curve.setMaximumCurveOutput(*d);
63 }
64
3/3
✓ Branch 1 taken 70 times.
✓ Branch 5 taken 28 times.
✓ Branch 6 taken 42 times.
140 if ((s = workspaceObject.getString(Curve_BiquadraticFields::InputUnitTypeforX, false, true))) {
65
2/2
✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
28 curve.setInputUnitTypeforX(*s);
66 }
67
3/3
✓ Branch 1 taken 70 times.
✓ Branch 5 taken 28 times.
✓ Branch 6 taken 42 times.
140 if ((s = workspaceObject.getString(Curve_BiquadraticFields::InputUnitTypeforY, false, true))) {
68
2/2
✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
28 curve.setInputUnitTypeforY(*s);
69 }
70
3/3
✓ Branch 1 taken 70 times.
✓ Branch 5 taken 24 times.
✓ Branch 6 taken 46 times.
140 if ((s = workspaceObject.getString(Curve_BiquadraticFields::OutputUnitType, false, true))) {
71
2/2
✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
24 curve.setOutputUnitType(*s);
72 }
73
74
1/1
✓ Branch 1 taken 70 times.
140 return curve;
75 70 }
76
77 } // namespace energyplus
78 } // namespace openstudio
79