public BluffWeatherAirline(BluffWeather bluffWeather) { NameOfCity = bluffWeather.NameOfCity; Country = bluffWeather.Country; Temperature = bluffWeather.Temperature; Clouds = bluffWeather.Clouds; }
public async Task RunAsync() { Console.WriteLine("Starting WeatherEnricher"); BluffWeather lastUpdate = null; while (true) { // Calling open weather map var openWeatherModel = await GetCurrentWeather(); // Translating to local model and filtering excess data. var localModel = TranslateToLocalModel(openWeatherModel); // Check if data has been changed since last update // Could be expanded to affect wait time. if (lastUpdate == null || !lastUpdate.Equals(localModel)) { //Send update to system ProduceUpdate(localModel); lastUpdate = localModel; Console.WriteLine("Updates produced."); } else { Console.WriteLine("Data was the same as last update. No Updates produced."); } //ProduceUpdate(localModel); Thread.Sleep(2000); } }
public BluffWeatherAIC(BluffWeather bluffWeather) { NameOfCity = bluffWeather.NameOfCity; Country = bluffWeather.Country; Temperature = bluffWeather.Temperature; Sunrise = bluffWeather.Sunrise; Sunset = bluffWeather.Sunset; }
public BluffWeatherATCC(BluffWeather bluffWeather) { NameOfCity = bluffWeather.NameOfCity; Lat = bluffWeather.Lat; Lon = bluffWeather.Lon; Country = bluffWeather.Country; Temperature = bluffWeather.Temperature; Pressure = bluffWeather.Pressure; Humidity = bluffWeather.Humidity; WindSpeed = bluffWeather.WindSpeed; WindDeg = bluffWeather.WindDeg; Clouds = bluffWeather.Clouds; Visibility = bluffWeather.Visibility; }
private void ProduceUpdate(BluffWeather bluffWeather) { _fanoutChannel.BasicPublish(_channelName + "Exchange", "", null, Encoding.ASCII.GetBytes(JsonSerializer.Serialize(bluffWeather))); }