[chronojump] At force sensor top options: show elastic/not elastic on top and laterality



commit 72c1bb301df57a2fb635aef6dfa106968135bda7
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Oct 6 17:52:09 2020 +0200

    At force sensor top options: show elastic/not elastic on top and laterality

 glade/app1.glade                 | 33 +++++++++++++++++++++------------
 src/gui/app1/chronojump.cs       |  6 +++++-
 src/gui/app1/contactsExercise.cs | 13 +++++++++++++
 src/gui/app1/forceSensor.cs      | 12 +++++++++++-
 4 files changed, 50 insertions(+), 14 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index e59e5cd8..c8f5f8a1 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -14660,6 +14660,7 @@ EncoderInertialCapture</property>
                                                             <property name="tooltip" 
translatable="yes">Both</property>
                                                             <property name="active">True</property>
                                                             <property name="draw_indicator">False</property>
+                                                            <signal name="toggled" 
handler="on_radio_force_sensor_laterality_toggled" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox303">
                                                             <property name="visible">True</property>
@@ -14706,6 +14707,7 @@ EncoderInertialCapture</property>
                                                             <property name="tooltip" 
translatable="yes">Left</property>
                                                             <property name="draw_indicator">False</property>
                                                             <property 
name="group">radio_force_sensor_laterality_both</property>
+                                                            <signal name="toggled" 
handler="on_radio_force_sensor_laterality_toggled" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox304">
                                                             <property name="visible">True</property>
@@ -14752,6 +14754,7 @@ EncoderInertialCapture</property>
                                                             <property name="tooltip" 
translatable="yes">Right</property>
                                                             <property name="draw_indicator">False</property>
                                                             <property 
name="group">radio_force_sensor_laterality_both</property>
+                                                            <signal name="toggled" 
handler="on_radio_force_sensor_laterality_toggled" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox305">
                                                             <property name="visible">True</property>
@@ -24996,6 +24999,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27852,18 +27858,6 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -27900,6 +27894,18 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -35979,6 +35985,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 1fecf60c..9156ccd0 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -3206,7 +3206,11 @@ public partial class ChronoJumpWindow
                        //on force sensor only show table
                        notebook_capture_graph_table.CurrentPage = 1; //"Show table"
                        notebook_capture_graph_table.ShowTabs = false;
-                       setLabelContactsExerciseSelected(m);
+
+                       //setLabelContactsExerciseSelected(m);
+                       //better use the followin so we will have the Elastic/not elastic display on mode 
change
+                       on_combo_force_sensor_exercise_changed (new object(), new EventArgs ());
+                       setLabelContactsExerciseSelectedOptionsForceSensor();
 
                        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 74a13af9..025540e9 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -237,4 +237,17 @@ public partial class ChronoJumpWindow
 
                label_contacts_exercise_selected_options.Text = name;
        }
+
+       private void setLabelContactsExerciseSelectedOptionsForceSensor()
+       {
+               string name = Catalog.GetString("Laterality:");
+               if(radio_force_sensor_laterality_l.Active)
+                       name += " " + Catalog.GetString("Left");
+               else if(radio_force_sensor_laterality_r.Active)
+                       name += " " + Catalog.GetString("Right");
+               else //if(radio_force_sensor_laterality_both.Active) //default to both
+                       name += " " + Catalog.GetString("Both");
+
+               label_contacts_exercise_selected_options.Text = name;
+       }
 }
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 7e9db39b..2b727c1d 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -2611,7 +2611,12 @@ LogB.Information(" fs R ");
                        changeTestImage("", "", "FORCESENSOR_NOT_ELASTIC");
                        image_button_force_sensor_stiffness_problem.Visible = false;
                }
-               setLabelContactsExerciseSelected(Catalog.GetString(fse.Name));
+
+               string isElasticStr = " (" + Catalog.GetString("Elastic") + ")";
+               if(! fse.ComputeAsElastic)
+                       isElasticStr = " (" + Catalog.GetString("Not elastic") + ")";
+
+               setLabelContactsExerciseSelected(Catalog.GetString(fse.Name) + isElasticStr);
                combo_force_sensor_button_sensitive_exercise(true);
        }
 
@@ -2827,6 +2832,11 @@ LogB.Information(" fs R ");
                                Catalog.GetString(ForceSensor.GetCaptureOptionsString(co)));
        }
 
+       private void on_radio_force_sensor_laterality_toggled (object o, EventArgs args)
+       {
+               setLabelContactsExerciseSelectedOptionsForceSensor();
+       }
+
        private string getLaterality(bool translated)
        {
                string lat = "";


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