GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 81.8% 18 / 0 / 22
Functions: 100.0% 1 / 0 / 1
Branches: 66.7% 26 / 0 / 39

src/energyplus/ForwardTranslator/ForwardTranslateCurveExponent.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/CurveExponent.hpp"
9 #include "../../model/CurveExponent_Impl.hpp"
10
11 #include "../../utilities/core/Assert.hpp"
12
13 #include <utilities/idd/Curve_Exponent_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 36 boost::optional<IdfObject> ForwardTranslator::translateCurveExponent(CurveExponent& modelObject) {
23
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 IdfObject idfObject(IddObjectType::Curve_Exponent);
24
25
1/1
✓ Branch 1 taken 36 times.
36 m_idfObjects.push_back(idfObject);
26
27 36 OptionalString s;
28 36 OptionalDouble d;
29
30
2/3
✓ Branch 1 taken 36 times.
✓ Branch 5 taken 36 times.
✗ Branch 6 not taken.
72 if ((s = modelObject.name())) {
31
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setName(*s);
32 }
33
34
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setDouble(Curve_ExponentFields::Coefficient1Constant, modelObject.coefficient1Constant());
35
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setDouble(Curve_ExponentFields::Coefficient2Constant, modelObject.coefficient2Constant());
36
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setDouble(Curve_ExponentFields::Coefficient3Constant, modelObject.coefficient3Constant());
37
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setDouble(Curve_ExponentFields::MinimumValueofx, modelObject.minimumValueofx());
38
2/2
✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
36 idfObject.setDouble(Curve_ExponentFields::MaximumValueofx, modelObject.maximumValueofx());
39
2/3
✓ Branch 1 taken 36 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 36 times.
72 if ((d = modelObject.minimumCurveOutput())) {
40 ✗ idfObject.setDouble(Curve_ExponentFields::MinimumCurveOutput, *d);
41 }
42
2/3
✓ Branch 1 taken 36 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 36 times.
72 if ((d = modelObject.maximumCurveOutput())) {
43 ✗ idfObject.setDouble(Curve_ExponentFields::MaximumCurveOutput, *d);
44 }
45
2/3
✓ Branch 1 taken 36 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 36 times.
36 if (!modelObject.isInputUnitTypeforXDefaulted()) {
46 ✗ idfObject.setString(Curve_ExponentFields::InputUnitTypeforX, modelObject.inputUnitTypeforX());
47 }
48
2/3
✓ Branch 1 taken 36 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 36 times.
36 if (!modelObject.isOutputUnitTypeDefaulted()) {
49 ✗ idfObject.setString(Curve_ExponentFields::OutputUnitType, modelObject.outputUnitType());
50 }
51
52
1/1
✓ Branch 1 taken 36 times.
72 return idfObject;
53 36 }
54
55 } // namespace energyplus
56 } // namespace openstudio
57