[chronojump] Race time include reaction time or not (see preferences)



commit 190495e8200ff30bf1c63fd6b2e5e7801b65a73f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 12 18:18:50 2018 +0100

    Race time include reaction time or not (see preferences)

 src/execute/run.cs |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 357df80..6737b44 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -47,7 +47,7 @@ public class RunExecute : EventExecute
        protected Constants.DoubleContact checkDoubleContactMode;
        protected int checkDoubleContactTime;
        
-       protected bool speedStartArrival;       
+       protected bool speedStartArrival; //if speedStartArrival then race time includes reaction time
        protected bool measureReactionTime;
        protected double reactionTimeMS; //reaction time in milliseconds
        
@@ -286,7 +286,9 @@ public class RunExecute : EventExecute
                                                        {
                                                                if(measureReactionTime)
                                                                        reactionTimeMS = 
timestampFirstContact;
-                                                               else
+
+                                                               // measuringReactionTime or not, if 
speedStartArrival, timestamp should include timpestampFirstContact
+                                                               if(speedStartArrival)
                                                                        timestamp += timestampFirstContact;
                                                        }
 
@@ -720,13 +722,14 @@ public class RunIntervalExecute : RunExecute
                                                needShowFeedbackMessage = true; 
                                        } else if(runPhase == runPhases.PLATFORM_INI_YES_TIME)
                                        {
+                                               lastTc = 0;
                                                if(measureReactionTime)
-                                               {
                                                        reactionTimeMS = timestamp;
-                                                       lastTc = 0;
-                                               } else
+
+                                               // measuringReactionTime or not, if speedStartArrival, 1st 
race time should include lastTc
+                                               if(speedStartArrival)
                                                        lastTc = timestamp/1000.0;
-                                       
+
                                                feedbackMessage = "";
                                                needShowFeedbackMessage = true; 
                                        } else {


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