Commit 4df6f918 authored by Xavier de Blas's avatar Xavier de Blas

drop jump "Q index" (tv/tc) added (closes task: 260) added:

src/stats/djQ.cs and src/stats/graphs/djQ.cs

stats now have type, subtype and "apply to"
rjIndex can be applied to "all reactive" or to one type of reactive
jump.

chronopic now gets initiated when starting if preferences/simulated ==
false, or when serial port is selected. Also is Closed only if it was
running

bug solved in show stats rjevolution where there are no rj jumps
improved stats gui
stats show_enunciate not shown by default

Web site: Added a graph of two contact platforms in index
parent 330a8ae5
......@@ -19,8 +19,8 @@ MCS = mcs
CHRONOJUMP = chronojump
CHRONOJUMP_DEP_GUI = src/gui/confirm.cs src/gui/error.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs
CHRONOJUMP_DEP_STATS = src/stats/main.cs src/stats/global.cs src/stats/sjCmjAbk.cs src/stats/sjCmjAbkPlus.cs src/stats/djIndex.cs src/stats/rjIndex.cs src/stats/rjPotencyBosco.cs src/stats/rjEvolution.cs src/stats/ieIub.cs
CHRONOJUMP_DEP_GRAPHS = src/stats/graphs/graphData.cs src/stats/graphs/graphSerie.cs src/stats/graphs/global.cs src/stats/graphs/sjCmjAbk.cs src/stats/graphs/sjCmjAbkPlus.cs src/stats/graphs/djIndex.cs src/stats/graphs/rjIndex.cs src/stats/graphs/rjPotencyBosco.cs src/stats/graphs/rjEvolution.cs src/stats/graphs/ieIub.cs
CHRONOJUMP_DEP_STATS = src/stats/main.cs src/stats/global.cs src/stats/sjCmjAbk.cs src/stats/sjCmjAbkPlus.cs src/stats/djIndex.cs src/stats/djQ.cs src/stats/rjIndex.cs src/stats/rjPotencyBosco.cs src/stats/rjEvolution.cs src/stats/ieIub.cs
CHRONOJUMP_DEP_GRAPHS = src/stats/graphs/graphData.cs src/stats/graphs/graphSerie.cs src/stats/graphs/global.cs src/stats/graphs/sjCmjAbk.cs src/stats/graphs/sjCmjAbkPlus.cs src/stats/graphs/djIndex.cs src/stats/graphs/djQ.cs src/stats/graphs/rjIndex.cs src/stats/graphs/rjPotencyBosco.cs src/stats/graphs/rjEvolution.cs src/stats/graphs/ieIub.cs
......
CHANGELOG:
25 aug 2005
drop jump "Q index" (tv/tc) added (closes task: 260) added:
src/stats/djQ.cs and src/stats/graphs/djQ.cs
stats now have type, subtype and "apply to"
rjIndex can be applied to "all reactive" or to one type of reactive
jump.
chronopic now gets initiated when starting if preferences/simulated ==
false, or when serial port is selected. Also is Closed only if it was
running
bug solved in show stats rjevolution where there are no rj jumps
improved stats gui
stats show_enunciate not shown by default
Web site: Added a graph of two contact platforms in index
22 aug 2005
load persons multiple finished (closes task: 271)
......
No preview for this file type
This diff is collapsed.
......@@ -236,6 +236,7 @@ public class ChronoJump
Chronopic.Plataforma platformState; //on (in platform), off (jumping), or unknow
Chronopic.Respuesta respuesta; //ok, error, or timeout in calling the platform
Chronopic cp;
bool cpRunning;
States loggedState; //log of last state
private bool firstRjValue;
private double rjTcCount;
......@@ -276,7 +277,8 @@ public class ChronoJump
} else { Console.WriteLine ( Catalog.GetString ("tables already created") ); }
Console.WriteLine("AllJumpsName: {0}", allJumpsName);
cpRunning = false;
loadPreferences ();
createTreeView_jumps(treeview_jumps);
......@@ -303,7 +305,7 @@ public class ChronoJump
rand = new Random(40);
//init connecting with chronopic
chronopicInit();
//chronopicInit();
program.Run();
}
......@@ -312,6 +314,9 @@ public class ChronoJump
{
Console.WriteLine ( Catalog.GetString ("starting connection with serial port") );
Console.WriteLine ( Catalog.GetString ("if program crashes, write to xavi@xdeblas.com") );
Console.WriteLine ( Catalog.GetString ("if you used modem by serial port before (in a linux session) chronojump chrases") );
Console.WriteLine ( Catalog.GetString ("change variable using 'sqlite ~/.chronojump/chronojump.db' and") );
Console.WriteLine ( Catalog.GetString ("'update preferences set value=\"True\" where name=\"simulated\";'") );
cp = new Chronopic("/dev/ttyS0");
......@@ -835,7 +840,9 @@ public class ChronoJump
private void on_delete_event (object o, DeleteEventArgs args) {
Console.WriteLine("Bye!");
cp.Close();
if(simulated == false) {
cp.Close();
}
Application.Quit();
}
......@@ -843,7 +850,9 @@ public class ChronoJump
private void on_quit1_activate (object o, EventArgs args) {
Console.WriteLine("Bye!");
cp.Close();
if(simulated == false) {
cp.Close();
}
Application.Quit();
}
......@@ -1149,12 +1158,21 @@ public class ChronoJump
{
simulated = true;
SqlitePreferences.Update("simulated", simulated.ToString());
//close connection with chronopic if initialized
if(cpRunning) {
cp.Close();
}
}
void on_radiobutton_serial_port_activate (object o, EventArgs args)
{
simulated = false;
SqlitePreferences.Update("simulated", simulated.ToString());
//init connecting with chronopic
chronopicInit();
cpRunning = true;
}
private void on_preferences_activate (object o, EventArgs args) {
......
This diff is collapsed.
......@@ -238,9 +238,15 @@ class SqliteStat : Sqlite
}
}
//dj index
public static ArrayList DjIndex (string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
//dj index, Q index, ... (indexType)
public static ArrayList DjIndexes (string indexType, string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
string formula = "";
if(indexType == "djIndex") {
formula = "((tv-tc)*100/tc)";
} else if (indexType == "indexQ") {
formula = "(tv/tc)";
}
string ini = "";
string end = "";
if(operationString == "MAX") {
......@@ -253,7 +259,8 @@ class SqliteStat : Sqlite
string orderByString = "ORDER BY ";
string moreSelect = "";
moreSelect = ini + "((tv-tc)*100/tc)" + end + " AS dj_index, jump.tv, jump.tc, jump.fall";
//moreSelect = ini + "((tv-tc)*100/tc)" + end + " AS dj_index, jump.tv, jump.tc, jump.fall";
moreSelect = ini + formula + end + " AS myIndex, jump.tv, jump.tc, jump.fall";
//manage allJumps
string fromString = " FROM jump, person ";
......@@ -285,7 +292,7 @@ class SqliteStat : Sqlite
jumpTypeString +
" AND jump.personID == person.uniqueID " +
groupByString +
orderByString + " dj_index DESC, " + ini + "jump.tv" + end + " DESC ";
orderByString + " myIndex DESC, " + ini + "jump.tv" + end + " DESC ";
Console.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
......@@ -338,12 +345,32 @@ class SqliteStat : Sqlite
return myArray;
}
public static ArrayList RjIndex (string sessionString, bool multisession, string ini, string end, bool showSex)
//public static ArrayList RjIndex (string sessionString, bool multisession, string ini, string end, bool showSex)
public static ArrayList RjIndex (string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
string ini = "";
string end = "";
if(operationString == "MAX") {
ini = "MAX(";
end = ")";
} else if(operationString == "AVG") {
ini = "AVG(";
end = ")";
}
string orderByString = "ORDER BY ";
string moreSelect = "";
moreSelect = ini + "((tvavg-tcavg)*100/tcavg)" + end + " AS rj_index, tvavg, tcavg, fall";
//manage allJumps
string fromString = " FROM jumpRj, person ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Catalog.GetString("All jumps")) {
moreSelect = moreSelect + ", jumpRj.type ";
fromString = " FROM jumpRj, person, jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
//if we use AVG or MAX, then we have to group by the results
//if there's more than one session, it sends the avg or max
string groupByString = "";
......@@ -357,8 +384,10 @@ class SqliteStat : Sqlite
dbcon.Open();
dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
" FROM jumpRj, person " +
//" FROM jumpRj, person " +
fromString +
sessionString +
jumpTypeString +
" AND jumpRj.personID == person.uniqueID " +
groupByString +
orderByString + " rj_index DESC, tvavg DESC ";
......@@ -370,6 +399,7 @@ class SqliteStat : Sqlite
reader = dbcmd.ExecuteReader();
string showSexString = "";
string showJumpTypeString = "";
string returnSessionString = "";
string returnTvString = "";
string returnTcString = "";
......@@ -379,6 +409,12 @@ class SqliteStat : Sqlite
if(showSex) {
showSexString = "." + reader[1].ToString() ;
}
//manage allJumps (show jumpType beside name (and sex))
//but only if it's not an AVG of different jumps
if(jumpType == Catalog.GetString("All jumps") && operationString != "AVG") {
showJumpTypeString = " (" + reader[7].ToString() + ")";
}
if(multisession) {
returnSessionString = ":" + reader[2].ToString();
} else {
......@@ -390,7 +426,7 @@ class SqliteStat : Sqlite
returnTcString = ":" + reader[5].ToString();
returnFallString = ":" + reader[6].ToString();
}
myArray.Add (reader[0].ToString() + showSexString +
myArray.Add (reader[0].ToString() + showSexString + showJumpTypeString +
returnSessionString + ":" + //session
reader[3].ToString() + //index
returnTvString + //tv
......@@ -403,13 +439,32 @@ class SqliteStat : Sqlite
return myArray;
}
public static ArrayList RjPotencyBosco (string sessionString, bool multisession, string ini, string end, bool showSex)
public static ArrayList RjPotencyBosco (string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
string ini = "";
string end = "";
if(operationString == "MAX") {
ini = "MAX(";
end = ")";
} else if(operationString == "AVG") {
ini = "AVG(";
end = ")";
}
string orderByString = "ORDER BY ";
string moreSelect = "";
moreSelect = ini + "9.81*9.81 * tvavg*jumps * time / ( 4 * jumps * (time - tvavg*jumps) )" + end + " AS potency, " +
" tvavg, tcavg, jumps, time, fall";
//manage allJumps
string fromString = " FROM jumpRj, person ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Catalog.GetString("All jumps")) {
moreSelect = moreSelect + ", jumpRj.type ";
fromString = " FROM jumpRj, person, jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
//if we use AVG or MAX, then we have to group by the results
//if there's more than one session, it sends the avg or max
string groupByString = "";
......@@ -423,8 +478,10 @@ class SqliteStat : Sqlite
dbcon.Open();
dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
" FROM jumpRj, person " +
//" FROM jumpRj, person " +
fromString +
sessionString +
jumpTypeString +
" AND jumpRj.personID == person.uniqueID " +
groupByString +
orderByString + " potency DESC, tvavg DESC ";
......@@ -436,6 +493,7 @@ class SqliteStat : Sqlite
reader = dbcmd.ExecuteReader();
string showSexString = "";
string showJumpTypeString = "";
string returnSessionString = "";
string returnTvString = "";
string returnTcString = "";
......@@ -447,6 +505,12 @@ class SqliteStat : Sqlite
if(showSex) {
showSexString = "." + reader[1].ToString() ;
}
//manage allJumps (show jumpType beside name (and sex))
//but only if it's not an AVG of different jumps
if(jumpType == Catalog.GetString("All jumps") && operationString != "AVG") {
showJumpTypeString = " (" + reader[9].ToString() + ")";
}
if(multisession) {
returnSessionString = ":" + reader[2].ToString();
} else {
......@@ -460,7 +524,7 @@ class SqliteStat : Sqlite
returnTimeString = ":" + reader[7].ToString();
returnFallString = ":" + reader[8].ToString();
}
myArray.Add (reader[0].ToString() + showSexString +
myArray.Add (reader[0].ToString() + showSexString + showJumpTypeString +
returnSessionString + ":" + //session
reader[3].ToString() + //index
returnTvString + //tv
......@@ -480,19 +544,29 @@ class SqliteStat : Sqlite
public static int ObtainMaxNumberOfJumps (string sessionString)
{
dbcon.Open();
dbcmd.CommandText = "SELECT MAX(jumps) from jumpRj " + sessionString;
dbcmd.CommandText = "SELECT MAX(jumps) from jumpRj " + sessionString +
"group by jumps order by jumps DESC limit 1";
//this is done because if no jumps, and we don't write last line, it returns a blank line
//and this crashes when converted to string
Console.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
SqliteDataReader reader;
reader = dbcmd.ExecuteReader();
int myReturn = 0;
bool found = false;
if(reader.Read()) {
found = true;
myReturn = Convert.ToInt32(reader[0].ToString());
}
reader.Close();
dbcon.Close();
return myReturn;
if (found) {
return myReturn;
} else {
return 0;
}
}
//convert the strings of TVs and TCs separated by '=' in
......@@ -519,12 +593,31 @@ class SqliteStat : Sqlite
}
//maxJumps for make all the results of same length (fill it with '-'s)
public static ArrayList RjEvolution (string sessionString, bool multisession, string ini, string end, bool showSex, int maxJumps)
public static ArrayList RjEvolution (string sessionString, bool multisession, string operationString, string jumpType, bool showSex, int maxJumps)
{
string ini = "";
string end = "";
if(operationString == "MAX") {
ini = "MAX(";
end = ")";
} else if(operationString == "AVG") {
ini = "AVG(";
end = ")";
}
string orderByString = "ORDER BY ";
string moreSelect = "";
moreSelect = ini + "((tvavg-tcavg)*100/tcavg)" + end + " AS rj_index, tcString, tvString, fall";
//manage allJumps
string fromString = " FROM jumpRj, person ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Catalog.GetString("All jumps")) {
moreSelect = moreSelect + ", jumpRj.type ";
fromString = " FROM jumpRj, person, jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
//if we use AVG or MAX, then we have to group by the results
//if there's more than one session, it sends the avg or max
string groupByString = "";
......@@ -538,8 +631,10 @@ class SqliteStat : Sqlite
dbcon.Open();
dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
" FROM jumpRj, person " +
//" FROM jumpRj, person " +
fromString +
sessionString +
jumpTypeString +
" AND jumpRj.personID == person.uniqueID " +
groupByString +
orderByString + " rj_index DESC, tvavg DESC ";
......@@ -551,6 +646,7 @@ class SqliteStat : Sqlite
reader = dbcmd.ExecuteReader();
string showSexString = "";
string showJumpTypeString = "";
string returnSessionString = "";
string allTCsTVsCombined = "";
string returnFallString = "";
......@@ -559,6 +655,12 @@ class SqliteStat : Sqlite
if(showSex) {
showSexString = "." + reader[1].ToString() ;
}
//manage allJumps (show jumpType beside name (and sex))
//but only if it's not an AVG of different jumps
if(jumpType == Catalog.GetString("All jumps") && operationString != "AVG") {
showJumpTypeString = " (" + reader[7].ToString() + ")";
}
if(multisession) {
returnSessionString = ":" + reader[2].ToString();
} else {
......@@ -571,7 +673,7 @@ class SqliteStat : Sqlite
returnFallString = ":" + reader[6].ToString();
}
myArray.Add (reader[0].ToString() + showSexString +
myArray.Add (reader[0].ToString() + showSexString + showJumpTypeString +
returnSessionString + ":" + //session
reader[3].ToString() + //index
allTCsTVsCombined + //tc:tv:tc:tv...
......
......@@ -29,7 +29,7 @@ public class StatDjIndex : Stat
{
protected string [] columnsString = {
Catalog.GetString("Jumper"),
Catalog.GetString("Index"),
Catalog.GetString("Dj Index"),
Catalog.GetString("Height"),
Catalog.GetString("TV"),
Catalog.GetString("TC"),
......@@ -69,17 +69,18 @@ public class StatDjIndex : Stat
multisession = true;
}
string indexType = "djIndex";
if(statsJumpsType == 3) { //avg of each jumper
if(multisession) {
string operation = "AVG";
processDataMultiSession (
SqliteStat.DjIndex(sessionString, multisession,
SqliteStat.DjIndexes(indexType, sessionString, multisession,
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = "AVG";
processDataSimpleSession ( cleanDontWanted (
SqliteStat.DjIndex(sessionString, multisession,
SqliteStat.DjIndexes(indexType, sessionString, multisession,
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
......@@ -88,14 +89,14 @@ public class StatDjIndex : Stat
//if more than on session, show only the avg or max of each jump/jumper
if(multisession) {
string operation = "MAX";
processDataMultiSession ( SqliteStat.DjIndex(sessionString, multisession,
processDataMultiSession ( SqliteStat.DjIndexes(indexType, sessionString, multisession,
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = ""; //no need of "MAX", there's an order by jump.tv desc
//and clenaDontWanted will do his work
processDataSimpleSession ( cleanDontWanted (
SqliteStat.DjIndex(sessionString, multisession,
SqliteStat.DjIndexes(indexType, sessionString, multisession,
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
......
......@@ -62,11 +62,12 @@ public class GraphDjIndex : StatDjIndex
}
if(this.operation == "MAX") {
CurrentGraphData.GraphTitle = Catalog.GetString("MAX values of Dj Index in")
+ " " + mySessions;
CurrentGraphData.GraphTitle = Catalog.GetString("MAX values of Dj Index")
+ " ((tv-tc)*100/tc) " + Catalog.GetString("in") + " " + mySessions;
} else {
CurrentGraphData.GraphTitle = Catalog.GetString("AVG values of Dj Index in")
+ " " + mySessions;
CurrentGraphData.GraphTitle = Catalog.GetString("AVG values of Dj Index")
+ " ((tv-tc)*100/tc) " + Catalog.GetString("in") + " " + mySessions;
}
......
......@@ -35,7 +35,7 @@ public class GraphRjEvolution : StatRjEvolution
protected string operation;
private Random myRand = new Random();
public GraphRjEvolution (ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public GraphRjEvolution (ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
string sessionString = obtainSessionSqlString(sessions);
//we need to know the reactive with more jumps for prepare columns
......@@ -65,9 +65,11 @@ public class GraphRjEvolution : StatRjEvolution
CurrentGraphData.WindowTitle = Catalog.GetString("ChronoJump graph");
if(this.operation == "MAX") {
CurrentGraphData.GraphTitle = Catalog.GetString("MAX values of Rj Evolution in single session");
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("MAX values of Rj Evolution in single session in "), jumpType);
} else {
CurrentGraphData.GraphTitle = Catalog.GetString("AVG values of Rj Evolution in single session");
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("AVG values of Rj Evolution in single session in "), jumpType);
}
CurrentGraphData.LabelLeft = Catalog.GetString("seconds");
......
......@@ -42,7 +42,7 @@ public class GraphRjIndex : StatRjIndex
GraphSerie serieFall;
public GraphRjIndex (ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public GraphRjIndex (ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
this.dataColumns = 4; //for Simplesession (index, tv(avg), tc(avg), fall)
this.jumpType = jumpType;
......@@ -62,10 +62,12 @@ public class GraphRjIndex : StatRjIndex
mySessions = Catalog.GetString("multiple sessions");
}
if(this.operation == "MAX") {
CurrentGraphData.GraphTitle = Catalog.GetString("MAX values of RjIndex in ")
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("MAX values of RjIndex in "), jumpType)
+ mySessions;
} else {
CurrentGraphData.GraphTitle = Catalog.GetString("AVG values of RjIndex in ")
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("AVG values of RjIndex in "), jumpType)
+ mySessions;
}
......
......@@ -44,7 +44,7 @@ public class GraphRjPotencyBosco : StatRjPotencyBosco
GraphSerie serieFall;
public GraphRjPotencyBosco (ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public GraphRjPotencyBosco (ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
this.dataColumns = 6; //for Simplesession (index, tv(avg), tc(avg), jumps, time, fall)
this.jumpType = jumpType;
......@@ -64,10 +64,12 @@ public class GraphRjPotencyBosco : StatRjPotencyBosco
mySessions = Catalog.GetString("multiple sessions");
}
if(this.operation == "MAX") {
CurrentGraphData.GraphTitle = Catalog.GetString("MAX values of RjPotency in ")
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("MAX values of RjPotency in "), jumpType)
+ mySessions;
} else {
CurrentGraphData.GraphTitle = Catalog.GetString("AVG values of RjPotency in ")
CurrentGraphData.GraphTitle = string.Format(
Catalog.GetString("AVG values of RjPotency in ") , jumpType)
+ mySessions;
}
......
......@@ -38,7 +38,7 @@ public class StatRjEvolution : Stat
this.limit = 0;
}
public StatRjEvolution (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public StatRjEvolution (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
string sessionString = obtainSessionSqlString(sessions);
......@@ -46,6 +46,7 @@ public class StatRjEvolution : Stat
maxJumps = SqliteStat.ObtainMaxNumberOfJumps(sessionString);
this.dataColumns = maxJumps*2 + 2; //for simplesession (index, (tv , tc)*jumps, fall)
this.jumpType = jumpType;
this.limit = limit;
//only simplesession
......@@ -75,13 +76,20 @@ public class StatRjEvolution : Stat
//we send maxJumps for make all the results of same length (fill it with '-'s)
if(statsJumpsType == 3) { //avg of each jumper
string operation = "AVG";
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjEvolution(sessionString, multisession, "AVG(", ")", showSex, maxJumps),
SqliteStat.RjEvolution(sessionString, multisession,
//"AVG(", ")", showSex, maxJumps),
operation, jumpType, showSex, maxJumps),
statsJumpsType, limit),
false, dataColumns); //don't print AVG and SD at end of row (has no sense)
} else {
string operation = ""; //no need of "MAX", there's an order by (index) desc
//and clenaDontWanted will do his work
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjEvolution(sessionString, multisession, "", "", showSex, maxJumps),
SqliteStat.RjEvolution(sessionString, multisession,
//"", "", showSex, maxJumps),
operation, jumpType, showSex, maxJumps),
statsJumpsType, limit),
false, dataColumns); //don't print AVG and SD at end of row (has no sense)
}
......
......@@ -42,9 +42,10 @@ public class StatRjIndex : Stat
this.limit = 0;
}
public StatRjIndex (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public StatRjIndex (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
this.dataColumns = 4; //for simplesession (index, tv (avg), tc (avg), fall)
this.jumpType = jumpType;
this.limit = limit;
if(sessions.Count > 1) {
......@@ -69,23 +70,36 @@ public class StatRjIndex : Stat
if(statsJumpsType == 3) { //avg of each jumper
if(multisession) {
string operation = "AVG";
processDataMultiSession (
SqliteStat.RjIndex(sessionString, multisession, "AVG(", ")", showSex),
SqliteStat.RjIndex(sessionString, multisession,
//"AVG(", ")", showSex),
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = "AVG";
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjIndex(sessionString, multisession, "AVG(", ")", showSex),
SqliteStat.RjIndex(sessionString, multisession,
//"AVG(", ")", showSex),
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
}
} else {
//if more than on session, show only the avg or max of each jump/jumper
if(multisession) {
processDataMultiSession ( SqliteStat.RjIndex(sessionString, multisession, "MAX(", ")", showSex),
string operation = "MAX";
processDataMultiSession ( SqliteStat.RjIndex(sessionString, multisession,
//"MAX(", ")", showSex),
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = ""; //no need of "MAX", there's an order by (index) desc
//and clenaDontWanted will do his work
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjIndex(sessionString, multisession, "", "", showSex),
SqliteStat.RjIndex(sessionString, multisession,
//"", "", showSex),
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
}
......
......@@ -44,9 +44,10 @@ public class StatRjPotencyBosco : Stat
this.limit = 0;
}
public StatRjPotencyBosco (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType, int limit)
public StatRjPotencyBosco (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, string jumpType, bool showSex, int statsJumpsType, int limit)
{
this.dataColumns = 6; //for simplesession (index, tv (avg), tc (avg), jumps, time, fall)
this.jumpType = jumpType;
this.limit = limit;
if(sessions.Count > 1) {
......@@ -71,23 +72,36 @@ public class StatRjPotencyBosco : Stat
if(statsJumpsType == 3) { //avg of each jumper
if(multisession) {
string operation = "AVG";
processDataMultiSession (
SqliteStat.RjPotencyBosco(sessionString, multisession, "AVG(", ")", showSex),
SqliteStat.RjPotencyBosco(sessionString, multisession,
//"AVG(", ")", showSex),
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = "AVG";
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjPotencyBosco(sessionString, multisession, "AVG(", ")", showSex),
SqliteStat.RjPotencyBosco(sessionString, multisession,
//"AVG(", ")", showSex),
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
}
} else {
//if more than on session, show only the avg or max of each jump/jumper
if(multisession) {
processDataMultiSession ( SqliteStat.RjPotencyBosco(sessionString, multisession, "MAX(", ")", showSex),
string operation = "MAX";
processDataMultiSession ( SqliteStat.RjPotencyBosco(sessionString, multisession,
//"MAX(", ")", showSex),
operation, jumpType, showSex),
true, sessions.Count);
} else {
string operation = ""; //no need of "MAX", there's an order by (index) desc
//and clenaDontWanted will do his work
processDataSimpleSession ( cleanDontWanted (
SqliteStat.RjPotencyBosco(sessionString, multisession, "", "", showSex),
SqliteStat.RjPotencyBosco(sessionString, multisession,
//"", "", showSex),
operation, jumpType, showSex),
statsJumpsType, limit),
true, dataColumns);
}
......
......@@ -190,7 +190,17 @@ public class Util
public static string FetchID (string text)
{
if (text.Length == 0) {
return "-1";
}
string [] myStringFull = text.Split(new char[] {':'});
for (int i=0; i < myStringFull[0].Length; i++)
{
if( ! Char.IsNumber(myStringFull[0], i)) {
return "-1";
}
}
return myStringFull[0];
}
......
......@@ -73,6 +73,12 @@ for (sort keys %languages)
#read all the data files for current language
open DATAFILES,"ls data/langs/$langSuffix/Pages/ | ";
foreach (<DATAFILES>) {
#strip out CVS dirs
if($_ =~ m/CVS/) {
next;
}
my $currentPage = $_;
chomp $currentPage;
print "--- Processing FILE data/langs/$langSuffix/Pages/$currentPage\n";
......@@ -157,6 +163,7 @@ sub getLanguageLinks {
#print current Language in a h2
$return .= "<h2>$langName</h2>\n";
$return .= "<font color=\"#cccccc\">----------------</font>\n";
$return .= "<ul>\n";
#print other languages if available
......