src/energyplus/ForwardTranslator/ForwardTranslatePythonPluginTrendVariable.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 | #include "../../model/Model.hpp" | ||
| 8 | |||
| 9 | #include "../../model/PythonPluginTrendVariable.hpp" | ||
| 10 | #include "../../model/PythonPluginVariable.hpp" | ||
| 11 | |||
| 12 | #include <utilities/idd/PythonPlugin_TrendVariable_FieldEnums.hxx> | ||
| 13 | // #include "../../utilities/idd/IddEnums.hpp" | ||
| 14 | #include <utilities/idd/IddEnums.hxx> | ||
| 15 | |||
| 16 | using namespace openstudio::model; | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace energyplus { | ||
| 21 | |||
| 22 | 3 | boost::optional<IdfObject> ForwardTranslator::translatePythonPluginTrendVariable(model::PythonPluginTrendVariable& modelObject) { | |
| 23 | // Instantiate an IdfObject of the class to store the values | ||
| 24 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
3 | IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::PythonPlugin_TrendVariable, modelObject); |
| 25 | |||
| 26 | // Name of a Python Plugin Variable: Required String | ||
| 27 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
|
3 | idfObject.setString(PythonPlugin_TrendVariableFields::NameofaPythonPluginVariable, modelObject.pythonPluginVariable().nameString()); |
| 28 | |||
| 29 | // Number of Timesteps to be Logged: Required Integer | ||
| 30 |
1/1✓ Branch 1 taken 3 times.
|
3 | int numberofTimestepstobeLogged = modelObject.numberofTimestepstobeLogged(); |
| 31 |
1/1✓ Branch 1 taken 3 times.
|
3 | idfObject.setInt(PythonPlugin_TrendVariableFields::NumberofTimestepstobeLogged, numberofTimestepstobeLogged); |
| 32 | |||
| 33 |
1/1✓ Branch 1 taken 3 times.
|
6 | return idfObject; |
| 34 | 3 | } // End of translate function | |
| 35 | |||
| 36 | } // end namespace energyplus | ||
| 37 | } // end namespace openstudio | ||
| 38 |