src/energyplus/ForwardTranslator/ForwardTranslateCurveBicubic.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/CurveBicubic.hpp" | ||
| 9 | #include "../../model/CurveBicubic_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Curve_Bicubic_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 | 7 | boost::optional<IdfObject> ForwardTranslator::translateCurveBicubic(CurveBicubic& modelObject) { | |
| 23 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | IdfObject idfObject(IddObjectType::Curve_Bicubic); |
| 24 | |||
| 25 |
1/1✓ Branch 1 taken 7 times.
|
7 | m_idfObjects.push_back(idfObject); |
| 26 | |||
| 27 | 7 | OptionalString s; | |
| 28 | 7 | OptionalDouble d; | |
| 29 | |||
| 30 |
2/3✓ Branch 1 taken 7 times.
✓ Branch 5 taken 7 times.
✗ Branch 6 not taken.
|
14 | if ((s = modelObject.name())) { |
| 31 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setName(*s); |
| 32 | } | ||
| 33 | |||
| 34 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient1Constant, modelObject.coefficient1Constant()); |
| 35 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient2x, modelObject.coefficient2x()); |
| 36 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient3x_POW_2, modelObject.coefficient3xPOW2()); |
| 37 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient4y, modelObject.coefficient4y()); |
| 38 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient5y_POW_2, modelObject.coefficient5yPOW2()); |
| 39 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient6x_TIMES_y, modelObject.coefficient6xTIMESY()); |
| 40 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient7x_POW_3, modelObject.coefficient7xPOW3()); |
| 41 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient8y_POW_3, modelObject.coefficient8yPOW3()); |
| 42 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient9x_POW_2_TIMES_y, modelObject.coefficient9xPOW2TIMESY()); |
| 43 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::Coefficient10x_TIMES_y_POW_2, modelObject.coefficient10xTIMESYPOW2()); |
| 44 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::MinimumValueofx, modelObject.minimumValueofx()); |
| 45 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::MaximumValueofx, modelObject.maximumValueofx()); |
| 46 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::MinimumValueofy, modelObject.minimumValueofy()); |
| 47 |
2/2✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
|
7 | idfObject.setDouble(Curve_BicubicFields::MaximumValueofy, modelObject.maximumValueofy()); |
| 48 |
2/3✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
|
14 | if ((d = modelObject.minimumCurveOutput())) { |
| 49 | ✗ | idfObject.setDouble(Curve_BicubicFields::MinimumCurveOutput, *d); | |
| 50 | } | ||
| 51 |
2/3✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
|
14 | if ((d = modelObject.maximumCurveOutput())) { |
| 52 | ✗ | idfObject.setDouble(Curve_BicubicFields::MaximumCurveOutput, *d); | |
| 53 | } | ||
| 54 |
2/3✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
|
7 | if (!modelObject.isInputUnitTypeforXDefaulted()) { |
| 55 | ✗ | idfObject.setString(Curve_BicubicFields::InputUnitTypeforX, modelObject.inputUnitTypeforX()); | |
| 56 | } | ||
| 57 |
2/3✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
|
7 | if (!modelObject.isInputUnitTypeforYDefaulted()) { |
| 58 | ✗ | idfObject.setString(Curve_BicubicFields::InputUnitTypeforY, modelObject.inputUnitTypeforY()); | |
| 59 | } | ||
| 60 |
2/3✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 7 times.
|
7 | if (!modelObject.isOutputUnitTypeDefaulted()) { |
| 61 | ✗ | idfObject.setString(Curve_BicubicFields::OutputUnitType, modelObject.outputUnitType()); | |
| 62 | } | ||
| 63 | |||
| 64 |
1/1✓ Branch 1 taken 7 times.
|
14 | return idfObject; |
| 65 | 7 | } | |
| 66 | |||
| 67 | } // namespace energyplus | ||
| 68 | } // namespace openstudio | ||
| 69 |