private void SetReading(FaceReading item, float newValue)
        {
            //Set Values
            item.Current = newValue;

            if (_currentIndex >= 90)
            {
                _currentIndex = 0;
            }
            item.AllValues[_currentIndex] = newValue;
            _currentIndex++;

            item.Average = item.AllValues.Average();

            //Min & Max
            if (newValue < item.Min)
            {
                item.Min = newValue;
            }
            if (newValue > item.Max)
            {
                item.Max = newValue;
            }
        }
示例#2
0
        private void SetReading(FaceReading item, float newValue)
        {
            //Set Values
            item.Current = newValue;

            if (_currentIndex >= 90)
            {
                _currentIndex = 0; 
            }
            item.AllValues[_currentIndex] = newValue;
            _currentIndex++;

            item.Average = item.AllValues.Average();

            //Min & Max
            if (newValue < item.Min)
            {
                item.Min = newValue;
            }
            if (newValue > item.Max)
            {
                item.Max = newValue;
            }
        }