[chronojump] IUB -> Arms Use Index
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] IUB -> Arms Use Index
- Date: Tue, 3 Jun 2014 09:07:53 +0000 (UTC)
commit c9251f4ef50638adf1964d5961ba73cac0ea701c
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jun 2 15:47:55 2014 +0200
IUB -> Arms Use Index
src/constants.cs | 4 +-
src/gui/stats.cs | 4 +-
src/sqlite/stat.cs | 257 +--------------------------------------
src/statType.cs | 8 +-
src/stats/global.cs | 42 +------
src/stats/graphs/global.cs | 6 +-
src/stats/graphs/jumpIndexes.cs | 10 +-
src/stats/jumpIndexes.cs | 10 +-
src/stats/main.cs | 4 +-
9 files changed, 26 insertions(+), 319 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index 728c663..137937f 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -81,9 +81,11 @@ public class Constants
public const string FvIndexFormula = "F/V sj+(100%)/sj *100";
public const string IeIndexFormula = "IE (cmj-sj)/sj *100";
- public const string IubIndexFormula = "IUB (abk-cmj)/cmj *100";
public const string IRnaIndexFormula = "IRna (djna-cmj)/cmj *100";
public const string IRaIndexFormula = "IRa (dja-cmj)/cmj *100";
+
+ public const string ArmsUseIndexFormula = "Arms Use Index (abk-cmj)/cmj *100";
+ public const string ArmsUseIndexName = "Arms Use Index";
public const string SubtractionBetweenTests = "Subtraction between tests";
diff --git a/src/gui/stats.cs b/src/gui/stats.cs
index 909a6e6..04265d7 100644
--- a/src/gui/stats.cs
+++ b/src/gui/stats.cs
@@ -188,7 +188,7 @@ public partial class ChronoJumpWindow {
Catalog.GetString("No indexes"),
Constants.FvIndexFormula,
Constants.IeIndexFormula,
- Constants.IubIndexFormula,
+ Constants.ArmsUseIndexFormula,
Constants.IRnaIndexFormula,
Constants.IRaIndexFormula,
Catalog.GetString(Constants.SubtractionBetweenTests),
@@ -655,7 +655,7 @@ public partial class ChronoJumpWindow {
UtilGtk.ComboUpdate(combo_stats_stat_apply_to, "CMJ, SJ");
combo_stats_stat_apply_to.Active = 0;
combo_stats_stat_apply_to.Sensitive = false;
- } else if (UtilGtk.ComboGetActive(combo_stats_stat_subtype) ==
Constants.IubIndexFormula) {
+ } else if (UtilGtk.ComboGetActive(combo_stats_stat_subtype) ==
Constants.ArmsUseIndexFormula) {
UtilGtk.ComboUpdate(combo_stats_stat_apply_to, "ABK, CMJ");
combo_stats_stat_apply_to.Active = 0;
combo_stats_stat_apply_to.Sensitive = false;
diff --git a/src/sqlite/stat.cs b/src/sqlite/stat.cs
index f656434..b1ce327 100644
--- a/src/sqlite/stat.cs
+++ b/src/sqlite/stat.cs
@@ -933,7 +933,7 @@ Log.WriteLine(intervalSpeeds);
return myArray;
}
- //is the same as IeIub except the moreSelect lines
+ //is the same as IE, Arms Use Index except the moreSelect lines
public static ArrayList JumpSimpleSubtraction (string sessionString, bool multisession, string ini,
string end, string jump1, string jump2, bool showSex)
{
string tp = Constants.PersonTable;
@@ -1358,259 +1358,4 @@ Log.WriteLine(intervalSpeeds);
}
- /*
- public static ArrayList GlobalNormal (string sessionString, string operation, bool sexSeparated,
- int personID, bool heightPreferred)
- {
- dbcon.Open();
-
- string personString = "";
- if(personID != -1) {
- personString = " AND jump.personID == " + personID;
- }
-
- if (sexSeparated) {
- dbcmd.CommandText = "SELECT type, sessionID, " + operation + "(tv), sex" +
- " FROM jump, person " +
- sessionString +
- " AND jump.personID == person.uniqueID" + personString +
- " GROUP BY jump.type, sessionID, person.sex " +
- " ORDER BY jump.type, person.sex DESC, sessionID" ;
- } else {
-
- dbcmd.CommandText = "SELECT type, sessionID, " + operation + "(tv) " +
- " FROM jump " +
- sessionString + personString +
- " GROUP BY type, sessionID " +
- " ORDER BY type, sessionID " ;
- }
-
- Log.WriteLine(dbcmd.CommandText.ToString());
- dbcmd.ExecuteNonQuery();
-
- SqliteDataReader reader;
- reader = dbcmd.ExecuteReader();
-
- //returns always two columns
- ArrayList myArray = new ArrayList(2);
- while(reader.Read()) {
- if (reader[0].ToString() != "DJ") {
-
- string heightString = Util.ChangeDecimalSeparator(reader[2].ToString());
- if(heightPreferred) {
- heightString =
Util.GetHeightInCentimeters(Util.ChangeDecimalSeparator(reader[2].ToString()));
- }
-
- if (sexSeparated) {
- myArray.Add (reader[0].ToString() + "." + reader[3].ToString() + ":" +
- reader[1].ToString() + ":" + heightString
- );
- } else {
- myArray.Add (reader[0].ToString() + ":" + reader[1].ToString()
- + ":" + heightString
- );
- }
- }
- }
-
- reader.Close();
- dbcon.Close();
-
- return myArray;
- }
-
- //djindex, qindex, rjIndex, rjpotency(bosco)
- public static ArrayList GlobalOthers (string statName, string statFormulae, string jumpTable, string
sessionString, string operation, bool sexSeparated, int personID)
- {
-
- //select all possible jumpTypes and put in jumpTypeString for SQL
- string jumpTypeString= " AND (";
- string [] myJumpTypes;
- if(jumpTable == "jump") {
- myJumpTypes = SqliteJumpType.SelectJumpTypes("", "TC", true);
- } else {
- myJumpTypes = SqliteJumpType.SelectJumpRjTypes("", true);
- }
- for(int i=0; i < myJumpTypes.Length ; i++) {
- if (i>0) {
- jumpTypeString += " OR ";
- }
- jumpTypeString += " type == '" + myJumpTypes[i] + "'";
- }
- jumpTypeString += " ) ";
-
-
- dbcon.Open();
-
-
- string personString = "";
- if(personID != -1) {
- personString = " AND personID == " + personID;
- }
-
- if (sexSeparated) {
- //select the MAX or AVG index grouped by sex
- //returns 0-2 rows
- dbcmd.CommandText = "SELECT sessionID, type, " + operation + statFormulae + ", sex "
+
- " FROM " + jumpTable + ", person " +
- sessionString +
- " AND personID == person.uniqueID" +
- jumpTypeString +
- personString +
- " GROUP BY sessionID, type, person.sex " +
- " ORDER BY person.sex DESC, type, sessionID" ;
- } else {
- //select the MAX or AVG index.
- //returns 0-1 rows
- dbcmd.CommandText = "SELECT sessionID, type, " + operation + statFormulae +
- " FROM " + jumpTable + " " +
- sessionString +
- jumpTypeString +
- personString +
- //the following solves a problem
- //of sqlite, that returns an
- //"empty line" when there are no
- //values to return in a index
- //calculation.
- //With the group by,
- //if there are no values,
- //it does not return any line
- " GROUP by sessionID, type " +
- " ORDER by type, sessionID";
- }
-
- Log.WriteLine(dbcmd.CommandText.ToString());
- dbcmd.ExecuteNonQuery();
-
- SqliteDataReader reader;
- reader = dbcmd.ExecuteReader();
-
- ArrayList myArray = new ArrayList(2);
-
- //returns always two columns
- while(reader.Read()) {
- if (sexSeparated) {
- myArray.Add (statName + " (" + reader[1].ToString() + ")" + //stat
name(jumptype)
- "." + reader[3].ToString() + ":" + //sex
- reader[0].ToString() + ":" +
Util.ChangeDecimalSeparator(reader[2].ToString()) //session, value
- );
- } else {
- myArray.Add (statName + " (" + reader[1].ToString() + ") " + ":" +
//stat name (jumptype)
- reader[0].ToString() + ":" +
Util.ChangeDecimalSeparator(reader[2].ToString()) //session, value
- );
- }
- }
-
- reader.Close();
- dbcon.Close();
-
- return myArray;
- }
-
- //IE, IUB, FV
- public static ArrayList GlobalIndexes (string statName, string jump1, string jump2, string
sessionString, string operation, bool sexSeparated, int personID)
- {
- dbcon.Open();
-
- string moreSelect = "";
- string weightString = ""; //used by FV index
- int sexColumn = 0;
-
- if(statName == "FV") {
- string heightJump1 = " 100*4.9* (j1.tv/2.0) * (j1.tv/2.0) "; //jump1 tv converted
to height
- string heightJump2 = " 100*4.9* (j2.tv/2.0) * (j2.tv/2.0) "; //jump2 tv converted
to height
- if(operation == "MAX") {
- //search MAX of two jumps, not max index!!
- moreSelect = " ( MAX(" + heightJump1 + ") )*100/(1.0*MAX(" + heightJump2 +
")) AS myIndex, " +
- "MAX(" + heightJump1 + "), MAX(" + heightJump2 + ") ";
- } else if(operation == "AVG") {
- moreSelect = " ( AVG(" + heightJump1 + ") )*100/(1.0*AVG(" + heightJump2 +
")) AS myIndex, " +
- "AVG(" + heightJump1 + "), AVG(" + heightJump2 + ")";
- }
- //weightString = " AND (j1.weight == \"100%\" OR j1.weight == person.weight||'" +
"Kg' ) ";
- weightString =
- // now jump weight is not stores as % or kg and with the '%' or 'kg' after.
Is always a %
- //" AND (j1.weight == \"100%\" OR j1.weight == personSessionWeight.weight||'"
+ "Kg' ) " +
-
- " AND j1.weight == \"100\" ";
- sexColumn = 4;
- } else { //IE, IUB
- if(operation == "MAX") {
- //search MAX of two jumps, not max index!!
- moreSelect = "( ( MAX(j1.tv) - MAX(j2.tv) )*100/(MAX(j2.tv)*1.0) ) AS myIndex
";
- } else if(operation == "AVG") {
- moreSelect = "( ( AVG(j1.tv) - AVG(j2.tv) )*100/(AVG(j2.tv)*1.0) ) AS myIndex
";
- }
- sexColumn = 2;
- }
-
- string personString = "";
- if(personID != -1) {
- personString = " AND j1.personID == " + personID + " AND j2.personID == " + personID
+ " ";
- }
-
- if (sexSeparated) {
- //select the MAX or AVG index grouped by sex
- //returns 0-2 rows
- dbcmd.CommandText = "SELECT j1.sessionID, " + moreSelect + ", person.sex " +
- " FROM jump AS j1, jump AS j2, person, personSessionWeight " +
- sessionString +
- weightString + //used by FV
- " AND j1.personID == person.uniqueID" +
- " AND j2.personID == person.uniqueID" +
- " AND j1.type == '" + jump1 + "'" +
- " AND j2.type == '" + jump2 + "'" +
- personString +
- " GROUP BY j1.sessionID, person.sex " +
- " ORDER BY person.sex DESC, j1.sessionID" ;
- } else {
- //select the MAX or AVG index.
- //returns 0-1 rows
- dbcmd.CommandText = "SELECT j1.sessionID, " + moreSelect +
- " FROM jump AS j1, jump AS j2, person, personSessionWeight " +
- sessionString +
- weightString + //used by FV
- " AND j1.personID == person.uniqueID" +
- " AND j2.personID == person.uniqueID" +
- " AND j1.type == '" + jump1 + "'" +
- " AND j2.type == '" + jump2 + "'" +
- personString +
- //the following solves a problem
- //of sqlite, that returns an
- //"empty line" when there are no
- //values to return in a index
- //calculation.
- //With the group by,
- //if there are no values,
- //it does not return any line
- " GROUP by j1.sessionID" +
- " ORDER by j1.sessionID";
- }
-
- Log.WriteLine(dbcmd.CommandText.ToString());
- dbcmd.ExecuteNonQuery();
-
- SqliteDataReader reader;
- reader = dbcmd.ExecuteReader();
-
- ArrayList myArray = new ArrayList(2);
-
- //returns always two columns
- while(reader.Read()) {
- if (sexSeparated) {
- myArray.Add (statName +"." + reader[sexColumn].ToString() + ":" +
reader[0].ToString()
- + ":" +
Util.ChangeDecimalSeparator(reader[1].ToString()) );
- } else {
- myArray.Add (statName + ":" + reader[0].ToString()
- + ":" +
Util.ChangeDecimalSeparator(reader[1].ToString()) );
- }
- }
-
- reader.Close();
- dbcon.Close();
-
- return myArray;
- }
- */
-
}
diff --git a/src/statType.cs b/src/statType.cs
index 8c1b891..75f3463 100644
--- a/src/statType.cs
+++ b/src/statType.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -238,8 +238,8 @@ public class StatType {
indexType = "subtraction";
else if(statisticSubType == Constants.IeIndexFormula)
indexType = "IE";
- else if(statisticSubType == Constants.IubIndexFormula)
- indexType = "IUB";
+ else if(statisticSubType == Constants.ArmsUseIndexFormula)
+ indexType = "Arms Use Index";
else if(statisticSubType == Constants.IRnaIndexFormula)
indexType = "IRna";
else if(statisticSubType == Constants.IRaIndexFormula)
@@ -268,7 +268,7 @@ public class StatType {
myStat = new GraphJumpSimpleSubtraction(myStatTypeStruct);
else
myStat = new StatJumpSimpleSubtraction(myStatTypeStruct,
treeview_stats);
- } else if(indexType == "IE" || indexType == "IUB" ||
+ } else if(indexType == "IE" || indexType == Constants.ArmsUseIndexName ||
indexType == "IRna" || indexType == "IRa") {
if(graph)
myStat = new GraphJumpIndexes (myStatTypeStruct, indexType);
diff --git a/src/stats/global.cs b/src/stats/global.cs
index 8861b25..5f7bd33 100644
--- a/src/stats/global.cs
+++ b/src/stats/global.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -83,46 +83,6 @@ public class StatGlobal : Stat
public override void PrepareData()
{
- /*
- string sessionString = obtainSessionSqlString(sessions, "jump");
-
- //it's better (nicer, cleaner, easier) to leave all the AVGSD as 'false'
- processDataMultiSession ( SqliteStat.GlobalNormal(sessionString, operation, showSex,
- personID, heightPreferred),
- false, sessions.Count );
-
- //session string must be different for indexes
- sessionString = obtainSessionSqlStringIndexes(sessions);
-
- processDataMultiSession ( SqliteStat.GlobalIndexes("IE", "CMJ", "SJ",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
- processDataMultiSession ( SqliteStat.GlobalIndexes("IUB", "ABK", "CMJ",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
- processDataMultiSession ( SqliteStat.GlobalIndexes("FV", "SJl", "SJ",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
-
- sessionString = obtainSessionSqlString(sessions, "jump");
- processDataMultiSession ( SqliteStat.GlobalOthers("DjIndex", "(100*((tv-tc)/tc))", "jump",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
- processDataMultiSession ( SqliteStat.GlobalOthers("IndexQ", "(tv/tc)", "jump",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
-
- sessionString = obtainSessionSqlString(sessions, "jumpRj");
- processDataMultiSession ( SqliteStat.GlobalOthers("RjIndex", "(100*((tvavg-tcavg)/tcavg))",
"jumpRj",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
- //processDataMultiSession ( SqliteStat.GlobalOthers("RjPotency",
- processDataMultiSession ( SqliteStat.GlobalOthers(Constants.RJPotencyBoscoName,
- "(9.81*9.81 * tvavg*jumps * time / (4*jumps*(time - tvavg*jumps)) )",
"jumpRj",
- sessionString, operation, showSex, personID),
- false, sessions.Count );
- */
-
}
public override string ToString ()
diff --git a/src/stats/graphs/global.cs b/src/stats/graphs/global.cs
index 46f2430..c7afe07 100644
--- a/src/stats/graphs/global.cs
+++ b/src/stats/graphs/global.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -142,7 +142,7 @@ public class GraphGlobal : StatGlobal
} else {
if(myValueBefore.StartsWith("DjIndex") ||
myValueBefore.StartsWith("RjIndex") ||
myValueBefore.StartsWith(Constants.RJPotencyBoscoName) ||
- myValueBefore == "IE" || myValueBefore == "IUB") {
+ myValueBefore == "IE" || myValueBefore ==
Constants.ArmsUseIndexName) {
serieIndex.SerieData.Add(myValue);
//serieTv.SerieData.Add("-");
} else if(myValueBefore.StartsWith("IndexQ") || myValueBefore ==
"FV") {
@@ -172,7 +172,7 @@ public class GraphGlobal : StatGlobal
if(valueNoSex.StartsWith("DjIndex") ||
valueNoSex.StartsWith("IndexQ") ||
valueNoSex.StartsWith("RjIndex") ||
valueNoSex.StartsWith(Constants.RJPotencyBoscoName) ||
- valueNoSex == "IE" || valueNoSex == "IUB" ||
valueNoSex == "FV" ) {
+ valueNoSex == "IE" || valueNoSex ==
Constants.ArmsUseIndexName || valueNoSex == "FV" ) {
mySerie.IsLeftAxis = false;
} else {
mySerie.IsLeftAxis = true;
diff --git a/src/stats/graphs/jumpIndexes.cs b/src/stats/graphs/jumpIndexes.cs
index 59bf836..4d25c81 100644
--- a/src/stats/graphs/jumpIndexes.cs
+++ b/src/stats/graphs/jumpIndexes.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -42,11 +42,11 @@ public class GraphJumpIndexes : StatJumpIndexes
this.dataColumns = 3; //for Simplesession (index, jump1, jump2)
- this.indexType = indexType; //"IE" or "IUB" or "IR"
+ this.indexType = indexType; //"IE" or Constants.ArmsUseIndexName or "IR"
if(indexType == "IE") {
jump1="CMJ";
jump2="SJ";
- } else if(indexType == "IUB") {
+ } else if(indexType == Constants.ArmsUseIndexName) {
jump1="ABK";
jump2="CMJ";
} else if(indexType == "IRna") { //reactivity DJna
@@ -77,8 +77,8 @@ public class GraphJumpIndexes : StatJumpIndexes
//CurrentGraphData.GraphTitle = this.ToString();
if(indexType == "IE")
CurrentGraphData.GraphTitle = Constants.IeIndexFormula;
- else if(indexType == "IUB")
- CurrentGraphData.GraphTitle = Constants.IubIndexFormula;
+ else if(indexType == Constants.ArmsUseIndexName)
+ CurrentGraphData.GraphTitle = Constants.ArmsUseIndexFormula;
else if(indexType == "IRna")
CurrentGraphData.GraphTitle = Constants.IRnaIndexFormula;
else // indexType == "IRa"
diff --git a/src/stats/jumpIndexes.cs b/src/stats/jumpIndexes.cs
index c426928..fff2504 100644
--- a/src/stats/jumpIndexes.cs
+++ b/src/stats/jumpIndexes.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -45,11 +45,11 @@ public class StatJumpIndexes : Stat
completeConstruction (myStatTypeStruct, treeview);
this.dataColumns = 3; //for simplesession (IE, cmj, sj)
- this.indexType = indexType; //"IE", "IUB", "IRna", "IRa"
+ this.indexType = indexType; //"IE", Constants.ArmsUseIndexName, "IRna", "IRa"
if(indexType == "IE") {
jump1="CMJ";
jump2="SJ";
- } else if(indexType == "IUB") {
+ } else if(indexType == Constants.ArmsUseIndexName) {
jump1="ABK";
jump2="CMJ";
} else if(indexType == "IRna") { //reactivity no arms
@@ -136,8 +136,8 @@ public class StatJumpIndexes : Stat
}
string indexString = "IE [(cmj-sj)/sj * 100]";
- if(indexType == "IUB") {
- indexString = "IUB [(abk-cmj)/cmj * 100]";
+ if(indexType == Constants.ArmsUseIndexName) {
+ indexString = Constants.ArmsUseIndexName + " [(abk-cmj)/cmj * 100]";
} else if(indexType == "IRna") {
indexString = "IRna [(djna-cmj)/cmj * 100]";
} else if(indexType == "IRa") {
diff --git a/src/stats/main.cs b/src/stats/main.cs
index fc2bb69..6d1b642 100644
--- a/src/stats/main.cs
+++ b/src/stats/main.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -40,7 +40,7 @@ using Mono.Unix;
* StatRjIndex
* StatPotencyBosco
* StatIE
- * StatIUB
+ * StatIUB //Arms Use Index
* StatGlobal //suitable for global and for a unique jumper
*
* ---------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]