[chronojump] Bump version 2.2.0



commit 29718aada0086456c824d134f89e1410ffe9028d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jan 9 11:12:34 2022 +0100

    Bump version 2.2.0

 src/execute/arduinoCapture.cs |  2 +-
 src/execute/runObjects.cs     | 10 +++++++++-
 src/forceSensor.cs            |  5 +++++
 src/gui/app1/chronojump.cs    | 27 +++++++++++++++++++++++++++
 src/gui/app1/forceSensor.cs   |  7 ++++++-
 src/gui/app1/jumpsProfile.cs  |  2 +-
 src/gui/cairo/jumpsProfile.cs | 39 ++++++++++++++++++++++++++++-----------
 src/networks.cs               |  4 +++-
 8 files changed, 80 insertions(+), 16 deletions(-)
---
diff --git a/src/execute/arduinoCapture.cs b/src/execute/arduinoCapture.cs
index 134fb63b3..78a71c393 100644
--- a/src/execute/arduinoCapture.cs
+++ b/src/execute/arduinoCapture.cs
@@ -194,7 +194,7 @@ public class PhotocellWirelessCapture: ArduinoCapture
 
                LogB.Information(string.Format("arduinoCapture portName: {0}, bauds: {1}", portName, bauds));
 
-               //empty the port after new capture
+               //empty the port before new capture
                flush();
 
                /*
diff --git a/src/execute/runObjects.cs b/src/execute/runObjects.cs
index 377a34d86..3f695677f 100644
--- a/src/execute/runObjects.cs
+++ b/src/execute/runObjects.cs
@@ -103,20 +103,25 @@ public class RunPhaseInfoManage
                bool firstPair = true;
                for(int i = startAt +1; i < list.Count; i +=2)
                {
+                       LogB.Information("At rpim IsStartDoubleContact B pre 1");
                        tcRPI = (RunPhaseInfo) list[i-1];
+                       LogB.Information("At rpim IsStartDoubleContact B pre 2");
                        tfRPI = (RunPhaseInfo) list[i];
 
                        LogB.Information("At rpim IsStartDoubleContact B");
                        if(firstPair && ! speedStart) {
+                               LogB.Information("At rpim IsStartDoubleContact B 3");
                                //if ! speedStart (started inside), don't count first contact time
                                if(tfRPI.Duration > checkTime)
                                        return false;
                        }
                        else {
+                               LogB.Information("At rpim IsStartDoubleContact B 4");
                                if(tcRPI.Duration + tfRPI.Duration > checkTime)
                                        return false;
                        }
                        firstPair = false;
+                       LogB.Information("At rpim IsStartDoubleContact B 5");
                }
                LogB.Information("At rpim IsStartDoubleContact C");
 
@@ -509,6 +514,7 @@ public class RunDoubleContact
 }
 
 //decide if use this or inspector
+//TODO: clarify what this class does
 public class RunPhaseTimeList
 {
        public bool SpeedStart;
@@ -720,6 +726,7 @@ public class RunPhaseTimeList
 
 }
 
+//TODO: clarify what this class does
 public class RunPhaseTimeListObject
 {
        //each contact can be start of a chunk, middle, end or startandend
@@ -756,7 +763,7 @@ public class RunPhaseTimeListObject
        }
 }
 
-//currently used for simple runs
+//TODO: clarify what this class does
 public class RunExecuteInspector
 {
        public enum Types { RUN_SIMPLE, RUN_INTERVAL }
@@ -824,6 +831,7 @@ public class RunExecuteInspector
        }
 }
 
+//TODO: clarify what this class does
 public class RunChangeImage
 {
        public enum Types { NONE, RUNNING, PHOTOCELL }
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index b3885dc1e..80c554db0 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1020,9 +1020,13 @@ public class ForceSensorCapturePoints
        //startAtSample is to make algorithm more efficient
        public int GetSampleOrPreviousAtTimeUs (int us, int startAtSample)
        {
+               LogB.Information(string.Format("us {0}, startAtSample {1}, times.Count {2} ",
+                                       us, startAtSample, times.Count));
                int lastPos = startAtSample;
                for(int i = startAtSample; i < times.Count; i ++)
                {
+                       LogB.Information(string.Format("i {0}, times[i] {1}, lastPos {2}",
+                                               i, times[i], lastPos));
                        if(times[i] > us)
                                return lastPos;
 
@@ -1031,6 +1035,7 @@ public class ForceSensorCapturePoints
                                lastPos ++;
                }
 
+               LogB.Information(string.Format("lastPos {0}", lastPos));
                return lastPos;
        }
 
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 1dcf78e12..46b9de586 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -1,8 +1,35 @@
+/*
+al win7 virtualbox provant de comentar a
+void on_button_execute_test_clicked (object o, EventArgs args) 
+la línia:
+       chronopicRegisterUpdate(false);
+però aquí no he provat de executar amb aquesta línia descomentada
+
+val, així funciona i es pot canviar de simples a múltiples sense problema
+el problema és quan cliquem a dispositiu, que precisament crida a 
+       chronopicRegisterUpdate(false);
+llavors no es veu el dispositiu i ja no va més
+potser sí que és pq aquí ho captura un altre thread
+
+sense el chronopicRegisterUpdate, quan fem captura tot va bé.
+al canviar mode hi ha chronopicRegisterUpdate i tot va bé
+al clicar device, hi ha chronopicRegisterUpdate i falla
+crec que la diferència és que al canviar de mode, abans del chronopicRegisterUpdate hi ha un Disconnect
+
+per tant posar això abans del device hauria de funcionar, provar-ho
+if(photocellWirelessCapture != null && ArduinoCapture.PortOpened)
+       photocellWirelessCapture.Disconnect();
+
+a encoder de cursa també falla al anar a mode, i és pq li cal fer el disconnect a portRE igual que el de 
portFS
+a changeMode
+
+
 //La camera 1 va mes rapid que la 0, provar de canviar i activatr primer la 1 a veure que tal
 
 //- Arreglar problema de no coincidencia entre imatge mini i imatge gran, per exemple session6, atleta 1
 //- modo simulado curses 4 curses no acaba la ultima
 //TODO: que es pugui seleccionar si es vol una webcam o 2
+*/
 
 
 /*
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 442604e5d..b22473b15 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -1498,12 +1498,13 @@ public partial class ChronoJumpWindow
                force = 0;
                triggerCode = "";
 
+               LogB.Information("strA: " + str);
                //check if there is one and only one ';'
                if( ! (str.Contains(";") && str.IndexOf(";") == str.LastIndexOf(";")) )
                        return false;
 
                string [] strFull = str.Split(new char[] {';'});
-               //LogB.Information("str: " + str);
+               LogB.Information("strB: " + str);
 
                //LogB.Information("time: " + strFull[0]);
                if(! Util.IsNumber(Util.ChangeDecimalSeparator(strFull[0]), true))
@@ -2782,6 +2783,10 @@ LogB.Information(" fs R ");
                {
                        // 1) get the sample count (we will need it to know the force at that sample)
                        triggerSample = fscPoints.GetSampleOrPreviousAtTimeUs(trigger.Us, triggerSample);
+                               
+
+                       LogB.Information("triggerSample: "+  triggerSample.ToString());
+                       LogB.Information("fscPoints.Points.Count: "+  fscPoints.Points.Count.ToString());
 
                        forceSensorCaptureGraphDrawTrigger (trigger,
                                        
Convert.ToInt32(fscPoints.GetTimeInPx(Convert.ToInt32(fscPoints.GetTimeAtCount(triggerSample)))),
diff --git a/src/gui/app1/jumpsProfile.cs b/src/gui/app1/jumpsProfile.cs
index 4f0c2b539..4eb84b58a 100644
--- a/src/gui/app1/jumpsProfile.cs
+++ b/src/gui/app1/jumpsProfile.cs
@@ -83,7 +83,7 @@ public partial class ChronoJumpWindow
                        button_jumps_profile_save_image.Sensitive = true; //allow to save image without 
having all 5 indexes
                }
 
-               JumpsProfileGraph.Do(jumpsProfile.GetIndexes(), drawingarea_jumps_profile,
+               JumpsProfileGraph.Do(jumpsProfile.JumpsDone, jumpsProfile.GetIndexes(), 
drawingarea_jumps_profile,
                                currentPerson.Name, currentSession.DateShort, 
preferences.fontType.ToString());
        }
        private void on_drawingarea_jumps_profile_expose_event (object o, ExposeEventArgs args) 
diff --git a/src/gui/cairo/jumpsProfile.cs b/src/gui/cairo/jumpsProfile.cs
index 25981b6e1..769becd9d 100644
--- a/src/gui/cairo/jumpsProfile.cs
+++ b/src/gui/cairo/jumpsProfile.cs
@@ -53,7 +53,7 @@ public static class JumpsProfileGraph
                }
        }
 
-       public static void Do (List<JumpsProfileIndex> l_jpi, DrawingArea area,
+       public static void Do (List<JumpsProfile.YesNo> jumpsDone, List<JumpsProfileIndex> l_jpi, DrawingArea 
area,
                        string title, string date, string font)
        {
                //LogB.Information(string.Format("is area null: {0}", (area == null)));
@@ -66,7 +66,24 @@ public static class JumpsProfileGraph
                g.SetSourceRGB(1,1,1);
                g.Paint();
 
-               //3 calculate sum
+               //3 prepare font
+               g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
+               int textHeight = 12;
+               g.SetFontSize(textHeight);
+
+               //4 exit if needed jumps
+               foreach(JumpsProfile.YesNo jyn in jumpsDone)
+                       if(jyn == JumpsProfile.YesNo.NO)
+                       {
+                               g.SetSourceRGB(0,0,0);
+                               g.SetFontSize(16);
+                               printText(100, 100, 24, textHeight, Constants.JumpsProfileNeededJumpsStr(), 
g, false);
+                               g.GetTarget().Dispose ();
+                               g.Dispose ();
+                               return;
+                       }
+
+               //5 calculate sum
                //but is not needed, because sum has to be dja
                //so if we have sum = 1 we can plot grey areas when not all indexes are calculated
                //so later sum will be 1, now is ok to just show an error message
@@ -75,11 +92,7 @@ public static class JumpsProfileGraph
                        if(jpi.Result >= 0)
                                sum += jpi.Result;
 
-               //4 prepare font
-               g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
-               int textHeight = 12;
-               g.SetFontSize(textHeight);
-
+               /*
                if(sum == 0)
                {
                        g.SetSourceRGB(0,0,0);
@@ -89,8 +102,9 @@ public static class JumpsProfileGraph
                        g.Dispose ();
                        return;
                }
+               */
 
-               //5 plot arcs
+               //6 plot arcs
                if(sum > 0 )
                {
                        double acc = 0; //accumulated
@@ -121,7 +135,7 @@ public static class JumpsProfileGraph
                        g.Stroke ();
                }
 
-               //6 draw legend at right
+               //7 draw legend at right
                int legendX = findLegendTextXPos(l_jpi, sum, 400);
                int y = 40;
                //R seq(from=50,to=(350-24),length.out=5)
@@ -144,16 +158,19 @@ public static class JumpsProfileGraph
 
                //g.SelectFontFace(font, Cairo.FontSlant.Normal, Cairo.FontWeight.Normal);
        
-               //7 print errors (if any)
+               //8 print errors (if any)
                g.SetSourceRGB(0.5, 0, 0);
                y = 70;
                foreach(JumpsProfileIndex jpi in l_jpi) {
                        if(jpi.ErrorMessage != "")
+                       {
                                printText(legendX +12,  y, 24, textHeight, jpi.ErrorMessage, g, false);
+                               LogB.Information("ErrorMessage: " + jpi.ErrorMessage);
+                       }
                        y += 69;
                }
                
-               //8 dispose
+               //9 dispose
                g.GetTarget().Dispose ();
                g.Dispose ();
        }
diff --git a/src/networks.cs b/src/networks.cs
index aa703d93e..6cf3c2203 100644
--- a/src/networks.cs
+++ b/src/networks.cs
@@ -131,7 +131,9 @@ public class NetworksSendMail
                parameters.Add(email);
 
                //note redirect output and error is false because if redirect input there are problems 
redirecting the others
-               ExecuteProcess.Result execute_result = ExecuteProcess.run ("mail.mailutils", parameters, 
getBody(title), false, false);
+               //ExecuteProcess.Result execute_result = ExecuteProcess.run ("mail.mailutils", parameters, 
getBody(title), false, false);
+               //TODO: decide if mail.mailutils (maybe debian) or mailutils (maybe manjaro), maybe this has 
to be on chronojump_config.txt
+               ExecuteProcess.Result execute_result = ExecuteProcess.run ("mailutils", parameters, 
getBody(title), false, false);
                if(! execute_result.success) {
                        ErrorStr = "Need to install mail.mailutils";
                }


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