private static Common.Weather.WeatherPointData ConvertToWeatherPointData(Weather source) { var destination = new Common.Weather.WeatherPointData(); destination.Temperature = new Common.Weather.Temperature { Celsius = source.Temperature }; destination.DewPoint = new Common.Weather.Temperature { Celsius = source.DewPoint }; destination.Pressure = source.Pressure; destination.WindDirection = source.WindDirection; destination.WindSpeed = source.WindSpeed; destination.Visibility = source.Visibility; if (source.Precipitation > 0) { destination.Precipitation = source.Precipitation; } destination.Ozone = source.Ozone; destination.Humidity = source.Humidity; destination.CloudCover = source.CloudCover; return destination; }
private static void ConvertToWeatherPoint(Common.Weather.WeatherPoint destination, Weather source) { destination.Timestamp = UnixToDateTime(source.Time); destination.Weather = ConvertToWeatherPointData(source); }