[chronojump] Selected device on discover is usable in any compatible mode (2)



commit d95cc6c76e868d6ea0dec4f0fa4fc8cda64db7a8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jul 11 11:24:20 2022 +0200

    Selected device on discover is usable in any compatible mode (2)

 src/gui/app1/chronojump.cs | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 39f0e1698..31ff205ee 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -3626,7 +3626,10 @@ public partial class ChronoJumpWindow
                hbox_drawingarea_realtime_capture_cairo.Visible = false;
                vbox_event_execute_drawingarea_run_interval_realtime_capture_cairo.Visible = false;
 
-               button_detect_show_hide (false);
+               if(chronopicRegister == null)
+                       chronopicRegisterUpdate(false);
+               chronopicRegister.ListSelectedForAllModes (); //debug
+               button_detect_show_hide (chronopicRegister.GetSelectedForMode (m).Port == "");
 
                //blank exercise options: useful for changing from jumps or runs to forceSensor, runEncoder, 
reaction time, other
                label_contacts_exercise_selected_name.Visible = true; //will not be visible when all the 
contacts_top combo is implemented
@@ -3646,8 +3649,6 @@ public partial class ChronoJumpWindow
 
                if(m == Constants.Modes.JUMPSSIMPLE || m == Constants.Modes.JUMPSREACTIVE)
                {
-                       button_detect_show_hide (true);
-
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        //notebook_capture_analyze.ShowTabs = true;
                        hbox_contacts_sup_capture_analyze_two_buttons.Visible = true;
@@ -3706,17 +3707,9 @@ public partial class ChronoJumpWindow
                        LogB.Information(string.Format("wireless conditions A: {0}, {1}",
                                cp2016.StoredWireless, chronopicRegister != null));
 
-                       if(chronopicRegister == null)
-                       {
-                               LogB.Information("Updating chronopicRegister to know if we have a wichro 
connected so we don't need 'Connected' at start");
-                               chronopicRegisterUpdate(false);
-                       }
-
                        LogB.Information(string.Format("wireless conditions B: {0}, {1}",
                                cp2016.StoredWireless, chronopicRegister != null));
 
-                       button_detect_show_hide (true);
-
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        //notebook_capture_analyze.ShowTabs = true;
                        hbox_contacts_sup_capture_analyze_two_buttons.Visible = true;
@@ -3776,7 +3769,6 @@ public partial class ChronoJumpWindow
                }
                else if (Constants.ModeIsENCODER (m))
                {
-                       button_detect_show_hide (true);
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.ENCODER);
 
 
@@ -3896,8 +3888,6 @@ public partial class ChronoJumpWindow
                } 
                else if(Constants.ModeIsFORCESENSOR (m))
                {
-                       button_detect_show_hide (true);
-
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        notebooks_change(m);
 
@@ -3944,8 +3934,6 @@ public partial class ChronoJumpWindow
                }
                else if(m == Constants.Modes.RUNSENCODER)
                {
-                       button_detect_show_hide (true);
-
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        notebooks_change(m);
 
@@ -4076,8 +4064,6 @@ public partial class ChronoJumpWindow
 
                SqlitePreferences.Update(SqlitePreferences.LastMode, m.ToString(), false);
 
-               chronopicRegisterUpdate(false);
-
                chronojumpWindowTestsNext();
 
                setLabelContactsExerciseSelectedOptions();


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