src/energyplus/ForwardTranslator/ForwardTranslateCurveQuartic.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/CurveQuartic.hpp" | ||
| 9 | #include "../../model/CurveQuartic_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Curve_Quartic_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::translateCurveQuartic(CurveQuartic& modelObject) { | |
| 23 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject idfObject(IddObjectType::Curve_Quartic); |
| 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_QuarticFields::Coefficient1Constant, modelObject.coefficient1Constant()); |
| 35 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::Coefficient2x, modelObject.coefficient2x()); |
| 36 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::Coefficient3x_POW_2, modelObject.coefficient3xPOW2()); |
| 37 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::Coefficient4x_POW_3, modelObject.coefficient4xPOW3()); |
| 38 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::Coefficient5x_POW_4, modelObject.coefficient5xPOW4()); |
| 39 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::MinimumValueofx, modelObject.minimumValueofx()); |
| 40 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_QuarticFields::MaximumValueofx, modelObject.maximumValueofx()); |
| 41 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if ((d = modelObject.minimumCurveOutput())) { |
| 42 | ✗ | idfObject.setDouble(Curve_QuarticFields::MinimumCurveOutput, *d); | |
| 43 | } | ||
| 44 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if ((d = modelObject.maximumCurveOutput())) { |
| 45 | ✗ | idfObject.setDouble(Curve_QuarticFields::MaximumCurveOutput, *d); | |
| 46 | } | ||
| 47 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (!modelObject.isInputUnitTypeforXDefaulted()) { |
| 48 | ✗ | idfObject.setString(Curve_QuarticFields::InputUnitTypeforX, modelObject.inputUnitTypeforX()); | |
| 49 | } | ||
| 50 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (!modelObject.isOutputUnitTypeDefaulted()) { |
| 51 | ✗ | idfObject.setString(Curve_QuarticFields::OutputUnitType, modelObject.outputUnitType()); | |
| 52 | } | ||
| 53 | |||
| 54 |
1/1✓ Branch 1 taken 2 times.
|
4 | return idfObject; |
| 55 | 2 | } | |
| 56 | |||
| 57 | } // namespace energyplus | ||
| 58 | } // namespace openstudio | ||
| 59 |