GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 0.0% 0 / 0 / 26
Functions: 0.0% 0 / 0 / 1
Branches: 0.0% 0 / 0 / 52

src/energyplus/ReverseTranslator/ReverseTranslateCurveExponent.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/CurveExponent.hpp"
9 #include "../../model/CurveExponent_Impl.hpp"
10
11 #include <utilities/idd/Curve_Exponent_FieldEnums.hxx>
12
13 using namespace openstudio::model;
14
15 namespace openstudio {
16 namespace energyplus {
17
18 ✗ boost::optional<ModelObject> ReverseTranslator::translateCurveExponent(const WorkspaceObject& workspaceObject) {
19 ✗ CurveExponent curve(m_model);
20
21 ✗ OptionalString s;
22 ✗ OptionalDouble d;
23
24 ✗ if ((s = workspaceObject.name())) {
25 ✗ curve.setName(*s);
26 }
27
28 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::Coefficient1Constant))) {
29 ✗ curve.setCoefficient1Constant(*d);
30 }
31 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::Coefficient2Constant))) {
32 ✗ curve.setCoefficient2Constant(*d);
33 }
34 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::Coefficient3Constant))) {
35 ✗ curve.setCoefficient3Constant(*d);
36 }
37 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::MinimumValueofx))) {
38 ✗ curve.setMinimumValueofx(*d);
39 }
40 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::MaximumValueofx))) {
41 ✗ curve.setMaximumValueofx(*d);
42 }
43 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::MinimumCurveOutput))) {
44 ✗ curve.setMinimumCurveOutput(*d);
45 }
46 ✗ if ((d = workspaceObject.getDouble(Curve_ExponentFields::MaximumCurveOutput))) {
47 ✗ curve.setMaximumCurveOutput(*d);
48 }
49 ✗ if ((s = workspaceObject.getString(Curve_ExponentFields::InputUnitTypeforX, false, true))) {
50 ✗ curve.setInputUnitTypeforX(*s);
51 }
52 ✗ if ((s = workspaceObject.getString(Curve_ExponentFields::OutputUnitType, false, true))) {
53 ✗ curve.setOutputUnitType(*s);
54 }
55
56 ✗ return curve;
57 ✗ }
58
59 } // namespace energyplus
60 } // namespace openstudio
61