[chronojump] starting gui for reaction time on runs



commit caacbe9f7846ea656ff66b1b40fd31527a7ba1ab
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 5 17:12:48 2018 +0100

    starting gui for reaction time on runs

 glade/app1.glade            |  117 ++++++++++++++++++++++++++++++++++++++++---
 glade/preferences_win.glade |   31 +-----------
 src/gui/chronojumpIcons.cs  |    4 ++
 src/gui/run.cs              |   35 +++++++++++++
 4 files changed, 149 insertions(+), 38 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 16ab3b3..e786b8f 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1530,6 +1530,9 @@
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_start_selector_jumps">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -6540,6 +6543,12 @@ EncoderInertialCapture</property>
                                                             <widget class="GtkHBox" id="hbox162">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">25</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox28">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
                                                             <widget class="GtkLabel" 
id="extra_window_runs_label_distance">
                                                             <property name="can_focus">False</property>
@@ -6552,11 +6561,6 @@ EncoderInertialCapture</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox28">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
                                                             <widget class="GtkSpinButton" 
id="extra_window_runs_spinbutton_distance">
                                                             <property name="can_focus">True</property>
                                                             <property name="invisible_char">●</property>
@@ -6575,7 +6579,7 @@ EncoderInertialCapture</property>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
                                                             <property name="padding">12</property>
-                                                            <property name="position">0</property>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             <child>
@@ -6586,6 +6590,53 @@ EncoderInertialCapture</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox239">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" 
id="check_run_simple_with_reaction_time">
+                                                            <property name="label" 
translatable="yes">Measure reaction time</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="clicked" 
handler="on_check_run_simple_with_reaction_time_clicked" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_run_simple_with_reaction_time_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_run_with_reaction_time_help_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_run_simple_with_reaction_time_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -6599,7 +6650,7 @@ EncoderInertialCapture</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
-                                                            <property name="fill">True</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
@@ -6768,13 +6819,60 @@ EncoderInertialCapture</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox245">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" 
id="check_run_interval_with_reaction_time">
+                                                            <property name="label" 
translatable="yes">Measure reaction time</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="clicked" 
handler="on_check_run_interval_with_reaction_time_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
+                                                            <property name="expand">True</property>
                                                             <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_run_interval_with_reaction_time_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_run_with_reaction_time_help_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_run_interval_with_reaction_time_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">3</property>
@@ -22641,6 +22739,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index f767760..8febce2 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -2647,35 +2647,6 @@ It starts before and arrives there with some speed.</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkHBox" id="hbox29">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">10</property>
-                            <child>
-                              <widget class="GtkCheckButton" id="check_encoder_capture_cut_by_triggers">
-                                <property name="label" translatable="yes">Cut sets into repetitions using 
triggers</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="draw_indicator">True</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <placeholder/>
-                            </child>
-                          </widget>
-                          <packing>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
-                            <property name="position">5</property>
-                          </packing>
-                        </child>
-                        <child>
                           <widget class="GtkFrame" id="frame9">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
@@ -2920,7 +2891,7 @@ It starts before and arrives there with some speed.</property>
                           <packing>
                             <property name="expand">True</property>
                             <property name="fill">True</property>
-                            <property name="position">6</property>
+                            <property name="position">5</property>
                           </packing>
                         </child>
                       </widget>
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index e4138d4..4947b12 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -61,6 +61,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_info2;
        [Widget] Gtk.Image image_info3;
        [Widget] Gtk.Image image_info4;
+       [Widget] Gtk.Image image_run_simple_with_reaction_time_help;
+       [Widget] Gtk.Image image_run_interval_with_reaction_time_help;
        [Widget] Gtk.Image image_info_sessions_info;
        [Widget] Gtk.Image image_add_test1;
        [Widget] Gtk.Image image_add_test2;
@@ -215,6 +217,8 @@ public partial class ChronoJumpWindow
                image_info2.Pixbuf = pixbuf;
                image_info3.Pixbuf = pixbuf;
                image_info4.Pixbuf = pixbuf;
+               image_run_simple_with_reaction_time_help.Pixbuf = pixbuf;
+               image_run_interval_with_reaction_time_help.Pixbuf = pixbuf;
                image_info_sessions_info.Pixbuf = pixbuf;
                image_encoder_1RM_info.Pixbuf = pixbuf;
                image_force_sensor_adjust_help.Pixbuf = pixbuf;
diff --git a/src/gui/run.cs b/src/gui/run.cs
index b9f3cea..744a5b3 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -901,6 +901,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Label extra_window_runs_label_distance;
        [Widget] Gtk.SpinButton extra_window_runs_spinbutton_distance;
        [Widget] Gtk.Label extra_window_runs_label_distance_units;
+       [Widget] Gtk.CheckButton check_run_simple_with_reaction_time;
        
        //options runs interval
        [Widget] Gtk.Label extra_window_runs_interval_label_distance;
@@ -909,6 +910,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Label extra_window_runs_interval_label_limit;
        [Widget] Gtk.SpinButton extra_window_runs_interval_spinbutton_limit;
        [Widget] Gtk.Label extra_window_runs_interval_label_limit_units;
+       [Widget] Gtk.CheckButton check_run_interval_with_reaction_time;
        
 
        double extra_window_runs_distance = 100;
@@ -1152,6 +1154,39 @@ public partial class ChronoJumpWindow
                extra_window_runs_interval_label_limit_units.Sensitive = sensitive;
        }
 
+       private bool changingCheckboxesRunWithReactionTime = false;
+       private void on_check_run_simple_with_reaction_time_clicked (object o, EventArgs args)
+       {
+               //avoid cyclic calls
+               if(changingCheckboxesRunWithReactionTime)
+                       return;
+
+               changingCheckboxesRunWithReactionTime = true;
+               check_run_interval_with_reaction_time.Active = check_run_simple_with_reaction_time.Active;
+               changingCheckboxesRunWithReactionTime = false;
+       }
+       private void on_check_run_interval_with_reaction_time_clicked (object o, EventArgs args)
+       {
+               //avoid cyclic calls
+               if(changingCheckboxesRunWithReactionTime)
+                       return;
+
+               changingCheckboxesRunWithReactionTime = true;
+               check_run_simple_with_reaction_time.Active = check_run_interval_with_reaction_time.Active;
+               changingCheckboxesRunWithReactionTime = false;
+       }
+
+       //valid for simple and for intervallic
+       private void on_button_run_with_reaction_time_help_clicked (object o, EventArgs args)
+       {
+               new DialogMessage(Constants.MessageTypes.INFO,
+                               "TODO" +
+                               "\nneed new device (introduce name)" +
+                               "\ntest will start when person is at start pad and push button is pressed" +
+                               "\nreaction time will be in ms and as a comment on Description"
+                               );
+       }
+
 }
 
 


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