src/energyplus/ReverseTranslator/ReverseTranslateCurveRectangularHyperbola1.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/CurveRectangularHyperbola1.hpp" | ||
| 9 | #include "../../model/CurveRectangularHyperbola1_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Curve_RectangularHyperbola1_FieldEnums.hxx> | ||
| 12 | |||
| 13 | using namespace openstudio::model; | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace energyplus { | ||
| 17 | |||
| 18 | 2 | boost::optional<ModelObject> ReverseTranslator::translateCurveRectangularHyperbola1(const WorkspaceObject& workspaceObject) { | |
| 19 |
1/1✓ Branch 1 taken 2 times.
|
2 | CurveRectangularHyperbola1 curve(m_model); |
| 20 | |||
| 21 | 2 | OptionalString s; | |
| 22 | 2 | OptionalDouble d; | |
| 23 | |||
| 24 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
|
4 | if ((s = workspaceObject.name())) { |
| 25 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setName(*s); |
| 26 | } | ||
| 27 | |||
| 28 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::Coefficient1C1))) { |
| 29 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setCoefficient1C1(*d); |
| 30 | } | ||
| 31 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::Coefficient2C2))) { |
| 32 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setCoefficient2C2(*d); |
| 33 | } | ||
| 34 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::Coefficient3C3))) { |
| 35 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setCoefficient3C3(*d); |
| 36 | } | ||
| 37 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::MinimumValueofx))) { |
| 38 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setMinimumValueofx(*d); |
| 39 | } | ||
| 40 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::MaximumValueofx))) { |
| 41 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setMaximumValueofx(*d); |
| 42 | } | ||
| 43 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::MinimumCurveOutput))) { |
| 44 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setMinimumCurveOutput(*d); |
| 45 | } | ||
| 46 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if ((d = workspaceObject.getDouble(Curve_RectangularHyperbola1Fields::MaximumCurveOutput))) { |
| 47 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | curve.setMaximumCurveOutput(*d); |
| 48 | } | ||
| 49 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
|
4 | if ((s = workspaceObject.getString(Curve_RectangularHyperbola1Fields::InputUnitTypeforx, false, true))) { |
| 50 | ✗ | curve.setInputUnitTypeforx(*s); | |
| 51 | } | ||
| 52 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
|
4 | if ((s = workspaceObject.getString(Curve_RectangularHyperbola1Fields::OutputUnitType, false, true))) { |
| 53 | ✗ | curve.setOutputUnitType(*s); | |
| 54 | } | ||
| 55 | |||
| 56 |
1/1✓ Branch 1 taken 2 times.
|
4 | return curve; |
| 57 | 2 | } | |
| 58 | |||
| 59 | } // namespace energyplus | ||
| 60 | } // namespace openstudio | ||
| 61 |