src/alfalfa/AlfalfaOutputVariable.hpp
| 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 | #ifndef ALFALFA_COMPONENT_OUTPUTVARIABLE_HPP | ||
| 7 | #define ALFALFA_COMPONENT_OUTPUTVARIABLE_HPP | ||
| 8 | |||
| 9 | #include "AlfalfaAPI.hpp" | ||
| 10 | |||
| 11 | #include "AlfalfaComponentBase.hpp" | ||
| 12 | |||
| 13 | #include "../utilities/idf/IdfObject.hpp" | ||
| 14 | |||
| 15 | namespace openstudio { | ||
| 16 | namespace alfalfa { | ||
| 17 | class ALFALFA_API AlfalfaOutputVariable : public AlfalfaComponentBase | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | /** | ||
| 21 | * Create an AlfalfaOutputVariable Component from a variable key and variable name which reflect the Output:Variable EnergyPlus IDD | ||
| 22 | */ | ||
| 23 | AlfalfaOutputVariable(const std::string& variable_key, const std::string& variable_name); | ||
| 24 | |||
| 25 | /** | ||
| 26 | * Create an AlfalfaOutputVariable Component from an IdfObject. | ||
| 27 | * Valid idf_object types are OutputVariable, EnergyManagementSystemOutputVariable, IdfObject(IddObjectType::Output_Variable) and IdfObject(IddObjectType::EnergyManagementSystem_OutputVariable) | ||
| 28 | */ | ||
| 29 | AlfalfaOutputVariable(const openstudio::IdfObject& output_variable); | ||
| 30 | |||
| 31 | std::string deriveName() const override; | ||
| 32 | |||
| 33 | Json::Value toJSON() const override; | ||
| 34 | |||
| 35 | 130 | AlfalfaComponentCapability capability() const override { | |
| 36 |
1/1✓ Branch 1 taken 130 times.
|
130 | return AlfalfaComponentCapability::Output; |
| 37 | } | ||
| 38 | |||
| 39 | 40 | AlfalfaComponentType type() const override { | |
| 40 |
1/1✓ Branch 1 taken 40 times.
|
40 | return AlfalfaComponentType::OutputVariable; |
| 41 | } | ||
| 42 | |||
| 43 | 86 | std::unique_ptr<AlfalfaComponentBase> clone() const override { | |
| 44 |
1/1✓ Branch 1 taken 86 times.
|
86 | return std::make_unique<AlfalfaOutputVariable>(*this); |
| 45 | } | ||
| 46 | |||
| 47 | std::string variableKey() const; | ||
| 48 | std::string variableName() const; | ||
| 49 | |||
| 50 | static bool acceptsObjectType(const IddObjectType& idd_type); | ||
| 51 | |||
| 52 | private: | ||
| 53 | std::string m_variable_key; | ||
| 54 | std::string m_variable_name; | ||
| 55 | }; | ||
| 56 | } // namespace alfalfa | ||
| 57 | } // namespace openstudio | ||
| 58 | |||
| 59 | #endif | ||
| 60 |