MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / setWeatherFile

Method setWeatherFile

src/model/WeatherFile.cpp:376–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374 }
375
376 boost::optional<WeatherFile> WeatherFile::setWeatherFile(Model& model, const openstudio::EpwFile& epwFile) {
377 WeatherFile weatherFile = model.getUniqueModelObject<WeatherFile>();
378 weatherFile.setString(OS_WeatherFileFields::City, epwFile.city());
379 weatherFile.setString(OS_WeatherFileFields::StateProvinceRegion, epwFile.stateProvinceRegion());
380 weatherFile.setString(OS_WeatherFileFields::Country, epwFile.country());
381 weatherFile.setString(OS_WeatherFileFields::DataSource, epwFile.dataSource());
382 weatherFile.setString(OS_WeatherFileFields::WMONumber, epwFile.wmoNumber());
383 weatherFile.setDouble(OS_WeatherFileFields::Latitude, epwFile.latitude());
384 weatherFile.setDouble(OS_WeatherFileFields::Longitude, epwFile.longitude());
385 weatherFile.setDouble(OS_WeatherFileFields::TimeZone, epwFile.timeZone());
386 weatherFile.setDouble(OS_WeatherFileFields::Elevation, epwFile.elevation());
387 weatherFile.setString(OS_WeatherFileFields::Url, toString(epwFile.path()));
388 weatherFile.setString(OS_WeatherFileFields::Checksum, epwFile.checksum());
389 if (auto s_ = epwFile.startDateActualYear()) {
390 weatherFile.setInt(OS_WeatherFileFields::StartDateActualYear, s_.get());
391 }
392
393 weatherFile.setString(OS_WeatherFileFields::StartDayofWeek, epwFile.startDayOfWeek().valueName());
394
395 return weatherFile;
396 }
397
398 std::string WeatherFile::city() const {
399 return getImpl<detail::WeatherFile_Impl>()->city();

Callers

nothing calls this directly

Calls 15

wmoNumberMethod · 0.80
valueNameMethod · 0.80
toStringFunction · 0.50
setStringMethod · 0.45
cityMethod · 0.45
stateProvinceRegionMethod · 0.45
countryMethod · 0.45
dataSourceMethod · 0.45
setDoubleMethod · 0.45
latitudeMethod · 0.45
longitudeMethod · 0.45

Tested by

no test coverage detected