[chronojump] Better AllReps on intersession and interperson



commit 8496c27d60863d5e29b5d825eb00c56e0cebd954
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue May 24 14:33:42 2016 +0200

    Better AllReps on intersession and interperson

 src/gui/encoder.cs                  |   10 --------
 src/gui/encoderSelectRepetitions.cs |   43 +++++++++-------------------------
 2 files changed, 12 insertions(+), 41 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index ce39ddb..b22968d 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -131,7 +131,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_encoder_analyze_cancel;
        [Widget] Gtk.Box hbox_encoder_user_curves;
        [Widget] Gtk.Label label_encoder_user_curves_active_num;
-       [Widget] Gtk.Label label_encoder_user_curves_slash;
        [Widget] Gtk.Label label_encoder_user_curves_all_num;
 
        [Widget] Gtk.Table table_encoder_analyze_instant;
@@ -2433,9 +2432,6 @@ public partial class ChronoJumpWindow
                createComboAnalyzeCross(false, false); //first creation: false, dateOnX: false
                
                hbox_encoder_user_curves.Visible = currentPerson != null;
-               //show active curves and all curves
-               label_encoder_user_curves_slash.Visible = true;
-               label_encoder_user_curves_all_num.Visible = true;
                
                hbox_combo_encoder_exercise_analyze.Visible = true;
 
@@ -2467,9 +2463,6 @@ public partial class ChronoJumpWindow
                createComboAnalyzeCross(false, check_encoder_intersession_x_is_date.Active);
 
                hbox_encoder_user_curves.Visible = currentPerson != null;
-               //only show active curves
-               label_encoder_user_curves_slash.Visible = false;
-               label_encoder_user_curves_all_num.Visible = false;
                
                hbox_combo_encoder_exercise_analyze.Visible = true;
                
@@ -2497,9 +2490,6 @@ public partial class ChronoJumpWindow
                createComboAnalyzeCross(false, false); //first creation: false, dateOnX: false
                
                hbox_encoder_user_curves.Visible = currentPerson != null;
-               //only show active curves
-               label_encoder_user_curves_slash.Visible = false;
-               label_encoder_user_curves_all_num.Visible = false;
                
                hbox_combo_encoder_exercise_analyze.Visible = true;
                
diff --git a/src/gui/encoderSelectRepetitions.cs b/src/gui/encoderSelectRepetitions.cs
index 5510b46..95ee296 100644
--- a/src/gui/encoderSelectRepetitions.cs
+++ b/src/gui/encoderSelectRepetitions.cs
@@ -129,44 +129,25 @@ public class EncoderSelectRepetitions
        protected void updateEncoderCompareInterAndReps() 
        {
                EncoderCompareInter = new ArrayList ();
+       
+               //find RepsActive
+               string [] selectedID = genericWin.GetColumn(0,true); //only active
+               string [] selectedDate = genericWin.GetColumn(dateColumn,true); //only active
+               for (int i=0 ; i < selectedID.Length ; i ++) 
+               {
+                       int id = Convert.ToInt32(selectedID[i]);
+                       RepsActive += genericWin.GetCell(id, allRepsColumn);
+                       EncoderCompareInter.Add(id + ":" + selectedDate[i]);
+               }
                
-               string [] allID = genericWin.GetColumn(0,true); //checked (selected session or person)
-               string [] selectedDate = genericWin.GetColumn(dateColumn,true); //checked (selected session 
or person)
-               
+               //find RepsAll
+               string [] allID = genericWin.GetColumn(0,false); //unchecked (session or person don't need to 
be selected)
                for (int i=0 ; i < allID.Length ; i ++) 
                {
                        int id = Convert.ToInt32(allID[i]);
                        RepsAll += genericWin.GetCell(id, allRepsColumn);
-                       EncoderCompareInter.Add(id + ":" + selectedDate[i]);
-               }
-               RepsActive = RepsAll;
-       }
-       
-       /*
-        * this uses the activeReps
-        * but better use allReps, see above
-        *
-       protected void updateEncoderCompareInterAndRepsOld() 
-       {
-               EncoderCompareInter = new ArrayList ();
-               
-               string [] selectedID = genericWin.GetColumn(0,true); //only active
-               string [] selectedDate = genericWin.GetColumn(dateColumn,true);
-
-               for (int i=0 ; i < selectedID.Length ; i ++) {
-                       int uniqueID = Convert.ToInt32(selectedID[i]);
-                       EncoderCompareInter.Add(uniqueID + ":" + selectedDate[i]);
-
-                       RepsActive += genericWin.GetCell(uniqueID, activeRepsColumn);
-               }
-               
-               string [] allID = genericWin.GetColumn(0,false);
-               for (int i=0 ; i < allID.Length ; i ++) {
-                       RepsAll += genericWin.GetCell(Convert.ToInt32(allID[i]), allRepsColumn);
                }
        }
-       */
-                
 }
 
 public class EncoderSelectRepetitionsIndividualCurrentSession : EncoderSelectRepetitions


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