GCC Code Coverage Report


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

src/energyplus/ReverseTranslator/ReverseTranslateCurveFunctionalPressureDrop.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/CurveFunctionalPressureDrop.hpp"
9 #include "../../model/CurveFunctionalPressureDrop_Impl.hpp"
10
11 #include <utilities/idd/Curve_Functional_PressureDrop_FieldEnums.hxx>
12
13 using namespace openstudio::model;
14
15 namespace openstudio {
16 namespace energyplus {
17
18 ✗ boost::optional<ModelObject> ReverseTranslator::translateCurveFunctionalPressureDrop(const WorkspaceObject& workspaceObject) {
19 ✗ CurveFunctionalPressureDrop 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_Functional_PressureDropFields::Diameter))) {
29 ✗ curve.setDiameter(*d);
30 }
31 ✗ if ((d = workspaceObject.getDouble(Curve_Functional_PressureDropFields::MinorLossCoefficient))) {
32 ✗ curve.setMinorLossCoefficient(*d);
33 }
34 ✗ if ((d = workspaceObject.getDouble(Curve_Functional_PressureDropFields::Length))) {
35 ✗ curve.setLength(*d);
36 }
37 ✗ if ((d = workspaceObject.getDouble(Curve_Functional_PressureDropFields::Roughness))) {
38 ✗ curve.setRoughness(*d);
39 }
40 ✗ if ((d = workspaceObject.getDouble(Curve_Functional_PressureDropFields::FixedFrictionFactor))) {
41 ✗ curve.setFixedFrictionFactor(*d);
42 }
43
44 ✗ return curve;
45 ✗ }
46
47 } // namespace energyplus
48 } // namespace openstudio
49