[chronojump] runs interval for compujump done! (NEED TESTS)



commit 65961f386fca48ac7ad538422ae45ddc4db6a7a0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jul 9 13:28:22 2017 +0200

    runs interval for compujump done! (NEED TESTS)

 glade/app1.glade           |  123 +++++++++++++++++++++++++++++++++++++++++++-
 howto_compujump_client.txt |   18 +++++--
 src/gui/networks.cs        |   48 +++++++++++++++++
 3 files changed, 182 insertions(+), 7 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 7121bbc..be4ccc0 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1337,6 +1337,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>
@@ -4072,12 +4075,16 @@ EncoderInertialCapture</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox4">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
                                                             <widget class="GtkHBox" id="hbox_runs_interval">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">20</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox4">
+                                                            <widget class="GtkHBox" id="hbox16">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">8</property>
@@ -4252,6 +4259,115 @@ EncoderInertialCapture</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" 
id="hbox_runs_interval_compujump">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">30</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label90">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Races:</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHButtonBox" 
id="hbuttonbox_runs_interval_compujump">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">30</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_run_interval_compujump_5m">
+                                                            <property name="label" translatable="yes">5 
m</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <signal name="toggled" 
handler="on_run_interval_compujump_type_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_run_interval_compujump_10m">
+                                                            <property name="label" translatable="yes">10 
m</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_run_interval_compujump_5m</property>
+                                                            <signal name="toggled" 
handler="on_run_interval_compujump_type_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_run_interval_compujump_15m">
+                                                            <property name="label" translatable="yes">15 
m</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_run_interval_compujump_5m</property>
+                                                            <signal name="toggled" 
handler="on_run_interval_compujump_type_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_run_interval_compujump_20m">
+                                                            <property name="label" translatable="yes">20 
m</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_run_interval_compujump_5m</property>
+                                                            <signal name="toggled" 
handler="on_run_interval_compujump_type_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">3</property>
+                                                            </packing>
+                                                            </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">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                           </widget>
@@ -17302,7 +17418,7 @@ then click this button.</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="relief">half</property>
                                                             <signal name="clicked" 
handler="on_button_encoder_inertial_calibrate_close_clicked" swapped="no"/>
-                                                           <accelerator key="Escape" signal="clicked"/>
+                                                            <accelerator key="Escape" signal="clicked"/>
                                                             <child>
                                                             <widget class="GtkLabel" id="label89">
                                                             <property name="visible">True</property>
@@ -20839,6 +20955,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/howto_compujump_client.txt b/howto_compujump_client.txt
index b8dbebc..902121c 100644
--- a/howto_compujump_client.txt
+++ b/howto_compujump_client.txt
@@ -25,14 +25,22 @@ $groups
 $ sqlite3 .local/share/Chronojump/chronojump.db
 delete from encoderExercise;
 
-11) also ensure there are no persons
+11) delete runInterval exercises. And Add these:
+
+delete from runIntervalType;
+insert into runIntervalType VALUES(1, "5 m", 5.0, 1, 1, 0, "", "");
+insert into runIntervalType VALUES(2, "10 m", 10.0, 1, 2, 0, "", "");
+insert into runIntervalType VALUES(3, "15 m", 15.0, 1, 3, 0, "", "");
+insert into runIntervalType VALUES(4, "20 m", 20.0, 1, 4, 0, "", "");
+
+12) also ensure there are no persons
 
 select * from person77;
 select * from personSession77;
 
 .quit
 
-12) Copy this chronojump_config.txt on .local/share/Chronojump
+13) Copy this chronojump_config.txt on .local/share/Chronojump
 
 #Session modes:
 SessionMode=MONTHLY
@@ -47,7 +55,7 @@ CompujumpStationID=1
 #will start on this mode and could not be changed
 CompujumpStationMode=POWERGRAVITATORY
 
-13) Change CompujumpServerURL or CompujumpStationID or CompujumpStationMode.
+14) Change CompujumpServerURL or CompujumpStationID or CompujumpStationMode.
     Remember SPACES are NOT allowed immediatelly before or after '='
-14) Open Chronojump
-15) Select preferences (Encoder capture main variable (mean speed?), font size..)
+15) Open Chronojump
+16) Select preferences (Encoder capture main variable (mean speed?), font size..)
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 78f5bc5..8c72fde 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -68,6 +68,13 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Notebook notebook_encoder_capture_main;
        [Widget] Gtk.VBox vbox_treeview_encoder_at_second_page;
 
+       //runsInterval
+       [Widget] Gtk.HBox hbox_runs_interval_compujump;
+       [Widget] Gtk.RadioButton radio_run_interval_compujump_5m;
+       [Widget] Gtk.RadioButton radio_run_interval_compujump_10m;
+       [Widget] Gtk.RadioButton radio_run_interval_compujump_15m;
+       [Widget] Gtk.RadioButton radio_run_interval_compujump_20m;
+
        //shown when menu is hidden
        [Widget] Gtk.HBox hbox_menu_and_preferences_outside_menu_contacts;
        [Widget] Gtk.HBox hbox_menu_and_preferences_outside_menu_encoder;
@@ -129,6 +136,9 @@ public partial class ChronoJumpWindow
                                else //if(configChronojump.CompujumpStationMode == 
Constants.Menuitem_modes.POWERINERTIAL)
                                        on_button_selector_start_encoder_inertial_clicked(new object (), new 
EventArgs());
 
+                               hbox_runs_interval.Visible = false;
+                               hbox_runs_interval_compujump.Visible = true;
+
                                menuitem_mode.Visible = false;
                                button_menu_outside_menu.Visible = false;
                                button_menu_outside_menu1.Visible = false;
@@ -635,6 +645,44 @@ public partial class ChronoJumpWindow
                dialogPersonPopup.DestroyDialog();
                LogB.Information("Selected task from gui/networks.cs:" + task.ToString());
 
+               if(configChronojump.CompujumpStationMode == Constants.Menuitem_modes.RUNSINTERVALLIC)
+                       compujumpTaskStartRunInterval(task);
+               else
+                       compujumpTaskStartEncoder(task);
+       }
+
+       private void on_run_interval_compujump_type_toggled(object o, EventArgs args)
+       {
+               RadioButton radio = o as RadioButton;
+               if (o == null)
+                       return;
+
+               if(radio == radio_run_interval_compujump_5m)
+                       combo_select_runs_interval.Active = 0;
+               else if(radio == radio_run_interval_compujump_10m)
+                       combo_select_runs_interval.Active = 1;
+               else if(radio == radio_run_interval_compujump_15m)
+                       combo_select_runs_interval.Active = 2;
+               else //if(radio == radio_run_interval_compujump_20m)
+                       combo_select_runs_interval.Active = 3;
+       }
+
+       private void compujumpTaskStartRunInterval(Task task)
+       {
+               if(task.ExerciseName == "5 m" || task.ExerciseName == "05 m")
+                       radio_run_interval_compujump_5m.Active = true;
+               else if(task.ExerciseName == "10 m")
+                       radio_run_interval_compujump_10m.Active = true;
+               else if(task.ExerciseName == "15 m")
+                       radio_run_interval_compujump_15m.Active = true;
+               else // if(task.ExerciseName == "20 m")
+                       radio_run_interval_compujump_20m.Active = true;
+
+               on_button_execute_test_clicked(new object(), new EventArgs());
+       }
+
+       private void compujumpTaskStartEncoder(Task task)
+       {
                combo_encoder_exercise_capture.Active = 
UtilGtk.ComboMakeActive(combo_encoder_exercise_capture, task.ExerciseName);
 
                //laterality


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