diff options
Diffstat (limited to 'Project/RateLimiter.cpp')
-rw-r--r-- | Project/RateLimiter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Project/RateLimiter.cpp b/Project/RateLimiter.cpp index 3a1b25a..42bede1 100644 --- a/Project/RateLimiter.cpp +++ b/Project/RateLimiter.cpp @@ -93,9 +93,9 @@ void RateLimiter::UpdatePoints() } } -bool RateLimiter::Solve(double input) +bool RateLimiter::Solve(double input, double timeStep) { - double rate = (input - m_output) / m_timeStep; + double rate = (input - m_output) / timeStep; bool reachLimit = false; if(rate > m_upLimit) { @@ -107,7 +107,7 @@ bool RateLimiter::Solve(double input) } if(reachLimit) - m_output += rate * m_timeStep; + m_output += rate * timeStep; else m_output = input; return true; |