/// <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; } }
/// <summary> /// Resets squat count. /// </summary> public void Reset() { SquatsCount = 0; SquatsUpdated.Invoke(this, SquatsCount); }