[chronojump] combo_select_contacts_top implemented for forceSensor



commit 88499f7d0c76402d9bec7a31a45bb5309d41b2fc
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Aug 2 11:14:22 2021 +0200

    combo_select_contacts_top implemented for forceSensor

 src/gui/app1/chronojump.cs       | 35 +++++++++++++++++++++++++----------
 src/gui/app1/contactsExercise.cs |  8 ++++++++
 src/gui/app1/forceSensor.cs      | 18 ++++++++++++++++++
 3 files changed, 51 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 850d99320..56f380669 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -819,7 +819,7 @@ public partial class ChronoJumpWindow
 
                        if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode == 
Constants.Modes.JUMPSREACTIVE ||
                                        current_mode == Constants.Modes.RUNSSIMPLE || current_mode == 
Constants.Modes.RUNSINTERVALLIC ||
-                                       current_mode == Constants.Modes.RUNSENCODER)
+                                       current_mode == Constants.Modes.RUNSENCODER || current_mode == 
Constants.Modes.FORCESENSOR)
                                createComboSelectContactsTop (true);
                }
 
@@ -2232,23 +2232,32 @@ public partial class ChronoJumpWindow
                                combo_select_contacts_top.Active = combo_select_runs_interval.Active;
                                combo_select_contacts_top.Sensitive = true;
                        }
-                       else if(current_mode == Constants.Modes.RUNSENCODER)
+                       else if(current_mode == Constants.Modes.RUNSENCODER || current_mode == 
Constants.Modes.FORCESENSOR)
                        {
                                if(combo_select_contacts_top == null)
                                        combo_select_contacts_top = ComboBox.NewText ();
 
-                               //copy the values form combo_run_encoder_exercise
-                               UtilGtk.ComboUpdate(combo_select_contacts_top,
-                                               UtilGtk.ComboGetValues (combo_run_encoder_exercise), "");
-                               combo_select_contacts_top.Active = combo_run_encoder_exercise.Active;
-                               combo_select_contacts_top.Sensitive = true;
+                               //copy the values form combo_run_encoder_exercise or 
combo_force_sensor_exercise
+                               if(current_mode == Constants.Modes.RUNSENCODER)
+                               {
+                                       UtilGtk.ComboUpdate(combo_select_contacts_top,
+                                                       UtilGtk.ComboGetValues (combo_run_encoder_exercise), 
"");
+                                       combo_select_contacts_top.Active = combo_run_encoder_exercise.Active;
+                               }
+                               else //(current_mode == Constants.Modes.FORCESENSOR)
+                               {
+                                       UtilGtk.ComboUpdate(combo_select_contacts_top,
+                                                       UtilGtk.ComboGetValues (combo_force_sensor_exercise), 
"");
+                                       combo_select_contacts_top.Active = combo_force_sensor_exercise.Active;
+                               }
 
+                               combo_select_contacts_top.Sensitive = true;
                                hbox_combo_select_contacts_top.PackStart(combo_select_contacts_top, true, 
true, 0);
                                hbox_combo_select_contacts_top.ShowAll();
                        }
                        /*
                        TODO:
-                       //else if(current_mode == Constants.Modes.FORCESENSOR)
+                       //other modes
                        //{
                        //}
                        ...
@@ -2320,7 +2329,7 @@ public partial class ChronoJumpWindow
 
                if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode == 
Constants.Modes.JUMPSREACTIVE ||
                                current_mode == Constants.Modes.RUNSSIMPLE || current_mode == 
Constants.Modes.RUNSINTERVALLIC ||
-                               current_mode == Constants.Modes.RUNSENCODER)
+                               current_mode == Constants.Modes.RUNSENCODER || current_mode == 
Constants.Modes.FORCESENSOR)
                {
                        button_combo_select_contacts_top_left.Sensitive = (combo.Active > 0);
                        button_combo_select_contacts_top_right.Sensitive = true;
@@ -2336,7 +2345,7 @@ public partial class ChronoJumpWindow
 
                if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode == 
Constants.Modes.JUMPSREACTIVE ||
                                current_mode == Constants.Modes.RUNSSIMPLE || current_mode == 
Constants.Modes.RUNSINTERVALLIC ||
-                               current_mode == Constants.Modes.RUNSENCODER)
+                               current_mode == Constants.Modes.RUNSENCODER || current_mode == 
Constants.Modes.FORCESENSOR)
                {
                        button_combo_select_contacts_top_left.Sensitive = true;
                        button_combo_select_contacts_top_right.Sensitive = ! isLast;
@@ -2435,6 +2444,8 @@ public partial class ChronoJumpWindow
                        on_combo_select_runs_interval_changed(o, args);
                else if(current_mode == Constants.Modes.RUNSENCODER)
                        on_combo_run_encoder_exercise_changed(o, args);
+               else if(current_mode == Constants.Modes.FORCESENSOR)
+                       on_combo_force_sensor_exercise_changed(o, args);
        }
 
        private void on_combo_select_jumps_changed(object o, EventArgs args)
@@ -3756,6 +3767,10 @@ public partial class ChronoJumpWindow
                        image_top_laterality_contacts.Visible = true;
                        setForceSensorLateralityPixbuf();
 
+                       createComboSelectContactsTop (true);
+                       label_contacts_exercise_selected_name.Visible = false;
+                       hbox_combo_select_contacts_top_with_arrows.Visible = true; //this will be unneded
+
                        pixbufModeCurrent = new Pixbuf (null, Util.GetImagePath(false) + 
"force_sensor_icon.png");
                        pixbufModeGrid = new Pixbuf (null, Util.GetImagePath(false) + 
"image_modes_force.png");
                }
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index 16e8bed96..a319d6743 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -285,6 +285,10 @@ public partial class ChronoJumpWindow
                        contacts_exercise_left_button (combo_run_encoder_exercise,
                                        button_combo_run_encoder_exercise_capture_left,
                                        button_combo_run_encoder_exercise_capture_right);
+               else if(current_mode == Constants.Modes.FORCESENSOR)
+                       contacts_exercise_left_button (combo_force_sensor_exercise,
+                                       button_combo_force_sensor_exercise_capture_left,
+                                       button_combo_force_sensor_exercise_capture_right);
        }
        private void on_button_combo_select_contacts_top_right_clicked (object o, EventArgs args)
        {
@@ -308,5 +312,9 @@ public partial class ChronoJumpWindow
                        contacts_exercise_right_button (combo_run_encoder_exercise,
                                        button_combo_run_encoder_exercise_capture_left,
                                        button_combo_run_encoder_exercise_capture_right);
+               else if(current_mode == Constants.Modes.FORCESENSOR)
+                       contacts_exercise_right_button (combo_force_sensor_exercise,
+                                       button_combo_force_sensor_exercise_capture_left,
+                                       button_combo_force_sensor_exercise_capture_right);
        }
 }
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index f750f77b7..7bb0c97af 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -3046,6 +3046,22 @@ LogB.Information(" fs R ");
 
        private void on_combo_force_sensor_exercise_changed (object o, EventArgs args)
        {
+               ComboBox combo = o as ComboBox;
+               if (o == null)
+                       return;
+
+               //two combobox are linked ---->
+               if(comboSelectContactsTopNoFollow)
+                       return;
+
+               comboSelectContactsTopNoFollow = true;
+               if (o == combo_force_sensor_exercise)
+                       combo_select_contacts_top.Active = combo_force_sensor_exercise.Active;
+               else if (o == combo_select_contacts_top)
+                       combo_force_sensor_exercise.Active = combo_select_contacts_top.Active;
+               comboSelectContactsTopNoFollow = false;
+               //<---- two combobox are linked
+
                ArrayList array = SqliteForceSensorExercise.Select (
                                 false, getExerciseIDFromAnyCombo(
                                        combo_force_sensor_exercise, forceSensorComboExercisesString, false), 
false );
@@ -3086,6 +3102,8 @@ LogB.Information(" fs R ");
                //sensitivity of left/right buttons
                button_combo_force_sensor_exercise_capture_left.Sensitive = 
(combo_force_sensor_exercise.Active > 0);
                button_combo_force_sensor_exercise_capture_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_force_sensor_exercise);
+               button_combo_select_contacts_top_left.Sensitive = (combo_force_sensor_exercise.Active > 0);
+               button_combo_select_contacts_top_right.Sensitive = ! 
UtilGtk.ComboSelectedIsLast(combo_force_sensor_exercise);
 
                setLabelContactsExerciseSelected(Catalog.GetString(fse.Name) + isElasticStr);
                combo_force_sensor_button_sensitive_exercise(true);


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