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

0.8.2.4 db 0.64 Added Margaria test: calculates power (only pending to add

0.8.2.4
db 0.64
Added Margaria test: calculates power (only pending to add the longDescription in program)

svn path=/trunk/; revision=466
parent fed11d71
......@@ -69,6 +69,7 @@ RESOURCES_IMAGES = -resource:images/mini/no_image.png,mini/no_image.png \
-resource:images/jump_rj_hexagon.png,jump_rj_hexagon.png -resource:images/mini/jump_rj_hexagon.png,mini/jump_rj_hexagon.png \
-resource:images/run_simple.png,run_simple.png -resource:images/mini/run_simple.png,mini/run_simple.png \
-resource:images/run_interval.png,run_interval.png -resource:images/mini/run_interval.png,mini/run_interval.png \
-resource:images/margaria.png,margaria.png -resource:images/mini/margaria.png,mini/margaria.png \
-resource:images/pulse_free.png,pulse_free.png -resource:images/mini/pulse_free.png,mini/pulse_free.png \
-resource:images/pulse_custom.png,pulse_custom.png -resource:images/mini/pulse_custom.png,mini/pulse_custom.png \
-resource:images/mtgug.png,mtgug.png -resource:images/mini/mtgug.png,mini/mtgug.png \
......
TODO:
Add Cabedo's tests
Add Margaria
add "chronopic3" to ping. maybe need to ask user
......@@ -14,9 +13,25 @@ all this will be release 0.9
do the ping gets real IP
SEvaluator must be also local, and when edit, upload it. On the other hand, if
it's only on server, we need to call server to know our values And it will be
easy that users can know the evaluator data of others.
mybe the best is have an SEvaluator local table iwht only one register.
There's a need of a bool telling if it has been updated since last change or
not.
Then there's no need of evaluatorUniqueID in preferences.
upload SEvaluator and edit it and re-upload
add chronopic and device code th SEvaluator and update the diagram
hide name in persons of server: replace it with uniqueID on insertion
2 mar 2009 (2)
0.8.2.4
db 0.64
Added Margaria test: calculates power (only pending to add the
longDescription in program)
2 mar 2009
0.8.2.3
Added a cancel to splash window to allow cancel ping on start (good
......
This diff is collapsed.
......@@ -104,6 +104,7 @@ public class ChronoJump
Application.Run();
}
//variables to manage the ping thread
string versionAvailable;
bool pinging;
bool pulseGTKPingShouldEnd;
......@@ -447,7 +448,6 @@ public class ChronoJump
else
splashWin.CancelButtonShow(false);
Thread.Sleep (50);
return true;
}
......
......@@ -290,12 +290,23 @@ Log.WriteLine("MANAGE(3)!!!!");
" " + Catalog.GetString("speed") + ": " + Util.TrimDecimals ( (distance/time).ToString(), pDN );
appbar.Push( 1,myStringPush );
string description = "";
if(type == "Margaria") {
// P = W * 9.8 * D / t
// W: person weight
// D: distance between 3d and 9th stair
double weight = SqlitePersonSession.SelectPersonWeight(personID, sessionID);
double distanceMM = distance / 1000;
description = "P = " + Util.TrimDecimals ( (weight * 9.8 * distanceMM / time).ToString(), pDN) + " (Watts)";
}
uniqueID = SqliteRun.Insert(false, Constants.RunTable, "NULL", personID, sessionID,
type, distance, time, "", //description
type, distance, time, description,
Util.BoolToNegativeInt(simulated));
//define the created object
eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, "", Util.BoolToNegativeInt(simulated));
eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, description, Util.BoolToNegativeInt(simulated));
//event will be raised, and managed in chronojump.cs
......
......@@ -462,13 +462,16 @@ public class ExportSession
foreach (string runString in myRuns) {
string [] myStr = runString.Split(new char[] {':'});
string speed = "";
if(myStr[4] != "Margaria")
speed = Util.TrimDecimals(Util.GetSpeed(myStr[5], myStr[6], true), dec);//speed in m/s (true)
myData.Add (
myStr[2] + ":" + //personID
myStr[0] + ":" + myStr[1] + ":" + //person.name, run.uniqueID
myStr[4] + ":" + myStr[5] + ":" + //run.type, run.distance
Util.TrimDecimals(myStr[6], dec) + ":" + //run.time
Util.TrimDecimals(Util.GetSpeed(myStr[5], myStr[6], true), dec) + ":" + //speed in m/s (true)
speed + ":" + //speed in m/s (true)
Util.RemoveNewLine(myStr[7]) + ":" + Util.NoYes(myStr[8]) //description, simulated
);
}
......
......@@ -117,6 +117,7 @@ public class ChronoJumpWindow
[Widget] Gtk.Button button_run_20yard;
[Widget] Gtk.Button button_run_505;
[Widget] Gtk.Button button_run_illinois;
[Widget] Gtk.Button button_run_margaria;
[Widget] Gtk.Button button_run_shuttle;
[Widget] Gtk.Button button_run_zigzag;
[Widget] Gtk.Button button_run_interval_by_laps;
......@@ -169,6 +170,7 @@ public class ChronoJumpWindow
[Widget] Gtk.MenuItem menuitem_run_20yard;
[Widget] Gtk.MenuItem menuitem_run_505;
[Widget] Gtk.MenuItem menuitem_run_illinois;
[Widget] Gtk.MenuItem menuitem_run_margaria;
[Widget] Gtk.MenuItem menuitem_run_shuttle;
[Widget] Gtk.MenuItem menuitem_run_zigzag;
[Widget] Gtk.MenuItem menuitem_run_interval_by_laps;
......@@ -2374,6 +2376,8 @@ Log.WriteLine("+++++++++++++++++ 7 ++++++++++++++++");
currentEventType = new RunType("Agility-505");
} else if(o == (object) button_run_illinois) {
currentEventType = new RunType("Agility-Illinois");
} else if(o == (object) button_run_margaria) {
currentEventType = new RunType("Margaria");
} else if(o == (object) button_run_shuttle) {
currentEventType = new RunType("Agility-Shuttle-Run");
} else if(o == (object) button_run_zigzag) {
......@@ -2930,6 +2934,8 @@ Log.WriteLine("+++++++++++++++++ 7 ++++++++++++++++");
if(o == (object) button_run_custom || o == (object) menuitem_run_custom) {
currentRunType = new RunType("Custom");
} else if (o == (object) button_run_margaria || o == (object) menuitem_run_margaria) {
currentRunType = new RunType("Margaria");
}
// add others...
......
......@@ -812,12 +812,12 @@ public class RunExtraWindow
[Widget] Gtk.Label label_limit_units;
[Widget] Gtk.Label label_distance;
[Widget] Gtk.SpinButton distance_limit;
[Widget] Gtk.Label label_meters;
[Widget] Gtk.Label label_distance_units;
[Widget] Gtk.Window run_extra;
[Widget] Gtk.SpinButton spinbutton_distance;
[Widget] Gtk.Button button_accept;
static int distance = 100;
static int distance;
static int limited = 10;
static bool tracksLimited;
......@@ -862,6 +862,13 @@ public class RunExtraWindow
hideDistanceData();
}
if(myRunType.Name == "Margaria") {
RunExtraWindowBox.label_distance.Text = Catalog.GetString("Vertical distance between\nstairs third and nine.");
RunExtraWindowBox.label_distance_units.Text = Catalog.GetString("Millimeters.");
distance = 1050;
} else
distance = 100;
RunExtraWindowBox.spinbutton_distance.Value = distance;
RunExtraWindowBox.spinbutton_limit.Value = limited;
......@@ -879,7 +886,7 @@ public class RunExtraWindow
static void hideDistanceData () {
RunExtraWindowBox.label_distance.Sensitive = false;
RunExtraWindowBox.spinbutton_distance.Sensitive = false;
RunExtraWindowBox.label_meters.Sensitive = false;
RunExtraWindowBox.label_distance_units.Sensitive = false;
}
void on_button_cancel_clicked (object o, EventArgs args)
......
......@@ -154,7 +154,7 @@ public class RunType : EventType
}
else if(name == "Agility-505") {
hasIntervals = false;
distance = 10;
distance = -1;
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
......@@ -259,6 +259,25 @@ public class RunType : EventType
"http://www.topendsports.com/testing/tests/zigzag.htm" + "\n" +
Catalog.GetString("Cited with permission.");
}
else if(name == "Margaria") {
hasIntervals = false;
distance = 0; //0:will ask user... refered to the vertical distance between third and nineth stair
tracksLimited = false;
fixedValue = 0;
isPredefined = true;
imageFileName = "margaria.png";
description = Catalog.GetString("Margaria-Kalamen");
longDescription = "";
/*
"<b>" + Catalog.GetString("Procedure") + "</b>: " +
Catalog.GetString("Markers are set up 5 and 15 meters from a line marked on the ground. The athlete runs from the 15 meter marker towards the line (run in distance to build up speed) and through the 5 m markers, turns on the line and runs back through the 5 m markers. The time is recorded from when the athletes first runs through the 5 meter marker, and stopped when they return through these markers (that is, the time taken to cover the 5 m up and back distance - 10 m total). The best of two trails is recorded. The turning ability on each leg should be tested. The subject should be encouraged to not overstep the line by too much, as this will increase their time.") + "\n\n" +
"<b>" + Catalog.GetString("Comments") + "</b>: " +
Catalog.GetString("This is a test of 180 degree turning ability. This ability may not be applicable to some sports.") + "\n\n" +
"http://www.topendsports.com/testing/tests/505.htm" + "\n" +
Catalog.GetString("Cited with permission.");
*/
} //interval
else if(name == "byLaps") {
hasIntervals = true;
......
......@@ -72,7 +72,7 @@ class Sqlite
* Important, change this if there's any update to database
* Important2: if database version get numbers higher than 1, check if the comparisons with currentVersion works ok
*/
static string lastChronojumpDatabaseVersion = "0.63";
static string lastChronojumpDatabaseVersion = "0.64";
public Sqlite() {
}
......@@ -812,6 +812,22 @@ class Sqlite
dbcon.Close();
currentVersion = "0.63";
}
if(currentVersion == "0.63") {
dbcon.Open();
RunType type = new RunType();
type.Name = "Margaria";
type.Distance = 0;
type.Description = "Margaria-Kalamen test";
SqliteRunType.Insert(type, Constants.RunTypeTable, true);
SqliteEvent.GraphLinkInsert (Constants.RunTable, "Margaria", "margaria.png", true);
SqlitePreferences.Update ("databaseVersion", "0.64", true);
Log.WriteLine("Converted DB to 0.64 (added margaria test)");
dbcon.Close();
currentVersion = "0.64";
}
}
......@@ -929,7 +945,8 @@ class Sqlite
SqliteCountry.initialize();
//changes [from - to - desc]
//0.62 - 0.63 Converted DB to 0.63 (added 'versionAvailable' to preferences)
//0.63 - 0.64 added margaria test
//0.62 - 0.63 added 'versionAvailable' to preferences
//0.61 - 0.62 added hexagon (jumpRj test)
//0.60 - 0.61 added RunIntervalType distancesString (now we van have interval tests with different distances of tracks). Added MTGUG
//0.59 - 0.60 added volumeOn and evaluatorServerID to preferences. Session has now serverUniqueID. Simulated now are -1, because 0 is real and positive is serverUniqueID
......
......@@ -65,6 +65,7 @@ class SqliteRunType : Sqlite
"400m:400:run 400 meters",
"1000m:1000:run 1000 meters",
"2000m:2000:run 2000 meters",
"Margaria:0:Margaria-Kalamen test",
//also simple agility tests
"Agility-20Yard:18.28:20Yard Agility test",
......@@ -243,6 +244,7 @@ class SqliteRunType : Sqlite
SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Illinois", "agility_illinois.png", true);
SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Shuttle-Run", "agility_shuttle.png", true);
SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-ZigZag", "agility_zigzag.png", true);
SqliteEvent.GraphLinkInsert (Constants.RunTable, "Margaria", "margaria.png", true);
}
......
......@@ -88,11 +88,20 @@ public class TreeViewRuns : TreeViewEvent
int count = 0;
myData[count++] = title;
//myData[count++] = Util.TrimDecimals(newRun.Speed.ToString(), pDN); this doesn't know the metersSecondsPreferred
myData[count++] = Util.TrimDecimals(Util.GetSpeed(
newRun.Distance.ToString(),
newRun.Time.ToString(),
metersSecondsPreferred ), pDN);
myData[count++] = Util.TrimDecimals(newRun.Distance.ToString(), pDN);
if(newRun.Type == "Margaria")
myData[count++] = ""; //don't show speed, because has no sense on Margaria
else {
myData[count++] = Util.TrimDecimals(Util.GetSpeed(
newRun.Distance.ToString(),
newRun.Time.ToString(),
metersSecondsPreferred ), pDN);
}
string distanceUnits = "";
if(newRun.Type == "Margaria")
distanceUnits = " mm";
myData[count++] = Util.TrimDecimals(newRun.Distance.ToString(), pDN) + distanceUnits;
myData[count++] = Util.TrimDecimals(newRun.Time.ToString(), pDN);
myData[count++] = newRun.Description;
myData[count++] = newRun.UniqueID.ToString();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment