src/model/CoilHeatingElectricMultiStage.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_COILHEATINGELECTRICMULTISTAGE_HPP | ||
| 7 | #define MODEL_COILHEATINGELECTRICMULTISTAGE_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "StraightComponent.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | namespace model { | ||
| 15 | |||
| 16 | class Schedule; | ||
| 17 | class CoilHeatingElectricMultiStageStageData; | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | |||
| 21 | class CoilHeatingElectricMultiStage_Impl; | ||
| 22 | |||
| 23 | } // namespace detail | ||
| 24 | |||
| 25 | /** CoilHeatingElectricMultiStage is a StraightComponent that wraps the OpenStudio IDD object 'OS:Coil:Heating:Electric:MultiStage'. | ||
| 26 | * Performance data for each stage is contained in a separate ModelObject called OS:Coil:Heating:Electric:MultiStage:StageData **/ | ||
| 27 | class MODEL_API CoilHeatingElectricMultiStage : public StraightComponent | ||
| 28 | { | ||
| 29 | public: | ||
| 30 | /** @name Constructors and Destructors */ | ||
| 31 | //@{ | ||
| 32 | |||
| 33 | explicit CoilHeatingElectricMultiStage(const Model& model); | ||
| 34 | |||
| 35 | 56 | virtual ~CoilHeatingElectricMultiStage() override = default; | |
| 36 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 37 | 5 | CoilHeatingElectricMultiStage(const CoilHeatingElectricMultiStage& other) = default; | |
| 38 | 11 | CoilHeatingElectricMultiStage(CoilHeatingElectricMultiStage&& other) = default; | |
| 39 | ✗ | CoilHeatingElectricMultiStage& operator=(const CoilHeatingElectricMultiStage&) = default; | |
| 40 | ✗ | CoilHeatingElectricMultiStage& operator=(CoilHeatingElectricMultiStage&&) = default; | |
| 41 | |||
| 42 | //@} | ||
| 43 | |||
| 44 | static IddObjectType iddObjectType(); | ||
| 45 | |||
| 46 | /** @name Getters */ | ||
| 47 | //@{ | ||
| 48 | |||
| 49 | Schedule availabilitySchedule() const; | ||
| 50 | |||
| 51 | //@} | ||
| 52 | /** @name Setters */ | ||
| 53 | //@{ | ||
| 54 | |||
| 55 | bool setAvailabilitySchedule(Schedule& schedule); | ||
| 56 | |||
| 57 | //@} | ||
| 58 | /** @name Other */ | ||
| 59 | //@{ | ||
| 60 | |||
| 61 | /** Return the performance data for each stage. **/ | ||
| 62 | std::vector<CoilHeatingElectricMultiStageStageData> stages() const; | ||
| 63 | |||
| 64 | unsigned numberOfStages() const; | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Get the index of a given CoilHeatingElectricMultiStageStageData (1-indexed) | ||
| 68 | */ | ||
| 69 | boost::optional<unsigned> stageIndex(const CoilHeatingElectricMultiStageStageData& stage) const; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Add a new stage after all of the existing stages. | ||
| 73 | */ | ||
| 74 | bool addStage(const CoilHeatingElectricMultiStageStageData& stage); | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Add a new CoilHeatingElectricMultiStageStageData to the list which a given index (1 to x). | ||
| 78 | * Internally calls addStage then setStageIndex, see remarks there | ||
| 79 | */ | ||
| 80 | bool addStage(const CoilHeatingElectricMultiStageStageData& stage, unsigned index); | ||
| 81 | |||
| 82 | /* | ||
| 83 | * You can shuffle the priority of a given CoilHeatingElectricMultiStageStageData after having added it | ||
| 84 | * If index is below 1, it's reset to 1. | ||
| 85 | * If index is greater than the number of stages, will reset to last | ||
| 86 | */ | ||
| 87 | bool setStageIndex(const CoilHeatingElectricMultiStageStageData& stage, unsigned index); | ||
| 88 | |||
| 89 | /* | ||
| 90 | * Set all stages using a list of CoilHeatingElectricMultiStageStageDatas | ||
| 91 | * Internally calls addStage, and will return the global status, but will continue trying if there are problems | ||
| 92 | * (eg: if you make a vector larger than the number of accepted stages, or a vector that has a stage from another model, the valid stages will be | ||
| 93 | * added indeed, but it'll eventually return false) | ||
| 94 | */ | ||
| 95 | bool setStages(const std::vector<CoilHeatingElectricMultiStageStageData>& stages); | ||
| 96 | |||
| 97 | /* | ||
| 98 | * Removes all CoilHeatingElectricMultiStageStageDatas in this object | ||
| 99 | */ | ||
| 100 | void removeAllStages(); | ||
| 101 | |||
| 102 | /* | ||
| 103 | * Remove the given CoilHeatingElectricMultiStageStageData from this object's stages | ||
| 104 | */ | ||
| 105 | bool removeStage(const CoilHeatingElectricMultiStageStageData& stage); | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Remove the CoilHeatingElectricMultiStageStageData at the given index (1-indexed) | ||
| 109 | */ | ||
| 110 | bool removeStage(unsigned index); | ||
| 111 | |||
| 112 | //@} | ||
| 113 | protected: | ||
| 114 | /// @cond | ||
| 115 | using ImplType = detail::CoilHeatingElectricMultiStage_Impl; | ||
| 116 | |||
| 117 | explicit CoilHeatingElectricMultiStage(std::shared_ptr<detail::CoilHeatingElectricMultiStage_Impl> impl); | ||
| 118 | |||
| 119 | friend class detail::CoilHeatingElectricMultiStage_Impl; | ||
| 120 | friend class Model; | ||
| 121 | friend class IdfObject; | ||
| 122 | friend class openstudio::detail::IdfObject_Impl; | ||
| 123 | /// @endcond | ||
| 124 | private: | ||
| 125 | REGISTER_LOGGER("openstudio.model.CoilHeatingElectricMultiStage"); | ||
| 126 | }; | ||
| 127 | |||
| 128 | /** \relates CoilHeatingElectricMultiStage*/ | ||
| 129 | using OptionalCoilHeatingElectricMultiStage = boost::optional<CoilHeatingElectricMultiStage>; | ||
| 130 | |||
| 131 | /** \relates CoilHeatingElectricMultiStage*/ | ||
| 132 | using CoilHeatingElectricMultiStageVector = std::vector<CoilHeatingElectricMultiStage>; | ||
| 133 | |||
| 134 | } // namespace model | ||
| 135 | } // namespace openstudio | ||
| 136 | |||
| 137 | #endif // MODEL_COILHEATINGELECTRICMULTISTAGE_HPP | ||
| 138 |