src/energyplus/ForwardTranslator/ForwardTranslateCurveLinear.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/CurveLinear.hpp" | ||
| 9 | #include "../../model/CurveLinear_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Curve_Linear_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 | 44 | boost::optional<IdfObject> ForwardTranslator::translateCurveLinear(CurveLinear& modelObject) { | |
| 23 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | IdfObject idfObject(IddObjectType::Curve_Linear); |
| 24 | |||
| 25 |
1/1✓ Branch 1 taken 44 times.
|
44 | m_idfObjects.push_back(idfObject); |
| 26 | |||
| 27 | 44 | OptionalString s; | |
| 28 | 44 | OptionalDouble d; | |
| 29 | |||
| 30 |
2/3✓ Branch 1 taken 44 times.
✓ Branch 5 taken 44 times.
✗ Branch 6 not taken.
|
88 | if ((s = modelObject.name())) { |
| 31 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | idfObject.setName(*s); |
| 32 | } | ||
| 33 | |||
| 34 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | idfObject.setDouble(Curve_LinearFields::Coefficient1Constant, modelObject.coefficient1Constant()); |
| 35 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | idfObject.setDouble(Curve_LinearFields::Coefficient2x, modelObject.coefficient2x()); |
| 36 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | idfObject.setDouble(Curve_LinearFields::MinimumValueofx, modelObject.minimumValueofx()); |
| 37 |
2/2✓ Branch 1 taken 44 times.
✓ Branch 4 taken 44 times.
|
44 | idfObject.setDouble(Curve_LinearFields::MaximumValueofx, modelObject.maximumValueofx()); |
| 38 |
3/3✓ Branch 1 taken 44 times.
✓ Branch 3 taken 19 times.
✓ Branch 4 taken 25 times.
|
88 | if ((d = modelObject.minimumCurveOutput())) { |
| 39 |
2/2✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
|
19 | idfObject.setDouble(Curve_LinearFields::MinimumCurveOutput, *d); |
| 40 | } | ||
| 41 |
3/3✓ Branch 1 taken 44 times.
✓ Branch 3 taken 19 times.
✓ Branch 4 taken 25 times.
|
88 | if ((d = modelObject.maximumCurveOutput())) { |
| 42 |
2/2✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
|
19 | idfObject.setDouble(Curve_LinearFields::MaximumCurveOutput, *d); |
| 43 | } | ||
| 44 |
3/3✓ Branch 1 taken 44 times.
✓ Branch 3 taken 13 times.
✓ Branch 4 taken 31 times.
|
44 | if (!modelObject.isInputUnitTypeforXDefaulted()) { |
| 45 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
|
13 | idfObject.setString(Curve_LinearFields::InputUnitTypeforX, modelObject.inputUnitTypeforX()); |
| 46 | } | ||
| 47 |
3/3✓ Branch 1 taken 44 times.
✓ Branch 3 taken 13 times.
✓ Branch 4 taken 31 times.
|
44 | if (!modelObject.isOutputUnitTypeDefaulted()) { |
| 48 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
|
13 | idfObject.setString(Curve_LinearFields::OutputUnitType, modelObject.outputUnitType()); |
| 49 | } | ||
| 50 | |||
| 51 |
1/1✓ Branch 1 taken 44 times.
|
88 | return idfObject; |
| 52 | 44 | } | |
| 53 | |||
| 54 | } // namespace energyplus | ||
| 55 | } // namespace openstudio | ||
| 56 |