[chronojump] When Chronopic gets disconnected, next test is managed simulated without crash



commit 9a1421871ce777dd2aef3a0cbb4c6537e9e277c7
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jul 22 14:27:07 2014 +0200

    When Chronopic gets disconnected, next test is managed simulated without crash

 src/execute/run.cs    |   22 ++++++++++------------
 src/gui/chronojump.cs |    9 ++++++++-
 src/gui/chronopic.cs  |    4 ++++
 3 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/src/execute/run.cs b/src/execute/run.cs
index be4ea7f..00073d4 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -113,8 +113,8 @@ public class RunExecute : EventExecute
        
        public override void Manage()
        {
-Log.WriteLine("MANAGE!!!!");
-                       
+               Log.WriteLine("MANAGE!!!!");
+
                //boolean to know if chronopic has been disconnected    
                chronopicDisconnected = false;
 
@@ -122,9 +122,9 @@ Log.WriteLine("MANAGE!!!!");
                        platformState = Chronopic.Plataforma.ON;
                else
                        platformState = chronopicInitialValue(cp);
-
-Log.WriteLine("MANAGE(b)!!!!");
                
+               Log.WriteLine("MANAGE(b)!!!!");
+
                //you can start ON or OFF the platform, 
                //we record always de TF (or time between we abandonate the platform since we arrive)
                if (platformState==Chronopic.Plataforma.ON) {
@@ -176,13 +176,12 @@ Log.WriteLine("MANAGE(b)!!!!");
                cancel = false;
                totallyCancelled = false;
 
-
-Log.WriteLine("MANAGE(2)!!!!");
+               Log.WriteLine("MANAGE(2)!!!!");
                //start thread
                thread = new Thread(new ThreadStart(waitEvent));
                GLib.Idle.Add (new GLib.IdleHandler (PulseGTK));
                thread.Start(); 
-Log.WriteLine("MANAGE(3)!!!!");
+               Log.WriteLine("MANAGE(3)!!!!");
        }
        
        protected override void waitEvent ()
@@ -205,7 +204,7 @@ Log.WriteLine("MANAGE(3)!!!!");
                        
                        //if (ok) {
                        if (ok && !cancel) {
-//Log.WriteLine("timestamp:" + timestamp);
+                               //Log.WriteLine("timestamp:" + timestamp);
                                if (platformState == Chronopic.Plataforma.ON && loggedState == States.OFF) {
                                        //has arrived
                                        loggedState = States.ON;
@@ -970,8 +969,8 @@ public class RunIntervalExecute : RunExecute
                        needEndEvent = true; //used for hiding some buttons on eventWindow, and also for 
updateTimeProgressBar here
                }
        }
-
-/*
+       
+       /*
        public string IntervalTimesString
        {
                get { return intervalTimesString; }
@@ -1022,8 +1021,7 @@ public class RunIntervalExecute : RunExecute
                        //      return (distanceTotal / timeTotal) * 3.6 ; 
                }
        }
-*/
-       
+       */
                
                
        ~RunIntervalExecute() {}
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 37580cf..7457ec6 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3704,7 +3704,7 @@ Console.WriteLine("X");
                
                if( currentJumpType.StartIn ) 
                        currentEventExecute.Manage();
-                else 
+               else 
                        currentEventExecute.ManageFall();
                
                thisJumpIsSimple = true; //used by: on_event_execute_update_graph_in_progress_clicked
@@ -3776,6 +3776,7 @@ Log.WriteLine("DDD 1");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -3953,6 +3954,7 @@ Log.WriteLine("DDD 2");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -4093,6 +4095,7 @@ Log.WriteLine("DDD 2");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -4237,6 +4240,7 @@ Log.WriteLine("DDD 2");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -4336,6 +4340,7 @@ Log.WriteLine("DDD 2");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -4465,6 +4470,7 @@ Log.WriteLine("DDD 2");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                
                if (currentEventExecute.Cancel)
@@ -4735,6 +4741,7 @@ Console.WriteLine("X");
                else if( currentEventExecute.ChronopicDisconnected ) {
                        Log.WriteLine("DISCONNECTED gui/cj");
                        createChronopicWindow(true);
+                       chronopicWin.Connected = false;
                }
                if (currentEventExecute.Cancel)
                        sensitiveGuiEventDone();
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 8b090fc..7a32566 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -321,6 +321,9 @@ Log.WriteLine("bbb");
                                        myCPD.Add(b);
                                }
                                Create (myCPD, encoderPort, true, volumeOn);
+                               
+                               connected = false;
+                               
                                new DialogMessage(Constants.MessageTypes.WARNING, 
                                                Catalog.GetString("One or more Chronopics have been 
disconnected.") + "\n" + 
                                                Catalog.GetString("Please connect again, and configure on 
Chronopic window."));
@@ -934,6 +937,7 @@ Log.WriteLine("bbb");
        //connected to a Chronopic      
        public bool Connected {
                get { return connected; }
+               set { connected = value; }
        }
        
        public Button FakeWindowDone {


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