Esempio n. 1
0
 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)
     });
 }
Esempio n. 2
0
 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
     });
 }
Esempio n. 3
0
        protected override WeatherInfo GetChangedData()
        {
            WeatherInfoOutside outsideSensorInfo = new WeatherInfoOutside
            {
                temperature = GetTemperature(),
                humidity    = GetHumidity(),
                pressure    = GetPressure(),
            };

            outsideSensorInfo.windInfo.windDirection = GetWindDirection();
            outsideSensorInfo.windInfo.windSpeed     = GetWindSpeed();
            return(outsideSensorInfo);
        }