src/energyplus/ReverseTranslator/ReverseTranslateCurveBicubic.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/CurveBicubic.hpp" | ||
| 9 | #include "../../model/CurveBicubic_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Curve_Bicubic_FieldEnums.hxx> | ||
| 12 | |||
| 13 | using namespace openstudio::model; | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace energyplus { | ||
| 17 | |||
| 18 | 1 | boost::optional<ModelObject> ReverseTranslator::translateCurveBicubic(const WorkspaceObject& workspaceObject) { | |
| 19 |
1/1✓ Branch 1 taken 1 time.
|
1 | CurveBicubic curve(m_model); |
| 20 | |||
| 21 | 1 | OptionalString s; | |
| 22 | 1 | OptionalDouble d; | |
| 23 | |||
| 24 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((s = workspaceObject.name())) { |
| 25 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setName(*s); |
| 26 | } | ||
| 27 | |||
| 28 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient1Constant))) { |
| 29 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient1Constant(*d); |
| 30 | } | ||
| 31 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient2x))) { |
| 32 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient2x(*d); |
| 33 | } | ||
| 34 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient3x_POW_2))) { |
| 35 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient3xPOW2(*d); |
| 36 | } | ||
| 37 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient4y))) { |
| 38 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient4y(*d); |
| 39 | } | ||
| 40 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient5y_POW_2))) { |
| 41 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient5yPOW2(*d); |
| 42 | } | ||
| 43 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient6x_TIMES_y))) { |
| 44 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient6xTIMESY(*d); |
| 45 | } | ||
| 46 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient7x_POW_3))) { |
| 47 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient7xPOW3(*d); |
| 48 | } | ||
| 49 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient8y_POW_3))) { |
| 50 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient8yPOW3(*d); |
| 51 | } | ||
| 52 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient9x_POW_2_TIMES_y))) { |
| 53 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient9xPOW2TIMESY(*d); |
| 54 | } | ||
| 55 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::Coefficient10x_TIMES_y_POW_2))) { |
| 56 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setCoefficient10xTIMESYPOW2(*d); |
| 57 | } | ||
| 58 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MinimumValueofx))) { |
| 59 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMinimumValueofx(*d); |
| 60 | } | ||
| 61 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MaximumValueofx))) { |
| 62 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMaximumValueofx(*d); |
| 63 | } | ||
| 64 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MinimumValueofy))) { |
| 65 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMinimumValueofy(*d); |
| 66 | } | ||
| 67 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MaximumValueofy))) { |
| 68 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMaximumValueofy(*d); |
| 69 | } | ||
| 70 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MinimumCurveOutput))) { |
| 71 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMinimumCurveOutput(*d); |
| 72 | } | ||
| 73 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
2 | if ((d = workspaceObject.getDouble(Curve_BicubicFields::MaximumCurveOutput))) { |
| 74 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setMaximumCurveOutput(*d); |
| 75 | } | ||
| 76 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((s = workspaceObject.getString(Curve_BicubicFields::InputUnitTypeforX, false, true))) { |
| 77 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setInputUnitTypeforX(*s); |
| 78 | } | ||
| 79 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((s = workspaceObject.getString(Curve_BicubicFields::InputUnitTypeforY, false, true))) { |
| 80 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setInputUnitTypeforY(*s); |
| 81 | } | ||
| 82 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
|
2 | if ((s = workspaceObject.getString(Curve_BicubicFields::OutputUnitType, false, true))) { |
| 83 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | curve.setOutputUnitType(*s); |
| 84 | } | ||
| 85 | |||
| 86 |
1/1✓ Branch 1 taken 1 time.
|
2 | return curve; |
| 87 | 1 | } | |
| 88 | |||
| 89 | } // namespace energyplus | ||
| 90 | } // namespace openstudio | ||
| 91 |