src/energyplus/ReverseTranslator/ReverseTranslateCurveQuadraticLinear.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 "../ReverseTranslator.hpp" | ||
| 7 | |||
| 8 | #include "../../model/CurveQuadraticLinear.hpp" | ||
| 9 | #include "../../model/CurveQuadraticLinear_Impl.hpp" | ||
| 10 | |||
| 11 | #include <utilities/idd/Curve_QuadraticLinear_FieldEnums.hxx> | ||
| 12 | |||
| 13 | using namespace openstudio::model; | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace energyplus { | ||
| 17 | |||
| 18 | ✗ | boost::optional<ModelObject> ReverseTranslator::translateCurveQuadraticLinear(const WorkspaceObject& workspaceObject) { | |
| 19 | ✗ | CurveQuadraticLinear curve(m_model); | |
| 20 | |||
| 21 | ✗ | OptionalString s; | |
| 22 | ✗ | OptionalDouble d; | |
| 23 | |||
| 24 | ✗ | if ((s = workspaceObject.name())) { | |
| 25 | ✗ | curve.setName(*s); | |
| 26 | } | ||
| 27 | |||
| 28 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient1Constant))) { | |
| 29 | ✗ | curve.setCoefficient1Constant(*d); | |
| 30 | } | ||
| 31 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient2x))) { | |
| 32 | ✗ | curve.setCoefficient2x(*d); | |
| 33 | } | ||
| 34 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient3x_POW_2))) { | |
| 35 | ✗ | curve.setCoefficient3xPOW2(*d); | |
| 36 | } | ||
| 37 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient4y))) { | |
| 38 | ✗ | curve.setCoefficient4y(*d); | |
| 39 | } | ||
| 40 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient5x_TIMES_y))) { | |
| 41 | ✗ | curve.setCoefficient5xTIMESY(*d); | |
| 42 | } | ||
| 43 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::Coefficient6x_POW_2_TIMES_y))) { | |
| 44 | ✗ | curve.setCoefficient6xPOW2TIMESY(*d); | |
| 45 | } | ||
| 46 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MinimumValueofx))) { | |
| 47 | ✗ | curve.setMinimumValueofx(*d); | |
| 48 | } | ||
| 49 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MaximumValueofx))) { | |
| 50 | ✗ | curve.setMaximumValueofx(*d); | |
| 51 | } | ||
| 52 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MinimumValueofy))) { | |
| 53 | ✗ | curve.setMinimumValueofy(*d); | |
| 54 | } | ||
| 55 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MaximumValueofy))) { | |
| 56 | ✗ | curve.setMaximumValueofy(*d); | |
| 57 | } | ||
| 58 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MinimumCurveOutput))) { | |
| 59 | ✗ | curve.setMinimumCurveOutput(*d); | |
| 60 | } | ||
| 61 | ✗ | if ((d = workspaceObject.getDouble(Curve_QuadraticLinearFields::MaximumCurveOutput))) { | |
| 62 | ✗ | curve.setMaximumCurveOutput(*d); | |
| 63 | } | ||
| 64 | ✗ | if ((s = workspaceObject.getString(Curve_QuadraticLinearFields::InputUnitTypeforX, false, true))) { | |
| 65 | ✗ | curve.setInputUnitTypeforX(*s); | |
| 66 | } | ||
| 67 | ✗ | if ((s = workspaceObject.getString(Curve_QuadraticLinearFields::InputUnitTypeforY, false, true))) { | |
| 68 | ✗ | curve.setInputUnitTypeforY(*s); | |
| 69 | } | ||
| 70 | ✗ | if ((s = workspaceObject.getString(Curve_QuadraticLinearFields::OutputUnitType, false, true))) { | |
| 71 | ✗ | curve.setOutputUnitType(*s); | |
| 72 | } | ||
| 73 | |||
| 74 | ✗ | return curve; | |
| 75 | ✗ | } | |
| 76 | |||
| 77 | } // namespace energyplus | ||
| 78 | } // namespace openstudio | ||
| 79 |