Beispiel #1
0
        float[] GetDirectionValuesToTime(int cntIntervals, DateTime begin, DateTime end, WindData wd)
        {
            List <float> result      = new List <float>();
            TimeSpan     t           = end.Subtract(begin);
            double       minutesStep = t.TotalMinutes / cntIntervals;

            // start with 1, because first value is 'current'
            for (int i = 0; i < cntIntervals; i++)
            {
                // begin of date interval
                DateTime first = begin.AddMinutes(minutesStep * i);
                // end of date interval
                DateTime last = begin.AddMinutes(minutesStep * (i + 1));
                if (last < first)
                {
                    last = first.AddSeconds(5);
                }
                result.Add(wd.GetTopDirectionValueBetweenDate(first, last));
            }
            return(result.ToArray());
        }