| 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(); |
nothing calls this directly
no test coverage detected