public StatisticInfo CalculateWindDirectionStatisticInfo(int countAcc, WeatherInfoOutside weatherInfo) { _accYValue += Math.Sin(weatherInfo.windInfo.windDirection * (Math.PI / 180)) * weatherInfo.windInfo.windSpeed; _accXValue += Math.Cos(weatherInfo.windInfo.windDirection * (Math.PI / 180)) * weatherInfo.windInfo.windSpeed; return(new StatisticInfo("wind direction") { MaxValue = null, MinValue = null, AverageValue = GetAverangeDirectionFromVector(countAcc) }); }
public StatisticInfo CalculateWindSpeedStatisticInfo(int countAcc, WeatherInfoOutside weatherInfo) { UpdateMinMaxValue(weatherInfo.windInfo.windSpeed); _accSpeedValue += weatherInfo.windInfo.windSpeed; return(new StatisticInfo("wind speed") { MaxValue = _maxSpeedValue, MinValue = _minSpeedValue, AverageValue = _accSpeedValue / countAcc }); }
protected override WeatherInfo GetChangedData() { WeatherInfoOutside outsideSensorInfo = new WeatherInfoOutside { temperature = GetTemperature(), humidity = GetHumidity(), pressure = GetPressure(), }; outsideSensorInfo.windInfo.windDirection = GetWindDirection(); outsideSensorInfo.windInfo.windSpeed = GetWindSpeed(); return(outsideSensorInfo); }