GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 91.7% 22 / 0 / 24
Functions: 100.0% 1 / 0 / 1
Branches: 83.7% 36 / 0 / 43

src/energyplus/ForwardTranslator/ForwardTranslateCurveSigmoid.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/CurveSigmoid.hpp"
9 #include "../../model/CurveSigmoid_Impl.hpp"
10
11 #include "../../utilities/core/Assert.hpp"
12
13 #include <utilities/idd/Curve_Sigmoid_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 12 boost::optional<IdfObject> ForwardTranslator::translateCurveSigmoid(CurveSigmoid& modelObject) {
23
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 IdfObject idfObject(IddObjectType::Curve_Sigmoid);
24
25
1/1
✓ Branch 1 taken 12 times.
12 m_idfObjects.push_back(idfObject);
26
27 12 OptionalString s;
28 12 OptionalDouble d;
29
30
2/3
✓ Branch 1 taken 12 times.
✓ Branch 5 taken 12 times.
✗ Branch 6 not taken.
24 if ((s = modelObject.name())) {
31
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setName(*s);
32 }
33
34
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::Coefficient1C1, modelObject.coefficient1C1());
35
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::Coefficient2C2, modelObject.coefficient2C2());
36
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::Coefficient3C3, modelObject.coefficient3C3());
37
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::Coefficient4C4, modelObject.coefficient4C4());
38
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::Coefficient5C5, modelObject.coefficient5C5());
39
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::MinimumValueofx, modelObject.minimumValueofx());
40
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 idfObject.setDouble(Curve_SigmoidFields::MaximumValueofx, modelObject.maximumValueofx());
41
3/3
✓ Branch 1 taken 12 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 4 times.
24 if ((d = modelObject.minimumCurveOutput())) {
42
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 idfObject.setDouble(Curve_SigmoidFields::MinimumCurveOutput, *d);
43 }
44
3/3
✓ Branch 1 taken 12 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 4 times.
24 if ((d = modelObject.maximumCurveOutput())) {
45
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 idfObject.setDouble(Curve_SigmoidFields::MaximumCurveOutput, *d);
46 }
47
2/3
✓ Branch 1 taken 12 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 if (!modelObject.isInputUnitTypeforxDefaulted()) {
48 ✗ idfObject.setString(Curve_SigmoidFields::InputUnitTypeforx, modelObject.inputUnitTypeforx());
49 }
50
2/3
✓ Branch 1 taken 12 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 12 times.
12 if (!modelObject.isOutputUnitTypeDefaulted()) {
51 ✗ idfObject.setString(Curve_SigmoidFields::OutputUnitType, modelObject.outputUnitType());
52 }
53
54
1/1
✓ Branch 1 taken 12 times.
24 return idfObject;
55 12 }
56
57 } // namespace energyplus
58 } // namespace openstudio
59