src/model/Site.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 "Site.hpp" | ||
| 7 | #include "Site_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Model_Impl.hpp" | ||
| 11 | |||
| 12 | #include "SimulationControl.hpp" | ||
| 13 | #include "SimulationControl_Impl.hpp" | ||
| 14 | #include "Facility.hpp" | ||
| 15 | #include "Facility_Impl.hpp" | ||
| 16 | |||
| 17 | #include "ClimateZones.hpp" | ||
| 18 | #include "ClimateZones_Impl.hpp" | ||
| 19 | #include "DesignDay.hpp" | ||
| 20 | #include "DesignDay_Impl.hpp" | ||
| 21 | #include "LightingDesignDay.hpp" | ||
| 22 | #include "LightingDesignDay_Impl.hpp" | ||
| 23 | #include "ShadingSurfaceGroup.hpp" | ||
| 24 | #include "ShadingSurfaceGroup_Impl.hpp" | ||
| 25 | #include "SkyTemperature.hpp" | ||
| 26 | #include "SkyTemperature_Impl.hpp" | ||
| 27 | #include "SizingPeriod.hpp" | ||
| 28 | #include "SizingPeriod_Impl.hpp" | ||
| 29 | #include "WeatherFile.hpp" | ||
| 30 | #include "WeatherFile_Impl.hpp" | ||
| 31 | #include "WeatherFileConditionType.hpp" | ||
| 32 | #include "WeatherFileConditionType_Impl.hpp" | ||
| 33 | #include "WeatherFileDays.hpp" | ||
| 34 | #include "WeatherFileDays_Impl.hpp" | ||
| 35 | #include "SiteWaterMainsTemperature.hpp" | ||
| 36 | #include "SiteWaterMainsTemperature_Impl.hpp" | ||
| 37 | #include "SiteGroundReflectance.hpp" | ||
| 38 | #include "SiteGroundReflectance_Impl.hpp" | ||
| 39 | #include "SiteGroundTemperatureBuildingSurface.hpp" | ||
| 40 | #include "SiteGroundTemperatureBuildingSurface_Impl.hpp" | ||
| 41 | #include "SiteGroundTemperatureDeep.hpp" | ||
| 42 | #include "SiteGroundTemperatureDeep_Impl.hpp" | ||
| 43 | #include "SiteGroundTemperatureShallow.hpp" | ||
| 44 | #include "SiteGroundTemperatureShallow_Impl.hpp" | ||
| 45 | #include "SiteGroundTemperatureFCfactorMethod.hpp" | ||
| 46 | #include "SiteGroundTemperatureFCfactorMethod_Impl.hpp" | ||
| 47 | |||
| 48 | #include <utilities/idd/IddFactory.hxx> | ||
| 49 | |||
| 50 | #include <utilities/idd/OS_Site_FieldEnums.hxx> | ||
| 51 | #include <utilities/idd/IddEnums.hxx> | ||
| 52 | |||
| 53 | #include "../utilities/core/Assert.hpp" | ||
| 54 | #include "../utilities/core/ContainersMove.hpp" | ||
| 55 | |||
| 56 | #include <algorithm> | ||
| 57 | |||
| 58 | namespace openstudio { | ||
| 59 | namespace model { | ||
| 60 | |||
| 61 | namespace detail { | ||
| 62 | |||
| 63 | 349 | Site_Impl::Site_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) : ParentObject_Impl(idfObject, model, keepHandle) { | |
| 64 |
4/6✓ Branch 1 taken 349 times.
✓ Branch 4 taken 349 times.
✓ Branch 7 taken 349 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 349 times.
✗ Branch 13 not taken.
|
349 | OS_ASSERT(idfObject.iddObject().type() == Site::iddObjectType()); |
| 65 | 349 | } | |
| 66 | |||
| 67 | 60 | Site_Impl::Site_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 68 | 60 | : ParentObject_Impl(other, model, keepHandle) { | |
| 69 |
4/6✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
✓ Branch 7 taken 60 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 60 times.
✗ Branch 13 not taken.
|
60 | OS_ASSERT(other.iddObject().type() == Site::iddObjectType()); |
| 70 | 60 | } | |
| 71 | |||
| 72 | 125 | Site_Impl::Site_Impl(const Site_Impl& other, Model_Impl* model, bool keepHandle) : ParentObject_Impl(other, model, keepHandle) {} | |
| 73 | |||
| 74 | 2 | IddObjectType Site_Impl::iddObjectType() const { | |
| 75 | 2 | return Site::iddObjectType(); | |
| 76 | } | ||
| 77 | |||
| 78 | 2 | boost::optional<ParentObject> Site_Impl::parent() const { | |
| 79 | 2 | return {}; | |
| 80 | } | ||
| 81 | |||
| 82 | 82 | std::vector<ModelObject> Site_Impl::children() const { | |
| 83 | 82 | std::vector<ModelObject> result; | |
| 84 | |||
| 85 | // weather file | ||
| 86 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalWeatherFile weatherFile = this->weatherFile(); |
| 87 |
2/2✓ Branch 0 taken 22 times.
✓ Branch 1 taken 60 times.
|
82 | if (weatherFile) { |
| 88 |
2/2✓ Branch 1 taken 22 times.
✓ Branch 4 taken 22 times.
|
22 | result.push_back(*weatherFile); |
| 89 | } | ||
| 90 | |||
| 91 | // site ground reflectance | ||
| 92 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteGroundReflectance siteGroundReflectance = this->siteGroundReflectance(); |
| 93 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 82 times.
|
82 | if (siteGroundReflectance) { |
| 94 | ✗ | result.push_back(*siteGroundReflectance); | |
| 95 | } | ||
| 96 | |||
| 97 | // site ground temperature building surface | ||
| 98 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteGroundTemperatureBuildingSurface siteGroundTemperatureBuildingSurface = this->siteGroundTemperatureBuildingSurface(); |
| 99 |
2/2✓ Branch 0 taken 34 times.
✓ Branch 1 taken 48 times.
|
82 | if (siteGroundTemperatureBuildingSurface) { |
| 100 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
34 | result.push_back(*siteGroundTemperatureBuildingSurface); |
| 101 | } | ||
| 102 | |||
| 103 | // site ground temperature deep | ||
| 104 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteGroundTemperatureDeep siteGroundTemperatureDeep = this->siteGroundTemperatureDeep(); |
| 105 |
2/2✓ Branch 0 taken 34 times.
✓ Branch 1 taken 48 times.
|
82 | if (siteGroundTemperatureDeep) { |
| 106 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
34 | result.push_back(*siteGroundTemperatureDeep); |
| 107 | } | ||
| 108 | |||
| 109 | // site ground temperature shallow | ||
| 110 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteGroundTemperatureShallow siteGroundTemperatureShallow = this->siteGroundTemperatureShallow(); |
| 111 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 82 times.
|
82 | if (siteGroundTemperatureShallow) { |
| 112 | ✗ | result.push_back(*siteGroundTemperatureShallow); | |
| 113 | } | ||
| 114 | |||
| 115 | // site ground temperature FCfactorMethod | ||
| 116 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteGroundTemperatureFCfactorMethod siteGroundTemperatureFCfactorMethod = this->siteGroundTemperatureFCfactorMethod(); |
| 117 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 82 times.
|
82 | if (siteGroundTemperatureFCfactorMethod) { |
| 118 | ✗ | result.push_back(*siteGroundTemperatureFCfactorMethod); | |
| 119 | } | ||
| 120 | |||
| 121 | // site water mains temperature | ||
| 122 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalSiteWaterMainsTemperature siteWaterMainsTemperature = this->siteWaterMainsTemperature(); |
| 123 |
2/2✓ Branch 0 taken 34 times.
✓ Branch 1 taken 48 times.
|
82 | if (siteWaterMainsTemperature) { |
| 124 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
34 | result.push_back(*siteWaterMainsTemperature); |
| 125 | } | ||
| 126 | |||
| 127 | // climate zones | ||
| 128 |
1/1✓ Branch 1 taken 82 times.
|
82 | OptionalClimateZones climateZones = this->climateZones(); |
| 129 |
2/2✓ Branch 0 taken 28 times.
✓ Branch 1 taken 54 times.
|
82 | if (climateZones) { |
| 130 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
28 | result.push_back(*climateZones); |
| 131 | } | ||
| 132 | |||
| 133 | // sizing periods | ||
| 134 |
3/3✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
✓ Branch 7 taken 82 times.
|
82 | openstudio::detail::concat_helper(result, model().getModelObjects<SizingPeriod>()); |
| 135 | |||
| 136 | // lighting design days | ||
| 137 |
3/3✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
✓ Branch 7 taken 82 times.
|
82 | openstudio::detail::concat_helper(result, model().getConcreteModelObjects<LightingDesignDay>()); |
| 138 | |||
| 139 | // some SkyTemperatures are children (those that do not explicitly point to something else) | ||
| 140 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | SkyTemperatureVector skyTemperatures = model().getConcreteModelObjects<SkyTemperature>(); |
| 141 |
1/1✓ Branch 1 taken 82 times.
|
82 | auto siteAsParent = getObject<ParentObject>(); |
| 142 |
2/2✓ Branch 5 taken 17 times.
✓ Branch 6 taken 82 times.
|
99 | for (SkyTemperature& st : skyTemperatures) { |
| 143 |
1/1✓ Branch 1 taken 17 times.
|
17 | OptionalParentObject opo = st.parent(); |
| 144 |
7/8✓ Branch 0 taken 17 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 17 times.
✓ Branch 6 taken 17 times.
✓ Branch 8 taken 11 times.
✓ Branch 9 taken 6 times.
✓ Branch 10 taken 11 times.
✓ Branch 11 taken 6 times.
|
17 | if (opo && (opo.get() == siteAsParent)) { |
| 145 | // result.emplace_back(st.cast<ModelObject>()); | ||
| 146 |
1/1✓ Branch 2 taken 11 times.
|
11 | result.emplace_back(std::move(st)); |
| 147 | } | ||
| 148 | 17 | } | |
| 149 | |||
| 150 | // shading surface groups | ||
| 151 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | openstudio::detail::concat_helper(result, this->shadingSurfaceGroups()); |
| 152 | |||
| 153 | 164 | return result; | |
| 154 | 82 | } | |
| 155 | |||
| 156 | ✗ | std::vector<IddObjectType> Site_Impl::allowableChildTypes() const { | |
| 157 | ✗ | return std::vector<IddObjectType>{ClimateZones::iddObjectType(), | |
| 158 | ✗ | DesignDay::iddObjectType(), | |
| 159 | ✗ | SkyTemperature::iddObjectType(), | |
| 160 | ✗ | WeatherFile::iddObjectType(), | |
| 161 | ✗ | WeatherFileConditionType::iddObjectType(), | |
| 162 | ✗ | WeatherFileDays::iddObjectType(), | |
| 163 | ✗ | SiteGroundReflectance::iddObjectType(), | |
| 164 | ✗ | SiteGroundTemperatureBuildingSurface::iddObjectType(), | |
| 165 | ✗ | SiteGroundTemperatureDeep::iddObjectType(), | |
| 166 | ✗ | SiteGroundTemperatureShallow::iddObjectType(), | |
| 167 | ✗ | SiteGroundTemperatureFCfactorMethod::iddObjectType(), | |
| 168 | ✗ | SiteWaterMainsTemperature::iddObjectType(), | |
| 169 | ✗ | ShadingSurfaceGroup::iddObjectType()}; | |
| 170 | } | ||
| 171 | |||
| 172 | 7 | const std::vector<std::string>& Site_Impl::outputVariableNames() const { | |
| 173 | static const std::vector<std::string> result{"Site Outdoor Air Drybulb Temperature", | ||
| 174 | "Site Outdoor Air Wetbulb Temperature", | ||
| 175 | "Site Direct Solar Radiation Rate per Area", | ||
| 176 | "Site Diffuse Solar Radiation Rate per Area", | ||
| 177 | "Site Exterior Beam Normal Illuminance", | ||
| 178 | "Site Exterior Horizontal Beam Illuminance", | ||
| 179 | "Site Exterior Horizontal Sky Illuminance", | ||
| 180 | "Site Beam Solar Radiation Luminous Efficacy", | ||
| 181 | "Site Sky Diffuse Solar Radiation Luminous Efficacy", | ||
| 182 | "Site Daylighting Model Sky Clearness", | ||
| 183 |
6/11✓ Branch 0 taken 2 times.
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 2 times.
✓ Branch 10 taken 22 times.
✓ Branch 11 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
33 | "Site Daylighting Model Sky Brightness"}; |
| 184 | 7 | return result; | |
| 185 | 6 | } | |
| 186 | |||
| 187 | 58 | double Site_Impl::latitude() const { | |
| 188 |
1/1✓ Branch 1 taken 58 times.
|
58 | boost::optional<double> value = getDouble(OS_SiteFields::Latitude, true); |
| 189 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 58 times.
✗ Branch 4 not taken.
|
58 | OS_ASSERT(value); |
| 190 |
1/1✓ Branch 1 taken 58 times.
|
116 | return value.get(); |
| 191 | } | ||
| 192 | |||
| 193 | 14 | bool Site_Impl::isLatitudeDefaulted() const { | |
| 194 | 14 | return isEmpty(OS_SiteFields::Latitude); | |
| 195 | } | ||
| 196 | |||
| 197 | 58 | double Site_Impl::longitude() const { | |
| 198 |
1/1✓ Branch 1 taken 58 times.
|
58 | boost::optional<double> value = getDouble(OS_SiteFields::Longitude, true); |
| 199 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 58 times.
✗ Branch 4 not taken.
|
58 | OS_ASSERT(value); |
| 200 |
1/1✓ Branch 1 taken 58 times.
|
116 | return value.get(); |
| 201 | } | ||
| 202 | |||
| 203 | 14 | bool Site_Impl::isLongitudeDefaulted() const { | |
| 204 | 14 | return isEmpty(OS_SiteFields::Longitude); | |
| 205 | } | ||
| 206 | |||
| 207 | 54 | double Site_Impl::timeZone() const { | |
| 208 |
1/1✓ Branch 1 taken 54 times.
|
54 | boost::optional<double> value = getDouble(OS_SiteFields::TimeZone, true); |
| 209 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 54 times.
✗ Branch 4 not taken.
|
54 | OS_ASSERT(value); |
| 210 |
1/1✓ Branch 1 taken 54 times.
|
108 | return value.get(); |
| 211 | } | ||
| 212 | |||
| 213 | 14 | bool Site_Impl::isTimeZoneDefaulted() const { | |
| 214 | 14 | return isEmpty(OS_SiteFields::TimeZone); | |
| 215 | } | ||
| 216 | |||
| 217 | 58 | double Site_Impl::elevation() const { | |
| 218 |
1/1✓ Branch 1 taken 58 times.
|
58 | boost::optional<double> value = getDouble(OS_SiteFields::Elevation, true); |
| 219 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 58 times.
✗ Branch 4 not taken.
|
58 | OS_ASSERT(value); |
| 220 |
1/1✓ Branch 1 taken 58 times.
|
116 | return value.get(); |
| 221 | } | ||
| 222 | |||
| 223 | 14 | bool Site_Impl::isElevationDefaulted() const { | |
| 224 | 14 | return isEmpty(OS_SiteFields::Elevation); | |
| 225 | } | ||
| 226 | |||
| 227 | 8 | std::string Site_Impl::terrain() const { | |
| 228 |
1/1✓ Branch 1 taken 8 times.
|
8 | boost::optional<std::string> value = getString(OS_SiteFields::Terrain, true); |
| 229 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
|
8 | OS_ASSERT(value); |
| 230 |
2/2✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
|
16 | return value.get(); |
| 231 | 8 | } | |
| 232 | |||
| 233 | 64 | bool Site_Impl::isTerrainDefaulted() const { | |
| 234 | 64 | return isEmpty(OS_SiteFields::Terrain); | |
| 235 | } | ||
| 236 | |||
| 237 | 5 | bool Site_Impl::keepSiteLocationInformation() const { | |
| 238 | 5 | return getBooleanFieldValue(OS_SiteFields::KeepSiteLocationInformation); | |
| 239 | } | ||
| 240 | |||
| 241 | 53 | bool Site_Impl::isKeepSiteLocationInformationDefaulted() const { | |
| 242 | 53 | return isEmpty(OS_SiteFields::KeepSiteLocationInformation); | |
| 243 | } | ||
| 244 | |||
| 245 | 189 | bool Site_Impl::setLatitude(double latitude) { | |
| 246 | 189 | bool result = setDouble(OS_SiteFields::Latitude, latitude); | |
| 247 | 189 | return result; | |
| 248 | } | ||
| 249 | |||
| 250 | 1 | void Site_Impl::resetLatitude() { | |
| 251 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::Latitude, ""); |
| 252 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 253 | 1 | } | |
| 254 | |||
| 255 | 189 | bool Site_Impl::setLongitude(double longitude) { | |
| 256 | 189 | bool result = setDouble(OS_SiteFields::Longitude, longitude); | |
| 257 | 189 | return result; | |
| 258 | } | ||
| 259 | |||
| 260 | 1 | void Site_Impl::resetLongitude() { | |
| 261 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::Longitude, ""); |
| 262 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 263 | 1 | } | |
| 264 | |||
| 265 | 185 | bool Site_Impl::setTimeZone(double timeZone) { | |
| 266 | 185 | bool result = setDouble(OS_SiteFields::TimeZone, timeZone); | |
| 267 | 185 | return result; | |
| 268 | } | ||
| 269 | |||
| 270 | 1 | void Site_Impl::resetTimeZone() { | |
| 271 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::TimeZone, ""); |
| 272 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 273 | 1 | } | |
| 274 | |||
| 275 | 189 | bool Site_Impl::setElevation(double elevation) { | |
| 276 | 189 | bool result = setDouble(OS_SiteFields::Elevation, elevation); | |
| 277 | 189 | return result; | |
| 278 | } | ||
| 279 | |||
| 280 | 1 | void Site_Impl::resetElevation() { | |
| 281 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::Elevation, ""); |
| 282 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 283 | 1 | } | |
| 284 | |||
| 285 | 14 | bool Site_Impl::setTerrain(const std::string& terrain) { | |
| 286 | 14 | bool result = setString(OS_SiteFields::Terrain, terrain); | |
| 287 | 14 | return result; | |
| 288 | } | ||
| 289 | |||
| 290 | 1 | void Site_Impl::resetTerrain() { | |
| 291 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::Terrain, ""); |
| 292 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 293 | 1 | } | |
| 294 | |||
| 295 | 3 | bool Site_Impl::setKeepSiteLocationInformation(bool keepSiteLocationInformation) { | |
| 296 | 3 | return setBooleanFieldValue(OS_SiteFields::KeepSiteLocationInformation, keepSiteLocationInformation); | |
| 297 | } | ||
| 298 | |||
| 299 | 1 | void Site_Impl::resetKeepSiteLocationInformation() { | |
| 300 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_SiteFields::KeepSiteLocationInformation, ""); |
| 301 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 302 | 1 | } | |
| 303 | |||
| 304 | 82 | boost::optional<WeatherFile> Site_Impl::weatherFile() const { | |
| 305 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<WeatherFile>(); |
| 306 | } | ||
| 307 | |||
| 308 | 82 | boost::optional<SiteGroundReflectance> Site_Impl::siteGroundReflectance() const { | |
| 309 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteGroundReflectance>(); |
| 310 | } | ||
| 311 | |||
| 312 | 82 | boost::optional<SiteGroundTemperatureBuildingSurface> Site_Impl::siteGroundTemperatureBuildingSurface() const { | |
| 313 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteGroundTemperatureBuildingSurface>(); |
| 314 | } | ||
| 315 | |||
| 316 | 82 | boost::optional<SiteGroundTemperatureDeep> Site_Impl::siteGroundTemperatureDeep() const { | |
| 317 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteGroundTemperatureDeep>(); |
| 318 | } | ||
| 319 | |||
| 320 | 82 | boost::optional<SiteGroundTemperatureShallow> Site_Impl::siteGroundTemperatureShallow() const { | |
| 321 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteGroundTemperatureShallow>(); |
| 322 | } | ||
| 323 | |||
| 324 | 82 | boost::optional<SiteGroundTemperatureFCfactorMethod> Site_Impl::siteGroundTemperatureFCfactorMethod() const { | |
| 325 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteGroundTemperatureFCfactorMethod>(); |
| 326 | } | ||
| 327 | |||
| 328 | 82 | boost::optional<SiteWaterMainsTemperature> Site_Impl::siteWaterMainsTemperature() const { | |
| 329 |
2/2✓ Branch 1 taken 82 times.
✓ Branch 4 taken 82 times.
|
82 | return this->model().getOptionalUniqueModelObject<SiteWaterMainsTemperature>(); |
| 330 | } | ||
| 331 | |||
| 332 | 83 | boost::optional<ClimateZones> Site_Impl::climateZones() const { | |
| 333 |
2/2✓ Branch 1 taken 83 times.
✓ Branch 4 taken 83 times.
|
83 | return this->model().getOptionalUniqueModelObject<ClimateZones>(); |
| 334 | } | ||
| 335 | |||
| 336 | 136 | ShadingSurfaceGroupVector Site_Impl::shadingSurfaceGroups() const { | |
| 337 |
2/2✓ Branch 1 taken 136 times.
✓ Branch 4 taken 136 times.
|
136 | ShadingSurfaceGroupVector result = this->model().getConcreteModelObjects<ShadingSurfaceGroup>(); |
| 338 |
2/2✓ Branch 4 taken 136 times.
✓ Branch 8 taken 136 times.
|
136 | result.erase(std::remove_if(result.begin(), result.end(), |
| 339 |
3/3✓ Branch 1 taken 303 times.
✓ Branch 4 taken 303 times.
✓ Branch 7 taken 303 times.
|
909 | [](const auto& shadingGroup) { return !istringEqual(shadingGroup.shadingSurfaceType(), "Site"); }), |
| 340 | 136 | result.end()); | |
| 341 | 136 | return result; | |
| 342 | ✗ | } | |
| 343 | /* | ||
| 344 | std::string Site_Impl::activeClimateZoneValue() const { | ||
| 345 | std::string result; | ||
| 346 | OptionalClimateZones oClimateZones = climateZones(); | ||
| 347 | if (oClimateZones) { | ||
| 348 | result = oClimateZones->activeClimateZoneValue(); | ||
| 349 | } | ||
| 350 | return result; | ||
| 351 | } | ||
| 352 | |||
| 353 | std::string Site_Impl::activeClimateZoneInstitution() const { | ||
| 354 | std::string result; | ||
| 355 | OptionalClimateZones oClimateZones = climateZones(); | ||
| 356 | if (oClimateZones) { | ||
| 357 | ClimateZone cz = oClimateZones->activeClimateZone(); | ||
| 358 | if (!cz.empty()) { result = cz.institution(); } | ||
| 359 | } | ||
| 360 | return result; | ||
| 361 | } | ||
| 362 | |||
| 363 | bool Site_Impl::setActiveClimateZoneValue(const std::string& value) { | ||
| 364 | ClimateZones climateZones = this->model().getUniqueModelObject<ClimateZones>(); | ||
| 365 | ClimateZone acz = climateZones.activeClimateZone(); | ||
| 366 | if (!acz.empty()) { | ||
| 367 | return acz.setValue(value); | ||
| 368 | } | ||
| 369 | return false; | ||
| 370 | } | ||
| 371 | |||
| 372 | bool Site_Impl::setActiveClimateZoneInstitution(const std::string& institution) { | ||
| 373 | ClimateZones climateZones = this->model().getUniqueModelObject<ClimateZones>(); | ||
| 374 | return !climateZones.setActiveClimateZone(institution).empty(); | ||
| 375 | } | ||
| 376 | */ | ||
| 377 | |||
| 378 | ✗ | std::vector<EMSActuatorNames> Site_Impl::emsActuatorNames() const { | |
| 379 | std::vector<EMSActuatorNames> actuators{ | ||
| 380 | {"Weather Data", "Outdoor Dry Bulb"}, {"Weather Data", "Outdoor Dew Point"}, {"Weather Data", "Outdoor Relative Humidity"}, | ||
| 381 | {"Weather Data", "Diffuse Solar"}, {"Weather Data", "Direct Solar"}, {"Weather Data", "Wind Speed"}, | ||
| 382 | {"Weather Data", "Wind Direction"}, | ||
| 383 | ✗ | }; | |
| 384 | ✗ | return actuators; | |
| 385 | ✗ | } | |
| 386 | |||
| 387 | ✗ | std::vector<std::string> Site_Impl::emsInternalVariableNames() const { | |
| 388 | ✗ | std::vector<std::string> types; | |
| 389 | ✗ | return types; | |
| 390 | } | ||
| 391 | } // namespace detail | ||
| 392 | |||
| 393 | 9606 | IddObjectType Site::iddObjectType() { | |
| 394 |
1/1✓ Branch 1 taken 9606 times.
|
9606 | IddObjectType result(IddObjectType::OS_Site); |
| 395 | 9606 | return result; | |
| 396 | } | ||
| 397 | |||
| 398 | ✗ | std::vector<std::string> Site::validTerrainValues() { | |
| 399 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_SiteFields::Terrain); | |
| 400 | } | ||
| 401 | |||
| 402 | 58 | double Site::latitude() const { | |
| 403 |
1/1✓ Branch 3 taken 58 times.
|
58 | return getImpl<detail::Site_Impl>()->latitude(); |
| 404 | } | ||
| 405 | |||
| 406 | 14 | bool Site::isLatitudeDefaulted() const { | |
| 407 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::Site_Impl>()->isLatitudeDefaulted(); |
| 408 | } | ||
| 409 | |||
| 410 | 58 | double Site::longitude() const { | |
| 411 |
1/1✓ Branch 3 taken 58 times.
|
58 | return getImpl<detail::Site_Impl>()->longitude(); |
| 412 | } | ||
| 413 | |||
| 414 | 14 | bool Site::isLongitudeDefaulted() const { | |
| 415 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::Site_Impl>()->isLongitudeDefaulted(); |
| 416 | } | ||
| 417 | |||
| 418 | 54 | double Site::timeZone() const { | |
| 419 |
1/1✓ Branch 3 taken 54 times.
|
54 | return getImpl<detail::Site_Impl>()->timeZone(); |
| 420 | } | ||
| 421 | |||
| 422 | 14 | bool Site::isTimeZoneDefaulted() const { | |
| 423 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::Site_Impl>()->isTimeZoneDefaulted(); |
| 424 | } | ||
| 425 | |||
| 426 | 58 | double Site::elevation() const { | |
| 427 |
1/1✓ Branch 3 taken 58 times.
|
58 | return getImpl<detail::Site_Impl>()->elevation(); |
| 428 | } | ||
| 429 | |||
| 430 | 14 | bool Site::isElevationDefaulted() const { | |
| 431 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::Site_Impl>()->isElevationDefaulted(); |
| 432 | } | ||
| 433 | |||
| 434 | 8 | std::string Site::terrain() const { | |
| 435 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::Site_Impl>()->terrain(); |
| 436 | } | ||
| 437 | |||
| 438 | 64 | bool Site::isTerrainDefaulted() const { | |
| 439 |
1/1✓ Branch 3 taken 64 times.
|
64 | return getImpl<detail::Site_Impl>()->isTerrainDefaulted(); |
| 440 | } | ||
| 441 | |||
| 442 | 5 | bool Site::keepSiteLocationInformation() const { | |
| 443 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::Site_Impl>()->keepSiteLocationInformation(); |
| 444 | } | ||
| 445 | |||
| 446 | 53 | bool Site::isKeepSiteLocationInformationDefaulted() const { | |
| 447 |
1/1✓ Branch 3 taken 53 times.
|
53 | return getImpl<detail::Site_Impl>()->isKeepSiteLocationInformationDefaulted(); |
| 448 | } | ||
| 449 | |||
| 450 | 189 | bool Site::setLatitude(double latitude) { | |
| 451 |
1/1✓ Branch 3 taken 189 times.
|
189 | return getImpl<detail::Site_Impl>()->setLatitude(latitude); |
| 452 | } | ||
| 453 | |||
| 454 | 1 | void Site::resetLatitude() { | |
| 455 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetLatitude(); |
| 456 | 1 | } | |
| 457 | |||
| 458 | 189 | bool Site::setLongitude(double longitude) { | |
| 459 |
1/1✓ Branch 3 taken 189 times.
|
189 | return getImpl<detail::Site_Impl>()->setLongitude(longitude); |
| 460 | } | ||
| 461 | |||
| 462 | 1 | void Site::resetLongitude() { | |
| 463 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetLongitude(); |
| 464 | 1 | } | |
| 465 | |||
| 466 | 185 | bool Site::setTimeZone(double timeZone) { | |
| 467 |
1/1✓ Branch 3 taken 185 times.
|
185 | return getImpl<detail::Site_Impl>()->setTimeZone(timeZone); |
| 468 | } | ||
| 469 | |||
| 470 | 1 | void Site::resetTimeZone() { | |
| 471 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetTimeZone(); |
| 472 | 1 | } | |
| 473 | |||
| 474 | 189 | bool Site::setElevation(double elevation) { | |
| 475 |
1/1✓ Branch 3 taken 189 times.
|
189 | return getImpl<detail::Site_Impl>()->setElevation(elevation); |
| 476 | } | ||
| 477 | |||
| 478 | 1 | void Site::resetElevation() { | |
| 479 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetElevation(); |
| 480 | 1 | } | |
| 481 | |||
| 482 | 14 | bool Site::setTerrain(const std::string& terrain) { | |
| 483 |
1/1✓ Branch 3 taken 14 times.
|
14 | return getImpl<detail::Site_Impl>()->setTerrain(terrain); |
| 484 | } | ||
| 485 | |||
| 486 | 1 | void Site::resetTerrain() { | |
| 487 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetTerrain(); |
| 488 | 1 | } | |
| 489 | |||
| 490 | 3 | bool Site::setKeepSiteLocationInformation(bool keepSiteLocationInformation) { | |
| 491 |
1/1✓ Branch 3 taken 3 times.
|
3 | return getImpl<detail::Site_Impl>()->setKeepSiteLocationInformation(keepSiteLocationInformation); |
| 492 | } | ||
| 493 | |||
| 494 | 1 | void Site::resetKeepSiteLocationInformation() { | |
| 495 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::Site_Impl>()->resetKeepSiteLocationInformation(); |
| 496 | 1 | } | |
| 497 | |||
| 498 | ✗ | boost::optional<WeatherFile> Site::weatherFile() const { | |
| 499 | ✗ | return getImpl<detail::Site_Impl>()->weatherFile(); | |
| 500 | } | ||
| 501 | |||
| 502 | ✗ | boost::optional<SiteGroundReflectance> Site::siteGroundReflectance() const { | |
| 503 | ✗ | return getImpl<detail::Site_Impl>()->siteGroundReflectance(); | |
| 504 | } | ||
| 505 | |||
| 506 | ✗ | boost::optional<SiteGroundTemperatureBuildingSurface> Site::siteGroundTemperatureBuildingSurface() const { | |
| 507 | ✗ | return getImpl<detail::Site_Impl>()->siteGroundTemperatureBuildingSurface(); | |
| 508 | } | ||
| 509 | |||
| 510 | ✗ | boost::optional<SiteGroundTemperatureDeep> Site::siteGroundTemperatureDeep() const { | |
| 511 | ✗ | return getImpl<detail::Site_Impl>()->siteGroundTemperatureDeep(); | |
| 512 | } | ||
| 513 | |||
| 514 | ✗ | boost::optional<SiteGroundTemperatureShallow> Site::siteGroundTemperatureShallow() const { | |
| 515 | ✗ | return getImpl<detail::Site_Impl>()->siteGroundTemperatureShallow(); | |
| 516 | } | ||
| 517 | |||
| 518 | ✗ | boost::optional<SiteGroundTemperatureFCfactorMethod> Site::siteGroundTemperatureFCfactorMethod() const { | |
| 519 | ✗ | return getImpl<detail::Site_Impl>()->siteGroundTemperatureFCfactorMethod(); | |
| 520 | } | ||
| 521 | |||
| 522 | ✗ | boost::optional<SiteWaterMainsTemperature> Site::siteWaterMainsTemperature() const { | |
| 523 | ✗ | return getImpl<detail::Site_Impl>()->siteWaterMainsTemperature(); | |
| 524 | } | ||
| 525 | |||
| 526 | 1 | boost::optional<ClimateZones> Site::climateZones() const { | |
| 527 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::Site_Impl>()->climateZones(); |
| 528 | } | ||
| 529 | |||
| 530 | 54 | ShadingSurfaceGroupVector Site::shadingSurfaceGroups() const { | |
| 531 |
1/1✓ Branch 3 taken 54 times.
|
54 | return getImpl<detail::Site_Impl>()->shadingSurfaceGroups(); |
| 532 | } | ||
| 533 | /* | ||
| 534 | std::string Site::activeClimateZoneValue() const { | ||
| 535 | return getImpl<detail::Site_Impl>()->activeClimateZoneValue(); | ||
| 536 | } | ||
| 537 | |||
| 538 | std::string Site::activeClimateZoneInstitution() const { | ||
| 539 | return getImpl<detail::Site_Impl>()->activeClimateZoneInstitution(); | ||
| 540 | } | ||
| 541 | |||
| 542 | bool Site::setActiveClimateZoneValue(const std::string& value) { | ||
| 543 | return getImpl<detail::Site_Impl>()->setActiveClimateZoneValue(value); | ||
| 544 | } | ||
| 545 | |||
| 546 | bool Site::setActiveClimateZoneInstitution(const std::string& institution) { | ||
| 547 | return getImpl<detail::Site_Impl>()->setActiveClimateZoneInstitution(institution); | ||
| 548 | } | ||
| 549 | */ | ||
| 550 | |||
| 551 | /// @cond | ||
| 552 |
1/1✓ Branch 3 taken 182 times.
|
182 | Site::Site(std::shared_ptr<detail::Site_Impl> impl) : ParentObject(std::move(impl)) {} |
| 553 | |||
| 554 | 288 | Site::Site(Model& model) : ParentObject(Site::iddObjectType(), model) {} | |
| 555 | |||
| 556 | /// @endcond | ||
| 557 | |||
| 558 | } // namespace model | ||
| 559 | } // namespace openstudio | ||
| 560 |