chronojump r445 - in trunk: . build/data chronojump_server chronojump_server/bin glade sqlite_diagrams src src/gui src/sqlite



Author: xaviblas
Date: Thu Jan 29 19:10:36 2009
New Revision: 445
URL: http://svn.gnome.org/viewvc/chronojump?rev=445&view=rev

Log:
	0.8.1.5
	db 0.61 
	done the distancesString change
		check convert
		creation of runTypes works!!!
	TODO: test doing different runs, editing, repairing!!!!

	Added the Maria Ginà test

	Ping is done while splash is running
	added src/server.cs

	at webserver happens strange things, if i comment or delete the
	methods from UploadJump to UploadPulse (in both server files), then
	there are problems of serialization and primitives.
	but if i uncomment those methods (that are never called) then all
	works.... ?

	serverUpload code not really cleaned



Added:
   trunk/src/server.cs
Modified:
   trunk/Makefile
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/changelog.txt
   trunk/chronojump_server/ChronojumpServer.cs
   trunk/chronojump_server/bin/chronojumpServer.dll
   trunk/chronojump_server/compile_wsdl.sh
   trunk/glade/chronojump.glade
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/src/chronojump.cs
   trunk/src/event.cs
   trunk/src/eventType.cs
   trunk/src/gui/chronojump.cs
   trunk/src/gui/event.cs
   trunk/src/gui/jump.cs
   trunk/src/gui/pulse.cs
   trunk/src/gui/run.cs
   trunk/src/gui/runType.cs
   trunk/src/gui/server.cs
   trunk/src/jump.cs
   trunk/src/runType.cs
   trunk/src/serverPing.cs
   trunk/src/sqlite/main.cs
   trunk/src/sqlite/runType.cs
   trunk/src/util.cs

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Thu Jan 29 19:10:36 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 src/serverEvaluator.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 src/server.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
 
@@ -148,7 +148,7 @@
 
 $(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)
+#currently deactivated WSDL compilation: (seems it doesn't work because when there's no network, there's no localhost) (not, it doesn't work by other reasons)
 #$(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/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Thu Jan 29 19:10:36 2009
@@ -1,17 +1,12 @@
 TODO (sorted)
 
-0.- doing the intervalDistancesString change !!!!!!!!!!!
-
 1.- upload SEvaluator and edit it and re-upload
 2.- on stats show data updated by user
 3.- write a version compatibility thing for each server method, and if not
 compatible, tell user to update it's chronojump version
-4.- Add the Maria Ginéest
 
 "questionnaire acabar
 cercar abstract google
-fer distancies diferents
-pending insert type in sql
 
 
 5.- do something with user created:
@@ -20,6 +15,7 @@
 +jumpType done
 +...
 
+
 Add hexagon test
 
 Add Cabedo's tests
@@ -36,8 +32,28 @@
 
 all this will be release as 0.8.2 or 0.9
 
+29 jan 2009
+	0.8.1.5
+	db 0.61 
+	done the distancesString change
+		check convert
+		creation of runTypes works!!!
+	TODO: test doing different runs, editing, repairing!!!!
+
+	Added the Maria Ginéest
+
+	Ping is done while splash is running
+	added src/server.cs
+
+	at webserver happens strange things, if i comment or delete the
+	methods from UploadJump to UploadPulse (in both server files), then
+	there are problems of serialization and primitives.
+	but if i uncomment those methods (that are never called) then all
+	works.... ?
+
+	serverUpload code not really cleaned
 
-27 jan 2008
+27 jan 2009
 	0.8.1.4
 	new src/gui/server.cs with gui of session upload.
 	
@@ -65,7 +81,7 @@
 	-fixed HasWeight bug in jumpType
 	-fixed crash on person add/edit when a ' is found
 
-23 jan 2008
+23 jan 2009
 	0.8.1.3
 	insert session now insert all it's persons
 
@@ -90,7 +106,7 @@
 
 	try-catch on sound playing
 
-16 jan 2008
+16 jan 2009
 	Now we are able to connect from client gtk (corall) to server on pinux and do a ping, or insert a
 	person!!!!!!
 	But the webservice from the navigator still doesn't work
@@ -112,7 +128,7 @@
 
 	backup database active again
 
-13 jan 2008
+13 jan 2009
 	0.8.1.1
 	on gui preferences, port windows and linux with combobox
 

Modified: trunk/chronojump_server/ChronojumpServer.cs
==============================================================================
--- trunk/chronojump_server/ChronojumpServer.cs	(original)
+++ trunk/chronojump_server/ChronojumpServer.cs	Thu Jan 29 19:10:36 2009
@@ -252,6 +252,27 @@
         return ((int)(results[0]));
     }
 
+    /// <remarks>
+///Upload a test
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadTest";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadTest(Event myTest, Constants.TestTypes type, string tableName) {
+        object[] results = this.Invoke("UploadTest", new object[] {
+            myTest, type, tableName});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginUploadTest(Event myTest, Constants.TestTypes type, string tableName, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadTest", new object[] {
+            myTest, type, tableName}, callback, asyncState);
+    }
+    
+    public int EndUploadTest(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
 
     /// <remarks>
 ///Upload a jump
@@ -406,6 +427,115 @@
         return ((string[])(results[0]));
     }
    
+
+    /// <remarks>
+///hola
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Hola";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int Hola(string text, int id) {
+        object[] results = this.Invoke("Hola", new object[] {
+            text, id});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginHola(string text, int id, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Hola", new object[] {
+            text, id}, callback, asyncState);
+    }
+    
+    public int EndHola(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+   
+    /*
+    /// <remarks>
+///hola2
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Hola2";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int Hola2(string text, Jump jump) {
+        object[] results = this.Invoke("Hola2", new object[] {
+            text, jump});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginHola2(string text, Jump jump, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Hola2", new object[] {
+            text, jump}, callback, asyncState);
+    }
+    
+    public int EndHola2(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+  */ 
+    /// <remarks>
+///hola3
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Hola3";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int Hola3(string text, Event jumpi) {
+        object[] results = this.Invoke("Hola3", new object[] {
+            text, jumpi});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginHola3(string text, Event jumpi, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Hola3", new object[] {
+            text, jumpi}, callback, asyncState);
+    }
+    
+    public int EndHola3(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+   /*
+    /// <remarks>
+///hola4
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Hola4";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int Hola4(string text, Event jump) {
+        object[] results = this.Invoke("Hola4", new object[] {
+            text, jump});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginHola4(string text, Event jump, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Hola4", new object[] {
+            text, jump}, callback, asyncState);
+    }
+    
+    public int EndHola4(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+    */
+
+   
+    /// <remarks>
+///hola5
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Hola5";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int Hola5(string text, Event jump, bool reactive) {
+        object[] results = this.Invoke("Hola5", new object[] {
+            text, jump, reactive});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginHola5(string text, Event jump, bool reactive, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Hola5", new object[] {
+            text, jump, reactive}, callback, asyncState);
+    }
+    
+    public int EndHola5(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+   
     /* 
     /// <remarks>
 ///Select person name

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

Modified: trunk/chronojump_server/compile_wsdl.sh
==============================================================================
--- trunk/chronojump_server/compile_wsdl.sh	(original)
+++ trunk/chronojump_server/compile_wsdl.sh	Thu Jan 29 19:10:36 2009
@@ -7,3 +7,4 @@
 
 echo compiling wsdl
 wsdl2 http://localhost:8080/chronojumpServer.asmx
+#wsdl2 http://0.0.0.0:8080/chronojumpServer.asmx

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Thu Jan 29 19:10:36 2009
@@ -6527,30 +6527,6 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkRadioButton" id="radiobutton_interval">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">intervallic</property>
-		  <property name="use_underline">True</property>
-		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
-		  <property name="active">False</property>
-		  <property name="inconsistent">False</property>
-		  <property name="draw_indicator">True</property>
-		  <property name="group">radiobutton_simple</property>
-		  <signal name="toggled" handler="on_radiobutton_interval_toggled" last_modification_time="Thu, 18 Aug 2005 13:05:09 GMT"/>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">1</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
 		<widget class="GtkHBox" id="hbox_fixed">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
@@ -6577,15 +6553,15 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkSpinButton" id="spin_fixed_num">
+		    <widget class="GtkSpinButton" id="spin_fixed_tracks_or_time">
 		      <property name="visible">True</property>
 		      <property name="sensitive">False</property>
 		      <property name="can_focus">True</property>
 		      <property name="climb_rate">1</property>
 		      <property name="digits">0</property>
-		      <property name="numeric">False</property>
+		      <property name="numeric">True</property>
 		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-		      <property name="snap_to_ticks">False</property>
+		      <property name="snap_to_ticks">True</property>
 		      <property name="wrap">False</property>
 		      <property name="adjustment">1 0 100 1 10 10</property>
 		    </widget>
@@ -6605,6 +6581,30 @@
 		  <property name="y_options">fill</property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="radiobutton_interval">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">intervallic</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">radiobutton_simple</property>
+		  <signal name="toggled" handler="on_radiobutton_interval_toggled" last_modification_time="Thu, 18 Aug 2005 13:05:09 GMT"/>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
@@ -6651,75 +6651,300 @@
 	      <property name="spacing">5</property>
 
 	      <child>
-		<widget class="GtkCheckButton" id="checkbutton_distance_fixed">
+		<widget class="GtkVBox" id="vbox149">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">fixed: </property>
-		  <property name="use_underline">True</property>
-		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
-		  <property name="active">False</property>
-		  <property name="inconsistent">False</property>
-		  <property name="draw_indicator">True</property>
-		  <signal name="clicked" handler="on_checkbutton_distance_fixed_clicked" last_modification_time="Thu, 18 Aug 2005 13:43:41 GMT"/>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">0</property>
 
-	      <child>
-		<widget class="GtkAlignment" id="alignment33">
-		  <property name="visible">True</property>
-		  <property name="xalign">1</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xscale">1</property>
-		  <property name="yscale">1</property>
-		  <property name="top_padding">0</property>
-		  <property name="bottom_padding">0</property>
-		  <property name="left_padding">0</property>
-		  <property name="right_padding">0</property>
+		  <child>
+		    <widget class="GtkRadioButton" id="radiobutton_dist_variable">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Variable (user will select distance at each test)</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <signal name="toggled" handler="on_radiobutton_dist_variable_toggled" last_modification_time="Wed, 28 Jan 2009 10:37:47 GMT"/>
+		      <signal name="toggled" handler="on_entries_required_changed" last_modification_time="Wed, 28 Jan 2009 14:45:32 GMT"/>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
 
 		  <child>
-		    <widget class="GtkSpinButton" id="spin_distance">
+		    <widget class="GtkRadioButton" id="radiobutton_dist_fixed">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="climb_rate">1</property>
-		      <property name="digits">0</property>
-		      <property name="numeric">False</property>
-		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
-		      <property name="snap_to_ticks">False</property>
-		      <property name="wrap">False</property>
-		      <property name="adjustment">100 0 99999 1 10 10</property>
+		      <property name="label" translatable="yes">Fixed (distance will be always the same)</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">radiobutton_dist_variable</property>
+		      <signal name="toggled" handler="on_radiobutton_dist_fixed_toggled" last_modification_time="Wed, 28 Jan 2009 10:42:24 GMT"/>
+		      <signal name="toggled" handler="on_entries_required_changed" last_modification_time="Wed, 28 Jan 2009 14:45:45 GMT"/>
 		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
 		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">False</property>
-		</packing>
-	      </child>
 
-	      <child>
-		<widget class="GtkLabel" id="label142">
-		  <property name="visible">True</property>
-		  <property name="label" translatable="yes">meters</property>
-		  <property name="use_underline">False</property>
-		  <property name="use_markup">False</property>
-		  <property name="justify">GTK_JUSTIFY_LEFT</property>
-		  <property name="wrap">False</property>
-		  <property name="selectable">False</property>
-		  <property name="xalign">0.5</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		  <property name="width_chars">-1</property>
-		  <property name="single_line_mode">False</property>
-		  <property name="angle">0</property>
+		  <child>
+		    <widget class="GtkHBox" id="hbox_distance_fixed">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">7</property>
+
+		      <child>
+			<widget class="GtkSpinButton" id="spin_distance_fixed">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="climb_rate">1</property>
+			  <property name="digits">0</property>
+			  <property name="numeric">False</property>
+			  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+			  <property name="snap_to_ticks">False</property>
+			  <property name="wrap">False</property>
+			  <property name="adjustment">100 0 99999 1 10 10</property>
+			</widget>
+			<packing>
+			  <property name="padding">18</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label142">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">(m)</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkRadioButton" id="radiobutton_dist_different">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Different (each track have different distance
+suitable for agility tests)</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		      <property name="group">radiobutton_dist_variable</property>
+		      <signal name="toggled" handler="on_radiobutton_dist_different_toggled" last_modification_time="Wed, 28 Jan 2009 10:42:45 GMT"/>
+		      <signal name="toggled" handler="on_radiobutton_dist_different_toggled" object="on_entries_required_changed" last_modification_time="Wed, 28 Jan 2009 14:46:02 GMT"/>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">False</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkAlignment" id="alignment_vbox_distance_variable">
+		      <property name="visible">True</property>
+		      <property name="xalign">0.5</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xscale">1</property>
+		      <property name="yscale">1</property>
+		      <property name="top_padding">0</property>
+		      <property name="bottom_padding">0</property>
+		      <property name="left_padding">20</property>
+		      <property name="right_padding">0</property>
+
+		      <child>
+			<widget class="GtkVBox" id="vbox_distance_variable">
+			  <property name="visible">True</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">0</property>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox_distance_different_tracks:number">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">8</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label547">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Number of tracks</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkSpinButton" id="spin_distance_different_tracks_number">
+				  <property name="visible">True</property>
+				  <property name="sensitive">False</property>
+				  <property name="can_focus">True</property>
+				  <property name="climb_rate">1</property>
+				  <property name="digits">0</property>
+				  <property name="numeric">True</property>
+				  <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+				  <property name="snap_to_ticks">True</property>
+				  <property name="wrap">False</property>
+				  <property name="adjustment">2 2 10 1 10 10</property>
+				  <signal name="changed" handler="on_spin_distance_different_tracks_number_changed" last_modification_time="Wed, 28 Jan 2009 12:34:53 GMT"/>
+				  <signal name="changed" handler="on_entries_required_changed" last_modification_time="Wed, 28 Jan 2009 14:47:31 GMT"/>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox288">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">8</property>
+
+			      <child>
+				<widget class="GtkLabel" id="label545">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">Distance of each track</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label546">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">(m)</property>
+				  <property name="use_underline">False</property>
+				  <property name="use_markup">False</property>
+				  <property name="justify">GTK_JUSTIFY_LEFT</property>
+				  <property name="wrap">False</property>
+				  <property name="selectable">False</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox_distance_variable">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
+
+			      <child>
+				<placeholder/>
+			      </child>
+			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>

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

Modified: trunk/src/chronojump.cs
==============================================================================
--- trunk/src/chronojump.cs	(original)
+++ trunk/src/chronojump.cs	Thu Jan 29 19:10:36 2009
@@ -28,14 +28,15 @@
 using System.Threading;
 using System.Diagnostics; //Process
 
+using System.Collections; //ArrayList
 
 public class ChronoJump 
 {
 	ChronoJumpWindow chronoJumpWin;
 	SplashWindow splashWin;
 	
-	private static string progversion = ""; //now in "version" file
-	private static string progname = "Chronojump";
+	private static string progVersion = ""; //now in "version" file
+	private static string progName = "Chronojump";
 	
 	private string runningFileName; //useful for knowing if there are two chronojump instances
 	private string messageToShowOnBoot = "";
@@ -89,7 +90,7 @@
 	{
 		
 		Application.Init();
-
+			
 		//start threading to show splash window
 		SplashWindow splashWin = SplashWindow.Show();
 		
@@ -108,26 +109,33 @@
 		
 
 		/* SERVER COMMUNICATION TESTS */
-/*
-		try {
+		//try {
+
 			ChronojumpServer myServer = new ChronojumpServer();
 
-			//example of list a dir in server
-			string [] myListDir = myServer.ListDirectory("/home");
-			foreach (string myResult in myListDir) 
-				Log.WriteLine(myResult);
-
-			Log.WriteLine(myServer.ConnectDatabase());
-			//select name of person with uniqueid 1
-			Log.WriteLine(myServer.SelectPersonName(1));
-			Log.WriteLine(myServer.DisConnectDatabase());
+			Jump jump = new Jump();
+			jump.UniqueID=777;
+			jump.Description="bon dia";
+			jump.Tv=919;
+			jump.HolaServer(myServer);
+			
+			JumpRj jumpRj = new JumpRj();
+			jumpRj.UniqueID=777;
+			jumpRj.Description="bon dia";
+			jumpRj.TvString="el meu tvString";
+			jumpRj.HolaServer(myServer);
+	
+	
+//			Application.Quit();
+			/*
 		}
 		catch {
 			Log.WriteLine("Unable to call server");
+			Application.Quit();
 		}
 		*/
 		/* END OF SERVER COMMUNICATION TESTS */
-
+		
 		//print version of chronojump
 		Log.WriteLine(string.Format("Chronojump version: {0}", readVersion()));
 
@@ -242,6 +250,9 @@
 
 		messageToShowOnBoot += recuperateBrokenEvents();
 
+		//connect to server to Ping
+		Log.WriteLine(Server.Ping(true, progName, readVersion())); //doInsertion
+
 		//start as "simulated"
 		SqlitePreferences.Update("simulated", "True", false); //false (dbcon not opened)
 
@@ -289,7 +300,7 @@
 	}
 
 	private void startChronojump() {	
-		chronoJumpWin = new ChronoJumpWindow(readVersion(), progname, runningFileName);
+		chronoJumpWin = new ChronoJumpWindow(readVersion(), progName, runningFileName);
 	}
 
 	private static void createBlankDB() {

Modified: trunk/src/event.cs
==============================================================================
--- trunk/src/event.cs	(original)
+++ trunk/src/event.cs	Thu Jan 29 19:10:36 2009
@@ -45,6 +45,10 @@
 		Console.WriteLine("++++++++");
 		return -1;
 	}	
+	
+	public virtual string Prova () {
+		return "estic a event";
+	}
 
 	public string Type
 	{

Modified: trunk/src/eventType.cs
==============================================================================
--- trunk/src/eventType.cs	(original)
+++ trunk/src/eventType.cs	Thu Jan 29 19:10:36 2009
@@ -29,6 +29,7 @@
 
 	protected Types type; //jump, run, reactionTime, pulse
 	
+	protected int uniqueID;
 	protected string name;
 	protected bool isPredefined;
 	protected string imageFileName;

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Thu Jan 29 19:10:36 2009
@@ -321,7 +321,7 @@
 	ChronopicConnection chronopicWin;
 	GenericWindow genericWin;
 	
-	SessionUploadWindow sessionUploadWin;
+	//SessionUploadWindow sessionUploadWin;
 
 	static EventExecuteWindow eventExecuteWin;
 
@@ -459,9 +459,6 @@
 	
 		putNonStandardIcons();	
 	
-		//connect to server to Ping
-		serverPing(true, false); //do insertion, don't display message to user
-		
 		if(chronopicPort != Constants.ChronopicDefaultPortWindows &&
 			chronopicPort != Constants.ChronopicDefaultPortLinux) {
 			ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Do you want to connect to Chronopic now?"), "");
@@ -889,12 +886,13 @@
 	 * ----------------  SERVER CALLS --------------------------
 	 *  --------------------------------------------------------
 	 */
-	
+
+/*	
 	bool serverSessionError;
 	bool needUpdateServerSession;
 	bool updatingServerSession;
 	SessionUploadPersonData sessionUploadPersonData;
-
+*/
 	/* 
 	 * SERVER CALLBACKS
 	 */
@@ -904,7 +902,8 @@
 	{
 		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
 		if(evalSID == Constants.ServerUndefinedID) 
-			serverUploadEvaluator();
+			//serverUploadEvaluator();
+			Server.ServerUploadEvaluator();
 
 		if(!checkPersonsMissingData()) {
 			string message1 = ""; 
@@ -939,13 +938,14 @@
 	}
 	
 	private void on_menuitem_server_ping (object o, EventArgs args) {
-		serverPing(true, true); //do insertion, display message to user
+		new DialogMessage(Constants.MessageTypes.INFO, 
+				Server.Ping(true, progName, progVersion)); //do insertion
 	}
 
 	/* 
 	 * SERVER THREAD GTK
 	 */
-	
+/*	
 	private bool PulseGTKServer ()
 	{
 		if(! thread.IsAlive) {
@@ -978,7 +978,7 @@
 		Log.Write(thread.ThreadState.ToString());
 		return true;
 	}
-			
+*/			
 	/* 
 	 * SERVER CODE
 	 */
@@ -1044,21 +1044,33 @@
 
 	private void on_server_upload_session_accepted (object o, EventArgs args) 
 	{
-		if(serverPing(false, false)) { //don't do insertion, don't display message to user
+		if(Server.Ping(false, "", "") != Constants.ServerOffline) { //false: don't do insertion
+			Server.InitializeSessionVariables();
+			/*
 			serverSessionError = false;
 			needUpdateServerSession = false;
 			updatingServerSession = false;
 			sessionUploadPersonData = new SessionUploadPersonData();
+			*/
+			Server.app1 = app1;
+			Server.currentSession = currentSession; //check that changes come to main currentSession again!!! TODO
+			Server.progName = progName;
+			Server.progVersion = progVersion;
 
-			thread = new Thread(new ThreadStart(on_server_upload_session_started));
-			GLib.Idle.Add (new GLib.IdleHandler (PulseGTKServer));
+			/*
+			//thread = new Thread(new ThreadStart(on_server_upload_session_started));
+			thread = new Thread(new ThreadStart(Server.On_server_upload_session_started));
+			//GLib.Idle.Add (new GLib.IdleHandler (PulseGTKServer));
+			GLib.Idle.Add (new GLib.IdleHandler (Server.PulseGTKServer));
 			thread.Start(); 
+			*/
+			Server.ThreadStart();
 		} else {
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
-	
-	//private void on_server_upload_session_started (object o, EventArgs args) 
+
+/*	
 	private void on_server_upload_session_started () 
 	{
 		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
@@ -1327,7 +1339,8 @@
 			serverSessionError = true;
 		}
 	}
-	
+*/
+/*	
 	//upload a person
 	private Person serverUploadPerson(ChronojumpServer myServer, Person person, int serverSessionID) 
 	{
@@ -1339,7 +1352,7 @@
 
 		return person;
 	}
-	
+
 	private void serverUploadPersonSessionIfNeeded(ChronojumpServer myServer, int personServerID, int sessionServerID, int weight)
 	{
 		myServer.UploadPersonSessionIfNeeded(personServerID, sessionServerID, weight);
@@ -1358,28 +1371,8 @@
 			uCode = Constants.UploadCodes.EXISTS;
 		} else {
 			int idAtServer = -1;
+			idAtServer = myServer.UploadTest((Event) myTest, type, tableName);
 			
-			switch (type) {
-				case Constants.TestTypes.JUMP:
-					idAtServer = myServer.UploadJump((Jump) myTest);
-					break;
-				case Constants.TestTypes.JUMP_RJ:
-					idAtServer = myServer.UploadJumpRj((JumpRj) myTest);
-					break;
-				case Constants.TestTypes.RUN:
-					idAtServer = myServer.UploadRun((Run) myTest);
-					break;
-				case Constants.TestTypes.RUN_I:
-					idAtServer = myServer.UploadRunI((RunInterval) myTest);
-					break;
-				case Constants.TestTypes.RT:
-					idAtServer = myServer.UploadRT((ReactionTime) myTest);
-					break;
-				case Constants.TestTypes.PULSE:
-					idAtServer = myServer.UploadPulse((Pulse) myTest);
-					break;
-			}
-
 			//update test (simulated) on client database
 			myTest.Simulated = idAtServer;
 			SqliteEvent.UpdateSimulated(false, tableName, myTest.UniqueID, idAtServer);
@@ -1389,32 +1382,6 @@
 		return uCode;
 	}
 
-	private bool serverPing(bool doInsertion, bool showMessage) {
-		try {
-			ChronojumpServer myServer = new ChronojumpServer();
-			Log.WriteLine(myServer.ConnectDatabase());
-		
-			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
-
-			ServerPing myPing = new ServerPing(evalSID, progName + " " + progVersion, Util.GetOS(), Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
-			//if !doIsertion nothing will be uploaded,
-			//is ok for uploadPerson to know if server is online
-			myPing.UniqueID = myServer.UploadPing(myPing, doInsertion);
-			
-			Log.WriteLine(myServer.DisConnectDatabase());
-
-			if(showMessage)
-				new DialogMessage(Constants.MessageTypes.INFO, "Uploaded" + myPing.ToString());
-
-			return true; //connected
-		} catch {
-			if(showMessage)
-				new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
-			
-			return false;
-		}
-	}	
-
 	private void serverUploadEvaluator () {
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
@@ -1434,6 +1401,7 @@
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
+*/
 
 	/*
 	private void on_menuitem_server_upload_evaluator (object o, EventArgs args) {
@@ -1927,7 +1895,7 @@
 
 	private void createComboRunsInterval() {
 		combo_runs_interval = ComboBox.NewText();
-		UtilGtk.ComboUpdate(combo_runs_interval, SqliteRunType.SelectRunIntervalTypes(Constants.AllRunsName, true), ""); //without filter, only select name
+		UtilGtk.ComboUpdate(combo_runs_interval, SqliteRunIntervalType.SelectRunIntervalTypes(Constants.AllRunsName, true), ""); //without filter, only select name
 		
 		combo_runs_interval.Active = 0;
 		combo_runs_interval.Changed += new EventHandler (on_combo_runs_interval_changed);
@@ -3335,6 +3303,7 @@
 				0,				//fixedValue (0, because has not intervals)
 				false,				//unlimited (false, because has not intervals)
 				runsMoreWin.SelectedDescription,
+				"", // distancesstring (deactivated now, TODO: activate)
 				SqliteEvent.GraphLinkSelectFileName("run", runsMoreWin.SelectedEventName)
 				);
 		
@@ -3514,6 +3483,7 @@
 				runsIntervalMoreWin.SelectedLimitedValue,
 				runsIntervalMoreWin.SelectedUnlimited,
 				runsIntervalMoreWin.SelectedDescription,
+				"", // distancesstring (deactivated now, TODO: activate)
 				SqliteEvent.GraphLinkSelectFileName(Constants.RunIntervalTable, runsMoreWin.SelectedEventName)
 				);
 
@@ -4442,7 +4412,7 @@
 	private void on_run_type_add_accepted (object o, EventArgs args) {
 		Log.WriteLine("ACCEPTED Add new run type");
 		UtilGtk.ComboUpdate(combo_runs, SqliteRunType.SelectRunTypes(Constants.AllRunsName, true), ""); //without filter, only select name
-		UtilGtk.ComboUpdate(combo_runs_interval, SqliteRunType.SelectRunIntervalTypes(Constants.AllRunsName, true), ""); //without filter, only select name
+		UtilGtk.ComboUpdate(combo_runs_interval, SqliteRunIntervalType.SelectRunIntervalTypes(Constants.AllRunsName, true), ""); //without filter, only select name
 		combo_runs.Active = 0;
 		combo_runs_interval.Active = 0;
 	}

Modified: trunk/src/gui/event.cs
==============================================================================
--- trunk/src/gui/event.cs	(original)
+++ trunk/src/gui/event.cs	Thu Jan 29 19:10:36 2009
@@ -328,18 +328,16 @@
 	}
 		
 	private void on_entry_tv_value_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_tv_value.Text.ToString())){
+		if(Util.IsNumber(entry_tv_value.Text.ToString(), true)){
 			entryTv = entry_tv_value.Text.ToString();
 			button_accept.Sensitive = true;
 		} else {
 			button_accept.Sensitive = false;
-			//entry_tv_value.Text = "";
-			//entry_tv_value.Text = entryTv;
 		}
 	}
 		
 	private void on_entry_tc_value_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_tc_value.Text.ToString())){
+		if(Util.IsNumber(entry_tc_value.Text.ToString(), true)){
 			entryTc = entry_tc_value.Text.ToString();
 			button_accept.Sensitive = true;
 		} else {
@@ -350,7 +348,7 @@
 	}
 		
 	private void on_entry_fall_value_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_fall_value.Text.ToString())){
+		if(Util.IsNumber(entry_fall_value.Text.ToString(), true)){
 			entryFall = entry_fall_value.Text.ToString();
 			button_accept.Sensitive = true;
 		} else {
@@ -361,7 +359,7 @@
 	}
 		
 	private void on_entry_time_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_time_value.Text.ToString())){
+		if(Util.IsNumber(entry_time_value.Text.ToString(), true)){
 			entryTime = entry_time_value.Text.ToString();
 			label_speed_value.Text = Util.TrimDecimals(
 					Util.GetSpeed (entryDistance, entryTime, metersSecondsPreferred) , pDN);
@@ -374,7 +372,7 @@
 	}
 	
 	private void on_entry_distance_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_distance_value.Text.ToString())){
+		if(Util.IsNumber(entry_distance_value.Text.ToString(), true)){
 			entryDistance = entry_distance_value.Text.ToString();
 			label_speed_value.Text = Util.TrimDecimals(
 					Util.GetSpeed (entryDistance, entryTime, metersSecondsPreferred) , pDN);
@@ -387,7 +385,7 @@
 	}
 		
 	private void on_entry_weight_value_changed (object o, EventArgs args) {
-		if(Util.IsNumber(entry_weight_value.Text.ToString())){
+		if(Util.IsNumber(entry_weight_value.Text.ToString(), true)){
 			entryWeight = entry_weight_value.Text.ToString();
 			button_accept.Sensitive = true;
 		} else {
@@ -399,7 +397,7 @@
 		
 	private void on_entry_angle_changed (object o, EventArgs args) {
 		string angleString = entry_angle_value.Text.ToString();
-		if(Util.IsNumber(angleString)) {
+		if(Util.IsNumber(angleString, true)) {
 			entryAngle = angleString;
 			button_accept.Sensitive = true;
 		} else if(angleString == "-") {

Modified: trunk/src/gui/jump.cs
==============================================================================
--- trunk/src/gui/jump.cs	(original)
+++ trunk/src/gui/jump.cs	Thu Jan 29 19:10:36 2009
@@ -489,7 +489,7 @@
 	{
 		Gtk.TreeIter iter;
 		store.GetIter (out iter, new Gtk.TreePath (args.Path));
-		if(Util.IsNumber(args.NewText) && (string) treeview_subevents.Model.GetValue(iter,1) != "-1") {
+		if(Util.IsNumber(args.NewText, true) && (string) treeview_subevents.Model.GetValue(iter,1) != "-1") {
 			//if it's limited by fixed value of seconds
 			//and new seconds are bigger than allowed, return
 			if(jumpType.FixedValue > 0 && ! jumpType.JumpsLimited &&
@@ -513,7 +513,7 @@
 	{
 		Gtk.TreeIter iter;
 		store.GetIter (out iter, new Gtk.TreePath (args.Path));
-		if(Util.IsNumber(args.NewText) && (string) treeview_subevents.Model.GetValue(iter,2) != "-1") {
+		if(Util.IsNumber(args.NewText, true) && (string) treeview_subevents.Model.GetValue(iter,2) != "-1") {
 			//if it's limited by fixed value of seconds
 			//and new seconds are bigger than allowed, return
 			if(jumpType.FixedValue > 0 && ! jumpType.JumpsLimited &&

Modified: trunk/src/gui/pulse.cs
==============================================================================
--- trunk/src/gui/pulse.cs	(original)
+++ trunk/src/gui/pulse.cs	Thu Jan 29 19:10:36 2009
@@ -362,7 +362,7 @@
 	{
 		Gtk.TreeIter iter;
 		store.GetIter (out iter, new Gtk.TreePath (args.Path));
-		if(Util.IsNumber(args.NewText)) {
+		if(Util.IsNumber(args.NewText, true)) {
 			/* 
 			 * currently all pulseTypes are non fixed, and it's not possible to create more types (by user), then there are no limitations
 			 */

Modified: trunk/src/gui/run.cs
==============================================================================
--- trunk/src/gui/run.cs	(original)
+++ trunk/src/gui/run.cs	Thu Jan 29 19:10:36 2009
@@ -210,7 +210,7 @@
 		combo_eventType.Sensitive=false;
 
 		string [] myTypes;
-		myTypes = SqliteRunType.SelectRunIntervalTypes("", true); //don't show allRunsName row, only select name
+		myTypes = SqliteRunIntervalType.SelectRunIntervalTypes("", true); //don't show allRunsName row, only select name
 		return myTypes;
 	}
 	
@@ -292,7 +292,7 @@
 	static RepairRunIntervalWindow RepairRunIntervalWindowBox;
 	Gtk.Window parent;
 
-	RunType runType;
+	RunType type;
 	RunInterval runInterval; //used on button_accept
 	
 
@@ -314,10 +314,10 @@
 		label_header.Text = string.Format(Catalog.GetString("Use this window to repair this test.\nDouble clic any cell to edit it (decimal separator: '{0}')"), localeInfo.NumberDecimalSeparator);
 	
 		
-		runType = SqliteRunType.SelectAndReturnRunIntervalType(myRun.Type);
+		type = SqliteRunIntervalType.SelectAndReturnRunIntervalType(myRun.Type);
 		
 		TextBuffer tb = new TextBuffer (new TextTagTable());
-		tb.Text = createTextForTextView(runType);
+		tb.Text = createTextForTextView(type);
 		textview1.Buffer = tb;
 		
 		createTreeView(treeview_subevents);
@@ -386,14 +386,14 @@
 	{
 		Gtk.TreeIter iter;
 		store.GetIter (out iter, new Gtk.TreePath (args.Path));
-		if(Util.IsNumber(args.NewText)) {
+		if(Util.IsNumber(args.NewText, true)) {
 			//if it's limited by fixed value of seconds
 			//and new seconds are bigger than allowed, return
-			if(runType.FixedValue > 0 && ! runType.TracksLimited &&
+			if(type.FixedValue > 0 && ! type.TracksLimited &&
 					getTotalTime() //current total time in treeview
 					- Convert.ToDouble((string) treeview_subevents.Model.GetValue(iter,1)) //-old cell
 					+ Convert.ToDouble(args.NewText) //+new cell
-					> runType.FixedValue) {	//bigger than allowed
+					> type.FixedValue) {	//bigger than allowed
 				return;
 			} else {
 				store.SetValue(iter, 1, args.NewText);
@@ -443,14 +443,14 @@
 
 			//don't allow to add a row before or after 
 			//if the runtype is fixed to n runs and we reached n
-			if(runType.FixedValue > 0 && runType.TracksLimited) {
+			if(type.FixedValue > 0 && type.TracksLimited) {
 				int lastRow = 0;
 				do {
 					lastRow = Convert.ToInt32 ((string) model.GetValue (iter, 0));
 				} while (store.IterNext (ref iter));
 
 				//don't allow if max rows reached
-				if(lastRow == runType.FixedValue) {
+				if(lastRow == type.FixedValue) {
 					button_add_before.Sensitive = false;
 					button_add_after.Sensitive = false;
 				}
@@ -527,16 +527,16 @@
 		runInterval.TimeTotal = Util.GetTotalTime(timeString);
 		runInterval.DistanceTotal = runInterval.TimeTotal * runInterval.DistanceInterval;
 	
-		if(runType.FixedValue > 0) {
-			//if this runType has a fixed value of runs or time, limitstring has not changed
-			if(runType.TracksLimited) {
-				runInterval.Limited = runType.FixedValue.ToString() + "R";
+		if(type.FixedValue > 0) {
+			//if this t'Type has a fixed value of runs or time, limitstring has not changed
+			if(type.TracksLimited) {
+				runInterval.Limited = type.FixedValue.ToString() + "R";
 			} else {
-				runInterval.Limited = runType.FixedValue.ToString() + "T";
+				runInterval.Limited = type.FixedValue.ToString() + "T";
 			}
 		} else {
 			//else limitstring should be calculated
-			if(runType.TracksLimited) {
+			if(type.TracksLimited) {
 				runInterval.Limited = runInterval.Tracks.ToString() + "R";
 			} else {
 				runInterval.Limited = runInterval.TimeTotal + "T";
@@ -901,7 +901,7 @@
 	protected override void fillTreeView (Gtk.TreeView tv, TreeStore store) 
 	{
 		//select data without inserting an "all jumps", and not obtain only name of jump
-		string [] myTypes = SqliteRunType.SelectRunIntervalTypes("", false);
+		string [] myTypes = SqliteRunIntervalType.SelectRunIntervalTypes("", false);
 		foreach (string myType in myTypes) {
 			string [] myStringFull = myType.Split(new char[] {':'});
 			

Modified: trunk/src/gui/runType.cs
==============================================================================
--- trunk/src/gui/runType.cs	(original)
+++ trunk/src/gui/runType.cs	Thu Jan 29 19:10:36 2009
@@ -45,12 +45,34 @@
 	[Widget] Gtk.HBox hbox_fixed;
 	[Widget] Gtk.RadioButton radiobutton_limited_tracks;
 	[Widget] Gtk.CheckButton checkbutton_limited_fixed;
-	[Widget] Gtk.CheckButton checkbutton_distance_fixed;
-	[Widget] Gtk.SpinButton spin_fixed_num;
+	[Widget] Gtk.SpinButton spin_fixed_tracks_or_time;
+
 	[Widget] Gtk.Label label_distance;
-	[Widget] Gtk.SpinButton spin_distance;
+	[Widget] Gtk.RadioButton radiobutton_dist_variable;
+	[Widget] Gtk.RadioButton radiobutton_dist_fixed;
+	[Widget] Gtk.RadioButton radiobutton_dist_different;
+
+	[Widget] Gtk.HBox hbox_distance_fixed;
+	[Widget] Gtk.SpinButton spin_distance_fixed;
+
+	[Widget] Gtk.VBox vbox_distance_variable;
+	[Widget] Gtk.SpinButton spin_distance_different_tracks_number;
+	[Widget] Gtk.HBox hbox_distance_variable;
+
 
 	[Widget] Gtk.TextView textview_description;
+	
+	//10 entries for distance different test definition
+	[Widget] Gtk.Entry dd0;
+	[Widget] Gtk.Entry dd1;
+	[Widget] Gtk.Entry dd2;
+	[Widget] Gtk.Entry dd3;
+	[Widget] Gtk.Entry dd4;
+	[Widget] Gtk.Entry dd5;
+	[Widget] Gtk.Entry dd6;
+	[Widget] Gtk.Entry dd7;
+	[Widget] Gtk.Entry dd8;
+	[Widget] Gtk.Entry dd9;
 
 	static RunTypeAddWindow RunTypeAddWindowBox;
 	Gtk.Window parent;
@@ -85,9 +107,25 @@
 		vbox_limited.Sensitive = false;	
 		hbox_fixed.Sensitive = false;	
 		button_accept.Sensitive = false;
-		spin_fixed_num.Sensitive = false;
+		spin_fixed_tracks_or_time.Sensitive = false;
 		label_distance.Text = Catalog.GetString("Distance");
-		spin_distance.Sensitive = false;
+		
+		radiobutton_dist_different.Sensitive = false;
+		hbox_distance_fixed.Hide();	
+		vbox_distance_variable.Hide();	
+					
+		dd0 = new Gtk.Entry(); 	dd0.Changed += new EventHandler(on_entries_required_changed);
+		dd1 = new Gtk.Entry(); 	dd1.Changed += new EventHandler(on_entries_required_changed);
+		dd2 = new Gtk.Entry(); 	dd2.Changed += new EventHandler(on_entries_required_changed);
+		dd3 = new Gtk.Entry(); 	dd3.Changed += new EventHandler(on_entries_required_changed);
+		dd4 = new Gtk.Entry(); 	dd4.Changed += new EventHandler(on_entries_required_changed);
+		dd5 = new Gtk.Entry(); 	dd5.Changed += new EventHandler(on_entries_required_changed);
+		dd6 = new Gtk.Entry(); 	dd6.Changed += new EventHandler(on_entries_required_changed);
+		dd7 = new Gtk.Entry(); 	dd7.Changed += new EventHandler(on_entries_required_changed);
+		dd8 = new Gtk.Entry(); 	dd8.Changed += new EventHandler(on_entries_required_changed);
+		dd9 = new Gtk.Entry(); 	dd9.Changed += new EventHandler(on_entries_required_changed);
+	
+		reset_hbox_distance_variable (2);
 	}
 		
 	void on_button_cancel_clicked (object o, EventArgs args)
@@ -104,6 +142,8 @@
 	
 	void on_button_accept_clicked (object o, EventArgs args)
 	{
+		//Console.WriteLine(getEntriesString());
+
 		//check if this run type exists, and check it's name is not AllRunsName
 		bool runTypeExists = Sqlite.Exists (Constants.RunTypeTable, Util.RemoveTildeAndColonAndDot(entry_name.Text));
 		if(Util.RemoveTildeAndColonAndDot(entry_name.Text) == Constants.AllRunsName) {
@@ -111,79 +151,87 @@
 		}
 		
 		if(runTypeExists) {
-			//string myString =  Catalog.GetString ("Run type: '") + 
-			//	Util.RemoveTildeAndColonAndDot(entry_name.Text) + 
-			//	Catalog.GetString ("' exists. Please, use another name");
-			string myString = string.Format(Catalog.GetString("Run type: '{0}' exists. Please, use another name"), Util.RemoveTildeAndColonAndDot(entry_name.Text) );
+			string myString = string.Format(Catalog.GetString("Run type: '{0}' exists. Please, use another name"), 
+					Util.RemoveTildeAndColonAndDot(entry_name.Text) );
 			Log.WriteLine (myString);
 			errorWin = ErrorWindow.Show(myString);
 		} else {
-			string myRun = "";
-			myRun = Util.RemoveTildeAndColonAndDot(entry_name.Text);
+			RunType type = new RunType();
+			type.Name = Util.RemoveTildeAndColonAndDot(entry_name.Text);
+			type.Description = Util.RemoveTildeAndColon(textview_description.Buffer.Text);
 						
-			if(checkbutton_distance_fixed.Active) {
-				myRun = myRun + ":" + spin_distance.Value.ToString();
-			} else {
-				myRun = myRun + ":0";
+			if(radiobutton_dist_variable.Active)
+				type.Distance = 0;
+			else if(radiobutton_dist_fixed.Active) 
+				type.Distance = spin_distance_fixed.Value;
+			else {
+				//dist_different (only on intervallic)
+				type.Distance = -1;
+				type.DistancesString = getEntriesString();
 			}
 			
-			if(radiobutton_simple.Active) {
-				myRun = myRun + ":" + 
-					Util.RemoveTildeAndColon(textview_description.Buffer.Text);
-			
-				SqliteRunType.RunTypeInsert(myRun, false); //false, because dbcon is not opened
-			} else {
+			if(radiobutton_simple.Active) 
+				SqliteRunType.Insert(type, Constants.RunTypeTable, false); //false, because dbcon is not opened
+			else {
 				if(radiobutton_unlimited.Active) {
-					//unlimited (but in runs do like if it's limited by seconds
+					//unlimited (but in runs do like if it's limited by seconds: TracksLimited = false
 					//(explanation in sqlite/jumpType.cs)
-					myRun = myRun + ":0:0:1"; 
+					type.TracksLimited = false; 
+					type.FixedValue = 0; 
+					type.Unlimited = true; 
 				} else {
-					if(radiobutton_limited_tracks.Active) {
-						myRun = myRun + ":1"; 
-					} else {
-						myRun = myRun + ":0";
-					}
+					type.TracksLimited = radiobutton_limited_tracks.Active;
 				
-					if(checkbutton_limited_fixed.Active) {
-						myRun = myRun + ":" + spin_fixed_num.Value; 
-					} else {
-						myRun = myRun + ":0"; 
-					}
+					if(checkbutton_limited_fixed.Active) 
+						type.FixedValue = Convert.ToInt32(spin_fixed_tracks_or_time.Value); 
+					else 
+						type.FixedValue = 0; 
+					
 						
-					//not unlimited run
-					myRun = myRun + ":0"; 
+					type.Unlimited = false; 
 				}
 			
-				myRun = myRun + ":" + 
-					Util.RemoveTildeAndColon(textview_description.Buffer.Text);
-				
-				SqliteRunType.RunIntervalTypeInsert(myRun, false); //false, because dbcon is not opened
+				SqliteRunIntervalType.Insert(type, Constants.RunIntervalTypeTable, false); //false, because dbcon is not opened
 			}
 			
-			Log.WriteLine(string.Format("Inserted: {0}", myRun));
+			//Log.WriteLine(string.Format("Inserted: {0}", type));
 			
 			fakeButtonAccept.Click();
 		
 			RunTypeAddWindowBox.run_type_add.Hide();
 			RunTypeAddWindowBox = null;
 		}
-
 	}
 
+	/* 
+	 * when radiobutton is simple
+	 * vboxLimited non sensitive
+	 * hboxFixed non sensitive
+	 * and distance different non sensitive
+	 */
+
+
 	void on_radiobutton_simple_toggled (object o, EventArgs args)
 	{
+		label_distance.Text = "Distance";
 		vbox_limited.Sensitive = false;	
 		hbox_fixed.Sensitive = false;	
-		label_distance.Text = "Distance";
+
+		if(radiobutton_dist_different.Active)
+			radiobutton_dist_variable.Active = true;
+		radiobutton_dist_different.Sensitive = false;
+		
 	}
 	
 	void on_radiobutton_interval_toggled (object o, EventArgs args)
 	{
+		label_distance.Text = "Distance\nof each track";
 		vbox_limited.Sensitive = true;	
 		if( ! radiobutton_unlimited.Active) {
 			hbox_fixed.Sensitive = true;	
 		}
-		label_distance.Text = "Distance\nof a track";
+		
+		radiobutton_dist_different.Sensitive = true;
 	}
 	
 	void on_radiobutton_limited_tracks_or_time_toggled (object o, EventArgs args)
@@ -198,30 +246,124 @@
 	
 	void on_checkbutton_limited_fixed_clicked (object o, EventArgs args)
 	{
-		if(checkbutton_limited_fixed.Active) {
-			spin_fixed_num.Sensitive = true;
-		} else {
-			spin_fixed_num.Sensitive = false;
-		}
+		if(checkbutton_limited_fixed.Active) 
+			spin_fixed_tracks_or_time.Sensitive = true;
+		else 
+			spin_fixed_tracks_or_time.Sensitive = false;
+
 	}
 	
-	void on_checkbutton_distance_fixed_clicked (object o, EventArgs args)
+	void on_radiobutton_dist_variable_toggled (object o, EventArgs args)
 	{
-		if(checkbutton_distance_fixed.Active) {
-			spin_distance.Sensitive = true;
-		} else {
-			spin_distance.Sensitive = false;
+		hbox_distance_fixed.Hide();	
+		vbox_distance_variable.Hide();	
+	}
+	
+	void on_radiobutton_dist_fixed_toggled (object o, EventArgs args)
+	{
+		hbox_distance_fixed.Show();	
+		vbox_distance_variable.Hide();	
+	}
+	
+	void on_radiobutton_dist_different_toggled (object o, EventArgs args)
+	{
+		hbox_distance_fixed.Hide();	
+		vbox_distance_variable.Show();	
+		spin_distance_different_tracks_number.Sensitive = true;
+	}
+	
+	void on_spin_distance_different_tracks_number_changed (object o, EventArgs args)
+	{
+		reset_hbox_distance_variable((int)spin_distance_different_tracks_number.Value);
+	}
+	
+	void reset_hbox_distance_variable (int colsNum) 
+	{
+		foreach(Gtk.Entry entry in hbox_distance_variable.Children)
+			hbox_distance_variable.Remove(entry);
+
+		int wc = 3; //widthChars (width of the entry)
+		int ml = 3; //maxLength (max chars to entry)
+		for (int i = 0; i < colsNum; i ++) {
+			switch(i) {
+				case 0: 
+					dd0.WidthChars = wc; dd0.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd0, false, false, 0);
+					break;
+				case 1: 
+					dd1.WidthChars = wc; dd1.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd1, false, false, 0);
+					break;
+				case 2: 
+					dd2.WidthChars = wc; dd2.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd2, false, false, 0);
+					break;
+				case 3: 
+					dd3.WidthChars = wc; dd3.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd3, false, false, 0);
+					break;
+				case 4: 
+					dd4.WidthChars = wc; dd4.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd4, false, false, 0);
+					break;
+				case 5: 
+					dd5.WidthChars = wc; dd5.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd5, false, false, 0);
+					break;
+				case 6: 
+					dd6.WidthChars = wc; dd6.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd6, false, false, 0);
+					break;
+				case 7: 
+					dd7.WidthChars = wc; dd7.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd7, false, false, 0);
+					break;
+				case 8: 
+					dd8.WidthChars = wc; dd8.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd8, false, false, 0);
+					break;
+				case 9: 
+					dd9.WidthChars = wc; dd9.MaxLength = ml;
+					hbox_distance_variable.PackStart(dd9, false, false, 0);
+					break;
+			}
+		}
+		hbox_distance_variable.ShowAll();
+	}
+
+	private string getEntriesString () {
+		string str = "";
+		string separator = "";
+		
+		string ddString = dd0.Text + "-" + dd1.Text + "-" + dd2.Text + "-" + dd3.Text + "-" + dd4.Text + "-" + 
+			dd5.Text + "-" + dd6.Text + "-" + dd7.Text + "-" + dd8.Text + "-" + dd9.Text; 
+		string [] s = ddString.Split(new char[] {'-'});
+
+		for(int i=0; i < (int)spin_distance_different_tracks_number.Value; i ++) {
+			str += separator + s[i];
+			separator = "-";
 		}
+		return str;
 	}
 	
 	void on_entries_required_changed (object o, EventArgs args)
 	{
-		if(entry_name.Text.ToString().Length > 0) {
-			button_accept.Sensitive = true;
-		}
-		else {
+		if(entry_name.Text.ToString().Length == 0) {
 			button_accept.Sensitive = false;
+			return;
 		}
+
+		if(radiobutton_dist_different.Active) {
+			string ddString = getEntriesString();
+			string [] s = ddString.Split(new char[] {'-'});
+			foreach (string myS in s)
+				if( ! Util.IsNumber(myS, true)) {
+					button_accept.Sensitive = false;
+					return;
+				}
+		}
+			
+		button_accept.Sensitive = true;
 	}
 
 

Modified: trunk/src/gui/server.cs
==============================================================================
--- trunk/src/gui/server.cs	(original)
+++ trunk/src/gui/server.cs	Thu Jan 29 19:10:36 2009
@@ -91,6 +91,7 @@
 	Gtk.Window parent;
 	
 	SessionUploadWindow (Gtk.Window parent) {
+	//SessionUploadWindow () {
 		Glade.XML gladeXML;
 		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "session_upload", null);
 		gladeXML.Autoconnect(this);
@@ -131,9 +132,11 @@
 	}
 	
 	static public SessionUploadWindow Show (Gtk.Window parent)
+	//static public SessionUploadWindow Show ()
 	{
 		if (SessionUploadWindowBox == null) {
 			SessionUploadWindowBox = new SessionUploadWindow (parent);
+			//SessionUploadWindowBox = new SessionUploadWindow ();
 		}
 		SessionUploadWindowBox.session_upload.Show ();
 		

Modified: trunk/src/jump.cs
==============================================================================
--- trunk/src/jump.cs	(original)
+++ trunk/src/jump.cs	Thu Jan 29 19:10:36 2009
@@ -38,6 +38,22 @@
 
 	public Jump() {
 	}
+	
+	public override string Prova () {
+		return "estic a jump";
+	}
+	
+	public string Prova2 () {
+		return "estic a jump2";
+	}
+
+//funciona	
+	public virtual void HolaServer (ChronojumpServer myServer) {
+		myServer.Hola("from jump1", uniqueID);
+		//myServer.Hola2("from jump2", this);
+		myServer.Hola3("from jump3", (Event)this);
+		myServer.Hola5("from jump 5", (Event)this, false);
+	}
 
 	//after inserting database (SQL)
 	public Jump(int uniqueID, int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string description, double angle, int simulated)
@@ -139,6 +155,13 @@
 	
 	public JumpRj() {
 	}
+	
+	public override void HolaServer (ChronojumpServer myServer) {
+		myServer.Hola("from jumpRj1", uniqueID);
+		//myServer.Hola2("from jumpRj2", this);
+		myServer.Hola5("from jumpRj 5", (Event)this, true);
+	}
+
 
 	//after inserting database (SQL)
 	public JumpRj(int uniqueID, int personID, int sessionID, string type, 

Modified: trunk/src/runType.cs
==============================================================================
--- trunk/src/runType.cs	(original)
+++ trunk/src/runType.cs	Thu Jan 29 19:10:36 2009
@@ -30,6 +30,11 @@
 	protected bool tracksLimited;
 	protected int fixedValue;
 	protected bool unlimited;
+	private string distancesString; //new at 0.8.1.5:
+		       			//when distance is 0 or >0, distancesString it's ""
+					//when distance is -1, distancesString is distance of each track, 
+					//	eg: "7-5-9" for a runInterval with three tracks of 7, 5 and 9 meters each
+					//	this is nice for agility tests
 
 	public RunType() {
 		type = Types.RUN;
@@ -44,6 +49,7 @@
 
 		unlimited = false;	//default value
 		imageFileName = "";
+		distancesString = "";
 		
 		//if this changes, sqlite/runType.cs initialize tables should change
 		//
@@ -62,7 +68,6 @@
 			tracksLimited 	= false;
 			fixedValue 	= 0;
 			isPredefined	= true;
-			description	= "";
 			description	= Catalog.GetString("Run 20 meters");
 			imageFileName = "run_simple.png";
 		} else if(name == "100m") {
@@ -297,6 +302,7 @@
 			isPredefined	= true;
 			description	= Catalog.GetString("Modified time Getup and Go test");
 			imageFileName = "mtgug.png";
+			distancesString = "1-7-19";	//this intervallic run has different distance for each track
 			longDescription = "The instructions given to perform the test were as follows: <<Sit down with your back resting on the back of the chair and with your two arms resting on your legs. When you hear the word <<go>>, stand up without using your arms, kick the ball in front of you as hard as you possibly can, using the instep of the foot you feel the safest. Then walk at your normal pace while counting backwards from 15 to 0 out loud. Turn around back the cone, without touching it, and go back to your seat, stepping into the circles, trying not to touch any of them. Finally, sit down again, trying not to use your arms>>.\n\n" +
 				"The stopwatches were activated on the word <<go>> and the button that saved the time intervals was pressed also after the following stages: when the subject stood up and kicked the ball; when the ball passed the 8 m line; and when the subject returned to the seated position in the same chair (42 cm height from the seat to the ground). The total time needed to perform the test provided a quantitative evaluation of performance. A qualitative evaluation was performed by the completion of an AQ. This AQ assesses 6 items with a Likert scale from 0 to 3, where 0 is the equivalent to needing help in order to perform the task, and 3 is equivalent to performing the task unaided with no mistakes. The maximum points that can be attained are 18. The items assessed were: (1) standing up from the chair, (2) kicking the ball, (3) walking whilst counting backwards from 15 to 0, (4) walking around the cone, (5) walking whilst stepping into the circles, and (6) sitting back down again (S
 ee assessment questionnaire).\n\n" + 
 				"<b>Assessment questionnaire</b>\n"+
@@ -309,17 +315,11 @@
 
 		}
 
-
-
-
-
-
-
 	}
 	
 	
 	public RunType(string name, bool hasIntervals, double distance, 
-			bool tracksLimited, int fixedValue, bool unlimited, string description, string imageFileName)
+			bool tracksLimited, int fixedValue, bool unlimited, string description, string distancesString, string imageFileName)
 	{
 		type = Types.RUN;
 		this.name 	= name;
@@ -329,45 +329,89 @@
 		this.fixedValue = fixedValue;
 		this.unlimited = unlimited;
 		this.description = description;
+		this.distancesString = description;
 		this.imageFileName = imageFileName;
 		
 		this.isPredefined	= true;
 	}
+	
+	//used to select a runType at Sqlite.convertTables
+	public RunType(string [] str, bool interval)
+	{
+		if(interval) {
+			this.uniqueID = Convert.ToInt32(str[0]);
+			this.name = str[1];
+			this.distance = Convert.ToDouble(Util.ChangeDecimalSeparator(str[2]));
+			this.tracksLimited = Util.IntToBool(Convert.ToInt32(str[3]));
+			this.fixedValue = Convert.ToInt32(str[4]);
+			this.unlimited = Util.IntToBool(Convert.ToInt32(str[5]));
+			this.description = str[6].ToString();
+		} else {
+			this.uniqueID = Convert.ToInt32(str[0]);
+			this.name = str[1];
+			this.distance = Convert.ToDouble(Util.ChangeDecimalSeparator(str[2]));
+			this.description = str[3].ToString();
+		}
+	}
+
+
+	//used by Sqlite.convertTables
+	//public override int InsertAtDB (bool dbconOpened, string tableName, bool interval) {
+	public int InsertAtDB (bool dbconOpened, string tableName, bool interval) {
+		if(interval)
+			/*
+			return SqliteRunIntervalType.Insert(dbconOpened, tableName,
+					name, distance, tracksLimited, fixedValue,
+					unlimited, description);
+					*/
+			return SqliteRunIntervalType.Insert(this, tableName, dbconOpened);
+		else
+			/*
+			return SqliteRunType.Insert(dbconOpened, tableName, 
+					name, distance, description);
+					*/
+			return SqliteRunType.Insert(this, tableName, dbconOpened);
+	}
+
 
 	public double Distance
 	{
-		get { 
+		get {
+			/*
 			if(isPredefined) {
 				return distance; 
 			} else {
 				return SqliteRunType.Distance(name);
 			}
+			*/
+				return distance; 
 		}
 		set { distance = value; }
 	}
 	
-	public bool HasIntervals
-	{
+	public bool HasIntervals {
 		get { return hasIntervals; }
 		set { hasIntervals = value; }
 	}
 	
-	public bool TracksLimited
-	{
+	public bool TracksLimited {
 		get { return tracksLimited; }
 		set { tracksLimited = value; }
 	}
 	
-	public int FixedValue
-	{
+	public int FixedValue {
 		get { return fixedValue; }
 		set { fixedValue = value; }
 	}
 	
-	public bool Unlimited
-	{
+	public bool Unlimited {
 		get { return unlimited; }
 		set { unlimited = value; }
 	}
+
+	public string DistancesString {
+		get { return distancesString; }
+		set { distancesString = value; }
+	}
 }
 

Added: trunk/src/server.cs
==============================================================================
--- (empty file)
+++ trunk/src/server.cs	Thu Jan 29 19:10:36 2009
@@ -0,0 +1,447 @@
+/*
+ * 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 System.Threading;
+using Mono.Unix;
+using Gtk;
+using Gdk;
+using Glade;
+
+public class Server
+{
+	public static string Ping(bool doInsertion, string progName, string progVersion) {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+		
+			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+
+			ServerPing myPing = new ServerPing(evalSID, progName + " " + progVersion, Util.GetOS(), 
+					Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
+			//if !doIsertion nothing will be uploaded,
+			//is ok for uploadPerson to know if server is online
+			myPing.UniqueID = myServer.UploadPing(myPing, doInsertion);
+			
+			Log.WriteLine(myServer.DisConnectDatabase());
+
+			return myPing.ToString();
+		} catch {
+			return Constants.ServerOffline;
+		}
+	}
+	
+	/* server session update */
+
+	static Thread thread;
+
+	public static SessionUploadWindow sessionUploadWin;
+	[Widget] public static Gtk.Window app1;
+	
+	public static Session currentSession;
+	public static string progName;
+	public static string progVersion;
+
+	public static bool serverSessionError;
+	public static bool needUpdateServerSession;
+	public static bool updatingServerSession;
+	public static SessionUploadPersonData sessionUploadPersonData;
+			
+	public static void InitializeSessionVariables() {
+		serverSessionError = false;
+		needUpdateServerSession = false;
+		updatingServerSession = false;
+		sessionUploadPersonData = new SessionUploadPersonData();
+	}
+			
+	public static void ThreadStart() {
+		thread = new Thread(new ThreadStart(on_server_upload_session_started));
+		GLib.Idle.Add (new GLib.IdleHandler (pulseGTKServer));
+		thread.Start(); 
+	}
+	
+	private static bool pulseGTKServer ()
+	{
+		if(! thread.IsAlive) {
+			sessionUploadWin.UploadFinished();
+			Log.Write("dying");
+			return false;
+		}
+
+		if (serverSessionError) {
+			new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Error uploading session to server"));
+			return false;
+		}
+
+		//need to do this, if not it crashes because chronopicWin gets died by thread ending
+		sessionUploadWin = SessionUploadWindow.Show(app1);
+		//sessionUploadWin = SessionUploadWindow.Show();
+
+		if(needUpdateServerSession && !updatingServerSession) {
+			//prevent that FillData is called again with same data
+			updatingServerSession = true;
+
+			//fill data
+			sessionUploadWin.FillData(sessionUploadPersonData);
+
+			//not need to update until there'm more data coming from the other thread
+			updatingServerSession = false;
+			needUpdateServerSession = false;
+		}
+		
+		Thread.Sleep (50);
+		Log.Write(thread.ThreadState.ToString());
+		return true;
+	}
+	
+	private static void on_server_upload_session_started () 
+	{
+		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+
+		try {	
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+		
+			//create ServerSession based on Session currentSession
+			ServerSession serverSession = new ServerSession(currentSession, evalSID, progName + " " + progVersion, 
+					Util.GetOS(), Util.DateParse(DateTime.Now.ToString()), Constants.ServerSessionStates.UPLOADINGSESSION); 
+
+			//if uploading session for first time
+			if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) 
+			{
+				//upload ServerSession
+				int idAtServer = myServer.UploadSession(serverSession);
+
+				//update session currentSession (serverUniqueID) on client database
+				currentSession.ServerUniqueID = idAtServer;
+				SqliteSession.UpdateServerUniqueID(currentSession.UniqueID, currentSession.ServerUniqueID);
+			}
+
+			myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGDATA); 
+
+			//upload persons (updating also person.serverUniqueID locally)
+			string [] myPersons = SqlitePersonSession.SelectCurrentSession(serverSession.UniqueID, true, false); //onlyIDAndName, not reversed
+			Constants.UploadCodes uCode;
+			foreach(string personStr in myPersons) {
+				Person person = SqlitePersonSession.PersonSelect(Util.FetchID(personStr), serverSession.UniqueID); 
+				//check person if exists
+				if(person.ServerUniqueID != Constants.ServerUndefinedID) 
+					uCode = Constants.UploadCodes.EXISTS;
+				else {
+					uCode = Constants.UploadCodes.OK;
+
+					//if sport is user defined, upload it
+					//and when upload the person, do it with new sportID
+					Sport sport = SqliteSport.Select(person.SportID);
+					if(sport.UserDefined) 
+						person.SportID = myServer.UploadSport(sport);
+
+					person = serverUploadPerson(myServer, person, serverSession.UniqueID);
+				}
+
+				//a person can be in the database for one session, 
+				//but maybe now we add jumps from another session and we should add an entry at personsessionweight
+				serverUploadPersonSessionIfNeeded(myServer, person.ServerUniqueID, currentSession.ServerUniqueID, person.Weight);
+
+				//other thread updates the gui:
+				sessionUploadPersonData.person = person;
+				sessionUploadPersonData.personCode = uCode;
+
+				//upload jumps
+				int countU = 0;					
+				int countE = 0;					
+				int countS = 0;					
+
+				string [] jumps = SqliteJump.SelectJumps(currentSession.UniqueID, person.UniqueID, "");
+				foreach(string myJump in jumps) {
+					string [] js = myJump.Split(new char[] {':'});
+					//select jump
+					Jump test = SqliteJump.SelectJumpData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+
+					//if test is not simulated and has not been uploaded,
+					//see if it's type is not predefined and is not in the database
+					//then upload it first
+					if(test.Simulated == 0) {
+						//upload jumpType if is user defined and doesn't exists in server database
+						//JumpType type = new JumpType(test.Type);
+						JumpType type = SqliteJumpType.SelectAndReturnJumpType(test.Type);
+						if( ! type.IsPredefined) {
+							//Console.WriteLine("USER DEFINED TEST: " + test.Type);
+							//
+							//this uploads the new type, as it's user created, it will be like this
+							//eg: for user defined jumpType: "supra" of evaluatorServerID: 9
+							//at server will be "supra-9"
+							//then two problems get solved:
+							//1.- every evaluator that uploads a type will have a different name 
+							//than other evaluator uploading a type that is named the same but could be different 
+							//(one can think that "supra" is another thing
+							//2- when the same evaluator upload some supra's, only a new type is created
+					
+							test.Type = myServer.UploadJumpType(type, evalSID);
+					
+							//test.Type in the server will have the correct name "supra-9" 
+						}
+					}
+
+					//upload... (if not because of simulated or uploaded before, report also the user)
+					uCode = serverUploadTest(myServer, Constants.TestTypes.JUMP, Constants.JumpTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.jumpsU = countU;
+				sessionUploadPersonData.jumpsE = countE;
+				sessionUploadPersonData.jumpsS = countS;
+
+				//upload jumpsRj
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] jumpsRj = SqliteJumpRj.SelectJumps(currentSession.UniqueID, person.UniqueID, "");
+				foreach(string myJump in jumpsRj) {
+					string [] js = myJump.Split(new char[] {':'});
+					//select jump
+					JumpRj test = SqliteJumpRj.SelectJumpData(Constants.JumpRjTable, Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.JUMP_RJ, Constants.JumpRjTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.jumpsRjU = countU;
+				sessionUploadPersonData.jumpsRjE = countE;
+				sessionUploadPersonData.jumpsRjS = countS;
+
+				//upload runs
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] runs = SqliteRun.SelectAllRuns(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRun in runs) {
+					string [] js = myRun.Split(new char[] {':'});
+					//select run
+					Run test = SqliteRun.SelectRunData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RUN, Constants.RunTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.runsU = countU;
+				sessionUploadPersonData.runsE = countE;
+				sessionUploadPersonData.runsS = countS;
+
+				//upload runs intervallic
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] runsI = SqliteRunInterval.SelectAllRuns(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRun in runsI) {
+					string [] js = myRun.Split(new char[] {':'});
+					//select run
+					RunInterval test = SqliteRunInterval.SelectRunData(Constants.RunIntervalTable, Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RUN_I, Constants.RunIntervalTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.runsIU = countU;
+				sessionUploadPersonData.runsIE = countE;
+				sessionUploadPersonData.runsIS = countS;
+
+				//upload reaction times
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] rts = SqliteReactionTime.SelectAllReactionTimes(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRt in rts) {
+					string [] js = myRt.Split(new char[] {':'});
+					//select rt
+					ReactionTime test = SqliteReactionTime.SelectReactionTimeData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RT, Constants.ReactionTimeTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.rtsU = countU;
+				sessionUploadPersonData.rtsE = countE;
+				sessionUploadPersonData.rtsS = countS;
+
+				//upload pulses
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] pulses = SqlitePulse.SelectAllPulses(currentSession.UniqueID, person.UniqueID);
+				foreach(string myPulse in pulses) {
+					string [] js = myPulse.Split(new char[] {':'});
+					//select pulse
+					Pulse test = SqlitePulse.SelectPulseData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.PULSE, Constants.PulseTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.pulsesU = countU;
+				sessionUploadPersonData.pulsesE = countE;
+				sessionUploadPersonData.pulsesS = countS;
+
+				needUpdateServerSession = true;
+				while(needUpdateServerSession) {
+					//wait until data is printed on the other thread
+				}
+
+			}
+
+			myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.DONE); 
+
+			Log.WriteLine(myServer.DisConnectDatabase());
+		} catch {
+			//other thread updates the gui:
+			serverSessionError = true;
+		}
+	}
+	
+	//upload a person
+	private static Person serverUploadPerson(ChronojumpServer myServer, Person person, int serverSessionID) 
+	{
+		int idAtServer = myServer.UploadPerson(person, serverSessionID);
+
+		//update person (serverUniqueID) on client database
+		person.ServerUniqueID = idAtServer;
+		SqlitePerson.Update(person);
+
+		return person;
+	}
+
+	private static void serverUploadPersonSessionIfNeeded(ChronojumpServer myServer, int personServerID, int sessionServerID, int weight)
+	{
+		myServer.UploadPersonSessionIfNeeded(personServerID, sessionServerID, weight);
+	}
+
+	//upload a test
+	private static Constants.UploadCodes serverUploadTest(ChronojumpServer myServer, Constants.TestTypes type, string tableName, Event myTest) 
+	{
+		Constants.UploadCodes uCode;
+
+		if(myTest.Simulated == Constants.Simulated) {
+			//Test is simulated, don't upload
+			uCode = Constants.UploadCodes.SIMULATED;
+		} else if(myTest.Simulated > 0) {
+			//Test is already uploaded, don't upload
+			uCode = Constants.UploadCodes.EXISTS;
+		} else {
+			int idAtServer = -1;
+			idAtServer = myServer.UploadTest((Event) myTest, type, tableName);
+			
+			//update test (simulated) on client database
+			myTest.Simulated = idAtServer;
+			SqliteEvent.UpdateSimulated(false, tableName, myTest.UniqueID, idAtServer);
+			
+			uCode = Constants.UploadCodes.OK;
+		}
+		return uCode;
+	}
+
+	public static void ServerUploadEvaluator () {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+			
+			//get Data, TODO: do it in a gui/window
+			ServerEvaluator myEval = new ServerEvaluator("myName", "myEmail", "myDateBorn", Constants.CountryUndefinedID, false);
+			//upload
+			myEval.UniqueID = myServer.UploadEvaluator(myEval);
+			//update evaluatorServerID locally
+			SqlitePreferences.Update("evaluatorServerID", myEval.UniqueID.ToString(), false);
+
+			new DialogMessage(Constants.MessageTypes.INFO, "Uploaded with ID: " + myEval.UniqueID);
+			
+			Log.WriteLine(myServer.DisConnectDatabase());
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+	
+}

Modified: trunk/src/serverPing.cs
==============================================================================
--- trunk/src/serverPing.cs	(original)
+++ trunk/src/serverPing.cs	Thu Jan 29 19:10:36 2009
@@ -53,7 +53,7 @@
 	}	
 
 	public override string ToString() {
-		return "ID: " + uniqueID + "\nEvaluatorID: " + evaluatorID + 
+		return Catalog.GetString("Uploaded") + "\nID: " + uniqueID + "\nEvaluatorID: " + evaluatorID + 
 			"\nChronojump Version: " + cjVersion + "\nOS Version: " + osVersion +
 			"\nIP: " + ip + "\nDate: " + date;
 	}

Modified: trunk/src/sqlite/main.cs
==============================================================================
--- trunk/src/sqlite/main.cs	(original)
+++ trunk/src/sqlite/main.cs	Thu Jan 29 19:10:36 2009
@@ -73,8 +73,8 @@
 	 * 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.60";
-	//static string lastChronojumpDatabaseVersion = "0.61";
+	//static string lastChronojumpDatabaseVersion = "0.60";
+	static string lastChronojumpDatabaseVersion = "0.61";
 
 	public Sqlite() {
 	}
@@ -529,11 +529,29 @@
 
 				SqliteJumpType.JumpTypeInsert ("Rocket:1:0:Rocket jump", true); 
 
+				/*
 				SqliteRunType.RunTypeInsert ("Agility-20Yard:18.28:20Yard Agility test", true);
 				SqliteRunType.RunTypeInsert ("Agility-505:10:505 Agility test", true);
 				SqliteRunType.RunTypeInsert ("Agility-Illinois:60:Illinois Agility test", true);
 				SqliteRunType.RunTypeInsert ("Agility-Shuttle-Run:40:Shuttle Run Agility test", true);
 				SqliteRunType.RunTypeInsert ("Agility-ZigZag:17.6:ZigZag Agility test", true);
+				*/
+				string [] iniRunTypes = {
+					"Agility-20Yard:18.28:20Yard Agility test",
+					"Agility-505:10:505 Agility test",
+					"Agility-Illinois:60:Illinois Agility test",
+					"Agility-Shuttle-Run:40:Shuttle Run Agility test",
+					"Agility-ZigZag:17.6:ZigZag Agility test"
+				};
+				foreach(string myString in iniRunTypes) {
+					string [] s = myString.Split(new char[] {':'});
+					RunType type = new RunType();
+					type.Name = s[0];
+					type.Distance = Convert.ToDouble(s[1]);
+					type.Description = s[2];
+					SqliteRunType.Insert(type, Constants.RunTypeTable, true);
+				}
+	
 
 				SqliteEvent.createGraphLinkTable();
 				SqliteRunType.AddGraphLinksRunSimpleAgility();	
@@ -562,7 +580,7 @@
 			if(currentVersion == "0.50") {
 				dbcon.Open();
 				SqliteRunType.AddGraphLinksRunSimple();	
-				SqliteRunType.AddGraphLinksRunInterval();	
+				SqliteRunIntervalType.AddGraphLinksRunInterval();	
 				SqlitePreferences.Update ("databaseVersion", "0.51", true); 
 				Log.WriteLine("added graphLinks for run simple and interval");
 				dbcon.Close();
@@ -758,28 +776,35 @@
 				currentVersion = "0.60";
 			}
 
-//			if(currentVersion == "0.60") {
-				/*
-				 * think carefully on the intervalDistancesString
-				 * should it go to runInterval or to runIntervalType 
+			if(currentVersion == "0.60") {
 				dbcon.Open();
-				conversionRateTotal = 2;
-
-				ArrayList arrayIDS = new ArrayList(1);
-				arrayIDS.Add("-1"); //intervalDistancesString
-				convertTables(new SqliteRunType(), Constants.RunIntervalTypeTable, 7, arrayIDS, false);
-				
+				conversionRateTotal = 3;
 				conversionRate = 1;
 
-				RUNINTERVAL or RUNINTERVALTYPE?
-				SqliteRunType.RunIntervalTypeInsert ("MTGUG:-1:true:3:false:Modified time Getup and Go test:7=3=2", true);
+				ArrayList arrayDS = new ArrayList(1);
+				arrayDS.Add("-1"); //distancesString
+				convertTables(new SqliteRunIntervalType(), Constants.RunIntervalTypeTable, 7, arrayDS, false);
 				
 				conversionRate = 2;
+
+				//SqliteRunType.RunIntervalTypeInsert ("MTGUG:-1:true:3:false:Modified time Getup and Go test:1-7-19", true);
+				RunType type = new RunType();
+				type.Name = "MTGUG";
+				type.Distance = -1;
+				type.TracksLimited = true;
+				type.FixedValue = 3;
+				type.Unlimited = false;
+				type.Description = "Modified time Getup and Go test";
+				type.DistancesString = "1-7-19";
+				SqliteRunIntervalType.Insert(type, Constants.RunIntervalTypeTable, true);
+				
+				SqlitePreferences.Update ("databaseVersion", "0.61", true); 
+				Log.WriteLine("Converted DB to 0.61 added RunIntervalType distancesString (now we van have interval tests with different distances of tracks). Added MTGUG");
+				
+				conversionRate = 3;
 				dbcon.Close();
 				currentVersion = "0.61";
-				*/
-//			}
-
+			}
 
 		}
 
@@ -856,10 +881,13 @@
 		
 		//run Types
 		creationRate ++;
-		SqliteRunType.createTableRunType();
-		SqliteRunType.createTableRunIntervalType();
-		SqliteRunType.initializeTableRunType();
-		SqliteRunType.initializeTableRunIntervalType();
+		SqliteRunType sqliteRunTypeObject = new SqliteRunType();
+		sqliteRunTypeObject.createTable(Constants.RunTypeTable);
+		SqliteRunType.initializeTable();
+
+		SqliteRunIntervalType sqliteRunIntervalTypeObject = new SqliteRunIntervalType();
+		sqliteRunIntervalTypeObject.createTable(Constants.RunIntervalTypeTable);
+		SqliteRunIntervalType.initializeTable();
 		
 		//reactionTimes
 		creationRate ++;
@@ -893,6 +921,7 @@
 		SqliteCountry.initialize();
 		
 		//changes [from - to - desc]
+		//0.60 - 0.61 added RunIntervalType distancesString (now we van have interval tests with different distances of tracks). Added MTGUG
 		//0.59 - 0.60 added volumeOn and evaluatorServerID to preferences. Session has now serverUniqueID. Simulated now are -1, because 0 is real and positive is serverUniqueID
 		//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)
@@ -1054,6 +1083,9 @@
 			} else if(tableName == Constants.SessionTable) {	
 				Session mySession = new Session(myReaderStr);
 				myArray.Add(mySession);
+			} else if(tableName == Constants.RunIntervalTypeTable) {	
+				RunType myType = new RunType(myReaderStr, true); //interval
+				myArray.Add(myType);
 			} else {
 				Event myEvent =  new Event();	
 				switch (tableName) {
@@ -1081,6 +1113,7 @@
 		}
 		reader.Close();
 
+Console.WriteLine("1" + tableName);
 		conversionSubRateTotal = myArray.Count * 2;
 
 		if(tableName == Constants.PersonTable) {	
@@ -1093,18 +1126,25 @@
 				mySession.InsertAtDB(true, Constants.ConvertTempTable);
 				conversionSubRate ++;
 			}
+		} else if(tableName == Constants.RunIntervalTypeTable) {	
+			foreach (RunType type in myArray) {
+				type.InsertAtDB(true, Constants.ConvertTempTable, true); //last true is for interval
+				conversionSubRate ++;
+			}
 		} else {
 			foreach (Event myEvent in myArray) {
 				myEvent.InsertAtDB(true, Constants.ConvertTempTable);
 				conversionSubRate ++;
 			}
 		}
-
+Console.WriteLine("2" + tableName);
 		//3rd drop desired table
 		Sqlite.dropTable(tableName);
 
+Console.WriteLine("3" + tableName);
 		//4d create desired table (now with new columns)
 		sqliteObject.createTable(tableName);
+Console.WriteLine("4" + tableName);
 
 		//5th insert data in desired table
 		if(tableName == Constants.PersonTable) {	
@@ -1117,6 +1157,11 @@
 				mySession.InsertAtDB(true, tableName);
 				conversionSubRate ++;
 			}
+		} else if(tableName == Constants.RunIntervalTypeTable) {	
+			foreach (RunType type in myArray) {
+				type.InsertAtDB(true, tableName, true); //last true is for interval
+				conversionSubRate ++;
+			}
 		} else {
 			foreach (Event myEvent in myArray) {
 				myEvent.InsertAtDB(true, tableName);
@@ -1124,6 +1169,7 @@
 			}
 		}
 
+Console.WriteLine("5" + tableName);
 		//6th drop temp table
 		Sqlite.dropTable(Constants.ConvertTempTable);
 	}

Modified: trunk/src/sqlite/runType.cs
==============================================================================
--- trunk/src/sqlite/runType.cs	(original)
+++ trunk/src/sqlite/runType.cs	Thu Jan 29 19:10:36 2009
@@ -42,10 +42,13 @@
 	
 	//creates table containing the types of simple Runs
 	//following INT values are booleans
-	protected internal static void createTableRunType()
+	//protected internal static void createTableRunType()
+	//protected internal static void createTable(string tableName)
+	protected override void createTable(string tableName)
 	{
 		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.RunTypeTable + " ( " +
+			//"CREATE TABLE " + Constants.RunTypeTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"name TEXT, " +
 			"distance FLOAT, " + //>0 variable distance, ==0 fixed distance
@@ -54,7 +57,8 @@
 	}
 	
 	//if this changes, runType.cs constructor should change 
-	protected internal static void initializeTableRunType()
+	//protected internal static void initializeTableRunType()
+	protected internal static void initializeTable()
 	{
 		string [] iniRunTypes = {
 			//name:distance:description
@@ -75,118 +79,49 @@
 		};
 		conversionSubRateTotal = iniRunTypes.Length;
 		conversionSubRate = 0;
-		foreach(string myRunType in iniRunTypes) {
-			RunTypeInsert(myRunType, true);
+		foreach(string myString in iniRunTypes) {
+			//RunTypeInsert(myString, true);
 			conversionSubRate ++;
+			string [] s = myString.Split(new char[] {':'});
+			RunType type = new RunType();
+			type.Name = s[0];
+			type.Distance = Convert.ToDouble(s[1]);
+			type.Description = s[2];
+			Insert(type, Constants.RunTypeTable, true);
 		}
 	
 		AddGraphLinksRunSimple();	
 		AddGraphLinksRunSimpleAgility();	
-		AddGraphLinksRunInterval();	
-	}
-	
-	public static void AddGraphLinksRunSimple() {
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "20m", "run_simple.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "100m", "run_simple.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "200m", "run_simple.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "400m", "run_simple.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "1000m", "run_simple.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "2000m", "run_simple.png", true);
-	}
-
-	public static void AddGraphLinksRunSimpleAgility() {
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-20Yard", "agility_20yard.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-505", "agility_505.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Illinois", "agility_illinois.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Shuttle-Run", "agility_shuttle.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-ZigZag", "agility_zigzag.png", true);
-	}
-
-	public static void AddGraphLinksRunInterval() {
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "byLaps", "run_interval.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "byTime", "run_interval.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "unlimited", "run_interval.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "20m10times", "run_interval.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "7m30seconds", "run_interval.png", true);
-		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "20m endurance", "run_interval.png", true);
-	}
-
-
-	//creates table containing the types of Interval Runs 
-	//following INT values are booleans
-	protected internal static void createTableRunIntervalType()
-	{
-		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.RunIntervalTypeTable + " ( " +
-			"uniqueID INTEGER PRIMARY KEY, " +
-			"name TEXT, " +
-			"distance FLOAT, " + //>0 variable distance, ==0 fixed distance
-					//this distance will be the same in all tracks
-			"tracksLimited INT, " +  //1 limited by tracks (intervals); 0 limited by time
-			"fixedValue INT, " +   //0: no fixed value; 3: 3 intervals or seconds 
-			"unlimited INT, " +		
-			"description TEXT )";		
-		dbcmd.ExecuteNonQuery();
 	}
 	
-	//if this changes, runType.cs constructor should change 
-	protected internal static void initializeTableRunIntervalType()
-	{
-		string [] iniRunTypes = {
-			//name:distance:tracksLimited:fixedValue:unlimited:description
-			"byLaps:0:1:0:0:Run n laps x distance",
-			"byTime:0:0:0:0:Make max laps in n seconds",
-			"unlimited:0:0:0:1:Continue running in n distance",	//suppose limited by time
-			"20m10times:20:1:10:0:Run 10 times a 20m distance",	//only in more runs
-			"7m30seconds:7:0:30:0:Make max laps in 30 seconds",	//only in more runs
-			"20m endurance:20:0:0:1:Continue running in 20m distance"	//only in more runs
-		};
-		foreach(string myRunType in iniRunTypes) {
-			RunIntervalTypeInsert(myRunType, true);
-		}
-	}
-
 	/*
 	 * RunType class methods
 	 */
 
-	public static void RunTypeInsert(string myRun, bool dbconOpened)
+	//public static void RunTypeInsert(string myRun, bool dbconOpened)
+	public static int Insert(RunType t, string tableName, bool dbconOpened)
 	{
-		string [] myStr = myRun.Split(new char[] {':'});
+		//string [] myStr = myRun.Split(new char[] {':'});
 		if(! dbconOpened) {
 			dbcon.Open();
 		}
-		dbcmd.CommandText = "INSERT INTO " + Constants.RunTypeTable + 
+		dbcmd.CommandText = "INSERT INTO " + tableName + 
 				" (uniqueID, name, distance, description)" +
-				" VALUES (NULL, '"
-				+ myStr[0] + "', " + myStr[1] + ", '" +	//name, distance
+				" VALUES (NULL, '" +
+				/*
+				myStr[0] + "', " + myStr[1] + ", '" +	//name, distance
 				myStr[2] + "')" ;	//description
+				*/
+				t.Name + "', " + t.Distance + ", '" + t.Description +	"')" ;	
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
+		int myLast = dbcon.LastInsertRowId;
 		if(! dbconOpened) {
 			dbcon.Close();
 		}
+		return myLast;
 	}
 	
-	public static void RunIntervalTypeInsert(string myRun, bool dbconOpened)
-	{
-		string [] myStr = myRun.Split(new char[] {':'});
-		if(! dbconOpened) {
-			dbcon.Open();
-		}
-		dbcmd.CommandText = "INSERT INTO " + Constants.RunIntervalTypeTable + 
-				" (uniqueID, name, distance, tracksLimited, fixedValue, unlimited, description)" +
-				" VALUES (NULL, '"
-				+ myStr[0] + "', " + myStr[1] + ", " +	//name, distance
-				myStr[2] + ", " + myStr[3] + ", " +	//tracksLimited, fixedValue
-				myStr[4] + ", '" + myStr[5] +"')" ;	//unlimited, description
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-		if(! dbconOpened) {
-			dbcon.Close();
-		}
-	}
-
 	public static string[] SelectRunTypes(string allRunsName, bool onlyName) 
 	{
 		//allRunsName: add and "allRunsName" value
@@ -246,6 +181,142 @@
 		return myTypes;
 	}
 
+	public static double Distance (string typeName) 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT distance " +
+			" FROM " + Constants.RunTypeTable +
+			" WHERE name == '" + typeName + "'";
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		double distance = 0;
+		while(reader.Read()) {
+			distance = Convert.ToDouble(reader[0].ToString());
+		}
+		dbcon.Close();
+		return distance;
+	}
+	
+	public static void AddGraphLinksRunSimple() {
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "20m", "run_simple.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "100m", "run_simple.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "200m", "run_simple.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "400m", "run_simple.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "1000m", "run_simple.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "2000m", "run_simple.png", true);
+	}
+
+	public static void AddGraphLinksRunSimpleAgility() {
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-20Yard", "agility_20yard.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-505", "agility_505.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Illinois", "agility_illinois.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-Shuttle-Run", "agility_shuttle.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunTable, "Agility-ZigZag", "agility_zigzag.png", true);
+	}
+
+
+}	
+
+class SqliteRunIntervalType : SqliteRunType
+{
+	public SqliteRunIntervalType() {
+	}
+	
+	~SqliteRunIntervalType() {}
+	
+	//creates table containing the types of Interval Runs 
+	//following INT values are booleans
+	//protected internal static void createTableRunIntervalType()
+	//protected internal static void createTable(string tableName)
+	protected override void createTable(string tableName)
+	{
+		dbcmd.CommandText = 
+			//"CREATE TABLE " + Constants.RunIntervalTypeTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
+			"uniqueID INTEGER PRIMARY KEY, " +
+			"name TEXT, " +
+			"distance FLOAT, " + //>0 variable distance, ==0 fixed distance
+					//this distance will be the same in all tracks.
+					//-1 each track can have a different distance (started at 0.8.1.5, see distancesString)
+			"tracksLimited INT, " +  //1 limited by tracks (intervals); 0 limited by time
+			"fixedValue INT, " +   //0: no fixed value; 3: 3 tracks or seconds 
+			"unlimited INT, " +		
+			"description TEXT, " +	
+			"distancesString TEXT )"; 	//new at 0.8.1.5:
+		       					//when distance is 0 or >0, distancesString it's ""
+							//when distance is -1, distancesString is distance of each track, 
+							//	eg: "7-5-9" for a runInterval with three tracks of 7, 5 and 9 meters each
+							//	this is nice for agility tests
+		dbcmd.ExecuteNonQuery();
+	}
+	
+	//if this changes, runType.cs constructor should change 
+	//protected internal static void initializeTableRunIntervalType()
+	protected internal static new void initializeTable()
+	{
+		string [] iniRunTypes = {
+			//name:distance:tracksLimited:fixedValue:unlimited:description
+			"byLaps:0:1:0:0:Run n laps x distance:",
+			"byTime:0:0:0:0:Make max laps in n seconds:",
+			"unlimited:0:0:0:1:Continue running in n distance:",	//suppose limited by time
+			"20m10times:20:1:10:0:Run 10 times a 20m distance:",	//only in more runs
+			"7m30seconds:7:0:30:0:Make max laps in 30 seconds:",	//only in more runs
+			"20m endurance:20:0:0:1:Continue running in 20m distance:",	//only in more runs
+			"MTGUG:-1:1:3:0:Modified time Getup and Go test:1-7-19"
+		};
+		foreach(string myString in iniRunTypes) {
+			//RunIntervalTypeInsert(myString, true);
+			string [] s = myString.Split(new char[] {':'});
+			RunType type = new RunType();
+			type.Name = s[0];
+			type.Distance = Convert.ToDouble(s[1]);
+			type.TracksLimited = Util.IntToBool(Convert.ToInt32(s[2]));
+			type.FixedValue = Convert.ToInt32(s[3]);
+			type.Unlimited = Util.IntToBool(Convert.ToInt32(s[4]));
+			type.Description = s[5];
+			type.DistancesString = s[6];
+			Insert(type, Constants.RunIntervalTypeTable, true);
+		}
+		
+		AddGraphLinksRunInterval();	
+	}
+
+	//public static void RunIntervalTypeInsert(string myRun, bool dbconOpened)
+	public static new int Insert(RunType t, string tableName, bool dbconOpened)
+	{
+		//done here for not having twho dbconsOpened
+		//double distance = t.Distance;
+
+		//string [] myStr = myRun.Split(new char[] {':'});
+		if(! dbconOpened) {
+			dbcon.Open();
+		}
+		dbcmd.CommandText = "INSERT INTO " + tableName + 
+				" (uniqueID, name, distance, tracksLimited, fixedValue, unlimited, description, distancesString)" +
+				" VALUES (NULL, '" +
+				/*
+				myStr[0] + "', " + myStr[1] + ", " +	//name, distance
+				myStr[2] + ", " + myStr[3] + ", " +	//tracksLimited, fixedValue
+				myStr[4] + ", '" + myStr[5] + ", " +	//unlimited, description
+				myStr[6] + "')" ;			//distancesString
+				*/
+				//t.Name + 	"', " + distance + ", " + t.TracksLimited + 	", " + t.FixedValue + ", " +
+				t.Name + 	"', " + t.Distance + ", " + Util.BoolToInt(t.TracksLimited) + 	", " + t.FixedValue + ", " +
+				Util.BoolToInt(t.Unlimited) + 	", '" + t.Description +	"', '" + t.DistancesString + 	"')" ;	
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		int myLast = dbcon.LastInsertRowId;
+		if(! dbconOpened) {
+			dbcon.Close();
+		}
+		return myLast;
+	}
+
 	public static string[] SelectRunIntervalTypes(string allRunsName, bool onlyName) 
 	{
 		dbcon.Open();
@@ -273,7 +344,8 @@
 						reader[3].ToString() + ":" + 	//tracksLimited
 						reader[4].ToString() + ":" + 	//fixedValue
 						reader[5].ToString() + ":" + 	//unlimited
-						reader[6].ToString() 		//description
+						reader[6].ToString() + ":" +	//description
+						reader[7].ToString() 		//distancesString
 					    );
 			}
 			count ++;
@@ -318,17 +390,13 @@
 		
 		while(reader.Read()) {
 			myRunType.Name = reader[1].ToString();
-			
-			myRunType.Distance = Convert.ToInt32( reader[2].ToString() );
-			
+			myRunType.Distance = Convert.ToDouble( reader[2].ToString() );
 			myRunType.HasIntervals = true;
-			
-			if(reader[3].ToString() == "1") { myRunType.TracksLimited = true; }
-			else { myRunType.TracksLimited = false; }
-			
+			myRunType.TracksLimited = Util.IntToBool(Convert.ToInt32(reader[3].ToString()));
 			myRunType.FixedValue = Convert.ToInt32( reader[4].ToString() );
-			if(reader[5].ToString() == "1") { myRunType.Unlimited = true; }
-			else { myRunType.Unlimited = false; }
+			myRunType.Unlimited = Util.IntToBool(Convert.ToInt32(reader[5].ToString()));
+			myRunType.Description = reader[6].ToString();
+			myRunType.DistancesString = reader[7].ToString();
 		}
 
 		reader.Close();
@@ -337,25 +405,14 @@
 		return myRunType;
 	}
 
-	public static double Distance (string typeName) 
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT distance " +
-			" FROM " + Constants.RunTypeTable +
-			" WHERE name == '" + typeName + "'";
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-
-		double distance = 0;
-		while(reader.Read()) {
-			distance = Convert.ToDouble(reader[0].ToString());
-		}
-		dbcon.Close();
-		return distance;
+	public static void AddGraphLinksRunInterval() {
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "byLaps", "run_interval.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "byTime", "run_interval.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "unlimited", "run_interval.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "20m10times", "run_interval.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "7m30seconds", "run_interval.png", true);
+		SqliteEvent.GraphLinkInsert (Constants.RunIntervalTable, "20m endurance", "run_interval.png", true);
 	}
 
-}	
+
+}

Modified: trunk/src/util.cs
==============================================================================
--- trunk/src/util.cs	(original)
+++ trunk/src/util.cs	Thu Jan 29 19:10:36 2009
@@ -326,7 +326,6 @@
 	public static double GetTotalTime (string timeString)
 	{
 		try{
-
 			if(timeString.Length > 0) {
 				string [] time= timeString.Split(new char[] {'='});
 
@@ -520,7 +519,7 @@
 	//ATTENTTION ONLY WORKS FOR POSITIVES
 	//before changing this method, better create another method for all numbers, 
 	//and call that method on possible negative numbers
-	public static bool IsNumber(string myString) {
+	public static bool IsNumber(string myString, bool canBeDecimal) {
 		System.Globalization.NumberFormatInfo localeInfo = new System.Globalization.NumberFormatInfo();
 		localeInfo = System.Globalization.NumberFormatInfo.CurrentInfo;
 		
@@ -533,6 +532,7 @@
 				countDecimals ++;
 			}
 		}
+		if(countDecimals > 0 && !canBeDecimal) { return false; }
 		if(countDecimals > 1) { return false; }
 
 		//false if it's blank, or it's only a decimal "."



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