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