示例#1
0
        /// <summary>
        /// Checks if squat occurred.
        /// </summary>
        private void AnalyzeNewWindow()
        {
            float average = CalculateStableAverage();

            if (average <= _upperThreshold && average >= _lowerThreshold && _valueExceededUpperThreshold)
            {
                _valueExceededUpperThreshold = false;
                SquatsCount++;
                SquatsUpdated.Invoke(this, SquatsCount);
            }
            else if (average > _upperThreshold)
            {
                _valueExceededUpperThreshold = true;
            }
        }
示例#2
0
 /// <summary>
 /// Resets squat count.
 /// </summary>
 public void Reset()
 {
     SquatsCount = 0;
     SquatsUpdated.Invoke(this, SquatsCount);
 }