[chronojump] stats runInterval better



commit 74696f6d95e4e1592df531607e220b212585ec5d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Mar 13 19:15:06 2011 +0100

    stats runInterval better

 src/stats/rjEvolution.cs    |    2 +-
 src/stats/runIntervallic.cs |   11 +++--------
 src/util.cs                 |   18 +++---------------
 3 files changed, 7 insertions(+), 24 deletions(-)
---
diff --git a/src/stats/rjEvolution.cs b/src/stats/rjEvolution.cs
index e5392f2..19cee8d 100644
--- a/src/stats/rjEvolution.cs
+++ b/src/stats/rjEvolution.cs
@@ -241,7 +241,7 @@ public class StatRjEvolution : Stat
 		// cannot be avg in this statistic
 		
 		string operation = ""; //no need of "MAX", there's an order by (index) desc
-		//and clenaDontWanted will do his work
+		//and cleanDontWanted will do his work
 		processDataSimpleSession ( cleanDontWanted (
 					SqliteStat.RjEvolution(sessionString, multisession, 
 						operation, jumpType, showSex, maxJumps), 
diff --git a/src/stats/runIntervallic.cs b/src/stats/runIntervallic.cs
index 4d9cc41..bd1ab86 100644
--- a/src/stats/runIntervallic.cs
+++ b/src/stats/runIntervallic.cs
@@ -64,7 +64,6 @@ public class StatRunIntervallic : Stat
 		columnsString[0] = Catalog.GetString("Person");
 		columnsString[1] = Catalog.GetString("Speed");
 
-//TODO: check this
 		if(toReport && maxRuns > 10) {
 			columnsString[2] = Catalog.GetString("Count");
 			for(int i=0; i < maxRuns && i < 10; i++) {
@@ -72,7 +71,6 @@ public class StatRunIntervallic : Stat
 			}
 		} else {
 			for(int i=0; i < maxRuns; i++) {
-//TODO: check this
 				columnsString[i+2] = Catalog.GetString("Speed") + (i+1).ToString(); //cols: 3, 4, 5, ...
 			}
 		}
@@ -93,7 +91,7 @@ public class StatRunIntervallic : Stat
 		double bestCount=-10000;	//best value found of 3 pairs
 
 		//start in pos 2 because first is name, second is speed
-		for ( int i=2; i < statValues.Length -numContinuous ; i=i+1 ) 
+		for ( int i=2; i <= statValues.Length -numContinuous ; i=i+1 ) 
 		{
 			double myCount = 0;
 			bool runFinished = false;
@@ -209,7 +207,6 @@ public class StatRunIntervallic : Stat
 			if(statValues[0] != Catalog.GetString("AVG") && statValues[0] != Catalog.GetString("SD")) {
 				store.SetValue(iter, 0, true);	//first col is true if it's not AVG or SD
 				markedRows.Add(myPath.ToString());
-				//Log.WriteLine("FROM PRINTDATA (EVOLUTION) Added to markedRows row:{0}", myPath.ToString());
 			}
 			
 			for(int i=0; i < statValues.Length; i++) {
@@ -229,15 +226,14 @@ public class StatRunIntervallic : Stat
 		//we send maxRuns for make all the results of same length (fill it with '-'s)
 		//
 		// cannot be avg in this statistic
-		// TODO: change this, it can be AVG
 		
 		string operation = ""; //no need of "MAX", there's an order by (index) desc
-		//and clenaDontWanted will do his work
+		//and cleanDontWanted will do his work
 		processDataSimpleSession ( cleanDontWanted (
 					SqliteStat.RunInterval(sessionString, multisession, 
 						operation, jumpType, showSex, maxRuns), 
 					statsJumpsType, limit),
-				false, dataColumns); //don't print AVG and SD at end of row (has no sense) TODO: change this
+				false, dataColumns); //TODO: maybe in future do avg and sd of speeds 
 	}
 		
 	public override string ToString () 
@@ -251,7 +247,6 @@ public class StatRunIntervallic : Stat
 			selectedValuesString = string.Format(Catalog.GetString("Max {0} values of each person"), limit);
 		} 
 		/* this option is not possible in this statistic
-		 * TODO: change this
 		else if(statsJumpsType == 3) { //avg of each jumper
 			selectedValuesString = avgValuesString; 
 		}  
diff --git a/src/util.cs b/src/util.cs
index 36e9b1b..2ceb190 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1258,14 +1258,8 @@ public class Util
 	}
 	
 	public static string GetRunISpeedsString(double distanceInterval, string timesString, 
-			string distancesString, string separator, int maxRuns) {
-
-Log.WriteLine("VVV");
-Log.WriteLine(distanceInterval.ToString());
-Log.WriteLine(distancesString);
-Log.WriteLine(timesString);
-Log.WriteLine(separator);
-Log.WriteLine("WWW");
+			string distancesString, string separator, int maxRuns) 
+	{
 		string [] times = timesString.Split(new char[] {'='});
 		string [] distances = distancesString.Split(new char[] {'-'});
 		string speeds = "";
@@ -1277,20 +1271,14 @@ Log.WriteLine("WWW");
 
 			//if has variable distance each track
 			if(distanceInterval == -1.0) {
-Log.WriteLine("-1");
 				int distPos = i % distances.Length;
 				distance = Convert.ToDouble(distances[distPos]);
-			} else {
-Log.WriteLine("NO -1");
+			} else 
 				distance = distanceInterval;
-			}
 
-//Log.WriteLine("d: {0}, t:{1}, d/t:{2}", distance, time, distance /time*1.0);
 			speeds += sep + (distance / time * 1.0).ToString();
 			sep = separator;
-Log.WriteLine(speeds);
 		}
-Log.WriteLine("RRR");
 		//fill the row with 0's equalling largest row
 		for(int j=i; j < maxRuns; j++) {
 			speeds = speeds + ":-:-";



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