[chronojump] Fixed encoder1RM with different exercises



commit f9fba67a76a6936ec3101228f85935c5bb67702b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jun 17 15:39:13 2013 +0200

    Fixed encoder1RM with different exercises

 src/gui/encoder.cs |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 04a4e12..effd907 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1637,14 +1637,17 @@ public partial class ChronoJumpWindow
                                int count = 0;
                                int exerciseOld = -1;
                                foreach(EncoderSQL es in data) {
-                                       if(count > 0 && es.exerciseID != exerciseOld) {
-                                               new DialogMessage(Constants.MessageTypes.WARNING, 
-                                                               Catalog.GetString("Sorry, cannot calculate 
1RM of different exercises."));
-                                               encoderProcessCancel = true;
-                                               return; 
+                                       if(es.future1 == "active") {
+                                               if(count > 0 && es.exerciseID != exerciseOld) {
+                                                       new DialogMessage(Constants.MessageTypes.WARNING, 
+                                                                       Catalog.GetString("Sorry, cannot 
calculate 1RM of different exercises."));
+                                                       encoderProcessCancel = true;
+                                                       return; 
+                                               }
+
+                                               exerciseOld = es.exerciseID;
+                                               count ++;
                                        }
-                                       exerciseOld = es.exerciseID;
-                                       count ++;
                                }
                                if(crossName == "1RM Any exercise") {
                                        //get speed1RM (from exercise of curve on SQL, not from combo)


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