chronojump r442 - in trunk: . build/data chronojump_server chronojump_server/bin glade po sqlite_diagrams src src/angle src/execute src/gui src/sqlite



Author: xaviblas
Date: Fri Jan 23 17:32:35 2009
New Revision: 442
URL: http://svn.gnome.org/viewvc/chronojump?rev=442&view=rev

Log:
23 jan 2008
	0.8.1.3
	insert session now insert all it's persons

	added src/serverEvaluator.cs, remember to svn add

	0.8.1.2
	Finished the server SPing, SEvaluator, server session code
	done server stats with: pings, evaluators,
	sessions, persons. TODO: tests

	db 0.60: 
	-added volumeOn and evaluatorServerID to preferences. 
	-Session has serverUniqueID. Simulated tests now are -1, because 0 is real and
	positive is serverUniqueID
	
	convertedTables of tests to put a serverUniqueID 
		simulated now contains the serverUniqueID:
		-1 simulated test
		0 real test not uploaded
		>0 serverUniqueID of uploaded test


	try-catch on sound playing




Added:
   trunk/src/serverEvaluator.cs
Modified:
   trunk/Makefile
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/version.txt
   trunk/changelog.txt
   trunk/chronojump_server/ChronojumpServer.cs
   trunk/chronojump_server/bin/chronojumpServer.dll
   trunk/glade/chronojump.glade
   trunk/po/POTFILES.in
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/sqlite_diagrams/chronojump_sqlite.png
   trunk/src/angle/changelog
   trunk/src/angle/kneeAngle.cpp
   trunk/src/chronojump.cs
   trunk/src/constants.cs
   trunk/src/execute/jump.cs
   trunk/src/execute/pulse.cs
   trunk/src/execute/reactionTime.cs
   trunk/src/execute/run.cs
   trunk/src/gui/chronojump.cs
   trunk/src/gui/event.cs
   trunk/src/gui/session.cs
   trunk/src/serverPing.cs
   trunk/src/session.cs
   trunk/src/sport.cs
   trunk/src/sqlite/event.cs
   trunk/src/sqlite/jump.cs
   trunk/src/sqlite/main.cs
   trunk/src/sqlite/personSession.cs
   trunk/src/sqlite/preferences.cs
   trunk/src/sqlite/server.cs
   trunk/src/sqlite/session.cs
   trunk/src/treeViewJump.cs
   trunk/src/treeViewPulse.cs
   trunk/src/treeViewReactionTime.cs
   trunk/src/treeViewRun.cs
   trunk/src/util.cs
   trunk/version.txt

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Fri Jan 23 17:32:35 2009
@@ -45,7 +45,7 @@
 
 CHRONOJUMP_DEP_SERVER = chronojump_server/ChronojumpServer.cs
 
-CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs src/log.cs src/serverPing.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
+CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs src/log.cs src/serverPing.cs src/serverEvaluator.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
 
 RESOURCES_GLADE = -resource:glade/chronojump.glade,chronojump.glade
 
@@ -106,7 +106,7 @@
 
 #--------Dependences of CHRONOJUMP_SERVER
 
-CHRONOJUMP_SERVER_DEP = chronojump_server/chronojumpServerCSharp.cs src/sqlite/*.cs src/util.cs src/person.cs src/event.cs src/jump.cs src/run.cs src/pulse.cs src/reactionTime.cs src/session.cs src/eventType.cs src/jumpType.cs src/runType.cs src/pulseType.cs src/sport.cs src/constants.cs src/log.cs src/serverPing.cs
+CHRONOJUMP_SERVER_DEP = chronojump_server/chronojumpServerCSharp.cs src/sqlite/*.cs src/util.cs src/person.cs src/event.cs src/jump.cs src/run.cs src/pulse.cs src/reactionTime.cs src/session.cs src/eventType.cs src/jumpType.cs src/runType.cs src/pulseType.cs src/sport.cs src/constants.cs src/log.cs src/serverPing.cs src/serverEvaluator.cs
 
 
 #--------Makefiles
@@ -147,8 +147,8 @@
 
 $(CHRONOJUMP_SERVER).dll: $(CHRONOJUMP_SERVER_DEP) chronojump_server/chronojumpServer.asmx
 	$(MCS) -t:library -out:chronojump_server/bin/chronojumpServer.dll -r:System.Data -r:Mono.Data.Sqlite -r:System.Web.Services -r:Mono.Posix $(CHRONOJUMP_SERVER_DEP)
-	#currently deactivated WSDL compilation: (seems it doesn't work because when there's no network, there's no localhost)
-	#$(WSDL)
+#currently deactivated WSDL compilation: (seems it doesn't work because when there's no network, there's no localhost)
+#$(WSDL)
 
 
 #--------------------------

Modified: trunk/build/data/chronojump.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/chronojump_mini.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/version.txt
==============================================================================
--- trunk/build/data/version.txt	(original)
+++ trunk/build/data/version.txt	Fri Jan 23 17:32:35 2009
@@ -1 +1 @@
-0.8.1.1
+0.8.1.3

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Fri Jan 23 17:32:35 2009
@@ -1,4 +1,47 @@
-Finishing the SPing code
+write a version compatibility thing for each server method, and if not
+compatible, tell user to update it's chronojump version
+
+check if server is online in a separate place on gui/chronojump.cs
+
+
+Add the Maria Ginéest
+todo: record ip in SPing
+todo: upload a test (will upload it's person if not done before)
+
+todo: upload a session (except already uploaded tests, also check don't upload
+already uploaded persons)
+created server/session table (need to 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
+
+23 jan 2008
+	0.8.1.3
+	insert session now insert all it's persons
+
+	added src/serverEvaluator.cs, remember to svn add
+
+	0.8.1.2
+	Finished the server SPing, SEvaluator, server session code
+	done server stats with: pings, evaluators,
+	sessions, persons. TODO: tests
+
+	db 0.60: 
+	-added volumeOn and evaluatorServerID to preferences. 
+	-Session has serverUniqueID. Simulated tests now are -1, because 0 is real and
+	positive is serverUniqueID
+	
+	convertedTables of tests to put a serverUniqueID 
+		simulated now contains the serverUniqueID:
+		-1 simulated test
+		0 real test not uploaded
+		>0 serverUniqueID of uploaded test
+
+
+	try-catch on sound playing
 
 16 jan 2008
 	Now we are able to connect from client gtk (corall) to server on pinux and do a ping, or insert a

Modified: trunk/chronojump_server/ChronojumpServer.cs
==============================================================================
--- trunk/chronojump_server/ChronojumpServer.cs	(original)
+++ trunk/chronojump_server/ChronojumpServer.cs	Fri Jan 23 17:32:35 2009
@@ -66,6 +66,7 @@
     
     /// <remarks>
 ///Select person name
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectPersonName";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string SelectPersonName(int personID) {
@@ -86,6 +87,7 @@
     
     /// <remarks>
 ///See all persons
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersons";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public ArrayList SelectAllPersons() {
@@ -97,13 +99,35 @@
         return this.BeginInvoke("SelectAllPersons", new object[0], callback, asyncState);
     }
     
-    public string[] EndSelectAllPersons(System.IAsyncResult asyncResult) {
+//public string[] EndSelectAllPersons(System.IAsyncResult asyncResult) {
+    public ArrayList EndSelectAllPersons(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-        return ((string[])(results[0]));
+//return ((string[])(results[0]));
+        return ((ArrayList)(results[0]));
+    }
+    
+    /// <remarks>
+///Stats
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/Stats";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public ArrayList Stats() {
+        object[] results = this.Invoke("Stats", new object[0]);
+        return ((ArrayList)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginStats(System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Stats", new object[0], callback, asyncState);
+    }
+    
+    public ArrayList EndStats(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((ArrayList)(results[0]));
     }
     
     /// <remarks>
 ///Select events from all persons
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersonEvents";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public object[] SelectAllPersonEvents(int personID) {
@@ -123,7 +147,29 @@
     }
     
     /// <remarks>
+///Insert session
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertSession";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int InsertSession(ServerSession mySession) {
+        object[] results = this.Invoke("InsertSession", new object[] {
+            mySession});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginInsertSession(ServerSession mySession, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("InsertSession", new object[] {
+            mySession}, callback, asyncState);
+    }
+    
+    public int EndInsertSession(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
 ///Insert person
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPerson";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public int InsertPerson(Person myPerson, int sessionID) {
@@ -144,12 +190,13 @@
 
     /// <remarks>
 ///Insert ping
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPing";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public object[] InsertPing(ServerPing myPing) {
+    public int InsertPing(ServerPing myPing) {
         object[] results = this.Invoke("InsertPing", new object[] {
             myPing});
-        return ((object[])(results[0]));
+        return ((int)(results[0]));
     }
     
     public System.IAsyncResult BeginInsertPing(ServerPing myPing, System.AsyncCallback callback, object asyncState) {
@@ -157,13 +204,56 @@
             myPing}, callback, asyncState);
     }
     
-    public object[] EndInsertPing(System.IAsyncResult asyncResult) {
+    public int EndInsertPing(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-        return ((object[])(results[0]));
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Insert evaluator
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertEvaluator";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int InsertEvaluator(ServerEvaluator myEval) {
+        object[] results = this.Invoke("InsertEvaluator", new object[] {
+            myEval});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginInsertEvaluator(ServerEvaluator myEval, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("InsertEvaluator", new object[] {
+            myEval}, callback, asyncState);
+    }
+    
+    public int EndInsertEvaluator(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Update session
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/UpdateSession";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UpdateSession(int sessionID, Constants.ServerSessionStates state) {
+        object[] results = this.Invoke("UpdateSession", new object[] {
+            sessionID, state});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginUpdateSession(int sessionID, Constants.ServerSessionStates state, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UpdateSession", new object[] {
+            sessionID, state}, callback, asyncState);
+    }
+    
+    public int EndUpdateSession(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
     }
 
     /// <remarks>
 ///List directory files (only as a sample)
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
     [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/ListDirectory";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string[] ListDirectory(string path) {

Modified: trunk/chronojump_server/bin/chronojumpServer.dll
==============================================================================
Binary files. No diff available.

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Fri Jan 23 17:32:35 2009
@@ -8244,7 +8244,7 @@
 		      <signal name="activate" handler="on_new_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3428">
+			<widget class="GtkImage" id="image3598">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8265,7 +8265,7 @@
 		      <signal name="activate" handler="on_open_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3429">
+			<widget class="GtkImage" id="image3599">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8286,7 +8286,7 @@
 		      <signal name="activate" handler="on_edit_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3430">
+			<widget class="GtkImage" id="image3600">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8308,7 +8308,7 @@
 		      <signal name="activate" handler="on_delete_session_activate" last_modification_time="Thu, 28 Jul 2005 13:37:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3431">
+			<widget class="GtkImage" id="image3601">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8336,7 +8336,7 @@
 		      <signal name="activate" handler="on_export_session_activate" last_modification_time="Sat, 12 Feb 2005 21:57:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3432">
+			<widget class="GtkImage" id="image3602">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-convert</property>
 			  <property name="icon_size">1</property>
@@ -8372,7 +8372,7 @@
 		      <signal name="activate" handler="on_preferences_activate" last_modification_time="Mon, 04 Oct 2004 19:19:19 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3433">
+			<widget class="GtkImage" id="image3603">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8410,6 +8410,45 @@
 			  </child>
 
 			  <child>
+			    <widget class="GtkSeparatorMenuItem" id="separador19">
+			      <property name="visible">True</property>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_insert_person">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Insert current person</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_insert_person" last_modification_time="Wed, 14 Jan 2009 02:03:56 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_insert_evaluator">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Insert evaluator</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_insert_evaluator" last_modification_time="Wed, 21 Jan 2009 13:35:37 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkMenuItem" id="menuitem_server_insert_session">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">Insert current session</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_menuitem_server_insert_session" last_modification_time="Thu, 22 Jan 2009 11:41:40 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
+			    <widget class="GtkSeparatorMenuItem" id="separador20">
+			      <property name="visible">True</property>
+			    </widget>
+			  </child>
+
+			  <child>
 			    <widget class="GtkMenuItem" id="menuitem_server_see_all">
 			      <property name="visible">True</property>
 			      <property name="label" translatable="yes">See all persons</property>
@@ -8419,11 +8458,11 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkMenuItem" id="menuitem_server_insert_person">
+			    <widget class="GtkMenuItem" id="menuitem_server_stats">
 			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Insert_current_person</property>
+			      <property name="label" translatable="yes">Stats</property>
 			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_insert_person" last_modification_time="Wed, 14 Jan 2009 02:03:56 GMT"/>
+			      <signal name="activate" handler="on_menuitem_server_stats" last_modification_time="Thu, 22 Jan 2009 13:19:24 GMT"/>
 			    </widget>
 			  </child>
 			</widget>
@@ -8445,7 +8484,7 @@
 		      <signal name="activate" handler="on_quit1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3434">
+			<widget class="GtkImage" id="image3604">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-quit</property>
 			  <property name="icon_size">1</property>
@@ -8479,7 +8518,7 @@
 		      <signal name="activate" handler="on_person_add_single_activate" last_modification_time="Thu, 18 Aug 2005 23:07:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3435">
+			<widget class="GtkImage" id="image3605">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8500,7 +8539,7 @@
 		      <signal name="activate" handler="on_person_add_multiple_activate" last_modification_time="Thu, 18 Aug 2005 23:01:23 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3436">
+			<widget class="GtkImage" id="image3606">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8527,7 +8566,7 @@
 		      <signal name="activate" handler="on_recuperate_person_activate" last_modification_time="Sun, 12 Dec 2004 00:40:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3437">
+			<widget class="GtkImage" id="image3607">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8548,7 +8587,7 @@
 		      <signal name="activate" handler="on_recuperate_persons_from_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3438">
+			<widget class="GtkImage" id="image3608">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8575,7 +8614,7 @@
 		      <signal name="activate" handler="on_edit_current_person_clicked" last_modification_time="Sun, 17 Oct 2004 11:43:33 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3439">
+			<widget class="GtkImage" id="image3609">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8596,7 +8635,7 @@
 		      <signal name="activate" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 09:51:24 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3440">
+			<widget class="GtkImage" id="image3610">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -8623,7 +8662,7 @@
 		      <signal name="activate" handler="on_delete_current_person_from_session_activate" last_modification_time="Thu, 28 Jul 2005 15:49:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3441">
+			<widget class="GtkImage" id="image3611">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8735,7 +8774,7 @@
 			      <signal name="activate" handler="on_button_more_clicked" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3442">
+				<widget class="GtkImage" id="image3612">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8760,7 +8799,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_clicked" last_modification_time="Sun, 17 Oct 2004 11:47:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3443">
+			<widget class="GtkImage" id="image3613">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8781,7 +8820,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_clicked" last_modification_time="Tue, 19 Oct 2004 11:54:17 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3444">
+			<widget class="GtkImage" id="image3614">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8847,7 +8886,7 @@
 			      <signal name="activate" handler="on_button_more_rj_clicked" last_modification_time="Fri, 11 Mar 2005 14:45:23 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3445">
+				<widget class="GtkImage" id="image3615">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8872,7 +8911,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3446">
+			<widget class="GtkImage" id="image3616">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8893,7 +8932,7 @@
 		      <signal name="activate" handler="on_repair_selected_reactive_jump_clicked" last_modification_time="Wed, 07 Dec 2005 01:14:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3447">
+			<widget class="GtkImage" id="image3617">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8914,7 +8953,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3448">
+			<widget class="GtkImage" id="image3618">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8941,7 +8980,7 @@
 		      <signal name="activate" handler="on_jump_type_add_activate" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3449">
+			<widget class="GtkImage" id="image3619">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9086,7 +9125,7 @@
 			      <signal name="activate" handler="on_button_run_more_clicked" last_modification_time="Fri, 22 Apr 2005 14:37:06 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3450">
+				<widget class="GtkImage" id="image3620">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9111,7 +9150,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3451">
+			<widget class="GtkImage" id="image3621">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9132,7 +9171,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3452">
+			<widget class="GtkImage" id="image3622">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9198,7 +9237,7 @@
 			      <signal name="activate" handler="on_button_run_interval_more_clicked" last_modification_time="Tue, 16 Aug 2005 01:18:41 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3453">
+				<widget class="GtkImage" id="image3623">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9223,7 +9262,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3454">
+			<widget class="GtkImage" id="image3624">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9244,7 +9283,7 @@
 		      <signal name="activate" handler="on_repair_selected_run_interval_clicked" last_modification_time="Wed, 03 May 2006 15:15:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3455">
+			<widget class="GtkImage" id="image3625">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -9265,7 +9304,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3456">
+			<widget class="GtkImage" id="image3626">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9292,7 +9331,7 @@
 		      <signal name="activate" handler="on_run_type_add_activate" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3457">
+			<widget class="GtkImage" id="image3627">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9372,7 +9411,7 @@
 		      <signal name="activate" handler="on_menuitem_view_stats_activate" last_modification_time="Tue, 26 Jul 2005 23:54:29 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3458">
+			<widget class="GtkImage" id="image3628">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9393,7 +9432,7 @@
 		      <signal name="activate" handler="on_show_report_activate" last_modification_time="Tue, 06 Sep 2005 09:10:32 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3459">
+			<widget class="GtkImage" id="image3629">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9461,7 +9500,7 @@
 		      <signal name="activate" handler="on_menuitem_manual_activate" last_modification_time="Wed, 03 Oct 2007 23:31:41 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3460">
+			<widget class="GtkImage" id="image3630">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -9497,7 +9536,7 @@
 		      <signal name="activate" handler="on_about1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3461">
+			<widget class="GtkImage" id="image3631">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-about</property>
 			  <property name="icon_size">1</property>
@@ -9524,7 +9563,7 @@
 		      <signal name="activate" handler="on_debug_crash_activate" last_modification_time="Thu, 23 Oct 2008 22:57:02 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3462">
+			<widget class="GtkImage" id="image3632">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-dialog-error</property>
 			  <property name="icon_size">1</property>

Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in	(original)
+++ trunk/po/POTFILES.in	Fri Jan 23 17:32:35 2009
@@ -31,9 +31,10 @@
 src/runType.cs
 src/sqlite/country.cs
 src/sqlite/personSession.cs
+src/sqlite/server.cs
+src/sqlite/session.cs
 src/sqlite/speciallity.cs
 src/sqlite/sport.cs
-src/sqlite/session.cs
 src/sqlite/stat.cs
 src/statType.cs
 src/stats/potency.cs

Modified: trunk/sqlite_diagrams/chronojump_sqlite.dia
==============================================================================
Binary files. No diff available.

Modified: trunk/sqlite_diagrams/chronojump_sqlite.png
==============================================================================
Binary files. No diff available.

Modified: trunk/src/angle/changelog
==============================================================================
--- trunk/src/angle/changelog	(original)
+++ trunk/src/angle/changelog	Fri Jan 23 17:32:35 2009
@@ -2,6 +2,16 @@
 having a black method full of validation things
 at end, validation should add compare code
 
+findHoles should work only on ROIs (Region Of Interest). 
+The best is to ask first user for the points and play with the threshold in
+ROI (don't with the hole image). ROI is always in the middle of
+point (in future, ROI is detected by kalvan)
+If the point gets lost on that ROI, ask user again
+Ability to record thresold for next person and load
+
+max size of point should be marked vy software, and also size of ROI
+(maybe in future, ROI of toe could be little than other ROIs (that move fast)
+
 des 18
 
 	changee toe to not allow to be one pixel width (really bottom of the

Modified: trunk/src/angle/kneeAngle.cpp
==============================================================================
--- trunk/src/angle/kneeAngle.cpp	(original)
+++ trunk/src/angle/kneeAngle.cpp	Fri Jan 23 17:32:35 2009
@@ -427,6 +427,9 @@
 			cvFlip( frame, frame_copy, 0 );
 
 
+imageGuiResult(gui, "a", font);
+//cvWaitKey(50); //to print above message
+
 		if(!gray)
 		{
 			gray = 		cvCreateImage(cvGetSize(frame),IPL_DEPTH_8U,1);
@@ -454,7 +457,9 @@
 		cvSmooth(frame_copy,frame_copy,2,5,5);
 		cvCvtColor(frame_copy,gray,CV_BGR2GRAY);
 		CvRect maxrect;
-			
+
+imageGuiResult(gui, "b", font);
+//cvWaitKey(50); //to print above message
 
 		/*
 		 * 3 
@@ -477,9 +482,13 @@
 			cvCvtColor(frame_copy,output,CV_BGR2GRAY);
 			cvThreshold(gray, output, threshold, thresholdMax,CV_THRESH_BINARY_INV);
 
+imageGuiResult(gui, "b1", font);
+//cvWaitKey(50); //to print above message
 
 
 			if(thresholdROIH != -1 || thresholdROIK != -1 || thresholdROIT != -1)  {
+imageGuiResult(gui, "b2", font);
+//cvWaitKey(50); //to print above message
 				int pointSize = 30;
 				CvRect rect;
 				rect.width=pointSize; rect.height=pointSize;
@@ -516,6 +525,8 @@
 					cvResetImageROI(gray);
 					cvResetImageROI(output);
 				}
+imageGuiResult(gui, "b3", font);
+//cvWaitKey(50); //to print above message
 
 
 				//					sprintf(label, "frame: %d", framesCount);
@@ -526,25 +537,33 @@
 				imagePrint(output, cvPoint(frame->width -200, frame->height-20), label, font, BLACK);
 
 				cvShowImage("threshold", output);
+imageGuiResult(gui, "b4", font);
+//cvWaitKey(50); //to print above message
 			}
 
+			if(framesCount >1) {
 
+imageGuiResult(gui, "b41", font);
+//cvWaitKey(50); //to print above message
 			CvSeq* seqHolesEnd = findHolesSkin(output, frame_copy, hipMarked, kneeMarked, toeMarked, font);
+imageGuiResult(gui, "b42", font);
+//cvWaitKey(50); //to print above message
 
 			hipMarked = *CV_GET_SEQ_ELEM( CvPoint, seqHolesEnd, 0); 
 			kneeMarked = *CV_GET_SEQ_ELEM( CvPoint, seqHolesEnd, 1 ); 
 			toeMarked = *CV_GET_SEQ_ELEM( CvPoint, seqHolesEnd, 2 ); 
+			}
 			
 			
 
-/* kalman */
+// kalman 
 			measurement_pt = kneeMarked;
 
 			//cvMatMulAdd(kalman->measurement_matrix, x_k,z_k,z_k);
 
 //			crossPoint(frame_copy, cvPoint(measurement_pt.x -20, measurement_pt.y), YELLOW, BIG); //works
 //			crossPoint(frame_copy, cvPoint(prediction_pt.x +20, prediction_pt.y), WHITE, BIG); //0,0
-/* /kalman */
+// /kalman 
 
 
 
@@ -560,15 +579,17 @@
 			cvNamedWindow( "toClick", 1 );
 			cvShowImage("toClick", frame_copy);
 
+imageGuiResult(gui, "b5", font);
+//cvWaitKey(50); //to print above message
 
 
-/* kalman */
+// kalman 
 			cvKalmanCorrect(kalman, measurement);
 
 			cvRandSetRange(&rng,0,sqrt(kalman->process_noise_cov->data.fl[0]),0);
 			cvRand(&rng, process_noise);			
 			cvMatMulAdd(kalman->transition_matrix, measurement, process_noise, measurement);
-/* /kalman */
+// /kalman 
 
 
 
@@ -585,7 +606,12 @@
 				forcePause = true;
 				reloadFrame = true;
 			}
+imageGuiResult(gui, "b6", font);
+//cvWaitKey(50); //to print above message
+
 		} 
+imageGuiResult(gui, "b7", font);
+//cvWaitKey(50); //to print above message
 		
 	//	cvWaitKey(0); ok
 		
@@ -623,6 +649,9 @@
 		kneeOld = kneeMarked;
 		toeOld = toeMarked;
 
+imageGuiResult(gui, "c", font);
+//cvWaitKey(50); //to print above message
+
 		/*
 		 * 4
 		 * PRINT MARKERS RELATED INFO AND DO CALCULATIONS LIKE ANGLE

Modified: trunk/src/chronojump.cs
==============================================================================
--- trunk/src/chronojump.cs	(original)
+++ trunk/src/chronojump.cs	Fri Jan 23 17:32:35 2009
@@ -51,17 +51,20 @@
 
 
 	public static void Main(string [] args) 
-	{
+	{/*
 		bool timeLogPassedOk = Log.Start(args);
 		Log.WriteLine(string.Format("Time log passed: {0}", timeLogPassedOk.ToString()));
 		Log.WriteLine(string.Format("Client database option 1 in ... " + Util.GetDatabaseDir()));
 		Log.WriteLine(string.Format("Client database option 2 in ... " + Util.GetDatabaseTempDir()));
 		string errorFile = Log.GetFile();
-		
+	
+		//comment this 4 lines to deactivated log, and use console.
+		//works better on a sudden crash
 		StreamWriter sw = new StreamWriter(new BufferedStream(new FileStream(errorFile, FileMode.Create)));
 		System.Console.SetOut(sw);
 		System.Console.SetError(sw);
 		sw.AutoFlush = true;
+*/
 
 		//this call has to be done to chronojump.prg
 		//chronojump.prg createBlankDB
@@ -105,6 +108,7 @@
 		
 
 		/* SERVER COMMUNICATION TESTS */
+/*
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
 
@@ -121,6 +125,7 @@
 		catch {
 			Log.WriteLine("Unable to call server");
 		}
+		*/
 		/* END OF SERVER COMMUNICATION TESTS */
 
 		//print version of chronojump

Modified: trunk/src/constants.cs
==============================================================================
--- trunk/src/constants.cs	(original)
+++ trunk/src/constants.cs	Fri Jan 23 17:32:35 2009
@@ -78,6 +78,9 @@
 	public const string IPUnknown = "Unknown"; 
 	public static int ServerUndefinedID = -1;
 	public static string ServerOffline = Catalog.GetString("Server is currently offline.");
+	public enum ServerSessionStates {
+		NOTHING, UPLOADINGSESSION, UPLOADINGPERSONS, UPLOADINGTESTS, DONE
+	}
 
 /*	OLD, check this
 	public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +
@@ -275,6 +278,8 @@
 		"South America" + ":" + Catalog.GetString("South America"),
 	};
 	
+	public static int Simulated = -1; 
+	
 	//levels of sport practice
 	//int will go into person database
 	//string will be shown in user language

Modified: trunk/src/execute/jump.cs
==============================================================================
--- trunk/src/execute/jump.cs	(original)
+++ trunk/src/execute/jump.cs	Fri Jan 23 17:32:35 2009
@@ -372,12 +372,11 @@
 
 		uniqueID = SqliteJump.Insert(false, Constants.JumpTable, "NULL", personID, sessionID, 
 				type, tv, tc, fall,  //type, tv, tc, fall
-				//weight, "", "", Util.BoolToInt(simulated)); //weight, limited, description
-				weight, "", angle, Util.BoolToInt(simulated)); //weight, description, simulated
+				weight, "", angle, Util.BoolToNegativeInt(simulated)); //weight, description, simulated
 
 		//define the created object
 		eventDone = new Jump(uniqueID, personID, sessionID, type, tv, tc, fall, 
-				weight, "", angle, Util.BoolToInt(simulated)); 
+				weight, "", angle, Util.BoolToNegativeInt(simulated)); 
 		
 		//event will be raised, and managed in chronojump.cs
 		fakeButtonFinished.Click();
@@ -913,7 +912,7 @@
 					fall, weight, description,
 					Util.GetAverage(tvString), Util.GetAverage(tcString),
 					tvString, tcString,
-					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)
+					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToNegativeInt(simulated)
 					);
 		else {
 			uniqueID = SqliteJumpRj.Insert(false, Constants.JumpRjTable, "NULL", personID, sessionID, 
@@ -921,11 +920,11 @@
 					fall, weight, description,
 					Util.GetAverage(tvString), Util.GetAverage(tcString),
 					tvString, tcString,
-					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)
+					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToNegativeInt(simulated)
 					);
 
 			//define the created object
-			eventDone = new JumpRj(uniqueID, personID, sessionID, type, tvString, tcString, fall, weight, description, jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)); 
+			eventDone = new JumpRj(uniqueID, personID, sessionID, type, tvString, tcString, fall, weight, description, jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToNegativeInt(simulated)); 
 
 
 			//event will be raised, and managed in chronojump.cs

Modified: trunk/src/execute/pulse.cs
==============================================================================
--- trunk/src/execute/pulse.cs	(original)
+++ trunk/src/execute/pulse.cs	Fri Jan 23 17:32:35 2009
@@ -324,11 +324,11 @@
 
 		uniqueID = SqlitePulse.Insert(false, Constants.PulseTable, "NULL", personID, sessionID, type, 
 				fixedPulse, totalPulsesNum, timesString, 
-				"", Util.BoolToInt(simulated) //description
+				"", Util.BoolToNegativeInt(simulated) //description
 				);
 
 		//define the created object
-		eventDone = new Pulse(uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timesString, "", Util.BoolToInt(simulated)); 
+		eventDone = new Pulse(uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timesString, "", Util.BoolToNegativeInt(simulated)); 
 		
 		string myStringPush =   Catalog.GetString("Last pulse") + ": " + personName + " " + type ;
 		appbar.Push( 1, myStringPush );

Modified: trunk/src/execute/reactionTime.cs
==============================================================================
--- trunk/src/execute/reactionTime.cs	(original)
+++ trunk/src/execute/reactionTime.cs	Fri Jan 23 17:32:35 2009
@@ -240,10 +240,10 @@
 		uniqueID = SqliteReactionTime.Insert(
 				false, Constants.ReactionTimeTable, 
 				"NULL", personID, sessionID, "", //type
-				time, "", Util.BoolToInt(simulated)); //time, description, simulated
+				time, "", Util.BoolToNegativeInt(simulated)); //time, description, simulated
 
 		//define the created object
-		eventDone = new ReactionTime(uniqueID, personID, sessionID, time, "", Util.BoolToInt(simulated)); 
+		eventDone = new ReactionTime(uniqueID, personID, sessionID, time, "", Util.BoolToNegativeInt(simulated)); 
 		
 		//event will be raised, and managed in chronojump.cs
 		fakeButtonFinished.Click();

Modified: trunk/src/execute/run.cs
==============================================================================
--- trunk/src/execute/run.cs	(original)
+++ trunk/src/execute/run.cs	Fri Jan 23 17:32:35 2009
@@ -293,10 +293,10 @@
 
 		uniqueID = SqliteRun.Insert(false, Constants.RunTable, "NULL", personID, sessionID, 
 				type, distance, time, "", //description
-				Util.BoolToInt(simulated)); 
+				Util.BoolToNegativeInt(simulated)); 
 		
 		//define the created object
-		eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, "", Util.BoolToInt(simulated)); 
+		eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, "", Util.BoolToNegativeInt(simulated)); 
 		
 		
 		//event will be raised, and managed in chronojump.cs
@@ -727,7 +727,7 @@
 					distanceInterval, intervalTimesString, tracks, 
 					"", 					//description
 					limitString,
-					Util.BoolToInt(simulated) 
+					Util.BoolToNegativeInt(simulated) 
 					);
 			}
 
@@ -737,11 +737,11 @@
 					distanceInterval, intervalTimesString, tracks, 
 					"", 					//description
 					limitString,
-					Util.BoolToInt(simulated) 
+					Util.BoolToNegativeInt(simulated) 
 					);
 
 			//define the created object
-			eventDone = new RunInterval(uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, "", limitString, Util.BoolToInt(simulated)); 
+			eventDone = new RunInterval(uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, "", limitString, Util.BoolToNegativeInt(simulated)); 
 
 
 			string tempValuesString = "";

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Fri Jan 23 17:32:35 2009
@@ -58,6 +58,7 @@
 	[Widget] Gtk.ComboBox combo_runs_interval;
 	[Widget] Gtk.ComboBox combo_pulses;
 
+	[Widget] Gtk.MenuItem menuitem_server_insert_session;
 	[Widget] Gtk.MenuItem menuitem_server_insert_person;
 
 	[Widget] Gtk.MenuItem menuitem_edit_selected_jump;
@@ -469,7 +470,7 @@
 		//	appbar2.Push ( 1, recuperatedString );
 
 		rand = new Random(40);
-		volumeOn = true;
+		//volumeOn = true;
 	
 		putNonStandardIcons();	
 		
@@ -494,8 +495,9 @@
 
 	private void putNonStandardIcons() {
 		Pixbuf pixbuf;
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-high.png");
-		image_volume.Pixbuf = pixbuf;
+		//pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-high.png");
+		//image_volume.Pixbuf = pixbuf;
+		
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_bell.png");
 		image_jump_reactive_bell.Pixbuf = pixbuf;
 		image_run_interval_bell.Pixbuf = pixbuf;
@@ -735,6 +737,12 @@
 		 else 
 			metersSecondsPreferred = false;
 		
+		if ( SqlitePreferences.Select("volumeOn") == "True" ) 
+			volumeOn = true;
+		 else 
+			volumeOn = false;
+		changeVolumeButton(volumeOn);
+		
 	
 		//change language works on windows. On Linux let's change the locale
 		//if(Util.IsWindows())
@@ -923,30 +931,121 @@
 		myMenu.ShowAll();
 	}
 		
-	//menu server calls
-	private void on_menuitem_server_ping (object o, EventArgs args) {
+	/* ---------------------------------------------------------
+	 * ----------------  SERVER CALLS --------------------------
+	 *  --------------------------------------------------------
+	 */
+
+	// upload session and it's persons (callback)
+	private void on_menuitem_server_insert_session (object o, EventArgs args) 
+	{
+		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+		if(evalSID == Constants.ServerUndefinedID) {
+			new DialogMessage(Constants.MessageTypes.WARNING, "Evaluator not in server.\n Nothing done!.");
+			return;
+		}
+	
+		try {	
+			if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) {
+				ChronojumpServer myServer = new ChronojumpServer();
+
+				Log.WriteLine(myServer.ConnectDatabase());
+
+				ServerSession serverSession = new ServerSession(currentSession, evalSID, progversion, 
+						Util.GetOS(), Util.DateParse(DateTime.Now.ToString()), Constants.ServerSessionStates.UPLOADINGSESSION); 
+
+				int idAtServer = myServer.InsertSession(serverSession);
+
+				Log.WriteLine(myServer.DisConnectDatabase());
+
+				//update session (serverUniqueID) on client database
+				currentSession.ServerUniqueID = idAtServer;
+				SqliteSession.UpdateServerUniqueID(currentSession.UniqueID, currentSession.ServerUniqueID);
+
+				new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + currentSession.UniqueID + ") " + 
+						" into server BD as ID: " + currentSession.ServerUniqueID);
+
+				myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGPERSONS); 
+
+				//adding the persons
+				string [] myPersons = SqlitePersonSession.SelectCurrentSession(serverSession.UniqueID, true, false); //onlyIDAndName, not reversed
+				foreach(string personStr in myPersons) {
+					Person person = SqlitePersonSession.PersonSelect(Util.FetchID(personStr), serverSession.UniqueID); 
+					serverUploadPerson(person, false);
+				}
+
+				myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGTESTS); 
+				
+			} else {
+				new DialogMessage(Constants.MessageTypes.WARNING, "(" + currentSession.UniqueID + ") " + 
+						" already exists in the BD as ID: " + currentSession.ServerUniqueID + ".\n Nothing done!.");
+			}
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+
+	}
+
+	//upload selected person (callback)
+	private void on_menuitem_server_insert_person (object o, EventArgs args) {
 		try {
+			//on_person_upload_to_server_activate(o, args);
+			serverUploadPerson(currentPerson, true);
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+	
+	//upload a person
+	private void serverUploadPerson(Person person, bool showDialogIfOk) {
+		if(person.ServerUniqueID == Constants.ServerUndefinedID) {
+
 			ChronojumpServer myServer = new ChronojumpServer();
+
 			Log.WriteLine(myServer.ConnectDatabase());
+			Log.WriteLine(myServer.SelectPersonName(1));
+
+			//this inserts also in personSession using client session
+			//this maybe have to be changed in future to server session
+
+			int idAtServer = myServer.InsertPerson(person, currentSession.UniqueID);
 
-			ServerPing myPing = new ServerPing(-1, Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
-			myServer.InsertPing(myPing);
-			
 			Log.WriteLine(myServer.DisConnectDatabase());
 
-			new DialogMessage(Constants.MessageTypes.INFO, "Inserted" + myPing.ToString());
-		} catch {
-			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+			//update person (serverUniqueID) on client database
+			person.ServerUniqueID = idAtServer;
+			SqlitePerson.Update(person);
+
+			if(showDialogIfOk)
+				new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + person.UniqueID + ") " + 
+						person.Name + " into server BD as ID: " + idAtServer);
+		} else {
+			new DialogMessage(Constants.MessageTypes.WARNING, "(" + person.UniqueID + ") " + 
+					person.Name + " already exists in the BD as ID: " + person.ServerUniqueID + ".\n Nothing done!.");
 		}
 	}
 
-	private void on_menuitem_server_insert_person (object o, EventArgs args) {
+	/*
+	private void on_person_upload_to_server_activate (object o, EventArgs args) 
+	{
+		serverUploadPerson(currentPerson);
+	}
+	*/
+
+	private void on_menuitem_server_stats (object o, EventArgs args) {
 		try {
-			on_person_upload_to_server_activate(o, args);
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+			ArrayList stats = myServer.Stats();
+			Log.WriteLine(myServer.DisConnectDatabase());
+
+			new DialogMessage(Constants.MessageTypes.INFO, "Stats in server:\n" + 
+					Util.ArrayListToSingleString(stats) + "\n" + Util.DateParse(DateTime.Now.ToString()));
 		} catch {
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
+	
 
 	private void on_menuitem_server_see_all (object o, EventArgs args) {
 		try {
@@ -961,34 +1060,54 @@
 		}
 	}
 	
-	private void on_person_upload_to_server_activate (object o, EventArgs args) {
-		if(currentPerson.ServerUniqueID == Constants.ServerUndefinedID) {
-
+	private void on_menuitem_server_ping (object o, EventArgs args) {
+		try {
 			ChronojumpServer myServer = new ChronojumpServer();
-
 			Log.WriteLine(myServer.ConnectDatabase());
-			Log.WriteLine(myServer.SelectPersonName(1));
-
-			//this inserts also in personSession using client session
-			//this maybe have to be changed in future to server session
-
-			int idAtServer = myServer.InsertPerson(currentPerson, currentSession.UniqueID);
+		
+			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
 
+			ServerPing myPing = new ServerPing(evalSID, progversion, Util.GetOS(), Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
+			myPing.UniqueID = myServer.InsertPing(myPing);
+			
 			Log.WriteLine(myServer.DisConnectDatabase());
 
-			//update person (serverUniqueID) on client database
-			currentPerson.ServerUniqueID = idAtServer;
-			SqlitePerson.Update(currentPerson);
-
-			new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + currentPerson.UniqueID + ") " + 
-					currentPerson.Name + " into server BD as ID: " + idAtServer);
-		} else {
-			new DialogMessage(Constants.MessageTypes.WARNING, "(" + currentPerson.UniqueID + ") " + 
-					currentPerson.Name + " already exists in the BD as ID: " + currentPerson.ServerUniqueID + ".\n Nothing done!.");
+			new DialogMessage(Constants.MessageTypes.INFO, "Inserted" + myPing.ToString());
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
+	}
+
+	private void on_menuitem_server_insert_evaluator (object o, EventArgs args) {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+			
+			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+			if(evalSID != Constants.ServerUndefinedID) {
+				//exists, nothing done
+				//new DialogMessage(Constants.MessageTypes.WARNING, "(" + currentPerson.UniqueID + ") " + 
+				//		currentPerson.Name + " already exists in the BD as ID: " + currentPerson.ServerUniqueID + ".\n Nothing done!.");
+				new DialogMessage(Constants.MessageTypes.WARNING, 
+						"Already exists in the BD as ID: " + evalSID + ".\n Nothing done!.");
+			} else {
+				//get Data, TODO: do it in a gui/window
+				ServerEvaluator myEval = new ServerEvaluator("myName", "myEmail", "myDateBorn", Constants.CountryUndefinedID, false);
+				//insert
+				myEval.UniqueID = myServer.InsertEvaluator(myEval);
+				//update evaluatorServerID locally
+				SqlitePreferences.Update("evaluatorServerID", myEval.UniqueID.ToString(), false);
 
+				new DialogMessage(Constants.MessageTypes.INFO, "Inserted with ID: " + myEval.UniqueID);
+			}
+			
+			Log.WriteLine(myServer.DisConnectDatabase());
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
 	}
 
+	
 
 	/* ---------------------------------------------------------
 	 * ----------------  TREEVIEW JUMPS ------------------------
@@ -1700,6 +1819,9 @@
 		if(sessionAddEditWin.CurrentSession != null) 
 		{
 			currentSession = sessionAddEditWin.CurrentSession;
+			//serverUniqueID is undefined until session is updated
+			currentSession.ServerUniqueID = Constants.ServerUndefinedID;
+
 			app1.Title = progname + " - " + currentSession.Name;
 
 			if(createdStatsWin) {
@@ -4207,21 +4329,29 @@
 	}
 
 	private void on_checkbutton_volume_clicked(object o, EventArgs args) {
-		Pixbuf pixbuf;
 		if(volumeOn) {
 			volumeOn = false;
-			pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-muted.png");
+			SqlitePreferences.Update("volumeOn", "False", false);
 		} else {
 			volumeOn = true;
-			pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-high.png");
+			SqlitePreferences.Update("volumeOn", "True", false);
 		}
-		image_volume.Pixbuf = pixbuf;
+		changeVolumeButton(volumeOn);
 
 //		if(repetitiveConditionsWin != null)
 			repetitiveConditionsWin.VolumeOn = volumeOn;
 
 		//Log.WriteLine("VolumeOn: {0}", volumeOn.ToString());
 	}
+		
+	private void changeVolumeButton(bool myVolume) {
+		Pixbuf pixbuf;
+		if(myVolume) 
+			pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-high.png");
+		else 
+			pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-muted.png");
+		image_volume.Pixbuf = pixbuf;
+	}
 
 	private void on_button_rj_bells_clicked(object o, EventArgs args) {
 		repetitiveConditionsWin.View(true, volumeOn); //show jumps
@@ -4276,6 +4406,7 @@
 		
 //		button_last_delete.Sensitive = false;
 		
+		menuitem_server_insert_session.Sensitive = false;
 		menuitem_server_insert_person.Sensitive = false;
 	}
 	
@@ -4294,6 +4425,8 @@
 		menuitem_edit_session.Sensitive = true;
 		menuitem_delete_session.Sensitive = true;
 		menu_persons.Sensitive = true;
+		
+		menuitem_server_insert_session.Sensitive = true;
 	}
 
 	//only called by delete person functions (if we run out of persons)

Modified: trunk/src/gui/event.cs
==============================================================================
--- trunk/src/gui/event.cs	(original)
+++ trunk/src/gui/event.cs	Fri Jan 23 17:32:35 2009
@@ -146,7 +146,7 @@
 		fillWindowTitleAndLabelHeader();
 
 		string id = myEvent.UniqueID.ToString();
-		if(myEvent.Simulated == 1) 
+		if(myEvent.Simulated == Constants.Simulated) 
 			label_simulated.Show();
 		
 		label_event_id_value.Text = id;

Modified: trunk/src/gui/session.cs
==============================================================================
--- trunk/src/gui/session.cs	(original)
+++ trunk/src/gui/session.cs	Fri Jan 23 17:32:35 2009
@@ -599,7 +599,8 @@
 			if(addSession) 
 				currentSession = new Session (Util.RemoveTildeAndColon(entry_name.Text), Util.RemoveTildeAndColon(entry_place.Text), myDate, 
 						sportID, speciallityID, levelID,
-						Util.RemoveTildeAndColon(textview.Buffer.Text));
+						Util.RemoveTildeAndColon(textview.Buffer.Text),
+						Constants.ServerUndefinedID);
 			else {
 				currentSession.Name = Util.RemoveTildeAndColon(entry_name.Text.ToString());
 				currentSession.Place = Util.RemoveTildeAndColon(entry_place.Text.ToString()); 
@@ -609,7 +610,7 @@
 				currentSession.PersonsPractice = levelID;
 				currentSession.Comments = Util.RemoveTildeAndColon(textview.Buffer.Text);
 
-				SqliteSession.Edit(currentSession.UniqueID, currentSession.Name, 
+				SqliteSession.Update(currentSession.UniqueID, currentSession.Name, 
 						currentSession.Place, currentSession.Date, 
 						sportID, speciallityID, levelID,
 						currentSession.Comments);

Added: trunk/src/serverEvaluator.cs
==============================================================================
--- (empty file)
+++ trunk/src/serverEvaluator.cs	Fri Jan 23 17:32:35 2009
@@ -0,0 +1,96 @@
+/*
+ * 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 System.Data;
+using System.Text; //StringBuilder
+
+using Mono.Unix;
+
+public class ServerEvaluator
+{
+	private int uniqueID;
+	private string name;
+	private string email;
+	private string dateBorn;
+	private int countryID;
+	private bool confiable;
+
+	//only initializing
+	//needed by the webservice
+	public ServerEvaluator() {
+	}
+
+	public ServerEvaluator(string name, string email, string dateBorn, int countryID, bool confiable) {
+		this.name = name;
+		this.email = email;
+		this.dateBorn = dateBorn;
+		this.countryID = countryID;
+		this.confiable = confiable;
+	}
+
+	public int InsertAtDB(bool dbconOpened){
+		Console.WriteLine("here" + this.ToString());
+		int myID = SqliteServer.InsertEvaluator(dbconOpened, name, email, dateBorn, countryID, confiable);
+		return myID;
+	}	
+
+	public override string ToString() {
+		return "ID: " + uniqueID + "; Name: " + name + 
+			"; Email: " + email + "; DateBorn: " + dateBorn +
+			"; CountryID: " + countryID + "; Confiable: " + confiable;
+	}
+	
+	public int UniqueID {
+		get { return uniqueID; }
+		set { uniqueID = value; }
+	}
+
+	//the set's are for the server
+	//"Private, internal, and protected members do not get serialized.  
+	//If the accessor is not specific, it is private by default (and will not get serialized)."
+	
+	public string Name {
+		get { return name; }
+		set { name = value; }
+	}
+
+	public string Email {
+		get { return email; }
+		set { email = value; }
+	}
+
+	public string DateBorn {
+		get { return dateBorn; }
+		set { dateBorn = value; }
+	}
+
+	public int CountryID {
+		get { return countryID; }
+		set { countryID = value; }
+	}
+
+	public bool Confiable {
+		get { return confiable; }
+		set { confiable = value; }
+	}
+
+}

Modified: trunk/src/serverPing.cs
==============================================================================
--- trunk/src/serverPing.cs	(original)
+++ trunk/src/serverPing.cs	Fri Jan 23 17:32:35 2009
@@ -29,6 +29,8 @@
 {
 	private int uniqueID;
 	private int evaluatorID;
+	private string cjVersion;
+	private string osVersion;
 	private string ip;
 	private string date;
 
@@ -37,23 +39,28 @@
 	public ServerPing() {
 	}
 
-	public ServerPing(int evaluatorID, string ip, string date) {
+	public ServerPing(int evaluatorID, string cjVersion, string osVersion, string ip, string date) {
 		this.evaluatorID = evaluatorID;
+		this.cjVersion = cjVersion;
+		this.osVersion = osVersion;
 		this.ip = ip;
 		this.date = date;
 	}
 
 	public int InsertAtDB(bool dbconOpened){
-		int myID = SqliteServer.InsertPing(dbconOpened, evaluatorID, ip, date);
+		int myID = SqliteServer.InsertPing(dbconOpened, evaluatorID, cjVersion, osVersion, ip, date);
 		return myID;
 	}	
 
 	public override string ToString() {
-		return "ID: " + uniqueID + "; evaluatorID: " + evaluatorID + "; IP: " + ip + "; date: " + date;
+		return "ID: " + uniqueID + "; EvaluatorID: " + evaluatorID + 
+			"; cjVersion: " + cjVersion + "; osVersion: " + osVersion +
+			"; IP: " + ip + "; Date: " + date;
 	}
 	
 	public int UniqueID {
 		get { return uniqueID; }
+		set { uniqueID = value; }
 	}
 
 	//the set's are for the server
@@ -65,6 +72,16 @@
 		set { evaluatorID = value; }
 	}
 
+	public string CJVersion {
+		get { return cjVersion; }
+		set { cjVersion = value; }
+	}
+
+	public string OSVersion {
+		get { return osVersion; }
+		set { osVersion = value; }
+	}
+
 	public string IP {
 		get { return ip; }
 		set { ip = value; }

Modified: trunk/src/session.cs
==============================================================================
--- trunk/src/session.cs	(original)
+++ trunk/src/session.cs	Fri Jan 23 17:32:35 2009
@@ -27,16 +27,18 @@
 
 public class Session {
 
-	int uniqueID;
-	string name;
-	string place;
-	string date;
-	string comments;
-	
-	private int personsSportID;	//1 undefined, 2 none, 3...n other sports (check table sportType). On session, undefined means that there's no default sport because persons have different sports
-	private int personsSpeciallityID;
-	private int personsPractice;	//-1 undefined, sedentary, 1 regular practice, 2 competition, 3 (alto rendimiento)
-	
+	protected int uniqueID;
+	protected string name;
+	protected string place;
+	protected string date;
+	protected string comments;
+	protected int serverUniqueID; //not on server
+	
+	protected int personsSportID;	//1 undefined, 2 none, 3...n other sports (check table sportType). On session, undefined means that there's no default sport because persons have different sports
+	protected int personsSpeciallityID;
+	protected int personsPractice;	//-1 undefined, sedentary, 1 regular practice, 2 competition, 3 (alto rendimiento)
+
+
 	//on gui SessionAddEditWindow, when we add a session, we call that class from gui/chronojump.cs with a session with -1 as uniqueID
 	public Session() {
 		uniqueID = -1;
@@ -47,7 +49,7 @@
 	//With person sport stuff
 	public Session(string newUniqueID, string newName, string newPlace, string newDate, 
 			int personsSportID, int personsSpeciallityID, int personsPractice,
-			string newComments) 
+			string newComments, int serverUniqueID) 
 	{
 		uniqueID = Convert.ToInt32(newUniqueID);
 		name = newName;
@@ -57,12 +59,13 @@
 		this.personsSpeciallityID = personsSpeciallityID;
 		this.personsPractice = personsPractice;
 		comments = newComments;
+		this.serverUniqueID = serverUniqueID; //remember don't do this on server
 	}
 
 	//typical constructor with personsSport stuff
 	public Session(string newName, string newPlace, string newDate, 
 			int personsSportID, int personsSpeciallityID, int personsPractice,
-			string newComments) 
+			string newComments, int serverUniqueID) 
 	{
 		name = newName;
 		place = newPlace;
@@ -75,14 +78,47 @@
 		name = Util.RemoveTildeAndColon(name);
 		place = Util.RemoveTildeAndColon(place);
 		comments = Util.RemoveTildeAndColon(comments);
+		this.serverUniqueID = serverUniqueID; //remember don't do this on server
 
-		
+		/*
 		uniqueID = SqliteSession.Insert (false, //dbconOpened,
-				Constants.SessionTable, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments);
+				Constants.SessionTable, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments, serverUniqueID);
+		*/
+		uniqueID = -1;
+		int insertedID = this.InsertAtDB(false, Constants.SessionTable);
+
+		//we need uniqueID for personSession
+		uniqueID = insertedID;
+
 
 		Log.WriteLine(this.ToString());
 	}
 
+	//used to select a session at Sqlite.convertTables
+	public Session(string [] myString)
+	{
+		this.uniqueID = Convert.ToInt32(myString[0]);
+		this.name = myString[1];
+		this.place = myString[2];
+		this.date = myString[3];
+		this.personsSportID = Convert.ToInt32(myString[4]);
+		this.personsSpeciallityID = Convert.ToInt32(myString[5]);
+		this.personsPractice = Convert.ToInt32(myString[6]);
+		this.comments = myString[7];
+		this.serverUniqueID = Convert.ToInt32(myString[8]);
+	}
+
+	public virtual int InsertAtDB (bool dbconOpened, string tableName) {
+		int myID = SqliteSession.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), name,
+				place, date, 
+				personsSportID, 
+				personsSpeciallityID, 
+				personsPractice, 
+				comments,
+				serverUniqueID);
+		return myID;
+	}
 	
 	public override string ToString()
 	{
@@ -127,6 +163,11 @@
 		set { comments = value; }
 	}
 	
+	public int ServerUniqueID {
+		get { return serverUniqueID; }
+		set { serverUniqueID = value; }
+	}
+
 	public int UniqueID {
 		get { return uniqueID; } 
 		set { uniqueID = value; }
@@ -154,3 +195,90 @@
 	   
 }
 
+public class ServerSession : Session
+{
+	//server stuff
+	int evaluatorID;
+	string evaluatorCJVersion;
+	string evaluatorOS;
+	string uploadedDate;
+	Constants.ServerSessionStates uploadingState;
+	//int uploadingState;
+
+	public ServerSession() {
+	}
+	
+	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;
+		place = mySession.Place;
+		date = mySession.Date;
+		personsSportID = mySession.PersonsSportID;
+		personsSpeciallityID = mySession.PersonsSpeciallityID;
+		personsPractice = mySession.PersonsPractice;
+		comments = mySession.Comments;
+		this.evaluatorID = evaluatorID;
+		this.evaluatorCJVersion = evaluatorCJVersion;
+		this.evaluatorOS = evaluatorOS;
+		this.uploadedDate = uploadedDate;
+		this.uploadingState = uploadingState;
+	}
+
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		int myID = SqliteServerSession.Insert(dbconOpened, tableName, 
+				//uniqueID.ToString(),
+				name,
+				place, date, 
+				personsSportID, 
+				personsSpeciallityID, 
+				personsPractice, 
+				comments,
+				serverUniqueID,
+				evaluatorID,
+				evaluatorCJVersion,
+				evaluatorOS,
+				uploadedDate,
+				uploadingState
+				);
+		return myID;
+	}
+	
+	public override string ToString()
+	{
+		return "[" + uniqueID + "]" + name + ", " + place + ", " + date + ", " + 
+			comments + ",(" + serverUniqueID + "), /" + evaluatorID + "/, " + 
+			evaluatorCJVersion + ", " + evaluatorOS + ", " + uploadedDate + ", " + uploadingState;
+	}
+	
+	public int EvaluatorID {
+		get { return evaluatorID; }
+		set { evaluatorID = value; }
+	}
+
+	public string EvaluatorCJVersion {
+		get { return evaluatorCJVersion; }
+		set { evaluatorCJVersion = value; }
+	}
+
+	public string EvaluatorOS {
+		get { return evaluatorOS; }
+		set { evaluatorOS = value; }
+	}
+
+	public string UploadedDate {
+		get { return uploadedDate; }
+		set { uploadedDate = value; }
+	}
+
+	public Constants.ServerSessionStates UploadingState {
+	//public int UploadingState {
+		get { return uploadingState; }
+		set { uploadingState = value; }
+	}
+
+
+}
+

Modified: trunk/src/sport.cs
==============================================================================
--- trunk/src/sport.cs	(original)
+++ trunk/src/sport.cs	Fri Jan 23 17:32:35 2009
@@ -56,7 +56,7 @@
 		this.graphLink = graphLink;
 	}
 
-	public string ToString() {
+	public override string ToString() {
 		string myString = "";
 		if(this.userDefined)
 			myString = "(" + Catalog.GetString(userDefinedString) + ")";

Modified: trunk/src/sqlite/event.cs
==============================================================================
--- trunk/src/sqlite/event.cs	(original)
+++ trunk/src/sqlite/event.cs	Fri Jan 23 17:32:35 2009
@@ -93,4 +93,42 @@
 		return returnString;
 	}
 		
+	//useful for passing serverUniqueID as simulated int
+	//updating local test when it gets uploaded
+	public static void UpdateSimulate(bool dbconOpened, string tableName, int uniqueID, int simulated)
+	{
+		if(!dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "UPDATE " + tableName + " SET simulated = " + simulated + 
+			" WHERE uniqueID == " + uniqueID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		if(!dbconOpened)
+			dbcon.Close();
+	}
+
+	//convertSimulate and simulateConvertToNegative as a part of db conversion to 0.60
+	//0.59 - 0.60 (...) Simulated now are -1, because 0 is real and positive is serverUniqueID
+	private static void convertSimulate(string tableName)
+	{
+		dbcmd.CommandText = "UPDATE " + tableName + " SET simulated = -1" + 
+			" WHERE simulated == 1";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+	}
+	public static void SimulatedConvertToNegative() 
+	{
+		convertSimulate(Constants.JumpTable);
+		convertSimulate(Constants.JumpRjTable);
+		convertSimulate(Constants.RunTable);
+		convertSimulate(Constants.RunIntervalTable);
+		convertSimulate(Constants.PulseTable);
+		convertSimulate(Constants.ReactionTimeTable);
+
+		//also as caution:
+		convertSimulate(Constants.TempJumpRjTable);
+		convertSimulate(Constants.TempRunIntervalTable);
+	}
 }

Modified: trunk/src/sqlite/jump.cs
==============================================================================
--- trunk/src/sqlite/jump.cs	(original)
+++ trunk/src/sqlite/jump.cs	Fri Jan 23 17:32:35 2009
@@ -55,7 +55,10 @@
 			"weight TEXT, " + //string because can contain "33%" or "50Kg"
 			"description TEXT, " +
 			"angle FLOAT, " + //-1.0 if undef
-			"simulated INT )";
+			"simulated INT )"; 	//since db: 0.60 (cj 0.8.1.2) simulated = -1, real test (not uploaded to server) = 0, 
+						//positive numbers represent the serverUniqueID
+						//the simulated has two purposes, but it's logical because 
+						//only real tests can be uploaded
 		dbcmd.ExecuteNonQuery();
 	}
 	

Modified: trunk/src/sqlite/main.cs
==============================================================================
--- trunk/src/sqlite/main.cs	(original)
+++ trunk/src/sqlite/main.cs	Fri Jan 23 17:32:35 2009
@@ -73,7 +73,7 @@
 	 * 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.59";
+	static string lastChronojumpDatabaseVersion = "0.60";
 
 	public Sqlite() {
 	}
@@ -688,7 +688,7 @@
 				SqlitePreferences.Update ("databaseVersion", "0.57", true); 
 				dbcon.Close();
 				
-				Log.WriteLine("Added simulated column to each event table on client. Added race, country, serverUniqueID. Convert to sport related done here if needed");
+				Log.WriteLine("Added simulated column to each event table on client. Added to person: race, country, serverUniqueID. Convert to sport related done here if needed");
 				currentVersion = "0.57";
 			}
 			if(currentVersion == "0.57") {
@@ -727,6 +727,32 @@
 				currentVersion = "0.59";
 			}
 
+			if(currentVersion == "0.59") {
+				dbcon.Open();
+				conversionRateTotal = 4;
+
+				conversionRate = 1;
+				SqlitePreferences.Insert ("volumeOn", "True"); 
+				SqlitePreferences.Insert ("evaluatorServerID", "-1");
+
+				conversionRate = 2;
+			
+				int columnsBefore = 8;
+				ArrayList arrayServerID = new ArrayList(1);
+				arrayServerID.Add(Constants.ServerUndefinedID.ToString());
+				convertTables(new SqliteSession(), Constants.SessionTable, columnsBefore, arrayServerID, false);
+				
+				conversionRate = 3;
+				SqliteEvent.SimulatedConvertToNegative();
+
+				SqlitePreferences.Update ("databaseVersion", "0.60", true); 
+				Log.WriteLine("Converted DB to 0.60 (added volumeOn and evaluatorServerID to preferences. session has now serverUniqueID. Simulated now are -1, because 0 is real and positive is serverUniqueID)"); 
+				
+				conversionRate = 4;
+				dbcon.Close();
+				currentVersion = "0.60";
+			}
+
 
 		}
 
@@ -755,14 +781,23 @@
 	{
 		dbcon.Open();
 
+		creationTotal = 12;
+		creationRate = 1;
+
 		if(server) {
 			SqliteServer sqliteServerObject = new SqliteServer();
 			sqliteServerObject.CreatePingTable();
 			sqliteServerObject.CreateEvaluatorTable();
+			
+			SqliteServerSession sqliteSessionObject = new SqliteServerSession();
+			sqliteSessionObject.createTable(Constants.SessionTable);
+		} else {
+			SqliteSession sqliteSessionObject = new SqliteSession();
+			sqliteSessionObject.createTable(Constants.SessionTable);
+			creationRate ++;
 		}
+		
 
-		creationTotal = 12;
-		creationRate = 1;
 		SqlitePerson sqlitePersonObject = new SqlitePerson();
 		sqlitePersonObject.createTable(Constants.PersonTable);
 
@@ -820,9 +855,6 @@
 		SqliteSpeciallity.InsertUndefined(true);
 
 		creationRate ++;
-		SqliteSession.createTable(Constants.SessionTable);
-		
-		creationRate ++;
 		SqlitePersonSession.createTable();
 		
 		creationRate ++;
@@ -834,6 +866,7 @@
 		SqliteCountry.initialize();
 		
 		//changes [from - to - desc]
+		//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
 		//0.58 - 0.59 Added 'showAngle' to preferences, changed angle on jump to double
 		//0.57 - 0.58 Countries without kingdom or republic (except when needed)
 		//0.56 - 0.57 Added simulated column to each event table on client. person: race, country, serverID. Convert to sport related done here if needed");
@@ -956,6 +989,7 @@
 		conversionSubRate = 1;
 		conversionSubRateTotal = -1; //unknown yet
 
+
 		//2st create convert temp table
 		sqliteObject.createTable(Constants.ConvertTempTable);
 
@@ -963,9 +997,9 @@
 		ArrayList myArray = new ArrayList(2);
 		dbcmd.CommandText = "SELECT * " + 
 			"FROM " + tableName + " ORDER BY uniqueID"; 
+		Log.WriteLine(dbcmd.CommandText.ToString());
 		SqliteDataReader reader;
 		reader = dbcmd.ExecuteReader();
-		Log.WriteLine(dbcmd.CommandText.ToString());
 
 		while(reader.Read()) {
 			string [] myReaderStr = new String[columnsBefore + columnsToAdd.Count];
@@ -990,6 +1024,9 @@
 			if(tableName == Constants.PersonTable) {	
 				Person myPerson =  new Person(myReaderStr);
 				myArray.Add(myPerson);
+			} else if(tableName == Constants.SessionTable) {	
+				Session mySession = new Session(myReaderStr);
+				myArray.Add(mySession);
 			} else {
 				Event myEvent =  new Event();	
 				switch (tableName) {
@@ -1024,6 +1061,11 @@
 				myPerson.InsertAtDB(true, Constants.ConvertTempTable);
 				conversionSubRate ++;
 			}
+		} else if(tableName == Constants.SessionTable) {	
+			foreach (Session mySession in myArray) {
+				mySession.InsertAtDB(true, Constants.ConvertTempTable);
+				conversionSubRate ++;
+			}
 		} else {
 			foreach (Event myEvent in myArray) {
 				myEvent.InsertAtDB(true, Constants.ConvertTempTable);
@@ -1043,6 +1085,11 @@
 				myPerson.InsertAtDB(true, tableName);
 				conversionSubRate ++;
 			}
+		} else if(tableName == Constants.SessionTable) {	
+			foreach (Session mySession in myArray) {
+				mySession.InsertAtDB(true, tableName);
+				conversionSubRate ++;
+			}
 		} else {
 			foreach (Event myEvent in myArray) {
 				myEvent.InsertAtDB(true, tableName);

Modified: trunk/src/sqlite/personSession.cs
==============================================================================
--- trunk/src/sqlite/personSession.cs	(original)
+++ trunk/src/sqlite/personSession.cs	Fri Jan 23 17:32:35 2009
@@ -166,7 +166,6 @@
 	public static Person PersonSelect(int uniqueID, int sessionID)
 	{
 		dbcon.Open();
-		//dbcmd.CommandText = "SELECT name, sex, dateborn, height, weight, description " +
 		dbcmd.CommandText = "SELECT person.name, person.sex, person.dateborn, person.height, " +
 			"personSessionWeight.weight, person.sportID, person.speciallityID, person.practice, person.description, " +
 			"person.race, person.countryID, person.serverUniqueID " +

Modified: trunk/src/sqlite/preferences.cs
==============================================================================
--- trunk/src/sqlite/preferences.cs	(original)
+++ trunk/src/sqlite/preferences.cs	Fri Jan 23 17:32:35 2009
@@ -61,6 +61,8 @@
 		Insert ("metersSecondsPreferred", "True");
 		Insert ("language", "es-ES"); 
 		Insert ("allowFinishRjAfterTime", "True"); 
+		Insert ("volumeOn", "True"); 
+		Insert ("evaluatorServerID", "-1");
 	}
 
 	public static void Insert(string myName, string myValue)

Modified: trunk/src/sqlite/server.cs
==============================================================================
--- trunk/src/sqlite/server.cs	(original)
+++ trunk/src/sqlite/server.cs	Fri Jan 23 17:32:35 2009
@@ -28,6 +28,7 @@
 using Mono.Data.Sqlite;
 //using System.Data.SQLite;
 
+using Mono.Unix; //Catalog
 
 class SqliteServer : Sqlite
 {
@@ -42,6 +43,8 @@
 			"CREATE TABLE " + Constants.ServerPingTable + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"evaluatorID INT, " + //foreign key
+			"cjVersion TEXT, " +
+			"osVersion TEXT, " +
 			"IP TEXT, " +
 			"date TEXT ) ";
 		dbcmd.ExecuteNonQuery();
@@ -52,7 +55,6 @@
 		dbcmd.CommandText = 
 			"CREATE TABLE " + Constants.ServerEvaluatorTable + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
-			"code TEXT, " +
 			"name TEXT, " +
 			"email TEXT, " +
 			"dateborn TEXT, " +
@@ -62,7 +64,7 @@
 	 }
 
 	//public static int InsertPing(ServerPing ping)
-	public static int InsertPing(bool dbconOpened, int evaluatorID, string ip, string date)
+	public static int InsertPing(bool dbconOpened, int evaluatorID, string cjVersion, string osVersion, string ip, string date)
 	{
 		if(! dbconOpened)
 			dbcon.Open();
@@ -70,9 +72,10 @@
 		string uniqueID = "NULL";
 
 		string myString = "INSERT INTO " + Constants.ServerPingTable + 
-			" (uniqueID, evaluatorID, IP, date) VALUES (" + 
-			//uniqueID + ", " + ping.EvaluatorID + ", '" + ping.IP + "', '" + ping.Date + "')" ;
-			uniqueID + ", " + evaluatorID + ", '" + ip + "', '" + date + "')" ;
+			" (uniqueID, evaluatorID, cjVersion, osVersion, IP, date) VALUES (" + 
+			uniqueID + ", " + evaluatorID + ", '" + 
+			cjVersion + "', '" + osVersion + "', '" +
+			ip + "', '" + date + "')" ;
 		
 		dbcmd.CommandText = myString;
 		
@@ -87,29 +90,23 @@
 		return myReturn;
 	}
 
-
-	/*
-
-	//can be "Constants.PersonTable" or "Constants.ConvertTempTable"
-	//temp is used to modify table between different database versions if needed
-	//public static int Insert(bool dbconOpened, string tableName, string name, string sex, string dateBorn, int height, int weight, int sportID, bool sportUserDefined, int practice, string description)
-	public static int Insert(bool dbconOpened, string tableName, string uniqueID, string name, string sex, string dateBorn, int height, int weight, int sportID, int speciallityID, int practice, string description, int race, int countryID, int serverUniqueID)
+	public static int InsertEvaluator(bool dbconOpened, string name, string email, string dateBorn, int countryID, bool confiable)
 	{
 		if(! dbconOpened)
 			dbcon.Open();
 
-		if(uniqueID == "-1")
-			uniqueID = "NULL";
+		string uniqueID = "NULL";
 
-		string myString = "INSERT INTO " + tableName + 
-			//" (uniqueID, name, sex, dateBorn, height, weight,  sportID, speciallityID, practice, description) VALUES (NULL, '" +
-			" (uniqueID, name, sex, dateBorn, height, weight,  sportID, speciallityID, practice, description, race, countryID, serverUniqueID) VALUES (" + uniqueID + ", '" +
-			name + "', '" + sex + "', '" + dateBorn + "', " + 
-			height + ", " + "-1" + ", " + //"-1" is weight because it's defined in personSesionWeight for allow change between sessions
-			sportID + ", " + speciallityID + ", " + practice + ", '" + description + "', " + 
-			race + ", " + countryID + ", " + serverUniqueID + ")" ;
+		string myString = "INSERT INTO " + Constants.ServerEvaluatorTable + 
+			" (uniqueID, name, email, dateBorn, countryID, confiable) VALUES (" + 
+			uniqueID + ", '" + name + "', '" + 
+			email + "', '" + dateBorn + "', " +
+			countryID + ", " + Util.BoolToInt(confiable) + ")" ;
 		
 		dbcmd.CommandText = myString;
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		
 		dbcmd.ExecuteNonQuery();
 		int myReturn = dbcon.LastInsertRowId;
 
@@ -119,375 +116,42 @@
 		return myReturn;
 	}
 
-	public static string SelectJumperName(int uniqueID)
+	public static ArrayList Stats() 
 	{
 		dbcon.Open();
-
-		dbcmd.CommandText = "SELECT name FROM " + Constants.PersonTable + " WHERE uniqueID == " + uniqueID;
-		
+		dbcmd.CommandText = "SELECT " +
+			" MAX(SPing.uniqueID), MAX(SEvaluator.uniqueID), MAX(session.uniqueID), MAX(person.uniqueID) " +
+			//", " + 
+			//" MAX(jump.uniqueID), MAX(jumpRj.uniqueID), MAX(run.uniqueID), MAX(runInterval.uniqueID), "+
+			//" MAX(reactionTime.uniqueID), MAX(pulse.uniqueID)" +
+			" FROM SPing, SEvaluator, session, person";
+			//, jump, jumpRj, run, runInterval, reactionTime, pulse";
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-		
-		string myReturn = "";
-		if(reader.Read()) {
-			myReturn = reader[0].ToString();
-		}
-		dbcon.Close();
-		return myReturn;
-	}
-		
-	//currently only used on server
-	public static ArrayList SelectAllPersons() 
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT * FROM person"; 
+		//TODO: problema quan no hi ha registres d'alguna tabla, com per exemple: reactionTime, llavors dona sempre: |||||||||
 		
 		SqliteDataReader reader;
 		reader = dbcmd.ExecuteReader();
-
 		ArrayList myArray = new ArrayList(1);
-
-		while(reader.Read()) 
-			myArray.Add ("(" + reader[0].ToString() + ") " + reader[1].ToString());
-
-		reader.Close();
-		dbcon.Close();
-
-		return myArray;
-	}
-		
-	public static string[] SelectAllPersonsRecuperable(string sortedBy, int except, int inSession, string searchFilterName) 
-	{
-		//sortedBy = name or uniqueID (= creation date)
-	
-
-		//1st select all the person.uniqueID of people who are in CurrentSession (or none if except == -1)
-		//2n select all names in database (or in one session if inSession != -1)
-		//3d filter all names (save all found in 2 that is not in 1)
-		//
-		//probably this can be made in only one time... future
-		//
-		//1
-		
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT person.uniqueID " +
-			" FROM person, personSessionWeight " +
-			" WHERE personSessionWeight.sessionID == " + except + 
-			" AND person.uniqueID == personSessionWeight.personID "; 
-		
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-
-		ArrayList myArray = new ArrayList(2);
-
-		int count = new int();
-		count = 0;
-
-		while(reader.Read()) {
-			myArray.Add (reader[0].ToString());
-			count ++;
-		}
-
-		reader.Close();
-		dbcon.Close();
-		
-		//2
-		//sort no case sensitive when we sort by name
-		if(sortedBy == "name") { 
-			sortedBy = "lower(person.name)" ; 
-		} else { 
-			sortedBy = "person.uniqueID" ; 
-		}
-		
-		dbcon.Open();
-		if(inSession == -1) {
-			string nameLike = "";
-			if(searchFilterName != "")
-				nameLike = "LOWER(person.name) LIKE LOWER ('%" + searchFilterName + "%') AND ";
-
-			dbcmd.CommandText = 
-				"SELECT person.*, personSessionWeight.weight, sport.Name, speciallity.Name  " +
-				" FROM person, personSessionWeight, sport, speciallity " + 
-				" WHERE " + nameLike + " person.UniqueID == personSessionWeight.personID " +
-				" AND person.sportID == sport.UniqueID AND person.speciallityID == speciallity.UniqueID " +
-				" GROUP BY person.uniqueID" +
-				" ORDER BY " + sortedBy;
-		} else {
-			dbcmd.CommandText = 
-				"SELECT person.*, personSessionWeight.weight, sport.Name, speciallity.Name " +
-				" FROM person, personSessionWeight, sport, speciallity " + 
-				" WHERE personSessionWeight.sessionID == " + inSession + 
-				" AND person.uniqueID == personSessionWeight.personID " + 
-				" AND person.sportID == sport.UniqueID AND person.speciallityID == speciallity.UniqueID " +
-				" ORDER BY " + sortedBy;
-		}
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		SqliteDataReader reader2;
-		reader2 = dbcmd.ExecuteReader();
-
-		ArrayList myArray2 = new ArrayList(2);
-
-		int count2 = new int();
-		count2 = 0;
-		bool found;
-
-		//3
-		while(reader2.Read()) {
-			found = false;
-			foreach (string line in myArray) {
-				if(line == reader2[0].ToString()) {
-					found = true;
-					goto finishForeach;
-				}
-			}
-			
-finishForeach:
-			
-			if (!found) {
-				myArray2.Add (reader2[0].ToString() + ":" + reader2[1].ToString() + ":" +
-						reader2[2].ToString() + ":" + reader2[3].ToString() + ":" +
-						reader2[4].ToString() + ":" + 
-						reader2[13].ToString() + ":" + //weight (from personSessionWeight)
-						reader2[14].ToString() + ":" + //sportName
-						reader2[15].ToString() + ":" + //speciallityName
-						Util.FindLevelName(Convert.ToInt32(reader2[8])) + ":" + //levelName
-						reader2[9].ToString() //description
-						);
-					//add race, countryID, serverUniqueID
-				count2 ++;
-			}
-		}
-
-		reader2.Close();
-		dbcon.Close();
-
-		string [] myPersons = new string[count2];
-		count2 = 0;
-		foreach (string line in myArray2) {
-			myPersons [count2++] = line;
-		}
-
-		return myPersons;
-	}
-
-	public static ArrayList SelectAllPersonEvents(int personID) 
-	{
-		SqliteDataReader reader;
-		ArrayList arraySessions = new ArrayList(2);
-		ArrayList arrayJumps = new ArrayList(2);
-		ArrayList arrayJumpsRj = new ArrayList(2);
-		ArrayList arrayRuns = new ArrayList(2);
-		ArrayList arrayRunsInterval = new ArrayList(2);
-		ArrayList arrayRTs = new ArrayList(2);
-		ArrayList arrayPulses = new ArrayList(2);
-	
-		dbcon.Open();
-		
-		//session where this person is loaded
-		dbcmd.CommandText = "SELECT sessionID, session.Name, session.Place, session.Date " + 
-			" FROM personSessionWeight, session " + 
-			" WHERE personID = " + personID + " AND session.uniqueID == personSessionWeight.sessionID " +
-			" ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arraySessions.Add ( reader[0].ToString() + ":" + reader[1].ToString() + ":" +
-					reader[2].ToString() + ":" + reader[3].ToString() );
-		}
-		reader.Close();
-
-		
-		//jumps
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM jump WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arrayJumps.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
-		}
-		reader.Close();
-		
-		//jumpsRj
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM jumpRj WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arrayJumpsRj.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
-		}
-		reader.Close();
-		
-		//runs
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM run WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arrayRuns.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
-		}
-		reader.Close();
-		
-		//runsInterval
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM runInterval WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arrayRunsInterval.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
-		}
-		reader.Close();
-		
-		//reaction time
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM reactiontime WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
 		
-		reader = dbcmd.ExecuteReader();
 		while(reader.Read()) {
-			arrayRTs.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
+			myArray.Add(Catalog.GetString("Pings")  	+ ": " + reader[0].ToString()); //ping
+			myArray.Add(Catalog.GetString("Evaluators") 	+ ": " + reader[1].ToString()); //eval
+			myArray.Add(Catalog.GetString("Sessions")   	+ ": " + reader[2].ToString()); //sess
+			myArray.Add(Catalog.GetString("Persons")  	+ ": " + reader[3].ToString()); //pers
+			/*
+			myArray.Add(reader[4].ToString()); //jump
+			myArray.Add(reader[5].ToString()); //jumpRj
+			myArray.Add(reader[6].ToString()); //run
+			myArray.Add(reader[7].ToString()); //runI
+			myArray.Add(reader[8].ToString()); //rt
+			myArray.Add(reader[9].ToString()); //pulse
+			*/
 		}
-		reader.Close();
-	
-		//pulses
-		dbcmd.CommandText = "SELECT sessionID, count(*) FROM pulse WHERE personID = " + personID +
-			" GROUP BY sessionID ORDER BY sessionID";
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		
-		reader = dbcmd.ExecuteReader();
-		while(reader.Read()) {
-			arrayPulses.Add ( reader[0].ToString() + ":" + reader[1].ToString() );
-		}
-		reader.Close();
-	
-	
-		dbcon.Close();
 		
-	
-		ArrayList arrayAll = new ArrayList(2);
-		string tempJumps;
-		string tempJumpsRj;
-		string tempRuns;
-		string tempRunsInterval;
-		string tempRTs;
-		string tempPulses;
-		bool found; 	//using found because a person can be loaded in a session 
-				//but whithout having done any event yet
-
-		//foreach session where this jumper it's loaded, check which events has
-		foreach (string mySession in arraySessions) {
-			string [] myStrSession = mySession.Split(new char[] {':'});
-			tempJumps = "";
-			tempJumpsRj = "";
-			tempRuns = "";
-			tempRunsInterval = "";
-			tempRTs = "";
-			tempPulses = "";
-			found = false;
-			
-			foreach (string myJumps in arrayJumps) {
-				string [] myStr = myJumps.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempJumps = myStr[1];
-					found = true;
-					break;
-				}
-			}
-		
-			foreach (string myJumpsRj in arrayJumpsRj) {
-				string [] myStr = myJumpsRj.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempJumpsRj = myStr[1];
-					found = true;
-					break;
-				}
-			}
-			
-			foreach (string myRuns in arrayRuns) {
-				string [] myStr = myRuns.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempRuns = myStr[1];
-					found = true;
-					break;
-				}
-			}
-			
-			foreach (string myRunsInterval in arrayRunsInterval) {
-				string [] myStr = myRunsInterval.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempRunsInterval = myStr[1];
-					found = true;
-					break;
-				}
-			}
-			
-			foreach (string myRTs in arrayRTs) {
-				string [] myStr = myRTs.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempRTs = myStr[1];
-					found = true;
-					break;
-				}
-			}
-			
-			foreach (string myPulses in arrayPulses) {
-				string [] myStr = myPulses.Split(new char[] {':'});
-				if(myStrSession[0] == myStr[0]) {
-					tempPulses = myStr[1];
-					found = true;
-					break;
-				}
-			}
-			
-
-
-			//if has events, write it's data
-			if (found) {
-				arrayAll.Add (myStrSession[1] + ":" + myStrSession[2] + ":" + 	//session name, place
-						myStrSession[3] + ":" + tempJumps + ":" + 	//sessionDate, jumps
-						tempJumpsRj + ":" + tempRuns + ":" + 		//jumpsRj, Runs
-						tempRunsInterval + ":" + tempRTs + ":" + 	//runsInterval, Reaction times
-						tempPulses);					//pulses
-			}
-		}
-
-		return arrayAll;
-	}
-	
-	public static void Update(Person myPerson)
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "UPDATE " + Constants.PersonTable + 
-			" SET name = '" + myPerson.Name + 
-			"', sex = '" + myPerson.Sex +
-			"', dateborn = '" + myPerson.DateBorn +
-			"', height = " + myPerson.Height +
-			", weight = " + myPerson.Weight +
-			", sportID = " + myPerson.SportID +
-			", speciallityID = " + myPerson.SpeciallityID +
-			", practice = " + myPerson.Practice +
-			", description = '" + myPerson.Description +
-			"', race = " + myPerson.Race +
-			", countryID = " + myPerson.CountryID +
-			", serverUniqueID = " + myPerson.ServerUniqueID +
-			" WHERE uniqueID == '" + myPerson.UniqueID + "'" ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
 		dbcon.Close();
+		return myArray;
 	}
 
-	
-	public static void Delete()
-	{
-	}
-
-	*/
 }

Modified: trunk/src/sqlite/session.cs
==============================================================================
--- trunk/src/sqlite/session.cs	(original)
+++ trunk/src/sqlite/session.cs	Fri Jan 23 17:32:35 2009
@@ -32,10 +32,15 @@
 
 class SqliteSession : Sqlite
 {
+	public SqliteSession() {
+	}
+	
+	~SqliteSession() {}
+
 	//can be "Constants.SessionTable" or "Constants.ConvertTempTable"
 	//temp is used to modify table between different database versions if needed
-	protected new internal static void createTable(string tableName)
-	//protected override void createTable(string tableName)
+	//protected new internal static void createTable(string tableName)
+	protected override void createTable(string tableName)
 	{
 		dbcmd.CommandText = 
 			"CREATE TABLE " + tableName + " ( " +
@@ -46,18 +51,27 @@
 			"personsSportID INT, " + 
 			"personsSpeciallityID INT, " + 
 			"personsPractice INT, " + //also called "level"
-			"comments TEXT )";		
+			"comments TEXT, " +
+			"serverUniqueID INT " +
+			" ) ";
 		dbcmd.ExecuteNonQuery();
 	}
 	
-	public static int Insert(bool dbconOpened, string tableName, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments, int serverUniqueID)
 	{
 		if(! dbconOpened)
 			dbcon.Open();
 
-		dbcmd.CommandText = "INSERT INTO " + tableName + " (uniqueID, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments)" +
-			" VALUES (NULL, '"
-			+ name + "', '" + place + "', '" + date + "', " + personsSportID + ", " + personsSpeciallityID + ", " + personsPractice + ", '" + comments + "')" ;
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
+		dbcmd.CommandText = "INSERT INTO " + tableName + " (uniqueID, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments, serverUniqueID)" +
+			" VALUES (" + uniqueID + ", '"
+			+ name + "', '" + place + "', '" + date + "', " + 
+			personsSportID + ", " + personsSpeciallityID + ", " + 
+			personsPractice + ", '" + comments + "', " +
+			serverUniqueID + ")" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myReturn = dbcon.LastInsertRowId;
 		
@@ -66,9 +80,10 @@
 
 		return myReturn;
 	}
-	
-	public static void Edit(int uniqueID, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments)
+
+	public static void Update(int uniqueID, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments) 
 	{
+		//TODO: serverUniqueID (but cannot be changed in gui/edit, then not need now)
 		dbcon.Open();
 		dbcmd.CommandText = "UPDATE " + Constants.SessionTable + " " +
 			" SET name = '" + name +
@@ -83,6 +98,22 @@
 		dbcon.Close();
 	}
 	
+	//updating local session when it gets uploaded
+	public static void UpdateServerUniqueID(int uniqueID, int serverID)
+	{
+		//if(!dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "UPDATE " +Constants.SessionTable + " SET serverUniqueID = " + serverID + 
+			" WHERE uniqueID == " + uniqueID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		//if(!dbconOpened)
+			dbcon.Close();
+	}
+
+	
 	public static Session Select(string myUniqueID)
 	{
 		dbcon.Open();
@@ -92,7 +123,7 @@
 		SqliteDataReader reader;
 		reader = dbcmd.ExecuteReader();
 	
-		string [] values = new string[8];
+		string [] values = new string[9];
 		
 		while(reader.Read()) {
 			values[0] = reader[0].ToString(); 
@@ -103,12 +134,13 @@
 			values[5] = reader[5].ToString();
 			values[6] = reader[6].ToString();
 			values[7] = reader[7].ToString();
+			values[8] = reader[8].ToString();
 		}
 
 		Session mySession = new Session(values[0], 
 			values[1], values[2], values[3], 
 			Convert.ToInt32(values[4]), Convert.ToInt32(values[5]), Convert.ToInt32(values[6]), 
-			values[7] );
+			values[7], Convert.ToInt32(values[8]) );
 		
 		dbcon.Close();
 		return mySession;
@@ -185,10 +217,10 @@
 		count = 0;
 
 		while(reader.Read()) {
-			string sportName = Catalog.GetString(reader[8].ToString());
+			string sportName = Catalog.GetString(reader[9].ToString());
 			string speciallityName = ""; //to solve a gettext bug (probably because speciallity undefined name is "")			
-			if(reader[9].ToString() != "")
-				speciallityName = Catalog.GetString(reader[9].ToString());
+			if(reader[10].ToString() != "")
+				speciallityName = Catalog.GetString(reader[10].ToString());
 			string levelName = Catalog.GetString(Util.FindLevelName(Convert.ToInt32(reader[6])));
 
 			myArray.Add (reader[0].ToString() + ":" + reader[1].ToString() + ":" +
@@ -455,6 +487,35 @@
 		}
 	}
 
+	
+	public static void DeleteWithJumps(string uniqueID)
+	{
+		dbcon.Open();
+
+		//delete the session
+		dbcmd.CommandText = "Delete FROM " + Constants.SessionTable + " WHERE uniqueID == " + uniqueID;
+		dbcmd.ExecuteNonQuery();
+		
+		//delete relations (existance) within persons and sessions in this session
+		dbcmd.CommandText = "Delete FROM " + Constants.PersonSessionWeightTable + " WHERE sessionID == " + uniqueID;
+		dbcmd.ExecuteNonQuery();
+		
+		//delete normal jumps
+		dbcmd.CommandText = "Delete FROM " + Constants.JumpTable + " WHERE sessionID == " + uniqueID;
+		dbcmd.ExecuteNonQuery();
+		
+		//delete repetitive jumps
+		dbcmd.CommandText = "Delete FROM " + Constants.JumpRjTable + " WHERE sessionID == " + uniqueID;
+		dbcmd.ExecuteNonQuery();
+		
+		//runs PENDING
+		
+		dbcon.Close();
+	}
+
+
+	/* OLD STUFF */
+
 	/* 
 	 * don't do more like this, use Sqlite.convertTables()
 	 */
@@ -464,7 +525,9 @@
 		ArrayList myArray = new ArrayList(2);
 
 		//1st create a temp table
-		createTable(Constants.ConvertTempTable);
+		//createTable(Constants.ConvertTempTable);
+		SqliteSession sqliteSessionObject = new SqliteSession();
+		sqliteSessionObject.createTable(Constants.ConvertTempTable);
 			
 		//2nd copy all data from session table to temp table
 		dbcmd.CommandText = "SELECT * " + 
@@ -476,14 +539,15 @@
 					1, //sport undefined
 					-1, //speciallity undefined
 					-1, //practice level undefined
-					reader[4].ToString()); //comments
+					reader[4].ToString(), //comments
+					Constants.ServerUndefinedID
+					); 
 			myArray.Add(mySession);
-
 		}
 		reader.Close();
 
 		foreach (Session mySession in myArray)
-			Insert(true, Constants.ConvertTempTable,
+			InsertOld(true, Constants.ConvertTempTable,
 				mySession.Name, mySession.Place, mySession.Date, 
 				mySession.PersonsSportID, mySession.PersonsSpeciallityID, mySession.PersonsPractice, mySession.Comments);
 
@@ -491,11 +555,12 @@
 		Sqlite.dropTable(Constants.SessionTable);
 
 		//4d create table persons (now with sport related stuff
-		createTable(Constants.SessionTable);
+		//createTable(Constants.SessionTable);
+		sqliteSessionObject.createTable(Constants.SessionTable);
 
 		//5th insert data in sessions (with sport related stuff)
 		foreach (Session mySession in myArray) 
-			Insert(true, Constants.SessionTable,
+			InsertOld(true, Constants.SessionTable,
 				mySession.Name, mySession.Place, mySession.Date, 
 				mySession.PersonsSportID, mySession.PersonsSpeciallityID, mySession.PersonsPractice, mySession.Comments);
 
@@ -504,31 +569,102 @@
 		Sqlite.dropTable(Constants.ConvertTempTable);
 	}
 	
-
-	
-	public static void DeleteWithJumps(string uniqueID)
+	/* used only on conversion from 0.55 to 0.56 */
+	public static int InsertOld(bool dbconOpened, string tableName, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments)
 	{
-		dbcon.Open();
+		if(! dbconOpened)
+			dbcon.Open();
 
-		//delete the session
-		dbcmd.CommandText = "Delete FROM " + Constants.SessionTable + " WHERE uniqueID == " + uniqueID;
+		dbcmd.CommandText = "INSERT INTO " + tableName + " (uniqueID, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments)" +
+			" VALUES (NULL, '"
+			+ name + "', '" + place + "', '" + date + "', " + 
+			personsSportID + ", " + personsSpeciallityID + ", " + 
+			personsPractice + ", '" + comments + "')" ;
 		dbcmd.ExecuteNonQuery();
+		int myReturn = dbcon.LastInsertRowId;
 		
-		//delete relations (existance) within persons and sessions in this session
-		dbcmd.CommandText = "Delete FROM " + Constants.PersonSessionWeightTable + " WHERE sessionID == " + uniqueID;
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myReturn;
+	}
+}
+
+class SqliteServerSession : SqliteSession
+{
+	public SqliteServerSession() {
+	}
+	
+	protected override void createTable(string tableName)
+	{
+		string serverSpecificString = 
+			", evaluatorID INT " +
+			", evaluatorCJVersion TEXT " + 
+			", evaluatorOS TEXT " +
+			", uploadedDate TEXT " +
+			", uploadingState INT ";
+
+		dbcmd.CommandText = 
+			"CREATE TABLE " + tableName + " ( " +
+			"uniqueID INTEGER PRIMARY KEY, " +
+			"name TEXT, " +
+			"place TEXT, " +
+			"date TEXT, " +		
+			"personsSportID INT, " + 
+			"personsSpeciallityID INT, " + 
+			"personsPractice INT, " + //also called "level"
+			"comments TEXT, " +
+			"serverUniqueID INT " +
+			serverSpecificString + 
+			" ) ";
 		dbcmd.ExecuteNonQuery();
-		
-		//delete normal jumps
-		dbcmd.CommandText = "Delete FROM " + Constants.JumpTable + " WHERE sessionID == " + uniqueID;
+	}
+	
+	//public static int Insert(bool dbconOpened, string tableName, string uniqueID, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments, int serverUniqueID, int evaluatorID, string evaluatorCJVersion, string evaluatorOS, string uploadedDate, Constants.ServerSessionStates uploadingState)
+	public static int Insert(bool dbconOpened, string tableName, string name, string place, string date, int personsSportID, int personsSpeciallityID, int personsPractice, string comments, int serverUniqueID, int evaluatorID, string evaluatorCJVersion, string evaluatorOS, string uploadedDate, Constants.ServerSessionStates uploadingState)
+	{
+		if(! dbconOpened)
+			dbcon.Open();
+
+		//(uniqueID == "-1")
+		//	uniqueID = "NULL";
+		string uniqueID = "NULL";
+
+		dbcmd.CommandText = "INSERT INTO " + tableName + " (uniqueID, name, place, date, personsSportID, personsSpeciallityID, personsPractice, comments, serverUniqueID, evaluatorID, evaluatorCJVersion, evaluatorOS, uploadedDate, uploadingState)" +
+			" VALUES (" + uniqueID + ", '"
+			+ name + "', '" + place + "', '" + date + "', " + 
+			personsSportID + ", " + personsSpeciallityID + ", " + 
+			personsPractice + ", '" + comments + "', " +
+			serverUniqueID + ", " + evaluatorID + ", '" +
+			evaluatorCJVersion + "', '" + evaluatorOS + "', '" +
+			uploadedDate + "', " + Convert.ToInt32(uploadingState) +
+			//uploadedDate + "', " + uploadingState +
+			")" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
+		int myReturn = dbcon.LastInsertRowId;
 		
-		//delete repetitive jumps
-		dbcmd.CommandText = "Delete FROM " + Constants.JumpRjTable + " WHERE sessionID == " + uniqueID;
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myReturn;
+	}
+	
+	//updating local session when it gets uploaded
+	public static void UpdateUploadingState(int uniqueID, Constants.ServerSessionStates state)
+	{
+		//if(!dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "UPDATE " + Constants.SessionTable + " SET uploadingState = " + Convert.ToInt32(state) + 
+			" WHERE uniqueID == " + uniqueID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
-		
-		//runs PENDING
-		
-		dbcon.Close();
+
+		//if(!dbconOpened)
+			dbcon.Close();
 	}
 
+	
+	~SqliteServerSession() {}
 }

Modified: trunk/src/treeViewJump.cs
==============================================================================
--- trunk/src/treeViewJump.cs	(original)
+++ trunk/src/treeViewJump.cs	Fri Jan 23 17:32:35 2009
@@ -176,7 +176,7 @@
 		Jump newJump = (Jump)myObject;
 
 		string title = newJump.Type;
-		if(newJump.Simulated == 1)
+		if(newJump.Simulated == Constants.Simulated)
 			title += " (s)";
 
 		string [] myData = new String [getColsNum()];
@@ -266,7 +266,7 @@
 		JumpRj newJumpRj = (JumpRj)myObject;
 
 		string title = newJumpRj.Type;
-		if(newJumpRj.Simulated == 1)
+		if(newJumpRj.Simulated == Constants.Simulated)
 			title += " (s) ";
 
 		string myTypeComplet = title + "(" + Util.GetLimitedRounded(newJumpRj.Limited, pDN) + ")";

Modified: trunk/src/treeViewPulse.cs
==============================================================================
--- trunk/src/treeViewPulse.cs	(original)
+++ trunk/src/treeViewPulse.cs	Fri Jan 23 17:32:35 2009
@@ -74,7 +74,7 @@
 		//if fixedPulse is not defined, comparate each pulse with the averave
 		string myTypeComplet = newPulse.Type;
 		
-		if(newPulse.Simulated == 1)
+		if(newPulse.Simulated == Constants.Simulated)
 			myTypeComplet += " (s) ";
 		
 		if(newPulse.FixedPulse != -1) 

Modified: trunk/src/treeViewReactionTime.cs
==============================================================================
--- trunk/src/treeViewReactionTime.cs	(original)
+++ trunk/src/treeViewReactionTime.cs	Fri Jan 23 17:32:35 2009
@@ -73,7 +73,7 @@
 		ReactionTime newReactionTime = (ReactionTime)myObject;
 
 		string title = "";
-		if(newReactionTime.Simulated == 1)
+		if(newReactionTime.Simulated == Constants.Simulated)
 			title += " (s) ";
 
 		string [] myData = new String [getColsNum()];

Modified: trunk/src/treeViewRun.cs
==============================================================================
--- trunk/src/treeViewRun.cs	(original)
+++ trunk/src/treeViewRun.cs	Fri Jan 23 17:32:35 2009
@@ -82,7 +82,7 @@
 		Run newRun = (Run)myObject;
 
 		string title = newRun.Type;
-		if(newRun.Simulated == 1)
+		if(newRun.Simulated == Constants.Simulated)
 			title += " (s)";
 
 		string [] myData = new String [getColsNum()];
@@ -155,7 +155,7 @@
 		RunInterval newRunI = (RunInterval)myObject;
 		
 		string title = newRunI.Type;
-		if(newRunI.Simulated == 1)
+		if(newRunI.Simulated == Constants.Simulated)
 			title += " (s) ";
 
 		string myTypeComplet = title + "(" + newRunI.DistanceInterval + "x" + Util.GetLimitedRounded(newRunI.Limited, pDN) + ")";

Modified: trunk/src/util.cs
==============================================================================
--- trunk/src/util.cs	(original)
+++ trunk/src/util.cs	Fri Jan 23 17:32:35 2009
@@ -548,16 +548,20 @@
 	//in chronojump we compile now for Linux with Mono and for Windows with .NET
 	//it should be something like IsDotNet()
 	public static bool IsWindows() {
-		OperatingSystem os = Environment.OSVersion;
-
-		Log.WriteLine(string.Format("platform: {0}, version: {1}", os.Platform, os.Version));
-
-		if(os.Platform.ToString().ToUpper().StartsWith("WIN"))
+		string os = GetOS();
+		if(os.ToUpper().StartsWith("WIN"))
 			return true;
 		else 
 			return false;
 	}
 	
+	public static string GetOS() {
+		OperatingSystem os = Environment.OSVersion;
+		string osString =  string.Format("{0}, {1}", os.Platform, os.Version);
+		Log.WriteLine(osString);
+		return osString;
+	}
+	
 	public static DateTime DateAsDateTime (string dateString) {
 		string [] dateFull = dateString.Split(new char[] {'/'});
 		DateTime dateTime;
@@ -671,10 +675,8 @@
 	//public static void PlaySound (System.Media.SystemSounds mySound, bool volumeOn) {
 	public static void PlaySound (Constants.SoundTypes mySound, bool volumeOn) {
 		if(volumeOn) {
-			//on mono windows, PlaySound is not implemented. Until find a solution let's play a system bell
-			//if(IsWindows())
-			//	Log.WriteLine("\a");
-			//else {
+			//TODO: this try/catch still doesn't work in my laptop with sound problems
+			try {
 				switch(mySound) {
 					case Constants.SoundTypes.CAN_START:
 						System.Media.SystemSounds.Question.Play();
@@ -686,7 +688,7 @@
 						System.Media.SystemSounds.Beep.Play();
 						break;
 				}
-			//}
+			} catch {}
 		}
 	}
 
@@ -869,6 +871,17 @@
 			return 0;
 	}
 
+	//used by simulated, since cj 0.8.1.2, db: 0.60
+	//-1 simulated test
+	//0 real test not uploaded
+	//>0 serverUniqueID of uploaded test
+	public static int BoolToNegativeInt (bool myBool) {
+		if(myBool)
+			return -1;
+		else
+			return 0;
+	}
+
 	public static string FindLevelName(int levelInt) {
 		string foundLevelName = "";
 		foreach(string level in Constants.Levels)

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Fri Jan 23 17:32:35 2009
@@ -1 +1 @@
-0.8.1.1
+0.8.1.3



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