[chronojump] RaceAnalyzer: Code for realtime speed show. WORKING!



commit 86c4b2de9ccdc17a37a39744ef4ee3c6da7cbaf0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Dec 14 16:58:01 2020 +0100

    RaceAnalyzer: Code for realtime speed show. WORKING!

 src/gui/app1/runEncoder.cs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index 8c32ea6f..47b6ee67 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -463,6 +463,7 @@ public partial class ChronoJumpWindow
                triggerListRunEncoder = new TriggerList();
                str = "";
                int firstTime = 0;
+               int timePre = 0;
 
                int rowsCount = 0;
                while(! runEncoderProcessFinish && ! runEncoderProcessCancel && ! runEncoderProcessError)
@@ -491,7 +492,9 @@ public partial class ChronoJumpWindow
                        int force = binaryReaded[2];
                        int encoderOrRCA = binaryReaded[3];
 
-                       runEncoderCaptureSpeed = UtilAll.DivideSafe(0.003003, time); //hardcoded: same as 
sprintEncoder.R
+                       runEncoderCaptureSpeed = UtilAll.DivideSafe(Math.Abs(encoderDisplacement) * 1000000 * 
0.003003, (time - timePre)); //hardcoded: same as sprintEncoder.R
+                       //LogB.Information("runEncoderCaptureSpeed: " + 
UtilAll.DivideSafe(Math.Abs(encoderDisplacement) * 1000000 * 0.003003, (time - timePre)).ToString()); 
//hardcoded: same as sprintEncoder.R
+                       timePre = time;
 
                        LogB.Information(string.Format("{0};{1};{2};{3};{4}", pps, encoderDisplacement, time, 
force, encoderOrRCA));
                        writer.WriteLine(string.Format("{0};{1};{2}", encoderDisplacement, time, force));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]