src/model/OutputVariable.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 MODEL_OUTPUTVARIABLE_HPP | ||
| 7 | #define MODEL_OUTPUTVARIABLE_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | class ReportingFrequency; | ||
| 15 | |||
| 16 | namespace model { | ||
| 17 | |||
| 18 | class Schedule; | ||
| 19 | |||
| 20 | namespace detail { | ||
| 21 | class OutputVariable_Impl; | ||
| 22 | } // namespace detail | ||
| 23 | |||
| 24 | /** OutputVariable derives from ModelObject and is an interface to the OpenStudio | ||
| 25 | * IDD object named "OS:Output:Variable". | ||
| 26 | * | ||
| 27 | * OutputVariable is used to request output data from EnergyPlus simulations. Each ModelObject defines | ||
| 28 | * a list of available output variable names which can be used to create OutputVariable requests. An | ||
| 29 | * OutputVariable request can apply to all objects (e.g. if the 'Key Value' field is set to '*') or only | ||
| 30 | * a particular object (e.g. if the 'Key Value' field is set to an object's name). If an OutputVariable object | ||
| 31 | * refers to a particular ModelObject then it is parented by that ModelObject, otherwise it is unparented. | ||
| 32 | * If an OutputVariable object is present when a Model is simulated in EnergyPlus, the OutputVariable can be | ||
| 33 | * used to access simulation results for its parent ModelObject. | ||
| 34 | */ | ||
| 35 | class MODEL_API OutputVariable : public ModelObject | ||
| 36 | { | ||
| 37 | public: | ||
| 38 | 2657 | virtual ~OutputVariable() override = default; | |
| 39 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 40 | 1223 | OutputVariable(const OutputVariable& other) = default; | |
| 41 | 115 | OutputVariable(OutputVariable&& other) = default; | |
| 42 | ✗ | OutputVariable& operator=(const OutputVariable&) = default; | |
| 43 | ✗ | OutputVariable& operator=(OutputVariable&&) = default; | |
| 44 | |||
| 45 | /** @name Constructors and Destructors */ | ||
| 46 | //@{ | ||
| 47 | |||
| 48 | /// Constructs a new OutputVariable object in the model. | ||
| 49 | explicit OutputVariable(const std::string& variableName, const Model& model); | ||
| 50 | |||
| 51 | virtual std::vector<openstudio::IdfObject> remove(); | ||
| 52 | |||
| 53 | //@} | ||
| 54 | |||
| 55 | static IddObjectType iddObjectType(); | ||
| 56 | |||
| 57 | static std::vector<std::string> reportingFrequencyValues(); | ||
| 58 | |||
| 59 | /** @name Getters */ | ||
| 60 | //@{ | ||
| 61 | |||
| 62 | std::string keyValue() const; | ||
| 63 | |||
| 64 | bool isKeyValueDefaulted() const; | ||
| 65 | |||
| 66 | std::string variableName() const; | ||
| 67 | |||
| 68 | std::string reportingFrequency() const; | ||
| 69 | |||
| 70 | bool isReportingFrequencyDefaulted() const; | ||
| 71 | |||
| 72 | boost::optional<Schedule> schedule() const; | ||
| 73 | |||
| 74 | bool exportToBCVTB() const; | ||
| 75 | |||
| 76 | bool isExportToBCVTBDefaulted() const; | ||
| 77 | |||
| 78 | //@} | ||
| 79 | /** @name Setters */ | ||
| 80 | //@{ | ||
| 81 | |||
| 82 | bool setKeyValue(const std::string& keyValue); | ||
| 83 | |||
| 84 | void resetKeyValue(); | ||
| 85 | |||
| 86 | bool setVariableName(const std::string& variableName); | ||
| 87 | |||
| 88 | bool setReportingFrequency(const std::string& reportingFrequency); | ||
| 89 | |||
| 90 | void resetReportingFrequency(); | ||
| 91 | |||
| 92 | bool setSchedule(Schedule& schedule); | ||
| 93 | |||
| 94 | void resetSchedule(); | ||
| 95 | |||
| 96 | bool setExportToBCVTB(bool exportToBCVTB); | ||
| 97 | |||
| 98 | void resetExportToBCVTB(); | ||
| 99 | |||
| 100 | //@} | ||
| 101 | protected: | ||
| 102 | /// @cond | ||
| 103 | |||
| 104 | using ImplType = detail::OutputVariable_Impl; | ||
| 105 | |||
| 106 | friend class Model; | ||
| 107 | friend class openstudio::IdfObject; | ||
| 108 | |||
| 109 | // constructor | ||
| 110 | explicit OutputVariable(std::shared_ptr<detail::OutputVariable_Impl> impl); | ||
| 111 | |||
| 112 | private: | ||
| 113 | REGISTER_LOGGER("openstudio.model.OutputVariable"); | ||
| 114 | |||
| 115 | /// @endcond | ||
| 116 | }; | ||
| 117 | |||
| 118 | /** \relates OutputVariable */ | ||
| 119 | using OptionalOutputVariable = boost::optional<OutputVariable>; | ||
| 120 | |||
| 121 | /** \relates OutputVariable */ | ||
| 122 | using OutputVariableVector = std::vector<OutputVariable>; | ||
| 123 | |||
| 124 | } // namespace model | ||
| 125 | } // namespace openstudio | ||
| 126 | |||
| 127 | #endif // MODEL_VARIABLE_HPP | ||
| 128 |