src/model/ElectricLoadCenterInverterPVWatts.cpp
| 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 | #include "ElectricLoadCenterInverterPVWatts.hpp" | ||
| 7 | #include "ElectricLoadCenterInverterPVWatts_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Schedule.hpp" | ||
| 10 | #include "Schedule_Impl.hpp" | ||
| 11 | #include "ThermalZone.hpp" | ||
| 12 | #include "ThermalZone_Impl.hpp" | ||
| 13 | #include "ScheduleTypeLimits.hpp" | ||
| 14 | #include "ScheduleTypeRegistry.hpp" | ||
| 15 | |||
| 16 | #include <utilities/idd/IddEnums.hxx> | ||
| 17 | #include <utilities/idd/OS_ElectricLoadCenter_Inverter_PVWatts_FieldEnums.hxx> | ||
| 18 | |||
| 19 | #include "../utilities/units/Unit.hpp" | ||
| 20 | |||
| 21 | #include "../utilities/core/Assert.hpp" | ||
| 22 | |||
| 23 | namespace openstudio { | ||
| 24 | namespace model { | ||
| 25 | |||
| 26 | namespace detail { | ||
| 27 | |||
| 28 | 7 | ElectricLoadCenterInverterPVWatts_Impl::ElectricLoadCenterInverterPVWatts_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 29 | 7 | : Inverter_Impl(idfObject, model, keepHandle) { | |
| 30 |
4/6✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 7 times.
✗ Branch 13 not taken.
|
7 | OS_ASSERT(idfObject.iddObject().type() == ElectricLoadCenterInverterPVWatts::iddObjectType()); |
| 31 | 7 | } | |
| 32 | |||
| 33 | ✗ | ElectricLoadCenterInverterPVWatts_Impl::ElectricLoadCenterInverterPVWatts_Impl(const openstudio::detail::WorkspaceObject_Impl& other, | |
| 34 | ✗ | Model_Impl* model, bool keepHandle) | |
| 35 | ✗ | : Inverter_Impl(other, model, keepHandle) { | |
| 36 | ✗ | OS_ASSERT(other.iddObject().type() == ElectricLoadCenterInverterPVWatts::iddObjectType()); | |
| 37 | ✗ | } | |
| 38 | |||
| 39 | 5 | ElectricLoadCenterInverterPVWatts_Impl::ElectricLoadCenterInverterPVWatts_Impl(const ElectricLoadCenterInverterPVWatts_Impl& other, | |
| 40 | 5 | Model_Impl* model, bool keepHandle) | |
| 41 | 5 | : Inverter_Impl(other, model, keepHandle) {} | |
| 42 | |||
| 43 | ✗ | const std::vector<std::string>& ElectricLoadCenterInverterPVWatts_Impl::outputVariableNames() const { | |
| 44 | static const std::vector<std::string> result{ | ||
| 45 | "Inverter DC to AC Efficiency", "Inverter DC Input Electricity Rate", "Inverter DC Input Electricity Energy", | ||
| 46 | "Inverter AC Output Electricity Rate", "Inverter AC Output Electricity Energy", "Inverter Conversion Loss Power", | ||
| 47 | "Inverter Conversion Loss Energy", "Inverter Conversion Loss Decrement Energy", "Inverter Thermal Loss Rate", | ||
| 48 | ✗ | "Inverter Thermal Loss Energy", "Inverter Ancillary AC Electricity Rate", "Inverter Ancillary AC Electricity Energy"}; | |
| 49 | ✗ | return result; | |
| 50 | ✗ | } | |
| 51 | |||
| 52 | ✗ | IddObjectType ElectricLoadCenterInverterPVWatts_Impl::iddObjectType() const { | |
| 53 | ✗ | return ElectricLoadCenterInverterPVWatts::iddObjectType(); | |
| 54 | } | ||
| 55 | |||
| 56 | ✗ | std::vector<ScheduleTypeKey> ElectricLoadCenterInverterPVWatts_Impl::getScheduleTypeKeys(const Schedule& /*schedule*/) const { | |
| 57 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 58 | ✗ | return result; | |
| 59 | } | ||
| 60 | |||
| 61 | ✗ | boost::optional<ThermalZone> ElectricLoadCenterInverterPVWatts_Impl::thermalZone() const { | |
| 62 | ✗ | return boost::none; | |
| 63 | } | ||
| 64 | |||
| 65 | ✗ | bool ElectricLoadCenterInverterPVWatts_Impl::setThermalZone(const ThermalZone& /*thermalZone*/) { | |
| 66 | ✗ | return false; | |
| 67 | } | ||
| 68 | |||
| 69 | ✗ | void ElectricLoadCenterInverterPVWatts_Impl::resetThermalZone() { | |
| 70 | ✗ | bool result = true; | |
| 71 | ✗ | OS_ASSERT(result); | |
| 72 | ✗ | } | |
| 73 | |||
| 74 | 3 | double ElectricLoadCenterInverterPVWatts_Impl::dcToACSizeRatio() const { | |
| 75 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_ElectricLoadCenter_Inverter_PVWattsFields::DCtoACSizeRatio, true); |
| 76 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 77 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 78 | } | ||
| 79 | |||
| 80 | 5 | bool ElectricLoadCenterInverterPVWatts_Impl::isDCToACSizeRatioDefaulted() const { | |
| 81 | 5 | return isEmpty(OS_ElectricLoadCenter_Inverter_PVWattsFields::DCtoACSizeRatio); | |
| 82 | } | ||
| 83 | |||
| 84 | 5 | double ElectricLoadCenterInverterPVWatts_Impl::inverterEfficiency() const { | |
| 85 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<double> value = getDouble(OS_ElectricLoadCenter_Inverter_PVWattsFields::InverterEfficiency, true); |
| 86 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 87 |
1/1✓ Branch 1 taken 5 times.
|
10 | return value.get(); |
| 88 | } | ||
| 89 | |||
| 90 | 5 | bool ElectricLoadCenterInverterPVWatts_Impl::isInverterEfficiencyDefaulted() const { | |
| 91 | 5 | return isEmpty(OS_ElectricLoadCenter_Inverter_PVWattsFields::InverterEfficiency); | |
| 92 | } | ||
| 93 | |||
| 94 | 1 | bool ElectricLoadCenterInverterPVWatts_Impl::setDCToACSizeRatio(double dcToACSizeRatio) { | |
| 95 | 1 | bool result = setDouble(OS_ElectricLoadCenter_Inverter_PVWattsFields::DCtoACSizeRatio, dcToACSizeRatio); | |
| 96 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 97 | 1 | return result; | |
| 98 | } | ||
| 99 | |||
| 100 | 1 | void ElectricLoadCenterInverterPVWatts_Impl::resetDCToACSizeRatio() { | |
| 101 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_ElectricLoadCenter_Inverter_PVWattsFields::DCtoACSizeRatio, ""); |
| 102 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 103 | 1 | } | |
| 104 | |||
| 105 | 2 | bool ElectricLoadCenterInverterPVWatts_Impl::setInverterEfficiency(double inverterEfficiency) { | |
| 106 | 2 | bool result = setDouble(OS_ElectricLoadCenter_Inverter_PVWattsFields::InverterEfficiency, inverterEfficiency); | |
| 107 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 108 | 2 | return result; | |
| 109 | } | ||
| 110 | |||
| 111 | 1 | void ElectricLoadCenterInverterPVWatts_Impl::resetInverterEfficiency() { | |
| 112 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_ElectricLoadCenter_Inverter_PVWattsFields::InverterEfficiency, ""); |
| 113 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 114 | 1 | } | |
| 115 | |||
| 116 | } // namespace detail | ||
| 117 | |||
| 118 | 7 | ElectricLoadCenterInverterPVWatts::ElectricLoadCenterInverterPVWatts(const Model& model) | |
| 119 | 7 | : Inverter(ElectricLoadCenterInverterPVWatts::iddObjectType(), model) { | |
| 120 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 7 times.
✗ Branch 5 not taken.
|
7 | OS_ASSERT(getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()); |
| 121 | |||
| 122 | // TODO: Appropriately handle the following required object-list fields. | ||
| 123 | 7 | bool ok = true; | |
| 124 | // ok = setHandle(); | ||
| 125 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 7 times.
✗ Branch 3 not taken.
|
7 | OS_ASSERT(ok); |
| 126 | 7 | } | |
| 127 | |||
| 128 | 7742 | IddObjectType ElectricLoadCenterInverterPVWatts::iddObjectType() { | |
| 129 |
1/1✓ Branch 1 taken 7742 times.
|
7742 | return {IddObjectType::OS_ElectricLoadCenter_Inverter_PVWatts}; |
| 130 | } | ||
| 131 | |||
| 132 | 3 | double ElectricLoadCenterInverterPVWatts::dcToACSizeRatio() const { | |
| 133 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->dcToACSizeRatio(); |
| 134 | } | ||
| 135 | |||
| 136 | 5 | bool ElectricLoadCenterInverterPVWatts::isDCToACSizeRatioDefaulted() const { | |
| 137 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->isDCToACSizeRatioDefaulted(); |
| 138 | } | ||
| 139 | |||
| 140 | 5 | double ElectricLoadCenterInverterPVWatts::inverterEfficiency() const { | |
| 141 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->inverterEfficiency(); |
| 142 | } | ||
| 143 | |||
| 144 | 5 | bool ElectricLoadCenterInverterPVWatts::isInverterEfficiencyDefaulted() const { | |
| 145 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->isInverterEfficiencyDefaulted(); |
| 146 | } | ||
| 147 | |||
| 148 | 1 | bool ElectricLoadCenterInverterPVWatts::setDCToACSizeRatio(double dcToACSizeRatio) { | |
| 149 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->setDCToACSizeRatio(dcToACSizeRatio); |
| 150 | } | ||
| 151 | |||
| 152 | 1 | void ElectricLoadCenterInverterPVWatts::resetDCToACSizeRatio() { | |
| 153 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->resetDCToACSizeRatio(); |
| 154 | 1 | } | |
| 155 | |||
| 156 | 2 | bool ElectricLoadCenterInverterPVWatts::setInverterEfficiency(double inverterEfficiency) { | |
| 157 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->setInverterEfficiency(inverterEfficiency); |
| 158 | } | ||
| 159 | |||
| 160 | 1 | void ElectricLoadCenterInverterPVWatts::resetInverterEfficiency() { | |
| 161 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::ElectricLoadCenterInverterPVWatts_Impl>()->resetInverterEfficiency(); |
| 162 | 1 | } | |
| 163 | |||
| 164 | /// @cond | ||
| 165 | 3 | ElectricLoadCenterInverterPVWatts::ElectricLoadCenterInverterPVWatts(std::shared_ptr<detail::ElectricLoadCenterInverterPVWatts_Impl> impl) | |
| 166 |
1/1✓ Branch 3 taken 3 times.
|
3 | : Inverter(std::move(impl)) {} |
| 167 | /// @endcond | ||
| 168 | |||
| 169 | } // namespace model | ||
| 170 | } // namespace openstudio | ||
| 171 |