From c6d815b6b11504be68d7a97df63cfef749624418 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 20 Dec 2017 20:45:35 -0200 Subject: Math expr GUI implemented --- Project/RateLimiter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Project/RateLimiter.cpp') diff --git a/Project/RateLimiter.cpp b/Project/RateLimiter.cpp index afba0ee..b9235a7 100644 --- a/Project/RateLimiter.cpp +++ b/Project/RateLimiter.cpp @@ -110,7 +110,7 @@ void RateLimiter::UpdatePoints() } } -bool RateLimiter::Solve(double input, double timeStep) +bool RateLimiter::Solve(double input, double timeStep, double currentTime) { double rate = (input - m_output) / timeStep; -- cgit From dbe0b112622f8e91fa3e44a6b6e1aa7e230d3ded Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sun, 31 Dec 2017 17:59:10 -0200 Subject: Math Expression implemented --- Project/RateLimiter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Project/RateLimiter.cpp') diff --git a/Project/RateLimiter.cpp b/Project/RateLimiter.cpp index b9235a7..c8da81d 100644 --- a/Project/RateLimiter.cpp +++ b/Project/RateLimiter.cpp @@ -110,9 +110,13 @@ void RateLimiter::UpdatePoints() } } -bool RateLimiter::Solve(double input, double timeStep, double currentTime) +bool RateLimiter::Solve(double* input, double timeStep) { - double rate = (input - m_output) / timeStep; + if(!input) { + m_output = 0.0; + return true; + } + double rate = (input[0] - m_output) / timeStep; bool reachLimit = false; if(rate > m_upLimit) { @@ -126,7 +130,7 @@ bool RateLimiter::Solve(double input, double timeStep, double currentTime) if(reachLimit) m_output += rate * timeStep; else - m_output = input; + m_output = input[0]; return true; } -- cgit