src/energyplus/ForwardTranslator/ForwardTranslateCurveExponentialDecay.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/CurveExponentialDecay.hpp" | ||
| 9 | #include "../../model/CurveExponentialDecay_Impl.hpp" | ||
| 10 | |||
| 11 | #include "../../utilities/core/Assert.hpp" | ||
| 12 | |||
| 13 | #include <utilities/idd/Curve_ExponentialDecay_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::translateCurveExponentialDecay(CurveExponentialDecay& modelObject) { | |
| 23 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | IdfObject idfObject(IddObjectType::Curve_ExponentialDecay); |
| 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_ExponentialDecayFields::Coefficient1C1, modelObject.coefficient1C1()); |
| 35 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_ExponentialDecayFields::Coefficient2C2, modelObject.coefficient2C2()); |
| 36 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_ExponentialDecayFields::Coefficient3C3, modelObject.coefficient3C3()); |
| 37 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_ExponentialDecayFields::MinimumValueofx, modelObject.minimumValueofx()); |
| 38 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | idfObject.setDouble(Curve_ExponentialDecayFields::MaximumValueofx, modelObject.maximumValueofx()); |
| 39 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if ((d = modelObject.minimumCurveOutput())) { |
| 40 | ✗ | idfObject.setDouble(Curve_ExponentialDecayFields::MinimumCurveOutput, *d); | |
| 41 | } | ||
| 42 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | if ((d = modelObject.maximumCurveOutput())) { |
| 43 | ✗ | idfObject.setDouble(Curve_ExponentialDecayFields::MaximumCurveOutput, *d); | |
| 44 | } | ||
| 45 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (!modelObject.isInputUnitTypeforxDefaulted()) { |
| 46 | ✗ | idfObject.setString(Curve_ExponentialDecayFields::InputUnitTypeforx, modelObject.inputUnitTypeforx()); | |
| 47 | } | ||
| 48 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
2 | if (!modelObject.isOutputUnitTypeDefaulted()) { |
| 49 | ✗ | idfObject.setString(Curve_ExponentialDecayFields::OutputUnitType, modelObject.outputUnitType()); | |
| 50 | } | ||
| 51 | |||
| 52 |
1/1✓ Branch 1 taken 2 times.
|
4 | return idfObject; |
| 53 | 2 | } | |
| 54 | |||
| 55 | } // namespace energyplus | ||
| 56 | } // namespace openstudio | ||
| 57 |