src/model/GeneratorPVWatts.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 "Model.hpp" | ||
| 7 | #include "Model_Impl.hpp" | ||
| 8 | |||
| 9 | #include "GeneratorPVWatts.hpp" | ||
| 10 | #include "GeneratorPVWatts_Impl.hpp" | ||
| 11 | #include "PlanarSurface.hpp" | ||
| 12 | #include "PlanarSurface_Impl.hpp" | ||
| 13 | #include "Surface.hpp" | ||
| 14 | #include "Surface_Impl.hpp" | ||
| 15 | #include "ShadingSurface.hpp" | ||
| 16 | #include "ShadingSurface_Impl.hpp" | ||
| 17 | |||
| 18 | #include "Schedule.hpp" | ||
| 19 | #include "Schedule_Impl.hpp" | ||
| 20 | #include "ScheduleTypeLimits.hpp" | ||
| 21 | #include "ScheduleTypeRegistry.hpp" | ||
| 22 | |||
| 23 | #include <utilities/idd/IddEnums.hxx> | ||
| 24 | #include <utilities/idd/OS_Generator_PVWatts_FieldEnums.hxx> | ||
| 25 | |||
| 26 | #include "../utilities/core/Assert.hpp" | ||
| 27 | |||
| 28 | namespace openstudio { | ||
| 29 | namespace model { | ||
| 30 | |||
| 31 | namespace detail { | ||
| 32 | |||
| 33 | 11 | GeneratorPVWatts_Impl::GeneratorPVWatts_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 34 | 11 | : Generator_Impl(idfObject, model, keepHandle) { | |
| 35 |
4/6✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 11 times.
✗ Branch 13 not taken.
|
11 | OS_ASSERT(idfObject.iddObject().type() == GeneratorPVWatts::iddObjectType()); |
| 36 | 11 | } | |
| 37 | |||
| 38 | ✗ | GeneratorPVWatts_Impl::GeneratorPVWatts_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 39 | ✗ | : Generator_Impl(other, model, keepHandle) { | |
| 40 | ✗ | OS_ASSERT(other.iddObject().type() == GeneratorPVWatts::iddObjectType()); | |
| 41 | ✗ | } | |
| 42 | |||
| 43 | 5 | GeneratorPVWatts_Impl::GeneratorPVWatts_Impl(const GeneratorPVWatts_Impl& other, Model_Impl* model, bool keepHandle) | |
| 44 | 5 | : Generator_Impl(other, model, keepHandle) {} | |
| 45 | |||
| 46 | ✗ | const std::vector<std::string>& GeneratorPVWatts_Impl::outputVariableNames() const { | |
| 47 | static const std::vector<std::string> result{"Generator Produced DC Electricity Rate", "Generator Produced DC Electricity Energy", | ||
| 48 | "Generator PV Cell Temperature", "Generator PV Short Circuit Current", | ||
| 49 | ✗ | "Generator PV Open Circuit Voltage", "Generator PV Array Efficiency"}; | |
| 50 | ✗ | return result; | |
| 51 | ✗ | } | |
| 52 | |||
| 53 | ✗ | IddObjectType GeneratorPVWatts_Impl::iddObjectType() const { | |
| 54 | ✗ | return GeneratorPVWatts::iddObjectType(); | |
| 55 | } | ||
| 56 | |||
| 57 | ✗ | std::vector<ScheduleTypeKey> GeneratorPVWatts_Impl::getScheduleTypeKeys(const Schedule& /*schedule*/) const { | |
| 58 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 59 | ✗ | return result; | |
| 60 | } | ||
| 61 | |||
| 62 | 1 | std::string GeneratorPVWatts_Impl::generatorObjectType() const { | |
| 63 |
1/1✓ Branch 1 taken 1 time.
|
2 | return "Generator:PVWatts"; |
| 64 | } | ||
| 65 | |||
| 66 | 1 | boost::optional<Schedule> GeneratorPVWatts_Impl::availabilitySchedule() const { | |
| 67 | 1 | boost::optional<Schedule> schedule; | |
| 68 | 1 | return schedule; | |
| 69 | } | ||
| 70 | |||
| 71 | 1 | boost::optional<double> GeneratorPVWatts_Impl::ratedElectricPowerOutput() const { | |
| 72 | 1 | return getDouble(OS_Generator_PVWattsFields::DCSystemCapacity); | |
| 73 | } | ||
| 74 | |||
| 75 | 1 | boost::optional<double> GeneratorPVWatts_Impl::ratedThermaltoElectricalPowerRatio() const { | |
| 76 | 1 | return boost::none; | |
| 77 | } | ||
| 78 | |||
| 79 | 2 | std::string GeneratorPVWatts_Impl::pvWattsVersion() const { | |
| 80 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> value = getString(OS_Generator_PVWattsFields::PVWattsVersion, true); |
| 81 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 82 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return value.get(); |
| 83 | 2 | } | |
| 84 | |||
| 85 | 3 | double GeneratorPVWatts_Impl::dcSystemCapacity() const { | |
| 86 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_Generator_PVWattsFields::DCSystemCapacity); |
| 87 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 88 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 89 | } | ||
| 90 | |||
| 91 | 3 | std::string GeneratorPVWatts_Impl::moduleType() const { | |
| 92 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> value = getString(OS_Generator_PVWattsFields::ModuleType, true); |
| 93 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 94 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | return value.get(); |
| 95 | 3 | } | |
| 96 | |||
| 97 | 5 | bool GeneratorPVWatts_Impl::isModuleTypeDefaulted() const { | |
| 98 | 5 | return isEmpty(OS_Generator_PVWattsFields::ModuleType); | |
| 99 | } | ||
| 100 | |||
| 101 | 3 | std::string GeneratorPVWatts_Impl::arrayType() const { | |
| 102 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<std::string> value = getString(OS_Generator_PVWattsFields::ArrayType, true); |
| 103 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 104 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
|
6 | return value.get(); |
| 105 | 3 | } | |
| 106 | |||
| 107 | 3 | bool GeneratorPVWatts_Impl::isArrayTypeDefaulted() const { | |
| 108 | 3 | return isEmpty(OS_Generator_PVWattsFields::ArrayType); | |
| 109 | } | ||
| 110 | |||
| 111 | 5 | double GeneratorPVWatts_Impl::systemLosses() const { | |
| 112 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<double> value = getDouble(OS_Generator_PVWattsFields::SystemLosses, true); |
| 113 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 114 |
1/1✓ Branch 1 taken 5 times.
|
10 | return value.get(); |
| 115 | } | ||
| 116 | |||
| 117 | 5 | bool GeneratorPVWatts_Impl::isSystemLossesDefaulted() const { | |
| 118 | 5 | return isEmpty(OS_Generator_PVWattsFields::SystemLosses); | |
| 119 | } | ||
| 120 | |||
| 121 | 3 | double GeneratorPVWatts_Impl::tiltAngle() const { | |
| 122 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_Generator_PVWattsFields::TiltAngle, true); |
| 123 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 124 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 125 | } | ||
| 126 | |||
| 127 | 3 | bool GeneratorPVWatts_Impl::isTiltAngleDefaulted() const { | |
| 128 | 3 | return isEmpty(OS_Generator_PVWattsFields::TiltAngle); | |
| 129 | } | ||
| 130 | |||
| 131 | 3 | double GeneratorPVWatts_Impl::azimuthAngle() const { | |
| 132 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_Generator_PVWattsFields::AzimuthAngle, true); |
| 133 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 134 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 135 | } | ||
| 136 | |||
| 137 | 3 | bool GeneratorPVWatts_Impl::isAzimuthAngleDefaulted() const { | |
| 138 | 3 | return isEmpty(OS_Generator_PVWattsFields::AzimuthAngle); | |
| 139 | } | ||
| 140 | |||
| 141 | 8 | boost::optional<PlanarSurface> GeneratorPVWatts_Impl::surface() const { | |
| 142 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
8 | return getObject<ModelObject>().getModelObjectTarget<PlanarSurface>(OS_Generator_PVWattsFields::SurfaceName); |
| 143 | } | ||
| 144 | |||
| 145 | 3 | double GeneratorPVWatts_Impl::groundCoverageRatio() const { | |
| 146 |
1/1✓ Branch 1 taken 3 times.
|
3 | boost::optional<double> value = getDouble(OS_Generator_PVWattsFields::GroundCoverageRatio, true); |
| 147 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 3 times.
✗ Branch 4 not taken.
|
3 | OS_ASSERT(value); |
| 148 |
1/1✓ Branch 1 taken 3 times.
|
6 | return value.get(); |
| 149 | } | ||
| 150 | |||
| 151 | 3 | bool GeneratorPVWatts_Impl::isGroundCoverageRatioDefaulted() const { | |
| 152 | 3 | return isEmpty(OS_Generator_PVWattsFields::GroundCoverageRatio); | |
| 153 | } | ||
| 154 | |||
| 155 | 12 | bool GeneratorPVWatts_Impl::setDCSystemCapacity(double dcSystemCapacity) { | |
| 156 | 12 | bool result = setDouble(OS_Generator_PVWattsFields::DCSystemCapacity, dcSystemCapacity); | |
| 157 | 12 | return result; | |
| 158 | } | ||
| 159 | |||
| 160 | 1 | bool GeneratorPVWatts_Impl::setModuleType(const std::string& moduleType) { | |
| 161 | 1 | bool result = setString(OS_Generator_PVWattsFields::ModuleType, moduleType); | |
| 162 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 163 | 1 | return result; | |
| 164 | } | ||
| 165 | |||
| 166 | 1 | void GeneratorPVWatts_Impl::resetModuleType() { | |
| 167 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::ModuleType, ""); |
| 168 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 169 | 1 | } | |
| 170 | |||
| 171 | 1 | bool GeneratorPVWatts_Impl::setArrayType(const std::string& arrayType) { | |
| 172 | 1 | bool result = setString(OS_Generator_PVWattsFields::ArrayType, arrayType); | |
| 173 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 174 | 1 | return result; | |
| 175 | } | ||
| 176 | |||
| 177 | 1 | void GeneratorPVWatts_Impl::resetArrayType() { | |
| 178 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::ArrayType, ""); |
| 179 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 180 | 1 | } | |
| 181 | |||
| 182 | 2 | bool GeneratorPVWatts_Impl::setSystemLosses(double systemLosses) { | |
| 183 | 2 | bool result = setDouble(OS_Generator_PVWattsFields::SystemLosses, systemLosses); | |
| 184 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 185 | 2 | return result; | |
| 186 | } | ||
| 187 | |||
| 188 | 1 | void GeneratorPVWatts_Impl::resetSystemLosses() { | |
| 189 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::SystemLosses, ""); |
| 190 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 191 | 1 | } | |
| 192 | |||
| 193 | 1 | bool GeneratorPVWatts_Impl::setTiltAngle(double tiltAngle) { | |
| 194 | 1 | bool result = true; | |
| 195 |
6/14✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 time.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
|
2 | result = result && setString(OS_Generator_PVWattsFields::SurfaceName, ""); |
| 196 |
2/4✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | result = result && setDouble(OS_Generator_PVWattsFields::TiltAngle, tiltAngle); |
| 197 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 198 | 1 | return result; | |
| 199 | } | ||
| 200 | |||
| 201 | 1 | void GeneratorPVWatts_Impl::resetTiltAngle() { | |
| 202 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::TiltAngle, ""); |
| 203 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 204 | 1 | } | |
| 205 | |||
| 206 | 1 | bool GeneratorPVWatts_Impl::setAzimuthAngle(double azimuthAngle) { | |
| 207 | 1 | bool result = true; | |
| 208 |
6/14✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 time.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 time.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
|
2 | result = result && setString(OS_Generator_PVWattsFields::SurfaceName, ""); |
| 209 |
2/4✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
|
1 | result = result && setDouble(OS_Generator_PVWattsFields::AzimuthAngle, azimuthAngle); |
| 210 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 211 | 1 | return result; | |
| 212 | } | ||
| 213 | |||
| 214 | 1 | void GeneratorPVWatts_Impl::resetAzimuthAngle() { | |
| 215 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::AzimuthAngle, ""); |
| 216 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 217 | 1 | } | |
| 218 | |||
| 219 | 3 | bool GeneratorPVWatts_Impl::setSurface(const PlanarSurface& surface) { | |
| 220 | 3 | bool result = true; | |
| 221 |
6/14✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 6 taken 3 times.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
|
6 | result = result && setString(OS_Generator_PVWattsFields::TiltAngle, ""); |
| 222 |
6/14✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 6 taken 3 times.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 3 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 3 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
|
6 | result = result && setString(OS_Generator_PVWattsFields::AzimuthAngle, ""); |
| 223 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 1 time.
|
6 | if (surface.optionalCast<Surface>()) { |
| 224 |
4/6✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 6 taken 2 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
|
2 | result = result && setPointer(OS_Generator_PVWattsFields::SurfaceName, surface.handle()); |
| 225 |
2/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
|
2 | } else if (surface.optionalCast<ShadingSurface>()) { |
| 226 |
4/6✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
|
1 | result = result && setPointer(OS_Generator_PVWattsFields::SurfaceName, surface.handle()); |
| 227 | } | ||
| 228 | 3 | return result; | |
| 229 | } | ||
| 230 | |||
| 231 | 2 | void GeneratorPVWatts_Impl::resetSurface() { | |
| 232 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | bool result = setString(OS_Generator_PVWattsFields::SurfaceName, ""); |
| 233 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 234 | 2 | } | |
| 235 | |||
| 236 | 1 | bool GeneratorPVWatts_Impl::setGroundCoverageRatio(double groundCoverageRatio) { | |
| 237 | 1 | bool result = setDouble(OS_Generator_PVWattsFields::GroundCoverageRatio, groundCoverageRatio); | |
| 238 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 239 | 1 | return result; | |
| 240 | } | ||
| 241 | |||
| 242 | 1 | void GeneratorPVWatts_Impl::resetGroundCoverageRatio() { | |
| 243 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Generator_PVWattsFields::GroundCoverageRatio, ""); |
| 244 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 245 | 1 | } | |
| 246 | |||
| 247 | } // namespace detail | ||
| 248 | |||
| 249 | 9 | GeneratorPVWatts::GeneratorPVWatts(const Model& model, double dcSystemCapacity) : Generator(GeneratorPVWatts::iddObjectType(), model) { | |
| 250 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✗ Branch 5 not taken.
|
9 | OS_ASSERT(getImpl<detail::GeneratorPVWatts_Impl>()); |
| 251 | |||
| 252 | 9 | bool ok = true; | |
| 253 | |||
| 254 |
1/1✓ Branch 1 taken 9 times.
|
9 | ok = this->setDCSystemCapacity(dcSystemCapacity); |
| 255 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
|
9 | if (!ok) { |
| 256 | ✗ | this->remove(); | |
| 257 | ✗ | LOG_AND_THROW("Cannot create a pvwatts generator with dc system capacity " << dcSystemCapacity); | |
| 258 | } | ||
| 259 | 9 | } | |
| 260 | |||
| 261 | 2 | GeneratorPVWatts::GeneratorPVWatts(const Model& model, const PlanarSurface& surface, double dcSystemCapacity) | |
| 262 | 2 | : Generator(GeneratorPVWatts::iddObjectType(), model) { | |
| 263 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✗ Branch 5 not taken.
|
2 | OS_ASSERT(getImpl<detail::GeneratorPVWatts_Impl>()); |
| 264 | |||
| 265 | 2 | bool ok = true; | |
| 266 | |||
| 267 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = this->setSurface(surface); |
| 268 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (!ok) { |
| 269 | ✗ | this->remove(); | |
| 270 | ✗ | LOG_AND_THROW("Cannot create a pvwatts generator without surface"); | |
| 271 | } | ||
| 272 | |||
| 273 |
1/1✓ Branch 1 taken 2 times.
|
2 | ok = this->setDCSystemCapacity(dcSystemCapacity); |
| 274 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | if (!ok) { |
| 275 |
1/1✓ Branch 1 taken 1 time.
|
1 | this->remove(); |
| 276 |
15/15✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 16 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 25 taken 1 time.
✓ Branch 28 taken 1 time.
✓ Branch 31 taken 1 time.
✓ Branch 34 taken 1 time.
✓ Branch 37 taken 1 time.
✓ Branch 40 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
|
1 | LOG_AND_THROW("Cannot create a pvwatts generator with dc system capacity " << dcSystemCapacity); |
| 277 | } | ||
| 278 | 2 | } | |
| 279 | |||
| 280 | 7623 | IddObjectType GeneratorPVWatts::iddObjectType() { | |
| 281 |
1/1✓ Branch 1 taken 7623 times.
|
7623 | return {IddObjectType::OS_Generator_PVWatts}; |
| 282 | } | ||
| 283 | |||
| 284 | 2 | std::string GeneratorPVWatts::pvWattsVersion() const { | |
| 285 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::GeneratorPVWatts_Impl>()->pvWattsVersion(); |
| 286 | } | ||
| 287 | |||
| 288 | 3 | double GeneratorPVWatts::dcSystemCapacity() const { | |
| 289 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->dcSystemCapacity(); |
| 290 | } | ||
| 291 | |||
| 292 | 3 | std::string GeneratorPVWatts::moduleType() const { | |
| 293 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->moduleType(); |
| 294 | } | ||
| 295 | |||
| 296 | 5 | bool GeneratorPVWatts::isModuleTypeDefaulted() const { | |
| 297 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::GeneratorPVWatts_Impl>()->isModuleTypeDefaulted(); |
| 298 | } | ||
| 299 | |||
| 300 | 3 | std::string GeneratorPVWatts::arrayType() const { | |
| 301 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->arrayType(); |
| 302 | } | ||
| 303 | |||
| 304 | 3 | bool GeneratorPVWatts::isArrayTypeDefaulted() const { | |
| 305 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->isArrayTypeDefaulted(); |
| 306 | } | ||
| 307 | |||
| 308 | 5 | double GeneratorPVWatts::systemLosses() const { | |
| 309 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::GeneratorPVWatts_Impl>()->systemLosses(); |
| 310 | } | ||
| 311 | |||
| 312 | 5 | bool GeneratorPVWatts::isSystemLossesDefaulted() const { | |
| 313 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::GeneratorPVWatts_Impl>()->isSystemLossesDefaulted(); |
| 314 | } | ||
| 315 | |||
| 316 | 3 | double GeneratorPVWatts::tiltAngle() const { | |
| 317 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->tiltAngle(); |
| 318 | } | ||
| 319 | |||
| 320 | 3 | bool GeneratorPVWatts::isTiltAngleDefaulted() const { | |
| 321 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->isTiltAngleDefaulted(); |
| 322 | } | ||
| 323 | |||
| 324 | 3 | double GeneratorPVWatts::azimuthAngle() const { | |
| 325 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->azimuthAngle(); |
| 326 | } | ||
| 327 | |||
| 328 | 3 | bool GeneratorPVWatts::isAzimuthAngleDefaulted() const { | |
| 329 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->isAzimuthAngleDefaulted(); |
| 330 | } | ||
| 331 | |||
| 332 | 8 | boost::optional<PlanarSurface> GeneratorPVWatts::surface() const { | |
| 333 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::GeneratorPVWatts_Impl>()->surface(); |
| 334 | } | ||
| 335 | |||
| 336 | 3 | double GeneratorPVWatts::groundCoverageRatio() const { | |
| 337 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->groundCoverageRatio(); |
| 338 | } | ||
| 339 | |||
| 340 | 3 | bool GeneratorPVWatts::isGroundCoverageRatioDefaulted() const { | |
| 341 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->isGroundCoverageRatioDefaulted(); |
| 342 | } | ||
| 343 | |||
| 344 | 12 | bool GeneratorPVWatts::setDCSystemCapacity(double dcSystemCapacity) { | |
| 345 |
1/1✓ Branch 3 taken 12 times.
|
12 | return getImpl<detail::GeneratorPVWatts_Impl>()->setDCSystemCapacity(dcSystemCapacity); |
| 346 | } | ||
| 347 | |||
| 348 | 1 | bool GeneratorPVWatts::setModuleType(const std::string& moduleType) { | |
| 349 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorPVWatts_Impl>()->setModuleType(moduleType); |
| 350 | } | ||
| 351 | |||
| 352 | 1 | void GeneratorPVWatts::resetModuleType() { | |
| 353 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetModuleType(); |
| 354 | 1 | } | |
| 355 | |||
| 356 | 1 | bool GeneratorPVWatts::setArrayType(const std::string& arrayType) { | |
| 357 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorPVWatts_Impl>()->setArrayType(arrayType); |
| 358 | } | ||
| 359 | |||
| 360 | 1 | void GeneratorPVWatts::resetArrayType() { | |
| 361 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetArrayType(); |
| 362 | 1 | } | |
| 363 | |||
| 364 | 2 | bool GeneratorPVWatts::setSystemLosses(double systemLosses) { | |
| 365 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::GeneratorPVWatts_Impl>()->setSystemLosses(systemLosses); |
| 366 | } | ||
| 367 | |||
| 368 | 1 | void GeneratorPVWatts::resetSystemLosses() { | |
| 369 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetSystemLosses(); |
| 370 | 1 | } | |
| 371 | |||
| 372 | 1 | bool GeneratorPVWatts::setTiltAngle(double tiltAngle) { | |
| 373 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorPVWatts_Impl>()->setTiltAngle(tiltAngle); |
| 374 | } | ||
| 375 | |||
| 376 | 1 | void GeneratorPVWatts::resetTiltAngle() { | |
| 377 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetTiltAngle(); |
| 378 | 1 | } | |
| 379 | |||
| 380 | 1 | bool GeneratorPVWatts::setAzimuthAngle(double azimuthAngle) { | |
| 381 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorPVWatts_Impl>()->setAzimuthAngle(azimuthAngle); |
| 382 | } | ||
| 383 | |||
| 384 | 1 | void GeneratorPVWatts::resetAzimuthAngle() { | |
| 385 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetAzimuthAngle(); |
| 386 | 1 | } | |
| 387 | |||
| 388 | 3 | bool GeneratorPVWatts::setSurface(const PlanarSurface& surface) { | |
| 389 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::GeneratorPVWatts_Impl>()->setSurface(surface); |
| 390 | } | ||
| 391 | |||
| 392 | 2 | void GeneratorPVWatts::resetSurface() { | |
| 393 |
1/1✓ Branch 3 taken 2 times.
|
2 | getImpl<detail::GeneratorPVWatts_Impl>()->resetSurface(); |
| 394 | 2 | } | |
| 395 | |||
| 396 | 1 | bool GeneratorPVWatts::setGroundCoverageRatio(double groundCoverageRatio) { | |
| 397 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::GeneratorPVWatts_Impl>()->setGroundCoverageRatio(groundCoverageRatio); |
| 398 | } | ||
| 399 | |||
| 400 | 1 | void GeneratorPVWatts::resetGroundCoverageRatio() { | |
| 401 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::GeneratorPVWatts_Impl>()->resetGroundCoverageRatio(); |
| 402 | 1 | } | |
| 403 | |||
| 404 | /// @cond | ||
| 405 |
1/1✓ Branch 3 taken 4 times.
|
4 | GeneratorPVWatts::GeneratorPVWatts(std::shared_ptr<detail::GeneratorPVWatts_Impl> impl) : Generator(std::move(impl)) {} |
| 406 | /// @endcond | ||
| 407 | |||
| 408 | } // namespace model | ||
| 409 | } // namespace openstudio | ||
| 410 |