[chronojump] Fixed Power and stiffness when no contact time



commit eba6b5b8bdc370357d1e4262b235f9d13fdea1ff
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jan 13 12:52:04 2015 +0100

    Fixed Power and stiffness when no contact time

 src/treeViewJump.cs |   19 +++++++++++++------
 src/util.cs         |    2 +-
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/treeViewJump.cs b/src/treeViewJump.cs
index 724c6a4..8a23599 100644
--- a/src/treeViewJump.cs
+++ b/src/treeViewJump.cs
@@ -377,15 +377,22 @@ public class TreeViewJumpsRj : TreeViewJumps
                        else
                                myFall = Convert.ToDouble(Util.GetHeightInCentimeters(myStringTv[lineCount 
-1]));
                        
-                       myData[count++] = Util.TrimDecimals(
-                                       Util.GetDjPower(Convert.ToDouble(thisTc), Convert.ToDouble(thisTv), 
-                                               (personWeight + weightInKg), myFall).ToString(), pDN);
+                       if(Convert.ToDouble(thisTc) > 0)
+                               myData[count++] = Util.TrimDecimals(
+                                               Util.GetDjPower(Convert.ToDouble(thisTc), 
Convert.ToDouble(thisTv), 
+                                                       (personWeight + weightInKg), myFall).ToString(), pDN);
+                       else
+                               myData[count++] = Util.TrimDecimals(
+                                               Util.GetPower(Convert.ToDouble(thisTv), personWeight, 
weightInKg).ToString(), pDN);
                }
                if (preferences.showStiffness) {
                        //use directly Util.GetStiffness because we want to get from this specific subjump, 
not all the reactive jump.
-                       myData[count++] = Util.TrimDecimals(
-                                       Util.GetStiffness(personWeight, weightInKg, Convert.ToDouble(thisTv), 
Convert.ToDouble(thisTc)).ToString(), 
-                                       pDN);
+                       if(Convert.ToDouble(thisTc) > 0)
+                               myData[count++] = Util.TrimDecimals(
+                                               Util.GetStiffness(personWeight, weightInKg, 
Convert.ToDouble(thisTv), Convert.ToDouble(thisTc)).ToString(), 
+                                               pDN);
+                       else
+                               myData[count++] = ""; 
                }
                if (preferences.showInitialSpeed) 
                        myData[count++] = Util.TrimDecimals(Util.GetInitialSpeed(
diff --git a/src/util.cs b/src/util.cs
index 07b8395..e7177c8 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -592,7 +592,7 @@ public class Util
                double totalMass = personMassInKg + extraMass;
                
                //return if mass is zero or there's no contact time
-               if( totalMass == 0 || tv == 0 || tc == 0)
+               if( totalMass == 0 || tv <= 0 || tc <= 0)
                        return 0;
 
                double stiffness;


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