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