Пример #1
0
        private float?OnePoint()
        {
            float sum = 0;
            int   boundary;

            if (_block.Length - _index < _n)
            {
                boundary = _n - (_block.Length - _index);
                for (; _index < _block.Length; _index++)
                {
                    sum += _block[_index];
                }
                _block.Clear();
                _source.LoadBlock(_block);
                _index = 0;
            }
            else
            {
                boundary = _index + _n;
            }
            for (; _index < boundary; _index++)
            {
                sum += _block[_index];
            }
            return(sum / _n);
        }
Пример #2
0
        private float?OnePoint()
        {
            _block.Clear();
            int length = _collector.CollectPoints(_block, _n);

            //how to handle?
            if (length < _n)
            {
                return(null);
            }
            return(Average());
        }