Commit 88c20644 authored by Xavier de Blas's avatar Xavier de Blas

0.8.1.4 new src/gui/server.cs with gui of session upload.

	0.8.1.4
	new src/gui/server.cs with gui of session upload.
	
	thread on server session update

	when user upload a session:
	-session is uploaded
	-person and personSession is uploaded
	-tests are uploaded
	-uploadingState change all the time
	session can be uploaded more times (with new data)
	-checks are done in (if no ok, user should edit): 
	-sports, speciallity, level, weight

	person uploads sport if user defined and not found in server database

	a silent ping is done at start
	added "chronojump" to version on ping
	repetitive conditions not shown at start

	started maria giné test

	fixed bugs:
	-gui/person (edit) crash on accept because serverUniqueID was unassigned
	-fixed HasWeight bug in jumpType
	-fixed crash on person add/edit when a ' is found


svn path=/trunk/; revision=444
parent 30c58ebb
......@@ -33,7 +33,7 @@ CHRONOJUMP_SERVER = chronojump_server
#--------Dependences of CHRONOJUMP
CHRONOJUMP_DEP_GUI = src/gui/chronojump.cs src/gui/confirm.cs src/gui/error.cs src/gui/eventExecute.cs src/gui/eventGraphConfigure.cs src/gui/event.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/reactionTime.cs src/gui/pulse.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs src/gui/report.cs src/gui/about.cs src/gui/helpPorts.cs src/gui/dialogMessage.cs src/gui/dialogCalendar.cs src/gui/dialogImageTest.cs src/gui/language.cs src/gui/repetitiveConditions.cs src/gui/chronopicConnection.cs src/gui/convertWeight.cs src/gui/genericWindow.cs src/gui/splash.cs
CHRONOJUMP_DEP_GUI = src/gui/chronojump.cs src/gui/confirm.cs src/gui/error.cs src/gui/eventExecute.cs src/gui/eventGraphConfigure.cs src/gui/event.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/reactionTime.cs src/gui/pulse.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs src/gui/report.cs src/gui/about.cs src/gui/helpPorts.cs src/gui/dialogMessage.cs src/gui/dialogCalendar.cs src/gui/dialogImageTest.cs src/gui/language.cs src/gui/repetitiveConditions.cs src/gui/chronopicConnection.cs src/gui/convertWeight.cs src/gui/genericWindow.cs src/gui/splash.cs src/gui/server.cs
CHRONOJUMP_DEP_STATS = src/statType.cs 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 src/stats/fv.cs src/stats/potency.cs src/stats/rjAVGSD.cs
......@@ -71,6 +71,7 @@ RESOURCES_IMAGES = -resource:images/mini/no_image.png,mini/no_image.png \
-resource:images/run_interval.png,run_interval.png -resource:images/mini/run_interval.png,mini/run_interval.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 \
-resource:images/stock_bell.png,stock_bell.png \
-resource:images/stock_bell_green.png,stock_bell_green.png \
-resource:images/stock_bell_red.png,stock_bell_red.png \
......
write a version compatibility thing for each server method, and if not
TODO (sorted)
0.- doing the intervalDistancesString change !!!!!!!!!!!
1.- upload SEvaluator and edit it and re-upload
2.- on stats show data updated by user
3.- write a version compatibility thing for each server method, and if not
compatible, tell user to update it's chronojump version
4.- Add the Maria Giné test
"questionnaire acabar
cercar abstract google
fer distancies diferents
pending insert type in sql
5.- do something with user created:
-sports DONE!
-testsTypes
+jumpType done
+...
Add hexagon test
Add Cabedo's tests
record ip in SPing
add "chronopic3" to ping. maybe need to ask to user
add a link to the server page
develop web stats and survey on web site
maybe server URL can be selected by client on preferences
all this will be release as 0.8.2 or 0.9
27 jan 2008
0.8.1.4
new src/gui/server.cs with gui of session upload.
thread on server session update
check if server is online in a separate place on gui/chronojump.cs
when user upload a session:
-session is uploaded
-person and personSession is uploaded
-tests are uploaded
-uploadingState change all the time
session can be uploaded more times (with new data)
-checks are done in (if no ok, user should edit):
-sports, speciallity, level, weight
person uploads sport if user defined and not found in server database
Add the Maria Giné test
todo: record ip in SPing
todo: upload a test (will upload it's person if not done before)
a silent ping is done at start
added "chronojump" to version on ping
repetitive conditions not shown at start
todo: upload a session (except already uploaded tests, also check don't upload
already uploaded persons)
created server/session table (need to test)
started maria giné test
user can upload a session:
-session will be uploaded
-person and personSession will be uploaded
-tests will be uploaded
-uploadingState will change all the time
fixed bugs:
-gui/person (edit) crash on accept because serverUniqueID was unassigned
-fixed HasWeight bug in jumpType
-fixed crash on person add/edit when a ' is found
23 jan 2008
0.8.1.3
......
This diff is collapsed.
This diff is collapsed.
......@@ -42,6 +42,9 @@ public class Constants
public const string IeIndexFormula = "IE (cmj-sj)/sj *100";
public const string IubIndexFormula = "IUB (abk-cmj)/cmj *100";
//tests types
public enum TestTypes { JUMP, JUMP_RJ, RUN, RUN_I, RT, PULSE }
//sqlite tables
//instead of typing the tableName directly (that can crash if it's bad written and it's not detected by compiler)
//use the following consts, and if it's misspelled, compiler will know
......@@ -77,10 +80,14 @@ public class Constants
public const string ServerEvaluatorTable = "SEvaluator";
public const string IPUnknown = "Unknown";
public static int ServerUndefinedID = -1;
public static string ServerOffline = Catalog.GetString("Server is currently offline.");
public static string ServerOffline = Catalog.GetString("Sorry, server is currently offline.");
public enum ServerSessionStates {
NOTHING, UPLOADINGSESSION, UPLOADINGPERSONS, UPLOADINGTESTS, DONE
NOTHING, UPLOADINGSESSION, UPLOADINGDATA, DONE
}
public enum UploadCodes {
EXISTS, SIMULATED, OK
}
/* OLD, check this
public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +
......
......@@ -35,14 +35,15 @@ public class Event
protected int simulated;
public Event() {
//simulated = false;
}
//used to select an event at Sqlite.addSimulatedInEventTables
public Event(string [] eventString) {
}
public virtual void InsertAtDB (bool dbconOpened, string tableName) {
public virtual int InsertAtDB (bool dbconOpened, string tableName) {
Console.WriteLine("++++++++");
return -1;
}
public string Type
......@@ -66,11 +67,13 @@ public class Event
public int SessionID
{
get { return sessionID; }
set { sessionID = value; }
}
public int PersonID
{
get { return personID; }
set { personID = value; }
}
public string PersonName
......
......@@ -43,6 +43,10 @@ public class EventType
longDescription = ""; //needed initalization because is not defined in lots of events
}
public override string ToString() {
return type + ", " + name + ", " + isPredefined + ", " + description;
}
public Types Type
{
get { return type; }
......@@ -67,6 +71,7 @@ public class EventType
public string Description
{
get { return description; }
set { description = value; }
}
public string LongDescription
......
......@@ -166,10 +166,10 @@ public class ExportSession
myPersons = SqlitePersonSession.SelectCurrentSession(mySession.UniqueID, false, false); //not onlyIDAndName, not reversed
myJumps= SqliteJump.SelectJumps(mySession.UniqueID, -1, "");
myJumpsRj = SqliteJumpRj.SelectJumps(mySession.UniqueID, -1, "");
myRuns= SqliteRun.SelectAllRuns(mySession.UniqueID);
myRunsInterval = SqliteRunInterval.SelectAllRuns(mySession.UniqueID);
myReactionTimes = SqliteReactionTime.SelectAllReactionTimes(mySession.UniqueID);
myPulses = SqlitePulse.SelectAllPulses(mySession.UniqueID);
myRuns= SqliteRun.SelectAllRuns(mySession.UniqueID, -1);
myRunsInterval = SqliteRunInterval.SelectAllRuns(mySession.UniqueID, -1);
myReactionTimes = SqliteReactionTime.SelectAllReactionTimes(mySession.UniqueID, -1);
myPulses = SqlitePulse.SelectAllPulses(mySession.UniqueID, -1);
}
protected virtual void printTitles(string title) {
......
This diff is collapsed.
......@@ -657,6 +657,7 @@ public class PersonAddModifyWindow
private string sex = "M";
private int weightIni;
private int serverUniqueID;
//
//if we are adding a person, personID it's -1
......@@ -702,7 +703,7 @@ public class PersonAddModifyWindow
UtilGtk.ComboGetActive(combo_sports) != Catalog.GetString(Constants.SportUndefined) &&
(! label_speciallity.Visible || UtilGtk.ComboGetActive(combo_speciallities) != Catalog.GetString(Constants.SpeciallityUndefined)) &&
Util.FetchID(UtilGtk.ComboGetActive(combo_levels)) != Constants.LevelUndefinedID
//countries is not required
//countries is not required to create a person here, but will be required for server
//&&
//UtilGtk.ComboGetActive(combo_continents) != Catalog.GetString(Constants.ContinentUndefined) &&
//UtilGtk.ComboGetActive(combo_countries) != Catalog.GetString(Constants.CountryUndefined)
......@@ -899,6 +900,8 @@ public class PersonAddModifyWindow
combo_countries.Active = UtilGtk.ComboMakeActive(countriesTranslated,
Catalog.GetString(countryString[1]));
}
serverUniqueID = myPerson.ServerUniqueID;
}
sport = SqliteSport.Select(mySportID);
......@@ -1088,7 +1091,7 @@ public class PersonAddModifyWindow
Catalog.GetString("Sorry, this sport '{0}' already exists in database"),
newSportName));
else {
int myID = SqliteSport.Insert(false, newSportName, true, //dbconOpened, , userDefined
int myID = SqliteSport.Insert(false, "-1", newSportName, true, //dbconOpened, , userDefined
false, ""); //hasSpeciallities, graphLink
Sport mySport = new Sport(myID, newSportName, true,
......@@ -1196,8 +1199,8 @@ public class PersonAddModifyWindow
textview2.Buffer.Text,
Constants.RaceUndefinedID,
Convert.ToInt32(Util.FindOnArray(':', 2, 0, UtilGtk.ComboGetActive(combo_countries), countries)),
currentPerson.ServerUniqueID);
serverUniqueID);
SqlitePerson.Update (currentPerson);
//change weight if needed
......
......@@ -94,6 +94,9 @@ public class RepetitiveConditionsWindow
gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "repetitive_conditions", null);
gladeXML.Autoconnect(this);
//don't show until View is called
repetitive_conditions.Hide ();
//put an icon to window
UtilGtk.IconWindow(repetitive_conditions);
......@@ -107,7 +110,7 @@ public class RepetitiveConditionsWindow
}
//don't show until View is called
RepetitiveConditionsWindowBox.repetitive_conditions.Hide ();
//RepetitiveConditionsWindowBox.repetitive_conditions.Hide ();
return RepetitiveConditionsWindowBox;
}
......
/*
* This file is part of ChronoJump
*
* ChronoJump is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ChronoJump is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Xavier de Blas:
* http://www.xdeblas.com, http://www.deporteyciencia.com (parleblas)
*/
using System;
using Gtk;
using Glade;
using GLib; //for Value
using System.Text; //StringBuilder
using Mono.Unix;
//object that will be uploaded to SessionUploadWindow
public class SessionUploadPersonData {
public Person person;
public Constants.UploadCodes personCode;
public int jumpsU;
public int jumpsE;
public int jumpsS;
public int jumpsRjU;
public int jumpsRjE;
public int jumpsRjS;
public int runsU;
public int runsE;
public int runsS;
public int runsIU;
public int runsIE;
public int runsIS;
public int rtsU;
public int rtsE;
public int rtsS;
public int pulsesU;
public int pulsesE;
public int pulsesS;
public SessionUploadPersonData () {
}
public SessionUploadPersonData (Person person, Constants.UploadCodes personCode,
int jumpsU, int jumpsE, int jumpsS,
int jumpsRjU, int jumpsRjE, int jumpsRjS,
int runsU, int runsE, int runsS,
int runsIU, int runsIE, int runsIS,
int rtsU, int rtsE, int rtsS,
int pulsesU, int pulsesE, int pulsesS) {
}
}
public class SessionUploadWindow {
[Widget] Gtk.Window session_upload;
private TreeStore store_persons;
private TreeStore store_j;
private TreeStore store_jr;
private TreeStore store_r;
private TreeStore store_ri;
private TreeStore store_rts;
private TreeStore store_pulses;
[Widget] Gtk.TreeView treeview_persons;
[Widget] Gtk.TreeView treeview_jumps;
[Widget] Gtk.TreeView treeview_jumps_rj;
[Widget] Gtk.TreeView treeview_runs;
[Widget] Gtk.TreeView treeview_runs_i;
[Widget] Gtk.TreeView treeview_rts;
[Widget] Gtk.TreeView treeview_pulses;
[Widget] Gtk.Label label_thanks;
[Widget] Gtk.Button button_close;
static SessionUploadWindow SessionUploadWindowBox;
Gtk.Window parent;
SessionUploadWindow (Gtk.Window parent) {
Glade.XML gladeXML;
gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "session_upload", null);
gladeXML.Autoconnect(this);
this.parent = parent;
//put an icon to window
UtilGtk.IconWindow(session_upload);
createTreeViews(
treeview_persons,
treeview_jumps,
treeview_jumps_rj,
treeview_runs,
treeview_runs_i,
treeview_rts,
treeview_pulses
);
store_persons = new TreeStore(typeof (string), typeof (string), typeof (string), typeof (string) );
store_j = new TreeStore(typeof (string), typeof (string), typeof (string) );
store_jr = new TreeStore(typeof (string), typeof (string), typeof (string) );
store_r = new TreeStore(typeof (string), typeof (string), typeof (string) );
store_ri = new TreeStore(typeof (string), typeof (string), typeof (string) );
store_rts = new TreeStore(typeof (string), typeof (string), typeof (string) );
store_pulses = new TreeStore(typeof (string), typeof (string), typeof (string) );
treeview_persons.Model = store_persons;
treeview_jumps.Model = store_j;
treeview_jumps_rj.Model = store_jr;
treeview_runs.Model = store_r;
treeview_runs_i.Model = store_ri;
treeview_rts.Model = store_rts;
treeview_pulses.Model = store_pulses;
label_thanks.Hide();
button_close.Sensitive = false;
}
static public SessionUploadWindow Show (Gtk.Window parent)
{
if (SessionUploadWindowBox == null) {
SessionUploadWindowBox = new SessionUploadWindow (parent);
}
SessionUploadWindowBox.session_upload.Show ();
return SessionUploadWindowBox;
}
private void createTreeViews (Gtk.TreeView treeview_persons, Gtk.TreeView treeview_jumps, Gtk.TreeView treeview_jumps_rj,
Gtk.TreeView treeview_runs, Gtk.TreeView treeview_runs_i, Gtk.TreeView treeview_rts, Gtk.TreeView treeview_pulses)
{
String [] personCols = {"ID", Catalog.GetString("Name"), "U", "E"};
String [] testCols = {"U", "E", "S"};
createTreeView(treeview_persons, personCols, 3);
createTreeView(treeview_jumps, testCols, 1);
createTreeView(treeview_jumps_rj, testCols, 1);
createTreeView(treeview_runs, testCols, 1);
createTreeView(treeview_runs_i, testCols, 1);
createTreeView(treeview_rts, testCols, 1);
createTreeView(treeview_pulses, testCols, 1);
}
private void createTreeView (Gtk.TreeView tv, String [] cols, int existsPos) {
int count = 0;
foreach(string col in cols) {
//paint in red the non uploaded cols
if(count >= existsPos) {
CellRendererText crt1 = new CellRendererText();
crt1.Foreground = "red";
//crt1.Background = "blue";
tv.AppendColumn ( col, crt1, "text", count++);
} else
tv.AppendColumn ( col, new CellRendererText(), "text", count++);
}
}
public void FillData (SessionUploadPersonData p) {
fillPerson (p.person, p.personCode);
fillTest (Constants.TestTypes.JUMP, p.jumpsU, p.jumpsE, p.jumpsS);
fillTest (Constants.TestTypes.JUMP_RJ, p.jumpsRjU, p.jumpsRjE, p.jumpsRjS);
fillTest (Constants.TestTypes.RUN, p.runsU, p.runsE, p.runsS);
fillTest (Constants.TestTypes.RUN_I, p.runsIU, p.runsIE, p.runsIS);
fillTest (Constants.TestTypes.RT, p.rtsU, p.rtsE, p.rtsS);
fillTest (Constants.TestTypes.PULSE, p.pulsesU, p.pulsesE, p.pulsesS);
}
private void fillPerson (Person person, Constants.UploadCodes uCode) {
string okCol = "";
string existCol = "";
if(uCode == Constants.UploadCodes.OK)
okCol = "*";
else
existCol = "*";
store_persons.AppendValues (person.UniqueID.ToString(), person.Name, okCol, existCol);
}
private void fillTest (Constants.TestTypes type, int countU, int countE, int countS) {
string u = countU.ToString();
string e = countE.ToString();
string s = countS.ToString();
if(u=="0")
u = "";
if(e=="0")
e = "";
if(s=="0")
s = "";
switch (type) {
case Constants.TestTypes.JUMP:
store_j.AppendValues (u, e, s);
break;
case Constants.TestTypes.JUMP_RJ:
store_jr.AppendValues (u, e, s);
break;
case Constants.TestTypes.RUN:
store_r.AppendValues (u, e, s);
break;
case Constants.TestTypes.RUN_I:
store_ri.AppendValues (u, e, s);
break;
case Constants.TestTypes.RT:
store_rts.AppendValues (u, e, s);
break;
case Constants.TestTypes.PULSE:
store_pulses.AppendValues (u, e, s);
break;
}
}
public void UploadFinished() {
label_thanks.Show();
button_close.Sensitive = true;
}
void on_button_close_clicked (object o, EventArgs args)
{
SessionUploadWindowBox.session_upload.Hide();
SessionUploadWindowBox = null;
}
void on_session_upload_delete_event (object o, DeleteEventArgs args)
{
SessionUploadWindowBox.session_upload.Hide();
SessionUploadWindowBox = null;
}
}
......@@ -540,7 +540,7 @@ public class SessionAddEditWindow {
Catalog.GetString("Sorry, this sport '{0}' already exists in database"),
newSportName));
else {
int myID = SqliteSport.Insert(false, newSportName, true, //dbconOpened, , userDefined
int myID = SqliteSport.Insert(false, "-1", newSportName, true, //dbconOpened, , userDefined
false, ""); //hasSpeciallities, graphLink
Sport mySport = new Sport(myID, newSportName, true,
......
......@@ -71,8 +71,8 @@ public class Jump : Event
this.simulated = Convert.ToInt32(eventString[10]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqliteJump.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqliteJump.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
type, tv, tc, fall,
......@@ -183,8 +183,8 @@ public class JumpRj : Jump
this.simulated = Convert.ToInt32(eventString[17]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqliteJumpRj.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqliteJumpRj.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
type, TvMax, TcMax, fall, weight,
......
......@@ -184,9 +184,9 @@ public class JumpType : EventType
return hasWeight;
} else {
if(isRepetitive)
return SqliteJumpType.HasWeight("jumpType", name);
else
return SqliteJumpType.HasWeight("jumpRjType", name);
else
return SqliteJumpType.HasWeight("jumpType", name);
}
}
set { hasWeight = value; }
......
......@@ -51,6 +51,10 @@ public class Person {
int race, int countryID, int serverUniqueID
)
{
//needed by the return of gui/personAddModifyWindow
name = Util.RemoveTildeAndColon(name);
description = Util.RemoveTildeAndColon(description);
this.uniqueID = uniqueID;
this.sex = sex;
this.name = name;
......@@ -72,6 +76,9 @@ public class Person {
int race, int countryID, int serverUniqueID,
int sessionID)
{
name = Util.RemoveTildeAndColon(name);
description = Util.RemoveTildeAndColon(description);
this.name = name;
this.sex = sex;
this.dateBorn = dateBorn;
......@@ -86,9 +93,6 @@ public class Person {
this.serverUniqueID = serverUniqueID; //remember don't do this on server
this.sessionID = sessionID;
name = Util.RemoveTildeAndColon(name);
description = Util.RemoveTildeAndColon(description);
//insert in the person table
/*
uniqueID = SqlitePerson.Insert (false, //dbconOpened
......
......@@ -65,8 +65,8 @@ public class Pulse : Event
this.simulated = Convert.ToInt32(eventString[8]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqlitePulse.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqlitePulse.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
type, fixedPulse, totalPulsesNum, timesString,
......
......@@ -51,8 +51,8 @@ public class ReactionTime : Event
this.simulated = Convert.ToInt32(eventString[6]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqliteReactionTime.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqliteReactionTime.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
"", time, //type, time
......
......@@ -120,16 +120,16 @@ public class Report : ExportSession
myJumpsRj = SqliteJumpRj.SelectJumps(sessionID, -1, "");
}
if(ShowSimpleRuns) {
myRuns= SqliteRun.SelectAllRuns(sessionID);
myRuns= SqliteRun.SelectAllRuns(sessionID, -1);
}
if (ShowIntervalRuns) {
myRunsInterval = SqliteRunInterval.SelectAllRuns(sessionID);
myRunsInterval = SqliteRunInterval.SelectAllRuns(sessionID, -1);
}
if(ShowReactionTimes) {
myReactionTimes= SqliteReactionTime.SelectAllReactionTimes(sessionID);
myReactionTimes= SqliteReactionTime.SelectAllReactionTimes(sessionID, -1);
}
if(ShowPulses) {
myPulses= SqlitePulse.SelectAllPulses(sessionID);
myPulses= SqlitePulse.SelectAllPulses(sessionID, -1);
}
}
......
......@@ -76,8 +76,8 @@ public class Run : Event
this.simulated = Convert.ToInt32(eventString[7]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqliteRun.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqliteRun.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
type, distance, time,
......@@ -166,8 +166,8 @@ public class RunInterval : Run
this.simulated = Convert.ToInt32(eventString[11]);
}
public override void InsertAtDB (bool dbconOpened, string tableName) {
SqliteRunInterval.Insert(dbconOpened, tableName,
public override int InsertAtDB (bool dbconOpened, string tableName) {
return SqliteRunInterval.Insert(dbconOpened, tableName,
uniqueID.ToString(),
personID, sessionID,
type, distanceTotal, timeTotal,
......
......@@ -288,7 +288,33 @@ public class RunType : EventType
isPredefined = true;
description = Catalog.GetString("Continue running in 20m distance");
imageFileName = "run_interval.png";
} else if(name == "MTGUG") {
hasIntervals = true;
distance = -1;
tracksLimited = true;
fixedValue = 3;
unlimited = false;
isPredefined = true;
description = Catalog.GetString("Modified time Getup and Go test");
imageFileName = "mtgug.png";
longDescription = "The instructions given to perform the test were as follows: <<Sit down with your back resting on the back of the chair and with your two arms resting on your legs. When you hear the word <<go>>, stand up without using your arms, kick the ball in front of you as hard as you possibly can, using the instep of the foot you feel the safest. Then walk at your normal pace while counting backwards from 15 to 0 out loud. Turn around back the cone, without touching it, and go back to your seat, stepping into the circles, trying not to touch any of them. Finally, sit down again, trying not to use your arms>>.\n\n" +
"The stopwatches were activated on the word <<go>> and the button that saved the time intervals was pressed also after the following stages: when the subject stood up and kicked the ball; when the ball passed the 8 m line; and when the subject returned to the seated position in the same chair (42 cm height from the seat to the ground). The total time needed to perform the test provided a quantitative evaluation of performance. A qualitative evaluation was performed by the completion of an AQ. This AQ assesses 6 items with a Likert scale from 0 to 3, where 0 is the equivalent to needing help in order to perform the task, and 3 is equivalent to performing the task unaided with no mistakes. The maximum points that can be attained are 18. The items assessed were: (1) standing up from the chair, (2) kicking the ball, (3) walking whilst counting backwards from 15 to 0, (4) walking around the cone, (5) walking whilst stepping into the circles, and (6) sitting back down again (See assessment questionnaire).\n\n" +
"<b>Assessment questionnaire</b>\n"+
"Sit to stand\n" +
"3 able to stand up without using hands in a steady and controlled action.\n2 able to stand up using hands in a steady and controlled action.\n1 able to stand up using hands after multiple attempts.\n 0 needs or asks for help.\n" +
"......\n\n" +
"BIBLIO: Giné-Garriga, M., Guerra, M., Marí-Dell’Olmo, M., Martin, C., & Unnithan, V.B. (2008). Sensitivity of a modified version of the ‘Timed Get Up and Go’ Test to predict fall risk in the elderly: a pilot study. Archives of Gerontology and Geriatrics, doi:10.1016/j.archger.2008.08.014. \n" +
"Abstract: "
;
}
}
......
......@@ -53,9 +53,9 @@ public class ServerPing
}
public override string ToString() {
return "ID: " + uniqueID + "; EvaluatorID: " + evaluatorID +
"; cjVersion: " + cjVersion + "; osVersion: " + osVersion +
"; IP: " + ip + "; Date: " + date;
return "ID: " + uniqueID + "\nEvaluatorID: " + evaluatorID +
"\nChronojump Version: " + cjVersion + "\nOS Version: " + osVersion +
"\nIP: " + ip + "\nDate: " + date;
}
public int UniqueID {
......
......@@ -210,7 +210,6 @@ public class ServerSession : Session
public ServerSession(Session mySession, int evaluatorID, string evaluatorCJVersion,
string evaluatorOS, string uploadedDate, Constants.ServerSessionStates uploadingState)
//string evaluatorOS, string uploadedDate, int uploadingState)
{
uniqueID = mySession.UniqueID;
name = mySession.Name;
......
......@@ -56,6 +56,14 @@ public class Sport
this.graphLink = graphLink;
}