[chronojump] More fixes on RCA encoder sync



commit 6f2d08449d5b1a54a3f34201aaa90667b129ce26
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 6 11:18:56 2017 +0100

    More fixes on RCA encoder sync

 src/encoderCapture.cs |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/encoderCapture.cs b/src/encoderCapture.cs
index 3356aba..b4e34c3 100644
--- a/src/encoderCapture.cs
+++ b/src/encoderCapture.cs
@@ -263,7 +263,7 @@ public abstract class EncoderCapture
                                                LogB.Information("Cleaning on capture");
 
                                                //remove this time on existing boolMs records
-                                               boolMsList.Substract(consecutiveZeros * 1000);
+                                               boolMsList.Substract(consecutiveZeros);
 
                                                consecutiveZeros = -1;
                                                encoderReadedInertialDisc = new List<int>();
@@ -655,10 +655,9 @@ public abstract class EncoderCapture
                if(count > allowedZeroMSAtStart)
                {
                        l.RemoveRange(0, count-allowedZeroMSAtStart);
+                       boolMsList.Substract(count-allowedZeroMSAtStart);
                } // else: not enough zeros at start, don't need to trim 
 
-               boolMsList.Substract(count-allowedZeroMSAtStart);
-               
                return l; 
        }
        
@@ -941,6 +940,14 @@ public class BoolMsList
                        boolMs.Substract(msToSubstract);
        }
 
+       //just to debug
+       public void ToString()
+       {
+               LogB.Information("Printing BoolMSList");
+               foreach(BoolMs boolMs in l)
+                       LogB.Information(boolMs.ToString());
+       }
+
        public void Write()
        {
                //save triggers to file (if any)


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