src/model/ElectricEquipment.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_ELECTRICEQUIPMENT_HPP | ||
| 7 | #define MODEL_ELECTRICEQUIPMENT_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "SpaceLoadInstance.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class Schedule; | ||
| 16 | class ElectricEquipmentDefinition; | ||
| 17 | |||
| 18 | namespace detail { | ||
| 19 | |||
| 20 | class ElectricEquipment_Impl; | ||
| 21 | |||
| 22 | } // namespace detail | ||
| 23 | |||
| 24 | /** ElectricEquipment is a SpaceLoadInstance that wraps the OpenStudio IDD object | ||
| 25 | * 'OS:ElectricEquipment'. Its fields are derived from the EnergyPlus IDD object | ||
| 26 | * 'ElectricEquipment'. \sa ElectricEquipmentDefinition */ | ||
| 27 | class MODEL_API ElectricEquipment : public SpaceLoadInstance | ||
| 28 | { | ||
| 29 | public: | ||
| 30 | /** @name Constructors and Destructors */ | ||
| 31 | //@{ | ||
| 32 | |||
| 33 | explicit ElectricEquipment(const ElectricEquipmentDefinition& electricEquipmentDefinition); | ||
| 34 | |||
| 35 | 2465 | virtual ~ElectricEquipment() override = default; | |
| 36 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 37 | 6 | ElectricEquipment(const ElectricEquipment& other) = default; | |
| 38 | 938 | ElectricEquipment(ElectricEquipment&& other) = default; | |
| 39 | ✗ | ElectricEquipment& operator=(const ElectricEquipment&) = default; | |
| 40 | 304 | ElectricEquipment& operator=(ElectricEquipment&&) = default; | |
| 41 | |||
| 42 | //@} | ||
| 43 | |||
| 44 | static IddObjectType iddObjectType(); | ||
| 45 | |||
| 46 | /** @name Getters */ | ||
| 47 | //@{ | ||
| 48 | |||
| 49 | /** Gets the ElectricEquipmentDefinition object. */ | ||
| 50 | ElectricEquipmentDefinition electricEquipmentDefinition() const; | ||
| 51 | |||
| 52 | /** Returns the (fractional) equipment schedule. If this object does not | ||
| 53 | * specify a schedule this function will search the hierarchy. */ | ||
| 54 | boost::optional<Schedule> schedule() const; | ||
| 55 | |||
| 56 | /** Returns true if this object does not specify a schedule directly. */ | ||
| 57 | bool isScheduleDefaulted() const; | ||
| 58 | |||
| 59 | std::string endUseSubcategory() const; | ||
| 60 | |||
| 61 | bool isEndUseSubcategoryDefaulted() const; | ||
| 62 | |||
| 63 | //@} | ||
| 64 | /** @name Setters */ | ||
| 65 | //@{ | ||
| 66 | |||
| 67 | /** Sets the ElectricEquipmentDefinition object. */ | ||
| 68 | bool setElectricEquipmentDefinition(const ElectricEquipmentDefinition& definition); | ||
| 69 | |||
| 70 | /** Sets the (fractional) Schedule. */ | ||
| 71 | bool setSchedule(Schedule& schedule); | ||
| 72 | |||
| 73 | /** Resets the (fractional) Schedule. */ | ||
| 74 | void resetSchedule(); | ||
| 75 | |||
| 76 | bool setMultiplier(double multiplier); | ||
| 77 | |||
| 78 | void resetMultiplier(); | ||
| 79 | |||
| 80 | bool setEndUseSubcategory(const std::string& endUseSubcategory); | ||
| 81 | |||
| 82 | void resetEndUseSubcategory(); | ||
| 83 | |||
| 84 | //@} | ||
| 85 | /** @name Other */ | ||
| 86 | //@{ | ||
| 87 | |||
| 88 | /** Returns the designLevel if possible based on the underlying data of | ||
| 89 | * electricEquipmentDefinition(). */ | ||
| 90 | boost::optional<double> designLevel() const; | ||
| 91 | |||
| 92 | /** Returns the powerPerFloorArea if possible based on the underlying data of | ||
| 93 | * electricEquipmentDefinition(). */ | ||
| 94 | boost::optional<double> powerPerFloorArea() const; | ||
| 95 | |||
| 96 | /** Returns the powerPerPerson if possible based on the underlying data of | ||
| 97 | * electricEquipmentDefinition(). */ | ||
| 98 | boost::optional<double> powerPerPerson() const; | ||
| 99 | |||
| 100 | /** Returns the design level represented by this instance, assuming floorArea (m^2) and | ||
| 101 | * numPeople. */ | ||
| 102 | double getDesignLevel(double floorArea, double numPeople) const; | ||
| 103 | |||
| 104 | /** Returns the watts/m^2 represented by this instance, assuming floorArea (m^2) and | ||
| 105 | * numPeople. */ | ||
| 106 | double getPowerPerFloorArea(double floorArea, double numPeople) const; | ||
| 107 | |||
| 108 | /** Returns the watts/person represented by this instance, assuming floorArea (m^2) and | ||
| 109 | * numPeople. */ | ||
| 110 | double getPowerPerPerson(double floorArea, double numPeople) const; | ||
| 111 | |||
| 112 | //@} | ||
| 113 | protected: | ||
| 114 | /// @cond | ||
| 115 | using ImplType = detail::ElectricEquipment_Impl; | ||
| 116 | |||
| 117 | friend class Model; | ||
| 118 | friend class openstudio::IdfObject; | ||
| 119 | |||
| 120 | explicit ElectricEquipment(std::shared_ptr<detail::ElectricEquipment_Impl> impl); | ||
| 121 | |||
| 122 | /// @endcond | ||
| 123 | private: | ||
| 124 | REGISTER_LOGGER("openstudio.model.ElectricEquipment"); | ||
| 125 | }; | ||
| 126 | |||
| 127 | /** \relates ElectricEquipment*/ | ||
| 128 | using OptionalElectricEquipment = boost::optional<ElectricEquipment>; | ||
| 129 | |||
| 130 | /** \relates ElectricEquipment*/ | ||
| 131 | using ElectricEquipmentVector = std::vector<ElectricEquipment>; | ||
| 132 | |||
| 133 | } // namespace model | ||
| 134 | } // namespace openstudio | ||
| 135 | |||
| 136 | #endif // MODEL_ELECTRICEQUIPMENT_HPP | ||
| 137 |