[chronojump] Change from gravitatory<->inertial, blanks interface



commit 36b3fb21a258b19769e946138aa038e4936ab2b0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Aug 4 12:10:07 2016 +0200

    Change from gravitatory<->inertial, blanks interface

 src/gui/chronojump.cs |   11 +++++++++++
 src/gui/encoder.cs    |   45 ++++++++++++++-------------------------------
 2 files changed, 25 insertions(+), 31 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 47de91e..3b68506 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3133,6 +3133,17 @@ public partial class ChronoJumpWindow
 
                        notebook_sup.CurrentPage = 1;
 
+
+                       /*
+                        * If there's a signal on gravitatory and we move to inertial, 
+                        * interface has to change to YESPERSON (meaning no_signal).
+                        * But, if there's no person shoud continue on NOPERSON
+                        */
+                       if(selectRowTreeView_persons(treeview_persons, treeview_persons_store, 0))
+                               encoderButtonsSensitive(encoderSensEnum.YESPERSON);
+                       
+                       blankEncoderInterface();
+
                        bool changed = false;
                        if(m == Constants.Menuitem_modes.POWERGRAVITATORY) {
                                menuitem_mode_selected_power_gravitatory.Visible = true;
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 5bfc352..12242f7 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -3709,41 +3709,27 @@ public partial class ChronoJumpWindow
        /* sensitivity stuff */ 
                        
        //called when a person changes
-       private void encoderPersonChanged() {
-               //TODO
-               /*
-               ArrayList data = SqliteEncoder.Select(
-                               false, -1, currentPerson.UniqueID, currentSession.UniqueID, -1,
-                               "curve", EncoderSQL.Eccons.ALL, 
-                               false, true);
+       private void encoderPersonChanged() 
+       {
+               encoderButtonsSensitive(encoderSensEnum.YESPERSON);
                
-               int activeCurvesNum = UtilEncoder.GetActiveCurvesNum(data);
-               label_encoder_user_curves_active_num.Text = activeCurvesNum.ToString();
+               array1RMUpdate(false);
+               encoder_change_displaced_weight_and_1RM ();
+       
+               blankEncoderInterface();
+       }
+       
+       /* called on:
+        * encoderPersonChanged()
+        * select_menuitem_mode_toggled(Constants.Menuitem_modes m)
+        */
+       private void blankEncoderInterface() {
                
-               label_encoder_user_curves_all_num.Text = data.Count.ToString();
-               */
-
-       /*      
-               if(radio_encoder_analyze_individual_current_set.Active)         //current set
-               {
-                       //when person changes, current signal is not loaded, 
-                       //then combo_encoder_analyze_curve_num_combo has to be empty
-                       UtilGtk.ComboUpdate(combo_encoder_analyze_curve_num_combo, new string [] {}, "");
-               } else if(radio_encoder_analyze_individual_current_session.Active) {
-                       updateComboEncoderAnalyzeCurveNumSavedReps(data, activeCurvesNum);      
-//
-//                     getActiveRepetitions() DOING THIS
-               } //rest of modes don't use this combo
-               */
                if(radio_encoder_analyze_individual_current_set.Active)
                        updateComboEncoderAnalyzeCurveNumFromCurrentSet ();
                else
                        prepareAnalyzeRepetitions();
-
-
        
-               encoderButtonsSensitive(encoderSensEnum.YESPERSON);
-               
                //blank the encoderCaptureListStore
                encoderCaptureListStore = new Gtk.ListStore (typeof (EncoderCurve));
                button_encoder_analyze_sensitiveness();
@@ -3758,9 +3744,6 @@ public partial class ChronoJumpWindow
                button_encoder_analyze_AB_save.Sensitive = false;
                button_encoder_analyze_table_save.Sensitive = false;
                button_encoder_analyze_1RM_save.Visible = false;
-
-               array1RMUpdate(false);
-               encoder_change_displaced_weight_and_1RM ();
        }
 
        private void encoderButtonsSensitive(encoderSensEnum option) 


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