Mercurial > public > ostc4
diff Discovery/Src/t7.c @ 174:ecb71521d004 max-depth
Bugfix: make max depth move with current depth (part 2)
Step 2 of the fix as introduced in the previous commit. Now we have
a smart averaging depth import from the RTE, we do not need to average
close to display time. So, simply kick out this logic here.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Mon, 11 Mar 2019 19:54:20 +0100 |
parents | 255eedad4155 |
children | d36596281501 |
line wrap: on
line diff
--- a/Discovery/Src/t7.c Mon Mar 11 19:48:57 2019 +0100 +++ b/Discovery/Src/t7.c Mon Mar 11 19:54:20 2019 +0100 @@ -2012,26 +2012,7 @@ } /* depth */ - float depth = 0; - float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter); - if(is_stateUsedSetToSim()) - { - depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2] + depthLastCall[3] + depthLastCall[4] + depthLastCall[5] + depthLastCall[6] + depthLastCall[7] + depthLastCall[8]) / 10.0f; - - idDepthLastCall++; - if(idDepthLastCall >= 9) - idDepthLastCall = 0; - depthLastCall[idDepthLastCall] = depthThisCall; - } - else - { - depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2]) / 4.0f; - - idDepthLastCall++; - if(idDepthLastCall >= 3) - idDepthLastCall = 0; - depthLastCall[idDepthLastCall] = depthThisCall; - } + float depth = unit_depth_float(stateUsed->lifeData.depth_meter); if(depth <= 0.3f) depth = 0;