src/alfalfa/AlfalfaMeter.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_METER_HPP | ||
| 7 | #define ALFALFA_COMPONENT_METER_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 AlfalfaMeter : public AlfalfaComponentBase | ||
| 18 | { | ||
| 19 | public: | ||
| 20 | /** | ||
| 21 | * Create an AlfalfaMeter Component from a meter_name which reflects the Output:Meter EneregyPlus IDD | ||
| 22 | */ | ||
| 23 | AlfalfaMeter(const std::string& meter_name); | ||
| 24 | |||
| 25 | /** | ||
| 26 | * Create an AlfalfaMeter Component from an IdfObject. | ||
| 27 | * Valid idf_object types are OutputMeter and IdfObject(IddObjectType::Output_Meter). | ||
| 28 | */ | ||
| 29 | AlfalfaMeter(const IdfObject& output_meter); | ||
| 30 | |||
| 31 | std::string deriveName() const override; | ||
| 32 | |||
| 33 | Json::Value toJSON() const override; | ||
| 34 | |||
| 35 | 98 | AlfalfaComponentCapability capability() const override { | |
| 36 |
1/1✓ Branch 1 taken 98 times.
|
98 | return AlfalfaComponentCapability::Output; |
| 37 | } | ||
| 38 | |||
| 39 | 30 | AlfalfaComponentType type() const override { | |
| 40 |
1/1✓ Branch 1 taken 30 times.
|
30 | return AlfalfaComponentType::Meter; |
| 41 | } | ||
| 42 | |||
| 43 | 68 | std::unique_ptr<AlfalfaComponentBase> clone() const override { | |
| 44 |
1/1✓ Branch 1 taken 68 times.
|
68 | return std::make_unique<AlfalfaMeter>(*this); |
| 45 | } | ||
| 46 | |||
| 47 | std::string meterName() const; | ||
| 48 | |||
| 49 | static bool acceptsObjectType(const IddObjectType& idd_type); | ||
| 50 | |||
| 51 | private: | ||
| 52 | std::string m_meter_name; | ||
| 53 | }; | ||
| 54 | } // namespace alfalfa | ||
| 55 | } // namespace openstudio | ||
| 56 | |||
| 57 | #endif | ||
| 58 |