[chronojump] Wireless photocell can start inside and better widgets behaviour in all situations



commit 7005dbc042f818fee4c46947ad3215766310191e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 7 18:10:46 2021 +0200

    Wireless photocell can start inside and better widgets behaviour in all situations

 src/execute/event.cs |  7 ++++---
 src/execute/run.cs   | 20 +++++++++++---------
 2 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/execute/event.cs b/src/execute/event.cs
index c7959e93d..53fda7ba9 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -100,7 +100,7 @@ public class EventExecute
        //timer has a delegate that updates the time progressBar. 
        //It starts when the first event is detected
        //protected System.Timers.Timer timerClock = new System.Timers.Timer();    
-       protected double timerCount; // every 50 milliseconds: 
+       protected double timerCount; // every 50 milliseconds:
        protected DateTime timerStart; // used as timestamp to count better 
 
        protected Random rand;
@@ -442,16 +442,17 @@ public class EventExecute
                                if(events == -1) //we don't want to display nothing
                                        //progressbar.Text = "";
                                        label_value.Text = "";
-                               else 
+                               else
                                        label_value.Text = Math.Round(events,3).ToString();
                        } else {
                                //activity mode
                                progressbar.Pulse();
 
                                //pass -1 in events in activity mode if don't want to use this label
-                               if(events != -1)
+                               if(events != -1) {
                                        //label_value.Text = Util.TrimDecimals(events.ToString(), 1);
                                        label_value.Text = Math.Round(events,3).ToString();
+                               }
                        }
                }
        }
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 7fc224989..64165c5c4 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -196,7 +196,9 @@ public class RunExecute : EventExecute
                Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
 
-               //runPhase = runPhases.START_WIRELESS_UNKNOWN;
+               //runPhase = runPhases.START_WIRELESS_UNKNOWN; //done before
+
+               /*
                //provem de forçar a que comencem en off, a veure si va be
                platformState = Chronopic.Plataforma.OFF;
                if (platformState==Chronopic.Plataforma.OFF) {
@@ -209,6 +211,7 @@ public class RunExecute : EventExecute
                        runPhase = runPhases.PRE_RUNNING;
                        runChangeImage.Current = RunChangeImage.Types.RUNNING;
                }
+               */
        }
 
        private void manageIniNotWireless()
@@ -319,6 +322,7 @@ LogB.Information("going to call photocellWirelessCapture.CaptureStart ()");
                {
                        feedbackMessage = Catalog.GetString("Please, wait!");
                        needShowFeedbackMessage = true;
+                       runPhase = runPhases.START_WIRELESS_UNKNOWN;
                        //photocellWirelessCapture = new PhotocellWirelessCapture(wirelessPort);
                        photocellWirelessCapture.Reset(wirelessPort);
                        photocellWirelessCapture.CaptureStart ();
@@ -443,11 +447,11 @@ LogB.Information("going to call photocellWirelessCapture.CaptureStart ()");
                                        //it has confirmed that first phase is PLATFORM_INI_YES/NO_TIME
                                        if(wireless && runPhase == runPhases.START_WIRELESS_UNKNOWN)
                                        {
-                                               if(speedStartArrival || measureReactionTime)
-                                                       runPhase = runPhases.PLATFORM_INI_YES_TIME;
-                                               else
-                                                       runPhase = runPhases.PLATFORM_INI_NO_TIME;
-
+                                               /*
+                                                  on wireless if we are still on unknown, change to 
INI_NO_TIME
+                                                  as we cannot know how much time we were on the platform, 
so INI_YES_TIME will be not aplicable
+                                                  */
+                                               runPhase = runPhases.PLATFORM_INI_NO_TIME;
                                                startIn = true;
                                        }
 
@@ -776,8 +780,7 @@ LogB.Information("going to call photocellWirelessCapture.CaptureStart ()");
                                myTimeValue = timerCount; //show time from the timerCount
                                break;
                }
-                               
-               
+
                //has no finished, but move progressbar time
                progressBarEventOrTimePreExecution(
                                false, //isEvent false: time
@@ -1218,7 +1221,6 @@ public class RunIntervalExecute : RunExecute
                                myTimeValue = timerCount; //show time from the timerCount
                                break;
                }
-                       
                if(! finish) 
                        progressBarEventOrTimePreExecution(
                                        false, //isEvent false: time


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