chronojump r391 - in trunk: . build/data glade sqlite_diagrams src src/execute src/gui src/sqlite



Author: xaviblas
Date: Thu Jun  5 13:11:19 2008
New Revision: 391
URL: http://svn.gnome.org/viewvc/chronojump?rev=391&view=rev

Log:
0.7.3
at splash screen it's shown conversion rate on update DB
new db: 0.57: 
-jump and jumpRj have angle
-events have simulated column. Also jumpRj and runInterval temp tables.
-simulated shown on treeviews and edit events
Upgraded Gtk.FileSelection (deprecated) to Gtk.FileChooserDialog (hope
this improves windows usability)
Code cleaning, improving:
-new code event.InsertAtDB
-start using sqlite classes as non static (done for createTable at all events)
-created SqliteJumpRj, SqliteRunInterval
-created method SliteMain.convertTable
removed crash test on menu
Added "Help" text to help button at preferences/chronopic



Added:
   trunk/src/sqlite/jumpRj.cs
   trunk/src/sqlite/runInterval.cs
Modified:
   trunk/Makefile
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/version.txt
   trunk/changelog.txt
   trunk/glade/chronojump.glade
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/sqlite_diagrams/chronojump_sqlite.png
   trunk/src/chronojump.cs
   trunk/src/constants.cs
   trunk/src/event.cs
   trunk/src/execute/jump.cs
   trunk/src/execute/pulse.cs
   trunk/src/execute/reactionTime.cs
   trunk/src/execute/run.cs
   trunk/src/exportSession.cs
   trunk/src/gui/chronojump.cs
   trunk/src/gui/event.cs
   trunk/src/gui/jump.cs
   trunk/src/gui/person.cs
   trunk/src/gui/pulse.cs
   trunk/src/gui/run.cs
   trunk/src/jump.cs
   trunk/src/log.cs
   trunk/src/pulse.cs
   trunk/src/reactionTime.cs
   trunk/src/report.cs
   trunk/src/run.cs
   trunk/src/sqlite/jump.cs
   trunk/src/sqlite/main.cs
   trunk/src/sqlite/person.cs
   trunk/src/sqlite/pulse.cs
   trunk/src/sqlite/reactionTime.cs
   trunk/src/sqlite/run.cs
   trunk/src/sqlite/session.cs
   trunk/src/treeViewJump.cs
   trunk/src/treeViewPulse.cs
   trunk/src/treeViewReactionTime.cs
   trunk/src/treeViewRun.cs
   trunk/version.txt

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Thu Jun  5 13:11:19 2008
@@ -39,7 +39,7 @@
 
 CHRONOJUMP_DEP_GRAPHS = src/stats/graphs/graphData.cs src/stats/graphs/graphSerie.cs src/stats/graphs/global.cs src/stats/graphs/sjCmjAbk.cs src/stats/graphs/sjCmjAbkPlus.cs src/stats/graphs/djIndex.cs src/stats/graphs/djQ.cs src/stats/graphs/rjIndex.cs src/stats/graphs/rjPotencyBosco.cs src/stats/graphs/rjEvolution.cs src/stats/graphs/ieIub.cs src/stats/graphs/fv.cs src/stats/graphs/potency.cs src/stats/graphs/rjAVGSD.cs
 
-CHRONOJUMP_DEP_SQLITE = src/sqlite/main.cs src/sqlite/preferences.cs src/sqlite/person.cs src/sqlite/session.cs src/sqlite/jump.cs src/sqlite/jumpType.cs src/sqlite/run.cs src/sqlite/runType.cs src/sqlite/personSession.cs src/sqlite/stat.cs src/sqlite/pulse.cs src/sqlite/pulseType.cs src/sqlite/reactionTime.cs src/sqlite/event.cs src/sqlite/sport.cs src/sqlite/speciallity.cs
+CHRONOJUMP_DEP_SQLITE = src/sqlite/main.cs src/sqlite/preferences.cs src/sqlite/person.cs src/sqlite/session.cs src/sqlite/jump.cs src/sqlite/jumpRj.cs src/sqlite/jumpType.cs src/sqlite/run.cs src/sqlite/runInterval.cs src/sqlite/runType.cs src/sqlite/personSession.cs src/sqlite/stat.cs src/sqlite/pulse.cs src/sqlite/pulseType.cs src/sqlite/reactionTime.cs src/sqlite/event.cs src/sqlite/sport.cs src/sqlite/speciallity.cs
 
 CHRONOJUMP_DEP_EXECUTE = src/execute/event.cs src/execute/jump.cs src/execute/run.cs src/execute/pulse.cs src/execute/reactionTime.cs
 

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

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

Modified: trunk/build/data/version.txt
==============================================================================
--- trunk/build/data/version.txt	(original)
+++ trunk/build/data/version.txt	Thu Jun  5 13:11:19 2008
@@ -1 +1 @@
-0.7.2
+0.7.3

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Thu Jun  5 13:11:19 2008
@@ -1,5 +1,23 @@
 CHRONOJUMP DETAILED CHANGELOG:
 
+5 Jun 2008
+	0.7.3
+	at splash screen it's shown conversion rate on update DB
+	new db: 0.57: 
+	-jump and jumpRj have angle
+	-events have simulated column. Also jumpRj and runInterval temp tables.
+	-simulated shown on treeviews and edit events
+	Upgraded Gtk.FileSelection (deprecated) to Gtk.FileChooserDialog (hope
+	this improves windows usability)
+	Code cleaning, improving:
+	-new code event.InsertAtDB
+	-start using sqlite classes as non static (done for createTable at all events)
+	-created SqliteJumpRj, SqliteRunInterval
+	-created method SliteMain.convertTable
+
+	removed crash test on menu
+	Added "Help" text to help button at preferences/chronopic
+
 3 Jun 2008
 	0.7.2 
 	splash window that tells start progress

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Thu Jun  5 13:11:19 2008
@@ -2155,14 +2155,66 @@
 	      <signal name="clicked" handler="on_button_help_clicked" last_modification_time="Sun, 07 May 2006 13:15:48 GMT"/>
 
 	      <child>
-		<widget class="GtkImage" id="image1628">
+		<widget class="GtkAlignment" id="alignment109">
 		  <property name="visible">True</property>
-		  <property name="stock">gtk-help</property>
-		  <property name="icon_size">4</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="xscale">0</property>
+		  <property name="yscale">0</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="GtkHBox" id="hbox267">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">2</property>
+
+		      <child>
+			<widget class="GtkImage" id="image3128">
+			  <property name="visible">True</property>
+			  <property name="stock">gtk-help</property>
+			  <property name="icon_size">4</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">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="label506">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Help</property>
+			  <property name="use_underline">True</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>
+		  </child>
 		</widget>
 	      </child>
 	    </widget>
@@ -7801,7 +7853,7 @@
 		      <signal name="activate" handler="on_new_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3024">
+			<widget class="GtkImage" id="image3093">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -7822,7 +7874,7 @@
 		      <signal name="activate" handler="on_open_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3025">
+			<widget class="GtkImage" id="image3094">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -7843,7 +7895,7 @@
 		      <signal name="activate" handler="on_edit_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3026">
+			<widget class="GtkImage" id="image3095">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -7865,7 +7917,7 @@
 		      <signal name="activate" handler="on_delete_session_activate" last_modification_time="Thu, 28 Jul 2005 13:37:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3027">
+			<widget class="GtkImage" id="image3096">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -7893,7 +7945,7 @@
 		      <signal name="activate" handler="on_export_session_activate" last_modification_time="Sat, 12 Feb 2005 21:57:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3028">
+			<widget class="GtkImage" id="image3097">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-convert</property>
 			  <property name="icon_size">1</property>
@@ -7929,7 +7981,7 @@
 		      <signal name="activate" handler="on_preferences_activate" last_modification_time="Mon, 04 Oct 2004 19:19:19 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3029">
+			<widget class="GtkImage" id="image3098">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -7956,7 +8008,7 @@
 		      <signal name="activate" handler="on_quit1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3030">
+			<widget class="GtkImage" id="image3099">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-quit</property>
 			  <property name="icon_size">1</property>
@@ -7990,7 +8042,7 @@
 		      <signal name="activate" handler="on_person_add_single_activate" last_modification_time="Thu, 18 Aug 2005 23:07:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3031">
+			<widget class="GtkImage" id="image3100">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8011,7 +8063,7 @@
 		      <signal name="activate" handler="on_person_add_multiple_activate" last_modification_time="Thu, 18 Aug 2005 23:01:23 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3032">
+			<widget class="GtkImage" id="image3101">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8038,7 +8090,7 @@
 		      <signal name="activate" handler="on_recuperate_person_activate" last_modification_time="Sun, 12 Dec 2004 00:40:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3033">
+			<widget class="GtkImage" id="image3102">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8059,7 +8111,7 @@
 		      <signal name="activate" handler="on_recuperate_persons_from_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3034">
+			<widget class="GtkImage" id="image3103">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8086,7 +8138,7 @@
 		      <signal name="activate" handler="on_edit_current_person_clicked" last_modification_time="Sun, 17 Oct 2004 11:43:33 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3035">
+			<widget class="GtkImage" id="image3104">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8107,7 +8159,7 @@
 		      <signal name="activate" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 09:51:24 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3036">
+			<widget class="GtkImage" id="image3105">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -8134,7 +8186,7 @@
 		      <signal name="activate" handler="on_delete_current_person_from_session_activate" last_modification_time="Thu, 28 Jul 2005 15:49:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3037">
+			<widget class="GtkImage" id="image3106">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8246,7 +8298,7 @@
 			      <signal name="activate" handler="on_button_more_clicked" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3038">
+				<widget class="GtkImage" id="image3107">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8271,7 +8323,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_clicked" last_modification_time="Sun, 17 Oct 2004 11:47:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3039">
+			<widget class="GtkImage" id="image3108">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8292,7 +8344,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_clicked" last_modification_time="Tue, 19 Oct 2004 11:54:17 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3040">
+			<widget class="GtkImage" id="image3109">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8358,7 +8410,7 @@
 			      <signal name="activate" handler="on_button_more_rj_clicked" last_modification_time="Fri, 11 Mar 2005 14:45:23 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3041">
+				<widget class="GtkImage" id="image3110">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8383,7 +8435,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3042">
+			<widget class="GtkImage" id="image3111">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8404,7 +8456,7 @@
 		      <signal name="activate" handler="on_repair_selected_reactive_jump_clicked" last_modification_time="Wed, 07 Dec 2005 01:14:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3043">
+			<widget class="GtkImage" id="image3112">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8425,7 +8477,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3044">
+			<widget class="GtkImage" id="image3113">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8452,7 +8504,7 @@
 		      <signal name="activate" handler="on_jump_type_add_activate" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3045">
+			<widget class="GtkImage" id="image3114">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8597,7 +8649,7 @@
 			      <signal name="activate" handler="on_button_run_more_clicked" last_modification_time="Fri, 22 Apr 2005 14:37:06 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3046">
+				<widget class="GtkImage" id="image3115">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8622,7 +8674,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3047">
+			<widget class="GtkImage" id="image3116">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8643,7 +8695,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3048">
+			<widget class="GtkImage" id="image3117">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8709,7 +8761,7 @@
 			      <signal name="activate" handler="on_button_run_interval_more_clicked" last_modification_time="Tue, 16 Aug 2005 01:18:41 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3049">
+				<widget class="GtkImage" id="image3118">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8734,7 +8786,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3050">
+			<widget class="GtkImage" id="image3119">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8755,7 +8807,7 @@
 		      <signal name="activate" handler="on_repair_selected_run_interval_clicked" last_modification_time="Wed, 03 May 2006 15:15:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3051">
+			<widget class="GtkImage" id="image3120">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8776,7 +8828,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3052">
+			<widget class="GtkImage" id="image3121">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8803,7 +8855,7 @@
 		      <signal name="activate" handler="on_run_type_add_activate" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3053">
+			<widget class="GtkImage" id="image3122">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8869,7 +8921,7 @@
 		      <signal name="activate" handler="on_button_pulse_more_clicked" last_modification_time="Sat, 28 Oct 2006 08:57:53 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3054">
+			<widget class="GtkImage" id="image3123">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-add</property>
 			  <property name="icon_size">1</property>
@@ -8903,7 +8955,7 @@
 		      <signal name="activate" handler="on_menuitem_view_stats_activate" last_modification_time="Tue, 26 Jul 2005 23:54:29 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3055">
+			<widget class="GtkImage" id="image3124">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -8924,7 +8976,7 @@
 		      <signal name="activate" handler="on_show_report_activate" last_modification_time="Tue, 06 Sep 2005 09:10:32 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3056">
+			<widget class="GtkImage" id="image3125">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -8955,7 +9007,7 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">Simulated</property>
 		      <property name="use_underline">True</property>
-		      <property name="active">False</property>
+		      <property name="active">True</property>
 		      <signal name="toggled" handler="on_radiobutton_simulated" last_modification_time="Tue, 09 May 2006 19:55:19 GMT"/>
 		    </widget>
 		  </child>
@@ -8992,7 +9044,7 @@
 		      <signal name="activate" handler="on_menuitem_manual_activate" last_modification_time="Wed, 03 Oct 2007 23:31:41 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3057">
+			<widget class="GtkImage" id="image3126">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -9015,28 +9067,6 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkImageMenuItem" id="menuitem_debug_crash">
-		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">click to make chronojump crash. Done for testing purposes</property>
-		      <property name="label" translatable="yes">_Debug: crash</property>
-		      <property name="use_underline">True</property>
-		      <signal name="activate" handler="on_menuitem_debug_crash_activate" last_modification_time="Sat, 10 May 2008 00:12:46 GMT"/>
-
-		      <child internal-child="image">
-			<widget class="GtkImage" id="image3058">
-			  <property name="visible">True</property>
-			  <property name="stock">gtk-dialog-error</property>
-			  <property name="icon_size">1</property>
-			  <property name="xalign">0.5</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
-
-		  <child>
 		    <widget class="GtkSeparatorMenuItem" id="separator2">
 		      <property name="visible">True</property>
 		    </widget>
@@ -9050,7 +9080,7 @@
 		      <signal name="activate" handler="on_about1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3059">
+			<widget class="GtkImage" id="image3127">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-about</property>
 			  <property name="icon_size">1</property>

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

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

Modified: trunk/src/chronojump.cs
==============================================================================
--- trunk/src/chronojump.cs	(original)
+++ trunk/src/chronojump.cs	Thu Jun  5 13:11:19 2008
@@ -46,6 +46,7 @@
 	bool needEndSplashWin = false;
 	bool needUpdateSplashMessage = false;
 	string splashMessage = "";
+	bool updatingDB = false;
 
 
 	public static void Main(string [] args) 
@@ -143,8 +144,11 @@
 			}
 
 			splashMessageChange(4);  //updating DB
+			updatingDB = true;
 
 			bool softwareIsNew = Sqlite.ConvertToLastChronojumpDBVersion();
+			updatingDB = false;
+
 			if(! softwareIsNew) {
 				//Console.Clear();
 				string errorMessage = string.Format(Catalog.GetString ("Sorry, this Chronojump version ({0}) is too old for your database."), readVersion()) + "\n" +  
@@ -236,7 +240,9 @@
 		splashWin.Pulse();
 		//Log.WriteLine("splash");
 
-		if(needUpdateSplashMessage) {
+		if(updatingDB) 
+			splashWin.UpdateLabel(splashMessage + " " + Sqlite.PrintConversionRate());
+		else if(needUpdateSplashMessage) {
 			splashWin.UpdateLabel(splashMessage);
 			needUpdateSplashMessage = false;
 		}
@@ -289,14 +295,8 @@
 		int existsTempData = Sqlite.TempDataExists(tableName);
 		if(existsTempData > 0)
 		{
-			JumpRj myJump = SqliteJump.SelectRjJumpData("tempJumpRj", existsTempData);
-			SqliteJump.InsertRj("jumpRj", "NULL", myJump.PersonID, myJump.SessionID,
-					myJump.Type, myJump.TvMax, myJump.TcMax, 
-					myJump.Fall, myJump.Weight, "", //fall, weight, description
-					myJump.TvAvg, myJump.TcAvg,
-					myJump.TvString, myJump.TcString,
-					myJump.Jumps, Util.GetTotalTime(myJump.TcString, myJump.TvString), myJump.Limited
-					);
+			JumpRj myJumpRj = SqliteJumpRj.SelectJumpData("tempJumpRj", existsTempData);
+			myJumpRj.InsertAtDB (false, Constants.JumpRjTable);
 
 			Sqlite.DeleteTempEvents(tableName);
 			returnString = "Recuperated last Reactive Jump";
@@ -306,13 +306,8 @@
 		existsTempData = Sqlite.TempDataExists(tableName);
 		if(existsTempData > 0)
 		{
-			RunInterval myRun = SqliteRun.SelectIntervalRunData("tempRunInterval", existsTempData);
-			SqliteRun.InsertInterval("runInterval", "NULL", myRun.PersonID, myRun.SessionID,
-					myRun.Type, myRun.DistanceTotal, myRun.TimeTotal, 
-					myRun.DistanceInterval, myRun.IntervalTimesString,  
-					myRun.Tracks, "", //description
-					myRun.Limited
-					);
+			RunInterval myRun = SqliteRunInterval.SelectRunData("tempRunInterval", existsTempData);
+			myRun.InsertAtDB (false, Constants.RunIntervalTable);
 
 			Sqlite.DeleteTempEvents(tableName);
 			returnString = "Recuperated last Intervallic Run";

Modified: trunk/src/constants.cs
==============================================================================
--- trunk/src/constants.cs	(original)
+++ trunk/src/constants.cs	Thu Jun  5 13:11:19 2008
@@ -37,14 +37,13 @@
 	//instead of typing the tableName directly (that can crash if it's bad written and it's not detected by compiler)
 	//use the following consts, and if it's misspelled, compiler will know
 	public const string PersonTable = "person";
-	public const string TempPersonTable = "tempPerson";
 	public const string SessionTable = "session";
-	public const string TempSessionTable = "tempSession";
 	public const string PersonSessionTable = "personSession";
 	public const string PersonSessionWeightTable = "personSessionWeight";
 	public const string SportTable = "sport";
 	public const string SpeciallityTable = "speciallity";
 	public const string PreferencesTable = "preferences";
+	public const string ConvertTempTable = "convertTemp"; //for conversions
 	//tests
 	public const string JumpTable = "jump";
 	public const string JumpRjTable = "jumpRj";
@@ -54,6 +53,7 @@
 	public const string TempRunIntervalTable = "tempRunInterval";
 	public const string PulseTable = "pulse";
 	public const string ReactionTimeTable = "reactionTime";
+
 	//tests types
 	public const string JumpTypeTable = "jumpType";
 	public const string JumpRjTypeTable = "jumpRjType";

Modified: trunk/src/event.cs
==============================================================================
--- trunk/src/event.cs	(original)
+++ trunk/src/event.cs	Thu Jun  5 13:11:19 2008
@@ -32,11 +32,18 @@
 	protected int uniqueID;
 	protected string type;
 	protected string description;
+	protected int simulated;
 
 	public Event() {
 		//simulated = false;
 	}
-	
+
+	//used to select an event at Sqlite.addSimulatedInEventTables
+	public Event(string [] eventString) {
+	}
+
+	public virtual void InsertAtDB (bool dbconOpened, string tableName) {
+	}	
 
 	public string Type
 	{
@@ -72,6 +79,12 @@
 		get { return SqlitePerson.SelectJumperName(personID); }
 	}
 	
+	public int Simulated {
+		get { return simulated; }
+		set { simulated = value; }
+	}
+	
+	
 	~Event() {}
 	   
 }

Modified: trunk/src/execute/jump.cs
==============================================================================
--- trunk/src/execute/jump.cs	(original)
+++ trunk/src/execute/jump.cs	Thu Jun  5 13:11:19 2008
@@ -42,6 +42,8 @@
 	private Chronopic cp;
 
 	private Jump jumpDone;
+
+	private int angle = -1;
 	
 	public JumpExecute() {
 	}
@@ -368,12 +370,14 @@
 		}
 		appbar.Push( 1,myStringPush );
 
-		uniqueID = SqliteJump.Insert(personID, sessionID, 
+		uniqueID = SqliteJump.Insert(false, Constants.JumpTable, "NULL", personID, sessionID, 
 				type, tv, tc, fall,  //type, tv, tc, fall
-				weight, "", ""); //weight, limited, description
+				//weight, "", "", Util.BoolToInt(simulated)); //weight, limited, description
+				weight, "", angle, Util.BoolToInt(simulated)); //weight, description, simulated
 
 		//define the created object
-		eventDone = new Jump(uniqueID, personID, sessionID, type, tv, tc, fall, weight, ""); 
+		eventDone = new Jump(uniqueID, personID, sessionID, type, tv, tc, fall, 
+				weight, "", angle, Util.BoolToInt(simulated)); 
 		
 		//event will be raised, and managed in chronojump.cs
 		fakeButtonFinished.Click();
@@ -436,6 +440,7 @@
 	//this will be a flag for finishing if allowFinishAfterTime is true
 	private bool shouldFinishAtNextFall = true;
 
+	private string angleString = "-1";
 	
 	public JumpRjExecute() {
 	}
@@ -903,24 +908,24 @@
 		}
 
 		if(tempTable) 
-			SqliteJump.InsertRj("tempJumpRj", "NULL", personID, sessionID, 
+			SqliteJumpRj.Insert(false, Constants.TempJumpRjTable, "NULL", personID, sessionID, 
 					type, Util.GetMax(tvString), Util.GetMax(tcString), 
 					fall, weight, description,
 					Util.GetAverage(tvString), Util.GetAverage(tcString),
 					tvString, tcString,
-					jumps, Util.GetTotalTime(tcString, tvString), limitString
+					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)
 					);
 		else {
-			uniqueID = SqliteJump.InsertRj("jumpRj", "NULL", personID, sessionID, 
+			uniqueID = SqliteJumpRj.Insert(false, Constants.JumpRjTable, "NULL", personID, sessionID, 
 					type, Util.GetMax(tvString), Util.GetMax(tcString), 
 					fall, weight, description,
 					Util.GetAverage(tvString), Util.GetAverage(tcString),
 					tvString, tcString,
-					jumps, Util.GetTotalTime(tcString, tvString), limitString
+					jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)
 					);
 
 			//define the created object
-			eventDone = new JumpRj(uniqueID, personID, sessionID, type, tvString, tcString, fall, weight, description, jumps, Util.GetTotalTime(tcString, tvString), limitString); 
+			eventDone = new JumpRj(uniqueID, personID, sessionID, type, tvString, tcString, fall, weight, description, jumps, Util.GetTotalTime(tcString, tvString), limitString, angleString, Util.BoolToInt(simulated)); 
 
 
 			//event will be raised, and managed in chronojump.cs

Modified: trunk/src/execute/pulse.cs
==============================================================================
--- trunk/src/execute/pulse.cs	(original)
+++ trunk/src/execute/pulse.cs	Thu Jun  5 13:11:19 2008
@@ -322,13 +322,13 @@
 
 		totalPulsesNum = Util.GetNumberOfJumps(timesString, false);
 
-		uniqueID = SqlitePulse.Insert("NULL", personID, sessionID, type, 
+		uniqueID = SqlitePulse.Insert(false, Constants.PulseTable, "NULL", personID, sessionID, type, 
 				fixedPulse, totalPulsesNum, timesString, 
-				"" 					//description
+				"", Util.BoolToInt(simulated) //description
 				);
 
 		//define the created object
-		eventDone = new Pulse(uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timesString, ""); 
+		eventDone = new Pulse(uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timesString, "", Util.BoolToInt(simulated)); 
 		
 		string myStringPush =   Catalog.GetString("Last pulse") + ": " + personName + " " + type ;
 		appbar.Push( 1, myStringPush );

Modified: trunk/src/execute/reactionTime.cs
==============================================================================
--- trunk/src/execute/reactionTime.cs	(original)
+++ trunk/src/execute/reactionTime.cs	Thu Jun  5 13:11:19 2008
@@ -236,10 +236,13 @@
 		
 		appbar.Push( 1,myStringPush );
 
-		uniqueID = SqliteReactionTime.Insert(personID, sessionID, "", time, ""); //type, time, description
+		uniqueID = SqliteReactionTime.Insert(
+				false, Constants.ReactionTimeTable, 
+				"NULL", personID, sessionID, "", //type
+				time, "", Util.BoolToInt(simulated)); //time, description, simulated
 
 		//define the created object
-		eventDone = new ReactionTime(uniqueID, personID, sessionID, time, ""); 
+		eventDone = new ReactionTime(uniqueID, personID, sessionID, time, "", Util.BoolToInt(simulated)); 
 		
 		//event will be raised, and managed in chronojump.cs
 		fakeButtonFinished.Click();

Modified: trunk/src/execute/run.cs
==============================================================================
--- trunk/src/execute/run.cs	(original)
+++ trunk/src/execute/run.cs	Thu Jun  5 13:11:19 2008
@@ -291,11 +291,12 @@
 			" " + Catalog.GetString("speed") + ": " + Util.TrimDecimals ( (distance/time).ToString(), pDN );
 		appbar.Push( 1,myStringPush );
 
-		uniqueID = SqliteRun.Insert(personID, sessionID, 
-				type, distance, time, ""); //type, distance, time, description
+		uniqueID = SqliteRun.Insert(false, Constants.RunTable, "NULL", personID, sessionID, 
+				type, distance, time, "", //description
+				Util.BoolToInt(simulated)); 
 		
 		//define the created object
-		eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, ""); 
+		eventDone = new Run(uniqueID, personID, sessionID, type, distance, time, "", Util.BoolToInt(simulated)); 
 		
 		
 		//event will be raised, and managed in chronojump.cs
@@ -721,24 +722,26 @@
 	
 		if(tempTable)
 			{
-			SqliteRun.InsertInterval("tempRunInterval", "NULL", personID, sessionID, type, 
+			SqliteRunInterval.Insert(false, Constants.TempRunIntervalTable, "NULL", personID, sessionID, type, 
 					distanceTotal, timeTotal,
 					distanceInterval, intervalTimesString, tracks, 
 					"", 					//description
-					limitString
+					limitString,
+					Util.BoolToInt(simulated) 
 					);
 			}
 
 		else {
-			uniqueID = SqliteRun.InsertInterval("runInterval", "NULL", personID, sessionID, type, 
+			uniqueID = SqliteRunInterval.Insert(false, Constants.RunIntervalTable, "NULL", personID, sessionID, type, 
 					distanceTotal, timeTotal,
 					distanceInterval, intervalTimesString, tracks, 
 					"", 					//description
-					limitString
+					limitString,
+					Util.BoolToInt(simulated) 
 					);
 
 			//define the created object
-			eventDone = new RunInterval(uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, "", limitString); 
+			eventDone = new RunInterval(uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, "", limitString, Util.BoolToInt(simulated)); 
 
 
 			string tempValuesString = "";

Modified: trunk/src/exportSession.cs
==============================================================================
--- trunk/src/exportSession.cs	(original)
+++ trunk/src/exportSession.cs	Thu Jun  5 13:11:19 2008
@@ -39,7 +39,6 @@
 	protected Session mySession;
 	protected TextWriter writer;
 	protected static Gtk.Window app1;
-	//protected static Gnome.AppBar myAppbar;
 	protected static Gtk.Statusbar myAppbar;
 	protected string fileName;
 	
@@ -69,66 +68,60 @@
 			exportString = Catalog.GetString ("Export session in format " + formatFile);
 		}
 
-			
-		FileSelection fs = new FileSelection (exportString);
-		fs.SelectMultiple = false;
+		
+		Gtk.FileChooserDialog fc=
+			new Gtk.FileChooserDialog(exportString,
+					app1,
+					FileChooserAction.Save,
+					Catalog.GetString("Cancel"),ResponseType.Cancel,
+					Catalog.GetString("Export"),ResponseType.Accept
+					);
 
-		//from: http://www.gnomebangalore.org/?q=node/view/467
-		if ( (Gtk.ResponseType) fs.Run () != Gtk.ResponseType.Ok) {
+		if (fc.Run() == (int)ResponseType.Accept) 
+		{
+			fileName = fc.Filename;
+			if(formatFile == "report") {
+				//add ".html" if needed, remember that on windows should be .htm
+				fileName = addHtmlIfNeeded(fileName);
+			} else {
+				//add ".csv" if needed
+				fileName = addCsvIfNeeded(fileName);
+			}
+			try {
+				if (File.Exists(fileName)) {
+					Log.WriteLine(string.Format("File {0} exists with attributes {1}, created at {2}", 
+								fileName, File.GetAttributes(fileName), File.GetCreationTime(fileName)));
+					Log.WriteLine("Overwrite...");
+					ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Are you sure you want to overwrite file: "), fileName);
+					confirmWin.Button_accept.Clicked += new EventHandler(on_overwrite_file_accepted);
+				} else {
+					writer = File.CreateText(fileName);
+					getData();
+					printData();
+					closeWriter();
+
+					string myString = string.Format(Catalog.GetString("Saved to {0}"), fileName);
+					new DialogMessage(myString, false); //false: is info
+				}
+			} 
+			catch {
+				string myString = string.Format(Catalog.GetString("Cannot export to file {0} "), fileName);
+				new DialogMessage(myString, true); //true: is warning
+			}
+		}
+		else {
 			Log.WriteLine("cancelled");
 			//report does not currently send the appBar reference
 			if(formatFile != "report") {
 				myAppbar.Push ( 1, Catalog.GetString ("Cancelled") );
 			}
-			fs.Hide ();
+			fc.Hide ();
 			return ;
 		}
-
-
-		fileName = fs.Filename;
-		fs.Hide ();
-
-		//TODO: improve this, because in /home/user/Desktop (with no filename)
-		//it uses /home/user/Desktop as fileame (and later adds csv or html
-		//if we use (Util.GetLastPartOfPath(fileName)
-		//it uses Desktop
-		if(fileName.Length == 0) {
-			new DialogMessage(Catalog.GetString("Please write export filename"), true); //true is warning
-			checkFile(formatFile);
-		}
-
-		if(formatFile == "report") {
-			//add ".html" if needed, remember that on windows should be .htm
-			fileName = addHtmlIfNeeded(fileName);
-		} else {
-			//add ".csv" if needed
-			fileName = addCsvIfNeeded(fileName);
-		}
-		//fileName = addDefaultNameIfNeeded(fileName);
-
-		//TODO: ensure fileName is valid
-
-		try {
-			if (File.Exists(fileName)) {
-				Log.WriteLine(string.Format("File {0} exists with attributes {1}, created at {2}", 
-						fileName, File.GetAttributes(fileName), File.GetCreationTime(fileName)));
-				Log.WriteLine("Overwrite...");
-				ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Are you sure you want to overwrite file: "), fileName);
-				confirmWin.Button_accept.Clicked += new EventHandler(on_overwrite_file_accepted);
-			} else {
-				writer = File.CreateText(fileName);
-				getData();
-				printData();
-				closeWriter();
-			
-				string myString = string.Format(Catalog.GetString("Saved to {0}"), fileName);
-				new DialogMessage(myString, false); //false: is info
-			}
-		} 
-		catch {
-			string myString = string.Format(Catalog.GetString("Cannot export to file {0} "), fileName);
-			new DialogMessage(myString, true); //true: is warning
-		}
+		
+		//Don't forget to call Destroy() or the FileChooserDialog window won't get closed.
+		fc.Destroy();
+		
 		return;
 	}
 
@@ -163,35 +156,14 @@
 		
 		return myFile;
 	}
-/*	
-	private string addDefaultNameIfNeeded(string originalURL)
-	{
-	*/
-		/*
-		 * /home/user/Desktop/test.cs  will return test.cs and posOfDot will be 4
-		 * /home/user/Desktop/.cs  will return .cs and posOfDot will be 0
-		 */
-	/*
-		string myLast = Util.GetLastPartOfPath(originalURL);
-		string returnURL = originalURL;
-		int posOfDot = myLast.LastIndexOf('.');
-		if (posOfDot == 0) 
-			returnURL = originalURL.Substring(0, originalURL.Length - myLast.Length) 
-				+ Catalog.GetString("export") + myLast;
-
-		Log.WriteLine(originalURL);
-		Log.WriteLine(returnURL);
-
-		return returnURL;
-	}
-	*/
+	
 	protected virtual void getData() 
 	{
 		myPersons = SqlitePersonSession.SelectCurrentSession(mySession.UniqueID, false, false); //not onlyIDAndName, not reversed
-		myJumps= SqliteJump.SelectNormalJumps(mySession.UniqueID, -1, "");
-		myJumpsRj = SqliteJump.SelectRjJumps(mySession.UniqueID, -1, "");
-		myRuns= SqliteRun.SelectAllNormalRuns(mySession.UniqueID);
-		myRunsInterval = SqliteRun.SelectAllIntervalRuns(mySession.UniqueID);
+		myJumps= SqliteJump.SelectJumps(mySession.UniqueID, -1, "");
+		myJumpsRj = SqliteJumpRj.SelectJumps(mySession.UniqueID, -1, "");
+		myRuns= SqliteRun.SelectAllRuns(mySession.UniqueID);
+		myRunsInterval = SqliteRunInterval.SelectAllRuns(mySession.UniqueID);
 		myReactionTimes = SqliteReactionTime.SelectAllReactionTimes(mySession.UniqueID);
 		myPulses = SqlitePulse.SelectAllPulses(mySession.UniqueID);
 	}
@@ -301,7 +273,10 @@
 					weightName + ":" + 
 					Catalog.GetString("Height") + ":" +
 					Catalog.GetString("Initial Speed") + ":" +
-					Catalog.GetString("Description") );
+					Catalog.GetString("Description") + ":" +
+					//Catalog.GetString("Angle") + ":" +
+					Catalog.GetString("Simulated") 
+				  );
 
 			foreach (string jumpString in myJumps) {
 				string [] myStr = jumpString.Split(new char[] {':'});
@@ -319,14 +294,14 @@
 
 				myData.Add (	
 						myStr[0] + ":" +  myStr[1] + ":" +  	//person.name, jump.uniqueID
-						//myStr[2] + ":" +  myStr[3] + ":" +  	//jump.personID, jump.sessionID
 						myStr[4] + ":" +  Util.TrimDecimals(myStr[6], dec) + ":" + 	//jump.type, jump.tc
 						Util.TrimDecimals(myStr[5], dec) + ":" +  myStr[7] + ":" + 	//jump.tv, jump.fall
-						//myStr[8] + ":" + 		//jump.weight,
 						Util.TrimDecimals(myWeight, dec) + ":" +
 						Util.TrimDecimals(Util.GetHeightInCentimeters(myStr[5]), dec) + ":" +  
 						Util.TrimDecimals(Util.GetInitialSpeed(myStr[5], true), dec) + ":" +  //true: m/s
-						myStr[9]		//jump.description
+						myStr[9] + ":" +	//jump.description
+						//myStr[10] + ":" +	//jump.angle
+						myStr[11]		//jump.simulated
 					   );
 			}
 			writeData(myData);
@@ -372,7 +347,9 @@
 						Catalog.GetString("Jumps") + ":" + 
 						Catalog.GetString("Time") + ":" + 
 						Catalog.GetString("Limited") + ":" + 
-						Catalog.GetString("Description" )
+						Catalog.GetString("Description") + ":" +
+						//Catalog.GetString("Angles") + ":" +
+						Catalog.GetString("Simulated") 
 					  );
 				isFirstHeader = false;
 			}
@@ -406,7 +383,9 @@
 					//myStr[8] + ":" +  myStr[14] + ":" + 	//jumpRj.Weight, jumpRj.Jumps
 					Util.TrimDecimals(myWeight,dec) + ":" +  myStr[14] + ":" + 	//jumpRj.Weight, jumpRj.Jumps
 					Util.TrimDecimals(myStr[15], dec) + ":" +  Util.GetLimitedRounded(myStr[16],dec) + ":" + 	//jumpRj.Time, jumpRj.Limited
-					myStr[9]		//jumpRj.Description
+					myStr[9] + ":" + 	//jumpRj.Description
+					//myStr[17] + ":" + 	//jumpRj.Angle
+					myStr[18] //simulated
 					);
 			
 			if(showSubjumps) {
@@ -468,7 +447,8 @@
 					Catalog.GetString("Distance") + ":" + 
 					Catalog.GetString("Time") + ":" + 
 					Catalog.GetString("Speed") + ":" + 
-					Catalog.GetString("Description") );
+					Catalog.GetString("Description") + ":" +
+					Catalog.GetString("Simulated") );
 
 			foreach (string runString in myRuns) {
 				string [] myStr = runString.Split(new char[] {':'});
@@ -478,7 +458,7 @@
 						myStr[4] + ":" +  myStr[5] + ":" + 	//run.type, run.distance
 						Util.TrimDecimals(myStr[6], dec) + ":" +  	//run.time
 						Util.TrimDecimals(Util.GetSpeed(myStr[5], myStr[6], true), dec) + ":" + //speed in m/s (true)
-						myStr[7]		//run.description
+						myStr[7] + ":" + myStr[8] //description, simulated
 					   );
 			}
 			writeData(myData);
@@ -511,7 +491,8 @@
 						Catalog.GetString("Distance interval") + ":" + 
 						Catalog.GetString("Tracks") + ":" + 
 						Catalog.GetString("Limited") + ":" +
-						Catalog.GetString("Description") );
+						Catalog.GetString("Description") + ":" +
+						Catalog.GetString("Simulated") );
 				isFirstHeader = false;
 			}
 
@@ -523,7 +504,7 @@
 					Util.TrimDecimals(Util.GetSpeed(myStr[5], myStr[6], true), dec) + ":" + 	//speed AVG in m/s(true)
 					myStr[7] + ":" + 	 	//run.distanceInterval
 					myStr[9] + ":" +  Util.GetLimitedRounded(myStr[11], dec) + ":" + 	//tracks, limited
-					myStr[10]		//description
+					myStr[10] + ":" + myStr[11]	//description, simulated
 				   );
 			
 			if(showSubruns) {
@@ -579,7 +560,8 @@
 					Catalog.GetString("Person") + ":" +
 					Catalog.GetString("Reaction time ID") + ":" + 
 					Catalog.GetString("Time") + ":" + 
-					Catalog.GetString("Description") );
+					Catalog.GetString("Description") + ":" +
+					Catalog.GetString("Simulated") );
 
 			foreach (string rtString in myReactionTimes) {
 				string [] myStr = rtString.Split(new char[] {':'});
@@ -589,7 +571,7 @@
 						//myStr[2] + ":" +  myStr[3] + ":" +  	//jump.personID, jump.sessionID
 						//myStr[4] + ":" +  //type
 						Util.TrimDecimals(myStr[5], dec) + ":" + 	//time
-						myStr[6]		//description
+						myStr[6] + ":" + myStr[7]	//description, simulated
 					   );
 			}
 			writeData(myData);
@@ -615,13 +597,14 @@
 					Catalog.GetString("Pulse ID") + ":" + 
 					Catalog.GetString("Type") + ":" + 
 					//Catalog.GetString("Time") + ":" +
-					Catalog.GetString("Description") );
+					Catalog.GetString("Description") + ":" +
+					Catalog.GetString("Simulated") );
 
 			string [] myStr = pulseString.Split(new char[] {':'});
 			myData.Add (
 					myStr[0] + ":" +  myStr[1] + ":" +  	//person.name, pulse.uniqueID
 					myStr[4] + ":" +  		 	//type
-					myStr[8]		//description
+					myStr[8] + ":" + myStr[9]		//description, simulated
 				   );
 			
 			writeData(myData);

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Thu Jun  5 13:11:19 2008
@@ -773,22 +773,22 @@
 				treeviewPersonsContextMenu(currentPerson);
 			} else if(myTv == treeview_jumps) {
 				if (myTreeViewJumps.EventSelectedID > 0) {
-					Jump myJump = SqliteJump.SelectNormalJumpData( myTreeViewJumps.EventSelectedID );
+					Jump myJump = SqliteJump.SelectJumpData( myTreeViewJumps.EventSelectedID );
 					treeviewJumpsContextMenu(myJump);
 				}
 			} else if(myTv == treeview_jumps_rj) {
 				if (myTreeViewJumpsRj.EventSelectedID > 0) {
-					JumpRj myJump = SqliteJump.SelectRjJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
+					JumpRj myJump = SqliteJumpRj.SelectJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
 					treeviewJumpsRjContextMenu(myJump);
 				}
 			} else if(myTv == treeview_runs) {
 				if (myTreeViewRuns.EventSelectedID > 0) {
-					Run myRun = SqliteRun.SelectNormalRunData( myTreeViewRuns.EventSelectedID );
+					Run myRun = SqliteRun.SelectRunData( myTreeViewRuns.EventSelectedID );
 					treeviewRunsContextMenu(myRun);
 				}
 			} else if(myTv == treeview_runs_interval) {
 				if (myTreeViewRunsInterval.EventSelectedID > 0) {
-					RunInterval myRun = SqliteRun.SelectIntervalRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+					RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
 					treeviewRunsIntervalContextMenu(myRun);
 				}
 			} else if(myTv == treeview_reaction_times) {
@@ -908,7 +908,7 @@
 	private void fillTreeView_jumps (string filter) {
 		string [] myJumps;
 		
-		myJumps = SqliteJump.SelectNormalJumps(currentSession.UniqueID, -1, "");
+		myJumps = SqliteJump.SelectJumps(currentSession.UniqueID, -1, "");
 		myTreeViewJumps.Fill(myJumps, filter);
 
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewJumps, treeview_jumps);
@@ -977,7 +977,7 @@
 
 	private void fillTreeView_jumps_rj (string filter) {
 		string [] myJumps;
-		myJumps = SqliteJump.SelectRjJumps(currentSession.UniqueID, -1, "");
+		myJumps = SqliteJumpRj.SelectJumps(currentSession.UniqueID, -1, "");
 		myTreeViewJumpsRj.Fill(myJumps, filter);
 
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewJumpsRj, treeview_jumps_rj);
@@ -1056,7 +1056,7 @@
 	}
 
 	private void fillTreeView_runs (string filter) {
-		string [] myRuns = SqliteRun.SelectAllNormalRuns(currentSession.UniqueID);
+		string [] myRuns = SqliteRun.SelectAllRuns(currentSession.UniqueID);
 		myTreeViewRuns.Fill(myRuns, filter);
 
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewRuns, treeview_runs);
@@ -1124,7 +1124,7 @@
 	}
 
 	private void fillTreeView_runs_interval (string filter) {
-		string [] myRuns = SqliteRun.SelectAllIntervalRuns(currentSession.UniqueID);
+		string [] myRuns = SqliteRunInterval.SelectAllRuns(currentSession.UniqueID);
 		myTreeViewRunsInterval.Fill(myRuns, filter);
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewRunsInterval, treeview_runs_interval);
 	}
@@ -3400,7 +3400,7 @@
 		//2.- check that this line is a jump and not a person (check also if it's not a individual RJ, the pass the parent RJ)
 		if (myTreeViewJumps.EventSelectedID > 0) {
 			//3.- obtain the data of the selected jump
-			Jump myJump = SqliteJump.SelectNormalJumpData( myTreeViewJumps.EventSelectedID );
+			Jump myJump = SqliteJump.SelectJumpData( myTreeViewJumps.EventSelectedID );
 		
 			//4.- edit this jump
 			editJumpWin = EditJumpWindow.Show(app1, myJump, weightPercentPreferred, prefsDigitsNumber);
@@ -3415,7 +3415,7 @@
 		//2.- check that this line is a jump and not a person (check also if it's not a individual RJ, the pass the parent RJ)
 		if (myTreeViewJumpsRj.EventSelectedID > 0) {
 			//3.- obtain the data of the selected jump
-			JumpRj myJump = SqliteJump.SelectRjJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
+			JumpRj myJump = SqliteJumpRj.SelectJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
 		
 			//4.- edit this jump
 			editJumpRjWin = EditJumpRjWindow.Show(app1, myJump, weightPercentPreferred, prefsDigitsNumber);
@@ -3452,7 +3452,7 @@
 		//2.- check that this line is a jump and not a person (check also if it's not a individual RJ, the pass the parent RJ)
 		if (myTreeViewRuns.EventSelectedID > 0) {
 			//3.- obtain the data of the selected run
-			Run myRun = SqliteRun.SelectNormalRunData( myTreeViewRuns.EventSelectedID );
+			Run myRun = SqliteRun.SelectRunData( myTreeViewRuns.EventSelectedID );
 			myRun.MetersSecondsPreferred = metersSecondsPreferred;
 			Log.WriteLine(myRun.ToString());
 		
@@ -3469,7 +3469,7 @@
 		//2.- check that this line is a run and not a person (check also if it's not a individual subrun, the pass the parent run)
 		if (myTreeViewRunsInterval.EventSelectedID > 0) {
 			//3.- obtain the data of the selected run
-			RunInterval myRun = SqliteRun.SelectIntervalRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+			RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
 			Log.WriteLine(myRun.ToString());
 		
 			//4.- edit this run
@@ -3957,7 +3957,7 @@
 		//2.- check that this line is a jump and not a person (check also if it's not a individual RJ, the pass the parent RJ)
 		if (myTreeViewJumpsRj.EventSelectedID > 0) {
 			//3.- obtain the data of the selected jump
-			JumpRj myJump = SqliteJump.SelectRjJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
+			JumpRj myJump = SqliteJumpRj.SelectJumpData( "jumpRj", myTreeViewJumpsRj.EventSelectedID );
 		
 			//4.- edit this jump
 			repairJumpRjWin = RepairJumpRjWindow.Show(app1, myJump, prefsDigitsNumber);
@@ -3984,7 +3984,7 @@
 		//(check also if it's not a individual run interval, then pass the parent run interval)
 		if (myTreeViewRunsInterval.EventSelectedID > 0) {
 			//3.- obtain the data of the selected run
-			RunInterval myRun = SqliteRun.SelectIntervalRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+			RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
 		
 			//4.- edit this run
 			repairRunIntervalWin = RepairRunIntervalWindow.Show(app1, myRun, prefsDigitsNumber);

Modified: trunk/src/gui/event.cs
==============================================================================
--- trunk/src/gui/event.cs	(original)
+++ trunk/src/gui/event.cs	Thu Jun  5 13:11:19 2008
@@ -133,8 +133,13 @@
 
 	protected void fillDialog (Event myEvent)
 	{
-		fillWindowTitleAndLabelHeader();	
-		label_event_id_value.Text = myEvent.UniqueID.ToString();
+		fillWindowTitleAndLabelHeader();
+
+		string id = myEvent.UniqueID.ToString();
+		if(myEvent.Simulated == 1) 
+			id += " <b>" + Catalog.GetString("Simulated") + "</b>";
+		label_event_id_value.Text = id;
+		label_event_id_value.UseMarkup = true;
 
 		if(showTv)
 			fillTv(myEvent);

Modified: trunk/src/gui/jump.cs
==============================================================================
--- trunk/src/gui/jump.cs	(original)
+++ trunk/src/gui/jump.cs	Thu Jun  5 13:11:19 2008
@@ -307,7 +307,7 @@
 		//only for jumps
 		double jumpPercentWeightForNewPerson = updateWeight(personID, sessionID);
 		
-		SqliteJump.UpdateRj(eventID, personID, entryFall, jumpPercentWeightForNewPerson, description);
+		SqliteJumpRj.Update(eventID, personID, entryFall, jumpPercentWeightForNewPerson, description);
 	}
 }
 
@@ -637,31 +637,34 @@
 				equal = "=";
 			} while (store.IterNext (ref myIter));
 		}
-			
+		
+		jumpRj.TvString = tvString;	
+		jumpRj.TcString = tcString;	
+		jumpRj.Jumps = Util.GetNumberOfJumps(tvString, false);
+		jumpRj.Time = Util.GetTotalTime(tcString, tvString);
+
 		//calculate other variables needed for jumpRj creation
 		
-		int jumps = Util.GetNumberOfJumps(tvString, false);
-		string limitString = "";
-	
 		if(jumpType.FixedValue > 0) {
 			//if this jumpType has a fixed value of jumps or time, limitstring has not changed
 			if(jumpType.JumpsLimited) {
-				limitString = jumpType.FixedValue.ToString() + "J";
+				jumpRj.Limited = jumpType.FixedValue.ToString() + "J";
 			} else {
-				limitString = jumpType.FixedValue.ToString() + "T";
+				jumpRj.Limited = jumpType.FixedValue.ToString() + "T";
 			}
 		} else {
 			//else limitstring should be calculated
 			if(jumpType.JumpsLimited) {
-				limitString = jumps.ToString() + "J";
+				jumpRj.Limited = jumpRj.Jumps.ToString() + "J";
 			} else {
-				limitString = Util.GetTotalTime(tcString, tvString) + "T";
+				jumpRj.Limited = Util.GetTotalTime(tcString, tvString) + "T";
 			}
 		}
 
 		//save it deleting the old first for having the same uniqueID
 		SqliteJump.Delete("jumpRj", jumpRj.UniqueID.ToString());
-		//int uniqueID = SqliteJump.InsertRj(jumpRj.UniqueID.ToString(), jumpRj.PersonID, jumpRj.SessionID, 
+		jumpRj.InsertAtDB(false, Constants.JumpRjTable); 
+		/*
 		SqliteJump.InsertRj("jumpRj", jumpRj.UniqueID.ToString(), jumpRj.PersonID, jumpRj.SessionID, 
 				jumpRj.Type, Util.GetMax(tvString), Util.GetMax(tcString), 
 				jumpRj.Fall, jumpRj.Weight, jumpRj.Description,
@@ -669,6 +672,7 @@
 				tvString, tcString,
 				jumps, Util.GetTotalTime(tcString, tvString), limitString
 				);
+				*/
 
 		//close the window
 		RepairJumpRjWindowBox.repair_sub_event.Hide();

Modified: trunk/src/gui/person.cs
==============================================================================
--- trunk/src/gui/person.cs	(original)
+++ trunk/src/gui/person.cs	Thu Jun  5 13:11:19 2008
@@ -1001,8 +1001,8 @@
 			//if weight has changed
 			if(adding && (int) spinbutton_weight.Value != weightIni) {
 				//see if this person has done jumps with weight
-				string [] myJumpsNormal = SqliteJump.SelectNormalJumps(currentSession.UniqueID, personID, "withWeight");
-				string [] myJumpsReactive = SqliteJump.SelectRjJumps(currentSession.UniqueID, personID, "withWeight");
+				string [] myJumpsNormal = SqliteJump.SelectJumps(currentSession.UniqueID, personID, "withWeight");
+				string [] myJumpsReactive = SqliteJumpRj.SelectJumps(currentSession.UniqueID, personID, "withWeight");
 
 				if(myJumpsNormal.Length > 0 || myJumpsReactive.Length > 0) {
 					//create the convertWeight Window

Modified: trunk/src/gui/pulse.cs
==============================================================================
--- trunk/src/gui/pulse.cs	(original)
+++ trunk/src/gui/pulse.cs	Thu Jun  5 13:11:19 2008
@@ -520,36 +520,20 @@
 			
 		//calculate other variables needed for pulse creation
 		
-		int totalPulsesNum = Util.GetNumberOfJumps(timeString, false); //don't need a GetNumberOfRuns, this works
-
-/*
-		string limitString = "";
-	
-		
-		if(runType.FixedValue > 0) {
-			//if this runType has a fixed value of runs or time, limitstring has not changed
-			if(runType.TracksLimited) {
-				limitString = runType.FixedValue.ToString() + "R";
-			} else {
-				limitString = runType.FixedValue.ToString() + "T";
-			}
-		} else {
-			//else limitstring should be calculated
-			if(runType.TracksLimited) {
-				limitString = runs.ToString() + "R";
-			} else {
-				limitString = Util.GetTotalTime(timeString) + "T";
-			}
-		}
-*/
+		myPulse.TotalPulsesNum = Util.GetNumberOfJumps(timeString, false); //don't need a GetNumberOfRuns, this works
+		myPulse.TimesString = timeString;
 
 		//save it deleting the old first for having the same uniqueID
 		SqlitePulse.Delete(myPulse.UniqueID.ToString());
+
+		myPulse.InsertAtDB(false, Constants.PulseTable);
+		/*
 		SqlitePulse.Insert(myPulse.UniqueID.ToString(), 
 				myPulse.PersonID, myPulse.SessionID, 
 				myPulse.Type, myPulse.FixedPulse, totalPulsesNum, 
 				timeString, myPulse.Description
 				);
+				*/
 
 		//close the window
 		RepairPulseWindowBox.repair_sub_event.Hide();

Modified: trunk/src/gui/run.cs
==============================================================================
--- trunk/src/gui/run.cs	(original)
+++ trunk/src/gui/run.cs	Thu Jun  5 13:11:19 2008
@@ -241,7 +241,7 @@
 
 
 	protected override void updateEvent(int eventID, int personID, string description) {
-		SqliteRun.IntervalUpdate(eventID, personID, description);
+		SqliteRunInterval.Update(eventID, personID, description);
 	}
 
 	protected override void on_button_cancel_clicked (object o, EventArgs args)
@@ -514,28 +514,31 @@
 			
 		//calculate other variables needed for runInterval creation
 		
-		int runs = Util.GetNumberOfJumps(timeString, false); //don't need a GetNumberOfRuns, this works
-		string limitString = "";
+		runInterval.Tracks = Util.GetNumberOfJumps(timeString, false); //don't need a GetNumberOfRuns, this works
+		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) {
-				limitString = runType.FixedValue.ToString() + "R";
+				runInterval.Limited = runType.FixedValue.ToString() + "R";
 			} else {
-				limitString = runType.FixedValue.ToString() + "T";
+				runInterval.Limited = runType.FixedValue.ToString() + "T";
 			}
 		} else {
 			//else limitstring should be calculated
 			if(runType.TracksLimited) {
-				limitString = runs.ToString() + "R";
+				runInterval.Limited = runInterval.Tracks.ToString() + "R";
 			} else {
-				limitString = Util.GetTotalTime(timeString) + "T";
+				runInterval.Limited = runInterval.TimeTotal + "T";
 			}
 		}
 
 		//save it deleting the old first for having the same uniqueID
-		SqliteRun.Delete("runInterval", runInterval.UniqueID.ToString());
-		SqliteRun.InsertInterval("runInterval", runInterval.UniqueID.ToString(), 
+		SqliteRun.Delete(Constants.RunIntervalTable, runInterval.UniqueID.ToString());
+		runInterval.InsertAtDB(false, Constants.RunIntervalTable); 
+		/*
+		SqliteRun.InsertInterval(false, Constants.RunIntervalTable, runInterval.UniqueID.ToString(), 
 				runInterval.PersonID, runInterval.SessionID, 
 				runInterval.Type, 
 				runs * runInterval.DistanceInterval,	//distanceTotal
@@ -545,6 +548,7 @@
 				runInterval.Description,
 				limitString
 				);
+				*/
 
 		//close the window
 		RepairRunIntervalWindowBox.repair_sub_event.Hide();

Modified: trunk/src/jump.cs
==============================================================================
--- trunk/src/jump.cs	(original)
+++ trunk/src/jump.cs	Thu Jun  5 13:11:19 2008
@@ -34,12 +34,13 @@
 
 	//for not checking always in database
 	protected bool hasFall;
+	private int angle;
 
 	public Jump() {
 	}
 
 	//after inserting database (SQL)
-	public Jump(int uniqueID, int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string description)
+	public Jump(int uniqueID, int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string description, int angle, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -50,39 +51,63 @@
 		this.fall = fall;
 		this.weight = weight;
 		this.description = description;
+		this.angle = angle;
+		this.simulated = simulated;
 	}
 
-
-	public virtual bool TypeHasWeight
+	//used to select a jump at SqliteJump.SelectNormalJumpData and at Sqlite.addSimulatedInEventTables
+	public Jump(string [] eventString)
 	{
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		this.type = eventString[3].ToString();
+		this.tv = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[4]));
+		this.tc = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[5]));
+		this.fall = Convert.ToInt32(eventString[6]);
+		this.weight = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[7]));
+		this.description = eventString[8].ToString();
+		this.angle = Convert.ToInt32(eventString[9]);
+		this.simulated = Convert.ToInt32(eventString[10]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqliteJump.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), 
+				personID, sessionID, 
+				type, tv, tc, fall, 
+				weight, description, 
+				angle, simulated);
+	}
+
+	public override string ToString() {
+		return uniqueID + ":" + personID + ":" + sessionID + ":" + type + ":" + tv + ":" + tc; //...
+	}
+
+	public virtual bool TypeHasWeight {
 		get { return SqliteJumpType.HasWeight("jumpType", type); }
 	}
 	
-	public virtual bool TypeHasFall
-	{
+	public virtual bool TypeHasFall {
 		get { return SqliteJumpType.HasFall("jumpType", type); } //jumpType is the table name
 	}
 	
-	public double Tv
-	{
+	public double Tv {
 		get { return tv; }
 		set { tv = value; }
 	}
 	
-	public double Tc
-	{
+	public double Tc {
 		get { return tc; }
 		set { tc = value; }
 	}
 	
-	public int Fall
-	{
+	public int Fall {
 		get { return fall; }
 		set { fall = value; }
 	}
 	
-	public double Weight
-	{
+	public double Weight {
 		get { return weight; }
 		set { weight = value; }
 	}
@@ -106,6 +131,7 @@
 	private double tvCount;
 	private double lastTc;
 	private double lastTv;
+	private string angleString;
 	
 	public JumpRj() {
 	}
@@ -113,7 +139,7 @@
 	//after inserting database (SQL)
 	public JumpRj(int uniqueID, int personID, int sessionID, string type, 
 			string tvString, string tcString, int fall, double weight, 
-			string description, int jumps, double time, string limited)
+			string description, int jumps, double time, string limited, string angleString, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -127,8 +153,42 @@
 		this.jumps = jumps;
 		this.time = time;
 		this.limited = limited;
+		this.angleString = angleString;
+		this.simulated = simulated;
 	}
 	
+	//used to select a jump at SqliteJump.SelectRjJumpData and at Sqlite.addSimulatedInEventTables
+	public JumpRj(string [] eventString)
+	{
+		//foreach(string myStr in eventString)
+		//	Log.WriteLine(myStr);
+
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		this.type = eventString[3].ToString();
+		this.tvString = Util.ChangeDecimalSeparator(eventString[11].ToString());
+		this.tcString = Util.ChangeDecimalSeparator(eventString[12].ToString());
+		this.fall = Convert.ToInt32(eventString[6]);
+		this.weight = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[7]));
+		this.description = eventString[8].ToString();
+		this.jumps = Convert.ToInt32(eventString[13]);
+		this.time = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[14]));
+		this.limited = eventString[15];
+		this.angleString = eventString[16];
+		this.simulated = Convert.ToInt32(eventString[17]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqliteJumpRj.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(),
+				personID, sessionID, 
+				type, TvMax, TcMax, fall, weight,
+				description, TvAvg, TcAvg, tvString, tcString,
+				jumps, time, limited, 
+				angleString, simulated);
+	}
+
 	public string Limited
 	{
 		get { return limited; }
@@ -183,6 +243,11 @@
 		set { jumps = value; }
 	}
 	
+	public double Time
+	{
+		set { time = value; }
+	}
+	
 	public bool JumpsLimited
 	{
 		get { return jumpsLimited; }

Modified: trunk/src/log.cs
==============================================================================
--- trunk/src/log.cs	(original)
+++ trunk/src/log.cs	Thu Jun  5 13:11:19 2008
@@ -32,6 +32,7 @@
 	
 	private static TextWriter writer;
 	private static string timeLog = "";
+	private static bool useConsole = false;
 				
 	private static bool initializeTime(string [] args) {
 		if(! Directory.Exists(GetDir())) {
@@ -86,8 +87,9 @@
 		
 		bool timeLogPassedOk = initializeTime(args);
 		
+		if(useConsole)
+			Console.WriteLine(GetFile());
 		try {
-			//Console.WriteLine(GetFile());
 			writer = File.CreateText(GetFile());
 		} catch {}
 		
@@ -95,7 +97,8 @@
 	}
 
 	public static void Write(string text) {
-		//Console.Write(text);
+		if(useConsole)
+			Console.Write(text);
 		try {
 			writer.Write(text);
 			writer.Flush();
@@ -103,8 +106,9 @@
 	}
 	
 	public static void WriteLine(string text) {
+		if(useConsole)
+			Console.WriteLine(text);
 		try {
-			//Console.WriteLine(text);
 			writer.WriteLine(text);
 			writer.Flush();
 		} catch {}

Modified: trunk/src/pulse.cs
==============================================================================
--- trunk/src/pulse.cs	(original)
+++ trunk/src/pulse.cs	Thu Jun  5 13:11:19 2008
@@ -39,7 +39,7 @@
 
 	//after inserting database (SQL)
 	public Pulse(int uniqueID, int personID, int sessionID, string type, double fixedPulse, 
-			int totalPulsesNum, string timesString, string description)
+			int totalPulsesNum, string timesString, string description, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -49,6 +49,28 @@
 		this.totalPulsesNum = totalPulsesNum;
 		this.timesString = timesString;
 		this.description = description;
+		this.simulated = simulated;
+	}
+
+	//used to select a event at SqlitePulse.SelectPulseData and at Sqlite.addSimulatedInEventTables
+	public Pulse(string [] eventString) {
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		this.type = eventString[3].ToString();
+		this.fixedPulse = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[4]));
+		this.totalPulsesNum = Convert.ToInt32(eventString[5]);
+		this.timesString = eventString[6].ToString();
+		this.description = eventString[7].ToString();
+		this.simulated = Convert.ToInt32(eventString[8]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqlitePulse.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), 
+				personID, sessionID, 
+				type, fixedPulse, totalPulsesNum, timesString,
+				description, simulated);
 	}
 
 	
@@ -77,18 +99,20 @@
 		return Util.GetAverage(myErrors);
 	}
 	
-	public string TimesString
-	{
-		get { return timesString; }
-		set { timesString = value; }
-	}
-	
-	public double FixedPulse
-	{
+	public double FixedPulse {
 		get { return fixedPulse; }
 		set { fixedPulse = value; }
 	}
 	
+	public int TotalPulsesNum {
+		set { totalPulsesNum = value; }
+	}
+	
+	public string TimesString {
+		get { return timesString; }
+		set { timesString = value; }
+	}
+	
 		
 	~Pulse() {}
 }

Modified: trunk/src/reactionTime.cs
==============================================================================
--- trunk/src/reactionTime.cs	(original)
+++ trunk/src/reactionTime.cs	Thu Jun  5 13:11:19 2008
@@ -30,15 +30,36 @@
 	}
 
 	//after inserting database (SQL)
-	public ReactionTime(int uniqueID, int personID, int sessionID, double time, string description)
+	public ReactionTime(int uniqueID, int personID, int sessionID, double time, string description, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
 		this.sessionID = sessionID;
 		this.time = time;
 		this.description = description;
+		this.simulated = simulated;
 	}
 
+	//used to select a event at SqliteReactionTime.SelectReactionTimeData and at Sqlite.addSimulatedInEventTables
+	public ReactionTime(string [] eventString) {
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		//this.type = eventString[3].ToString();
+		this.time = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[4]));
+		this.description = eventString[5].ToString();
+		this.simulated = Convert.ToInt32(eventString[6]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqliteReactionTime.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), 
+				personID, sessionID, 
+				"", time, //type, time
+				description, simulated);
+	}
+
+
 	public double Time
 	{
 		get { return time; }

Modified: trunk/src/report.cs
==============================================================================
--- trunk/src/report.cs	(original)
+++ trunk/src/report.cs	Thu Jun  5 13:11:19 2008
@@ -108,16 +108,16 @@
 			myPersons = SqlitePersonSession.SelectCurrentSession(sessionID, false, false); //not onlyIDAndName, not reversed
 		}
 		if(ShowSimpleJumps) {
-			myJumps= SqliteJump.SelectNormalJumps(sessionID, -1, "");
+			myJumps= SqliteJump.SelectJumps(sessionID, -1, "");
 		}
 		if(ShowReactiveJumps) {
-			myJumpsRj = SqliteJump.SelectRjJumps(sessionID, -1, "");
+			myJumpsRj = SqliteJumpRj.SelectJumps(sessionID, -1, "");
 		}
 		if(ShowSimpleRuns) {
-			myRuns= SqliteRun.SelectAllNormalRuns(sessionID);
+			myRuns= SqliteRun.SelectAllRuns(sessionID);
 		}
 		if (ShowIntervalRuns) {
-			myRunsInterval = SqliteRun.SelectAllIntervalRuns(sessionID);
+			myRunsInterval = SqliteRunInterval.SelectAllRuns(sessionID);
 		}
 		if(ShowReactionTimes) {
 			myReactionTimes= SqliteReactionTime.SelectAllReactionTimes(sessionID);

Modified: trunk/src/run.cs
==============================================================================
--- trunk/src/run.cs	(original)
+++ trunk/src/run.cs	Thu Jun  5 13:11:19 2008
@@ -51,7 +51,7 @@
 	}
 
 	//after inserting database (SQL)
-	public Run(int uniqueID, int personID, int sessionID, string type, double distance, double time, string description)
+	public Run(int uniqueID, int personID, int sessionID, string type, double distance, double time, string description, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -60,6 +60,28 @@
 		this.distance = distance;
 		this.time = time;
 		this.description = description;
+		this.simulated = simulated;
+	}
+
+	//used to select a run at SqliteRun.SelectNormalRunData and at Sqlite.addSimulatedInEventTables
+	public Run(string [] eventString)
+	{
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		this.type = eventString[3].ToString();
+		this.distance = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[4]));
+		this.time = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[5]));
+		this.description = eventString[6].ToString();
+		this.simulated = Convert.ToInt32(eventString[7]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqliteRun.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), 
+				personID, sessionID, 
+				type, distance, time, 
+				description, simulated);
 	}
 
 	
@@ -90,6 +112,7 @@
 		set { metersSecondsPreferred = value; }
 	}
 
+	
 	~Run() {}
 	   
 }
@@ -110,7 +133,7 @@
 	}
 	
 	//after inserting database (SQL)
-	public RunInterval(int uniqueID, int personID, int sessionID, string type, double distanceTotal, double timeTotal, double distanceInterval, string intervalTimesString, double tracks, string description, string limited)
+	public RunInterval(int uniqueID, int personID, int sessionID, string type, double distanceTotal, double timeTotal, double distanceInterval, string intervalTimesString, double tracks, string description, string limited, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -123,6 +146,34 @@
 		this.tracks = tracks;
 		this.description = description;
 		this.limited = limited;
+		this.simulated = simulated;
+	}
+
+	//used to select a run at SqliteRun.SelectIntervalRunData and at Sqlite.addSimulatedInEventTables
+	public RunInterval(string [] eventString)
+	{
+		this.uniqueID = Convert.ToInt32(eventString[0]);
+		this.personID = Convert.ToInt32(eventString[1]);
+		this.sessionID = Convert.ToInt32(eventString[2]);
+		this.type = eventString[3].ToString();
+		this.distanceTotal = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[4]));
+		this.timeTotal = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[5]));
+		this.distanceInterval = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[6]));
+		this.intervalTimesString = Util.ChangeDecimalSeparator(eventString[7]);
+		this.tracks = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[8]));
+		this.description = eventString[9].ToString();
+		this.limited = eventString[10].ToString();
+		this.simulated = Convert.ToInt32(eventString[11]);
+	}
+
+	public override void InsertAtDB (bool dbconOpened, string tableName) {
+		SqliteRunInterval.Insert(dbconOpened, tableName, 
+				uniqueID.ToString(), 
+				personID, sessionID, 
+				type, distanceTotal, timeTotal, 
+				distanceInterval, intervalTimesString,
+				tracks, description, 
+				limited, simulated);
 	}
 
 	public string IntervalTimesString
@@ -154,7 +205,7 @@
 		get { return tracks; }
 		set { tracks = value; }
 	}
-		
+	
 	public string Limited
 	{
 		get { return limited; }

Modified: trunk/src/sqlite/jump.cs
==============================================================================
--- trunk/src/sqlite/jump.cs	(original)
+++ trunk/src/sqlite/jump.cs	Thu Jun  5 13:11:19 2008
@@ -31,14 +31,20 @@
 
 class SqliteJump : Sqlite
 {
+	public SqliteJump() {
+	}
+	
+	~SqliteJump() {}
+
 	/*
 	 * create and initialize tables
 	 */
 	
-	protected internal static void createTable()
+	protected override void createTable(string tableName)
 	{
+		//values: Constants.JumpTable and Constants.TempEventTable'
 		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.JumpTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"personID INT, " +
 			"sessionID INT, " +
@@ -47,88 +53,40 @@
 			"tc FLOAT, " +
 			"fall INT, " +  
 			"weight TEXT, " + //string because can contain "33%" or "50Kg"
-			"description TEXT )";		
+			"description TEXT, " +
+			"angle INT, " + //-1 if undef
+			"simulated INT )";
 		dbcmd.ExecuteNonQuery();
 	}
 	
-	protected internal static void rjCreateTable(string tableName)
-	{
-		//values: 'jumpRj' and 'tempJumpRj'
-
-		dbcmd.CommandText = 
-			"CREATE TABLE " + tableName + " ( " +
-			"uniqueID INTEGER PRIMARY KEY, " +
-			"personID INT, " +
-			"sessionID INT, " +
-			"type TEXT, " + 
-			"tvMax FLOAT, " +
-			"tcMax FLOAT, " +
-			"fall INT, " +  
-			"weight TEXT, " + //string because can contain "33%" or "50Kg"
-			"description TEXT, " +		//this and the above values are equal than normal jump
-			"tvAvg FLOAT, " +		//this and next values are Rj specific
-			"tcAvg FLOAT, " +
-			"tvString TEXT, " +
-			"tcString TEXT, " +
-			"jumps INT, " +
-			"time FLOAT, " + //if limit it's 'n' jumps, we probably waste 7.371 seconds
-			"limited TEXT) "; //for RJ, "11J" or "11S" (11 Jumps, 11 seconds)
-		dbcmd.ExecuteNonQuery();
-	}
-
 	
 	/*
 	 * Jump class methods
 	 */
 	
-	public static int Insert(int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string limited, string description)
+	//public static int Insert(int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string limited, string description, int simulated)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string description, int angle, int simulated)
 	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO " + Constants.JumpTable +  
-				" (uniqueID, personID, sessionID, type, tv, tc, fall, weight, description)" +
-				" VALUES (NULL, "
+		if(! dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "INSERT INTO " + tableName +  
+				" (uniqueID, personID, sessionID, type, tv, tc, fall, weight, description, angle, simulated)" +
+				" VALUES (" + uniqueID + ", "
 				+ personID + ", " + sessionID + ", '" + type + "', "
 				+ Util.ConvertToPoint(tv) + ", " + Util.ConvertToPoint(tc) + ", " + fall + ", '" 
-				+  Util.ConvertToPoint(weight) + "', '" + description + "')" ;
+				+  Util.ConvertToPoint(weight) + "', '" + description + "', " + angle + ", " + simulated +")" ;
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myLast = dbcon.LastInsertRowId;
-		dbcon.Close();
+		if(! dbconOpened)
+			dbcon.Close();
 
-		//Jump myJump = new Jump(myLast, personID, sessionID,
-		//		type, tv, tc, fall, weight, description );
-		
 		return myLast;
 	}
 	
-	//fall has values like "10J" or "10T" (10 jumps, or 10 seconds, respectively)
-	public static int InsertRj(string tableName, string uniqueID, int personID, int sessionID, string type, double tvMax, double tcMax, int fall, double weight, string description, double tvAvg, double tcAvg, string tvString, string tcString, int jumps, double time, string limited )
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO " + tableName + 
-				" (uniqueID, personID, sessionID, type, tvMax, tcMax, fall, weight, description, " +
-				"tvAvg, tcAvg, tvString, tcString, jumps, time, limited	)" +
-				"VALUES (" + uniqueID + ", " +
-				personID + ", " + sessionID + ", '" + type + "', " +
-				Util.ConvertToPoint(tvMax) + ", " + Util.ConvertToPoint(tcMax) + ", '" + 
-				fall + "', '" + Util.ConvertToPoint(weight) + "', '" + description + "', " +
-				Util.ConvertToPoint(tvAvg) + ", " + Util.ConvertToPoint(tcAvg) + ", '" + 
-				Util.ConvertToPoint(tvString) + "', '" + Util.ConvertToPoint(tcString) + "', " +
-				jumps + ", " + Util.ConvertToPoint(time) + ", '" + limited + "')" ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-		int myLast = dbcon.LastInsertRowId;
-
-		//JumpRj myJump = new JumpRj (myLast, personID, sessionID, type, tvString, tcString,
-		//		fall, weight, description, jumps, time, limited );
-
-		dbcon.Close();
-
-		return myLast;
-	}
-
 	//if all persons, put -1 in personID
-	public static string[] SelectNormalJumps(int sessionID, int personID, string filterWeight) 
+	public static string[] SelectJumps(int sessionID, int personID, string filterWeight) 
 	{
 		string filterPersonString = "";
 		if(personID != -1)
@@ -173,7 +131,9 @@
 					reader[7].ToString() + ":" + 	//fall
 					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + 	//weight
 					reader[9].ToString() + ":" +	//description
-					reader[10].ToString() 		//person.weight
+					reader[10].ToString() + ":" +	//angle
+					reader[11].ToString() + ":" +	//simulated
+					reader[12].ToString() 		//person.weight
 					);
 			count ++;
 		}
@@ -190,74 +150,7 @@
 		return myJumps;
 	}
 
-	public static string[] SelectRjJumps(int sessionID, int personID, string filterWeight) 
-	{
-		string filterPersonString = "";
-		if(personID != -1)
-			filterPersonString = " AND person.uniqueID == " + personID;
-
-		string filterWeightString = "";
-		if(filterWeight == "withWeight")
-			filterWeightString = " AND jumpRj.weight != 0 ";
-
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT person.name, jumpRj.*, personSessionWeight.weight " +
-			" FROM person, jumpRj, personSessionWeight " +
-			" WHERE person.uniqueID == jumpRj.personID" + 
-			" AND jumpRj.sessionID == " + sessionID + 
-			filterPersonString +
-			filterWeightString +
-			" AND personSessionWeight.personID == person.uniqueID " +
-			" AND personSessionWeight.sessionID == jumpRj.sessionID " +
-			" ORDER BY person.uniqueID, jumpRj.uniqueID";
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-
-		ArrayList myArray = new ArrayList(2);
-
-		int count = new int();
-		count = 0;
-
-		while(reader.Read()) {
-			myArray.Add (reader[0].ToString() + ":" +	//person.name
-					reader[1].ToString() + ":" +	//jumpRj.uniqueID
-					reader[2].ToString() + ":" + 	//jumpRj.personID
-					reader[3].ToString() + ":" + 	//jumpRj.sessionID
-					reader[4].ToString() + ":" + 	//jumpRj.type
-					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + 	//tvMax
-					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + 	//tcMax
-					reader[7].ToString() + ":" + 	//fall
-					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + 	//weight
-					reader[9].ToString() + ":" + 	//description
-					Util.ChangeDecimalSeparator(reader[10].ToString()) + ":" + 	//tvAvg,
-					Util.ChangeDecimalSeparator(reader[11].ToString()) + ":" + 	//tcAvg,
-					Util.ChangeDecimalSeparator(reader[12].ToString()) + ":" + 	//tvString,
-					Util.ChangeDecimalSeparator(reader[13].ToString()) + ":" + 	//tcString,
-					reader[14].ToString() + ":" + 	//jumps,
-					reader[15].ToString() + ":" + 	//time,
-					reader[16].ToString() + ":" + 	//limited
-					reader[17].ToString() 	 	//person.weight
-					);
-			count ++;
-		}
-
-		reader.Close();
-		dbcon.Close();
-
-		string [] myJumps = new string[count];
-		count =0;
-		foreach (string line in myArray) {
-			myJumps [count++] = line;
-		}
-
-		return myJumps;
-	}
-
-	public static Jump SelectNormalJumpData(int uniqueID)
+	public static Jump SelectJumpData(int uniqueID)
 	{
 		dbcon.Open();
 
@@ -270,89 +163,12 @@
 		reader = dbcmd.ExecuteReader();
 		reader.Read();
 
-		Jump myJump = new Jump(
-				Convert.ToInt32(reader[0]),
-				Convert.ToInt32(reader[1]),
-				Convert.ToInt32(reader[2]),
-				reader[3].ToString(),
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[4].ToString()) ),
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[5].ToString()) ),
-				Convert.ToInt32(reader[6]),  //fall
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[7].ToString()) ), //weight
-				reader[8].ToString() //description
-				);
+		Jump myJump = new Jump(DataReaderToStringArray(reader, 11));
 	
 		dbcon.Close();
 		return myJump;
 	}
 		
-	public static JumpRj SelectRjJumpData(string tableName, int uniqueID)
-	{
-		//tableName is jumpRj or tempJumpRj
-
-		dbcon.Open();
-
-		dbcmd.CommandText = "SELECT * FROM " + tableName + " WHERE uniqueID == " + uniqueID;
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-		reader.Read();
-
-		JumpRj myJump = new JumpRj(
-				Convert.ToInt32(reader[0]),	//uniqueID
-				Convert.ToInt32(reader[1]),	//personID
-				Convert.ToInt32(reader[2]),	//sessionID
-				reader[3].ToString(),		//type
-				Util.ChangeDecimalSeparator(reader[11].ToString()),		//tvString
-				Util.ChangeDecimalSeparator(reader[12].ToString()),		//tcString
-				//tvMax and tcMax not needed by the constructor:
-				//Convert.ToDouble( reader[4].ToString() ), //tvMax
-				//Convert.ToDouble( reader[5].ToString() ), //tcMax
-				Convert.ToInt32(reader[6]),  	//fall
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[7].ToString()) ), 	//weight
-				reader[8].ToString(), 		//description
-				//tvAvg and tcAvg not needed by the constructor:
-				//Convert.ToDouble( reader[9].ToString() ), //tvAvg
-				//Convert.ToDouble( reader[10].ToString() ), //tcAvg
-				Convert.ToInt32(reader[13]),		//jumps
-				Convert.ToDouble(reader[14]),		//time
-				reader[15].ToString()		//limited
-				);
-
-		dbcon.Close();
-		return myJump;
-	}
-	
-
-	//checks if there are Rjs with different number of TCs than TFs
-	//then repair database manually, and look if the jump is jumpLimited, and how many jumps there are defined
-	public static void FindBadRjs()
-	{
-		dbcon.Open();
-
-		dbcmd.CommandText = "SELECT uniqueID, tcstring, tvstring, jumps, limited FROM jumpRj";
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-		reader.Read();
-
-		while(reader.Read()) {
-			if(Util.GetNumberOfJumps(reader[1].ToString(), true) != Util.GetNumberOfJumps(reader[2].ToString(), true)) {
-				Log.WriteLine(string.Format("Problem with jumpRj: {0}, tcstring{1}, tvstring{2}, jumps{3}, limited{4}", 
-						reader[0].ToString(), 
-						Util.GetNumberOfJumps(reader[1].ToString(), true).ToString(), 
-						Util.GetNumberOfJumps(reader[2].ToString(), true).ToString(), 
-						reader[3].ToString(), reader[4].ToString()));
-			}
-		}
-		dbcon.Close();
-	}
 
 	public static void Update(int jumpID, string type, string tv, string tc, string fall, int personID, double weight, string description)
 	{
@@ -370,19 +186,6 @@
 		dbcon.Close();
 	}
 
-	public static void UpdateRj(int jumpID, int personID, string fall, double weight, string description)
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "UPDATE jumpRj SET personID = " + personID + 
-			", fall = " + Util.ConvertToPoint(Convert.ToDouble(fall)) + 
-			", weight = " + Util.ConvertToPoint(weight) + 
-			", description = '" + description +
-			"' WHERE uniqueID == " + jumpID ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-		dbcon.Close();
-	}
-
 	public static void UpdateWeight(string tableName, int uniqueID, int weight)
 	{
 		dbcon.Open();
@@ -406,8 +209,6 @@
 	//onle for change SJ+ CMJ+ and ABK+ to SJl...
 	public static void ChangeWeightToL()
 	{
-		//dbcon.Open();
-		
 		dbcmd.CommandText = "UPDATE jump SET type = 'SJl' WHERE type == 'SJ+'";
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
@@ -419,7 +220,5 @@
 		dbcmd.CommandText = "UPDATE jump SET type = 'ABKl' WHERE type == 'ABK+'";
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
-		
-		//dbcon.Close();
 	}
 }

Added: trunk/src/sqlite/jumpRj.cs
==============================================================================
--- (empty file)
+++ trunk/src/sqlite/jumpRj.cs	Thu Jun  5 13:11:19 2008
@@ -0,0 +1,221 @@
+/*
+ * 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.IO;
+using System.Collections; //ArrayList
+//using Mono.Data.SqliteClient;
+//using System.Data.SqlClient;
+using Mono.Data.Sqlite;
+//using System.Data.SQLite;
+
+
+class SqliteJumpRj : SqliteJump
+{
+	public SqliteJumpRj() {
+	}
+	~SqliteJumpRj() {}
+	
+	protected override void createTable(string tableName)
+	{
+		//values: 'jumpRj' and 'tempJumpRj'
+
+		dbcmd.CommandText = 
+			"CREATE TABLE " + tableName + " ( " +
+			"uniqueID INTEGER PRIMARY KEY, " +
+			"personID INT, " +
+			"sessionID INT, " +
+			"type TEXT, " + 
+			"tvMax FLOAT, " +
+			"tcMax FLOAT, " +
+			"fall INT, " +  
+			"weight TEXT, " + //string because can contain "33%" or "50Kg"
+			"description TEXT, " +		//this and the above values are equal than normal jump
+			"tvAvg FLOAT, " +		//this and next values are Rj specific
+			"tcAvg FLOAT, " +
+			"tvString TEXT, " +
+			"tcString TEXT, " +
+			"jumps INT, " +
+			"time FLOAT, " + //if limit it's 'n' jumps, we probably waste 7.371 seconds
+			"limited TEXT, " + //for RJ, "11J" or "11S" (11 Jumps, 11 seconds)
+			"angleString TEXT, " + //"-1" if undef
+			"simulated INT )";
+		dbcmd.ExecuteNonQuery();
+	}
+
+	//fall has values like "10J" or "10T" (10 jumps, or 10 seconds, respectively)
+	public static int Insert (bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double tvMax, double tcMax, int fall, double weight, string description, double tvAvg, double tcAvg, string tvString, string tcString, int jumps, double time, string limited, string angleString, int simulated )
+	{
+		if(! dbconOpened)
+			dbcon.Open();
+		dbcmd.CommandText = "INSERT INTO " + tableName + 
+				" (uniqueID, personID, sessionID, type, tvMax, tcMax, fall, weight, description, " +
+				"tvAvg, tcAvg, tvString, tcString, jumps, time, limited, angleString, simulated )" +
+				"VALUES (" + uniqueID + ", " +
+				personID + ", " + sessionID + ", '" + type + "', " +
+				Util.ConvertToPoint(tvMax) + ", " + Util.ConvertToPoint(tcMax) + ", '" + 
+				fall + "', '" + Util.ConvertToPoint(weight) + "', '" + description + "', " +
+				Util.ConvertToPoint(tvAvg) + ", " + Util.ConvertToPoint(tcAvg) + ", '" + 
+				Util.ConvertToPoint(tvString) + "', '" + Util.ConvertToPoint(tcString) + "', " +
+				jumps + ", " + Util.ConvertToPoint(time) + ", '" + limited + "', '" + angleString + "', " + simulated +")" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		int myLast = dbcon.LastInsertRowId;
+
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myLast;
+	}
+
+	public static string[] SelectJumps(int sessionID, int personID, string filterWeight) 
+	{
+		string filterPersonString = "";
+		if(personID != -1)
+			filterPersonString = " AND person.uniqueID == " + personID;
+
+		string filterWeightString = "";
+		if(filterWeight == "withWeight")
+			filterWeightString = " AND jumpRj.weight != 0 ";
+
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT person.name, jumpRj.*, personSessionWeight.weight " +
+			" FROM person, jumpRj, personSessionWeight " +
+			" WHERE person.uniqueID == jumpRj.personID" + 
+			" AND jumpRj.sessionID == " + sessionID + 
+			filterPersonString +
+			filterWeightString +
+			" AND personSessionWeight.personID == person.uniqueID " +
+			" AND personSessionWeight.sessionID == jumpRj.sessionID " +
+			" ORDER BY person.uniqueID, jumpRj.uniqueID";
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(2);
+
+		int count = new int();
+		count = 0;
+
+		while(reader.Read()) {
+			myArray.Add (reader[0].ToString() + ":" +	//person.name
+					reader[1].ToString() + ":" +	//jumpRj.uniqueID
+					reader[2].ToString() + ":" + 	//jumpRj.personID
+					reader[3].ToString() + ":" + 	//jumpRj.sessionID
+					reader[4].ToString() + ":" + 	//jumpRj.type
+					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + 	//tvMax
+					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + 	//tcMax
+					reader[7].ToString() + ":" + 	//fall
+					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + 	//weight
+					reader[9].ToString() + ":" + 	//description
+					Util.ChangeDecimalSeparator(reader[10].ToString()) + ":" + 	//tvAvg,
+					Util.ChangeDecimalSeparator(reader[11].ToString()) + ":" + 	//tcAvg,
+					Util.ChangeDecimalSeparator(reader[12].ToString()) + ":" + 	//tvString,
+					Util.ChangeDecimalSeparator(reader[13].ToString()) + ":" + 	//tcString,
+					reader[14].ToString() + ":" + 	//jumps,
+					reader[15].ToString() + ":" + 	//time,
+					reader[16].ToString() + ":" + 	//limited
+					reader[17].ToString() + ":" +	//angleString
+					reader[18].ToString() + ":" +	//simulated
+					reader[19].ToString() 	 	//person.weight
+					);
+			count ++;
+		}
+
+		reader.Close();
+		dbcon.Close();
+
+		string [] myJumps = new string[count];
+		count =0;
+		foreach (string line in myArray) {
+			myJumps [count++] = line;
+		}
+
+		return myJumps;
+	}
+
+	public static JumpRj SelectJumpData(string tableName, int uniqueID)
+	{
+		//tableName is jumpRj or tempJumpRj
+
+		dbcon.Open();
+
+		dbcmd.CommandText = "SELECT * FROM " + tableName + " WHERE uniqueID == " + uniqueID;
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+		reader.Read();
+
+		JumpRj myJump = new JumpRj(DataReaderToStringArray(reader, 18));
+
+		dbcon.Close();
+		return myJump;
+	}
+	
+	public static void Update(int jumpID, int personID, string fall, double weight, string description)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "UPDATE jumpRj SET personID = " + personID + 
+			", fall = " + Util.ConvertToPoint(Convert.ToDouble(fall)) + 
+			", weight = " + Util.ConvertToPoint(weight) + 
+			", description = '" + description +
+			"' WHERE uniqueID == " + jumpID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		dbcon.Close();
+	}
+
+	//checks if there are Rjs with different number of TCs than TFs
+	//then repair database manually, and look if the jump is jumpLimited, and how many jumps there are defined
+	public static void FindBadRjs()
+	{
+		dbcon.Open();
+
+		dbcmd.CommandText = "SELECT uniqueID, tcstring, tvstring, jumps, limited FROM jumpRj";
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+		reader.Read();
+
+		while(reader.Read()) {
+			if(Util.GetNumberOfJumps(reader[1].ToString(), true) != Util.GetNumberOfJumps(reader[2].ToString(), true)) {
+				Log.WriteLine(string.Format("Problem with jumpRj: {0}, tcstring{1}, tvstring{2}, jumps{3}, limited{4}", 
+						reader[0].ToString(), 
+						Util.GetNumberOfJumps(reader[1].ToString(), true).ToString(), 
+						Util.GetNumberOfJumps(reader[2].ToString(), true).ToString(), 
+						reader[3].ToString(), reader[4].ToString()));
+			}
+		}
+		dbcon.Close();
+	}
+
+}
+

Modified: trunk/src/sqlite/main.cs
==============================================================================
--- trunk/src/sqlite/main.cs	(original)
+++ trunk/src/sqlite/main.cs	Thu Jun  5 13:11:19 2008
@@ -47,12 +47,32 @@
 
 	static string connectionString = "version = 3; Data source = " + sqlFile;
 
+	//for conversion
+	static string currentVersion = "";
+	static int conversionRate;
+	static int conversionRateTotal;
+	static int conversionSubRate;
+	static int conversionSubRateTotal;
+
 
 	/*
 	 * Important, change this if there's any update to database
-	 * Important2: if database version get numbers higher than 1, check if the comparisons with myVersion works ok
+	 * Important2: if database version get numbers higher than 1, check if the comparisons with currentVersion works ok
 	 */
-	static string lastChronojumpDatabaseVersion = "0.56";
+	static string lastChronojumpDatabaseVersion = "0.57";
+
+	public Sqlite() {
+	}
+
+	/*
+	public void CreateTable(string tableName) {
+		createTable(tableName);
+	}
+	*/
+	protected virtual void createTable(string tableName) {
+	}
+	
+	~Sqlite() {}
 
 
 	public static void Connect()
@@ -145,20 +165,20 @@
 
 		string myPath = "";
 		string sqliteStr = "";
-		string sqlite3Str = "";
+		//string sqlite3Str = "";
 		string extension = "";
 		try {
 			if(Util.IsWindows()) {
 				myPath = Constants.UtilProgramsWindows;
 				extension = Constants.ExtensionProgramsWindows;
 				sqliteStr = "sqlite.exe";
-				sqlite3Str = "sqlite3.exe";
+				//sqlite3Str = "sqlite3.exe";
 			}
 			else {
 				myPath = Constants.UtilProgramsLinux;
 				extension = Constants.ExtensionProgramsLinux;
 				sqliteStr = "sqlite-2.8.17.bin";
-				sqlite3Str = "sqlite3-3.5.0.bin";
+				//sqlite3Str = "sqlite3-3.5.0.bin";
 			}
 
 			if(File.Exists(myPath + Path.DirectorySeparatorChar + sqliteStr)) 
@@ -205,6 +225,13 @@
 
 	}
 
+	public static string PrintConversionRate() {
+		double toReach = Convert.ToDouble(lastChronojumpDatabaseVersion);
+		return currentVersion + "/" + toReach.ToString() + " " +
+			conversionRate.ToString() + "/" + conversionRateTotal.ToString() + " " +
+			conversionSubRate.ToString() + "/" + conversionSubRateTotal.ToString() + " ";
+	}
+
 	public static bool ConvertToLastChronojumpDBVersion() {
 
 		//if(checkIfIsSqlite2())
@@ -212,23 +239,31 @@
 
 		addChronopicPortNameIfNotExists();
 
-		string myVersion = SqlitePreferences.Select("databaseVersion");
+		//string currentVersion = SqlitePreferences.Select("databaseVersion");
+		currentVersion = SqlitePreferences.Select("databaseVersion");
 
 		//Log.WriteLine("lastDB: {0}", Convert.ToDouble(lastChronojumpDatabaseVersion));
-		//Log.WriteLine("myVersion: {0}", Convert.ToDouble(myVersion));
+		//Log.WriteLine("currentVersion: {0}", Convert.ToDouble(currentVersion));
 
 		bool returnSoftwareIsNew = true; //-1 if there's software is too old for database (moved db to other computer)
-		if(Convert.ToDouble(lastChronojumpDatabaseVersion) == Convert.ToDouble(myVersion))
+		if(Convert.ToDouble(lastChronojumpDatabaseVersion) == Convert.ToDouble(currentVersion))
 			Log.WriteLine("Database is already latest version");
-		else if(Convert.ToDouble(lastChronojumpDatabaseVersion) < Convert.ToDouble(myVersion)) {
+		else if(Convert.ToDouble(lastChronojumpDatabaseVersion) < Convert.ToDouble(currentVersion)) {
 			Log.WriteLine("User database newer than program, need to update software");
 			returnSoftwareIsNew = false;
 		} else {
 			Log.WriteLine("Old database, need to convert");
-			if(myVersion == "0.41") {
+
+			SqliteJumpRj sqliteJumpRjObject = new SqliteJumpRj();
+			SqliteRunInterval sqliteRunIntervalObject = new SqliteRunInterval();
+			SqliteReactionTime sqliteReactionTimeObject = new SqliteReactionTime();
+			SqlitePulse sqlitePulseObject = new SqlitePulse();
+
+			if(currentVersion == "0.41") {
 				dbcon.Open();
 
-				SqlitePulse.createTable();
+				//SqlitePulse.createTable(Constants.PulseTable);
+				sqlitePulseObject.createTable(Constants.PulseTable);
 				SqlitePulseType.createTablePulseType();
 				SqlitePulseType.initializeTablePulseType();
 
@@ -236,71 +271,74 @@
 				Log.WriteLine("Converted DB to 0.42 (added pulse and pulseType tables)");
 
 				dbcon.Close();
-				myVersion = "0.42";
+				currentVersion = "0.42";
 			}
 
-			if(myVersion == "0.42") {
+			if(currentVersion == "0.42") {
 				dbcon.Open();
 				SqlitePulseType.Insert ("Free:-1:-1:free PulseStep mode", true); 
 				SqlitePreferences.Insert ("language", "es-ES"); 
 				SqlitePreferences.Update ("databaseVersion", "0.43", true); 
 				Log.WriteLine("Converted DB to 0.43 (added 'free' pulseType & language peference)");
 				dbcon.Close();
-				myVersion = "0.43";
+				currentVersion = "0.43";
 			}
 
-			if(myVersion == "0.43") {
+			if(currentVersion == "0.43") {
 				dbcon.Open();
 				SqlitePreferences.Insert ("showQIndex", "False"); 
 				SqlitePreferences.Insert ("showDjIndex", "False"); 
 				SqlitePreferences.Update ("databaseVersion", "0.44", true); 
 				Log.WriteLine("Converted DB to 0.44 (added showQIndex, showDjIndex)");
 				dbcon.Close();
-				myVersion = "0.44";
+				currentVersion = "0.44";
 			}
 
-			if(myVersion == "0.44") {
+			if(currentVersion == "0.44") {
 				dbcon.Open();
 				SqlitePreferences.Insert ("allowFinishRjAfterTime", "True"); 
 				SqlitePreferences.Update ("databaseVersion", "0.45", true); 
 				Log.WriteLine("Converted DB to 0.45 (added allowFinishRjAfterTime)");
 				dbcon.Close();
-				myVersion = "0.45";
+				currentVersion = "0.45";
 			}
 
-			if(myVersion == "0.45") {
+			if(currentVersion == "0.45") {
 				dbcon.Open();
 				SqliteJumpType.JumpTypeInsert ("Free:1:0:Free jump", true); 
 				SqlitePreferences.Update ("databaseVersion", "0.46", true); 
 				Log.WriteLine("Added Free jump type");
 				dbcon.Close();
-				myVersion = "0.46";
+				currentVersion = "0.46";
 			}
 
-			if(myVersion == "0.46") {
+			if(currentVersion == "0.46") {
 				dbcon.Open();
 
-				SqliteReactionTime.createTable();
+				//SqliteReactionTime.createTable(Constants.ReactionTimeTable);
+				sqliteReactionTimeObject.createTable(Constants.ReactionTimeTable);
 
 				SqlitePreferences.Update ("databaseVersion", "0.47", true); 
 				Log.WriteLine("Added reaction time table");
 				dbcon.Close();
-				myVersion = "0.47";
+				currentVersion = "0.47";
 			}
 
-			if(myVersion == "0.47") {
+			if(currentVersion == "0.47") {
 				dbcon.Open();
 
-				SqliteJump.rjCreateTable(Constants.TempJumpRjTable);
-				SqliteRun.intervalCreateTable(Constants.TempRunIntervalTable);
+				//SqliteJumpRj.createTable(Constants.TempJumpRjTable);
+				sqliteJumpRjObject.createTable(Constants.TempJumpRjTable);
+				//SqliteRun.intervalCreateTable(Constants.TempRunIntervalTable);
+				sqliteRunIntervalObject.createTable(Constants.TempRunIntervalTable);
 
 				SqlitePreferences.Update ("databaseVersion", "0.48", true); 
 				Log.WriteLine("created tempJumpReactive and tempRunInterval tables");
 				dbcon.Close();
-				myVersion = "0.48";
+				currentVersion = "0.48";
 			}
 
-			if(myVersion == "0.48") {
+			if(currentVersion == "0.48") {
 				dbcon.Open();
 
 				SqliteJumpType.JumpTypeInsert ("Rocket:1:0:Rocket jump", true); 
@@ -318,10 +356,10 @@
 				Log.WriteLine("Added graphLinkTable, added Rocket jump and 5 agility tests: (20Yard, 505, Illinois, Shuttle-Run & ZigZag. Added graphs pof the 5 agility tests)");
 
 				dbcon.Close();
-				myVersion = "0.49";
+				currentVersion = "0.49";
 			}
 
-			if(myVersion == "0.49") {
+			if(currentVersion == "0.49") {
 				dbcon.Open();
 				SqliteJumpType.Update ("SJ+", "SJl"); 
 				SqliteJumpType.Update ("CMJ+", "CJl"); 
@@ -332,20 +370,20 @@
 				SqlitePreferences.Update ("databaseVersion", "0.50", true); 
 				Log.WriteLine("changed SJ+ to SJl, same for CMJ+ and ABK+, added jump and jumpRj graph links");
 				dbcon.Close();
-				myVersion = "0.50";
+				currentVersion = "0.50";
 			}
 
-			if(myVersion == "0.50") {
+			if(currentVersion == "0.50") {
 				dbcon.Open();
 				SqliteRunType.AddGraphLinksRunSimple();	
 				SqliteRunType.AddGraphLinksRunInterval();	
 				SqlitePreferences.Update ("databaseVersion", "0.51", true); 
 				Log.WriteLine("added graphLinks for run simple and interval");
 				dbcon.Close();
-				myVersion = "0.51";
+				currentVersion = "0.51";
 			}
 
-			if(myVersion == "0.51") {
+			if(currentVersion == "0.51") {
 				dbcon.Open();
 				SqliteJumpType.Update ("CJl", "CMJl"); 
 				SqliteEvent.GraphLinkInsert (Constants.JumpTable, "CMJl", "jump_cmj_l.png", true);
@@ -353,10 +391,10 @@
 				SqlitePreferences.Update ("databaseVersion", "0.52", true); 
 				Log.WriteLine("added graphLinks for cmj_l and abk_l, fixed CMJl name");
 				dbcon.Close();
-				myVersion = "0.52";
+				currentVersion = "0.52";
 			}
 			
-			if(myVersion == "0.52") {
+			if(currentVersion == "0.52") {
 				dbcon.Open();
 				SqlitePersonSession.createTable (); 
 				dbcon.Close();
@@ -369,10 +407,10 @@
 				dbcon.Close();
 				
 				Log.WriteLine("created weightSession table. Moved person weight data to weightSession table for each session that has performed");
-				myVersion = "0.53";
+				currentVersion = "0.53";
 			}
 			
-			if(myVersion == "0.53") {
+			if(currentVersion == "0.53") {
 				dbcon.Open();
 
 				SqliteSport.createTable();
@@ -386,9 +424,9 @@
 				dbcon.Close();
 				
 				Log.WriteLine("Created sport tables. Added sport data, speciallity and level of practice to person table");
-				myVersion = "0.54";
+				currentVersion = "0.54";
 			}
-			if(myVersion == "0.54") {
+			if(currentVersion == "0.54") {
 				dbcon.Open();
 
 				SqliteSpeciallity.InsertUndefined(true);
@@ -397,9 +435,9 @@
 				dbcon.Close();
 				
 				Log.WriteLine("Added undefined to speciallity table");
-				myVersion = "0.55";
+				currentVersion = "0.55";
 			}
-			if(myVersion == "0.55") {
+			if(currentVersion == "0.55") {
 				dbcon.Open();
 
 				SqliteSession.convertTableAddingSportStuff();
@@ -408,7 +446,46 @@
 				dbcon.Close();
 				
 				Log.WriteLine("Added session default sport stuff into session table");
-				myVersion = "0.56";
+				currentVersion = "0.56";
+			}
+			if(currentVersion == "0.56") {
+				dbcon.Open();
+
+				ArrayList arraySimulated = new ArrayList(1);
+				arraySimulated.Add("-1");
+				
+				ArrayList arrayAngleAndSimulated = new ArrayList(1);
+				arrayAngleAndSimulated.Add("-1"); //angle
+				arrayAngleAndSimulated.Add("-1"); //simulated
+
+				conversionRateTotal = 7;
+				conversionRate = 1;
+				convertTables(new SqliteJump(), Constants.JumpTable, 9, arrayAngleAndSimulated);
+				conversionRate ++;
+				convertTables(new SqliteJumpRj(), Constants.JumpRjTable, 16, arrayAngleAndSimulated);
+				conversionRate ++;
+				convertTables(new SqliteRun(), Constants.RunTable, 7, arraySimulated);
+				conversionRate ++;
+				convertTables(new SqliteRunInterval(), Constants.RunIntervalTable, 11, arraySimulated);
+				conversionRate ++;
+				convertTables(new SqliteReactionTime(), Constants.ReactionTimeTable, 6, arraySimulated);
+				conversionRate ++;
+				convertTables(new SqlitePulse(), Constants.PulseTable, 8, arraySimulated);
+
+				//reacreate temp tables for have also the simulated column
+				conversionRate ++;
+				Sqlite.dropTable(Constants.TempJumpRjTable);
+				//SqliteJumpRj.createTable(Constants.TempJumpRjTable);
+				sqliteJumpRjObject.createTable(Constants.TempJumpRjTable);
+				Sqlite.dropTable(Constants.TempRunIntervalTable);
+				//SqliteRun.intervalCreateTable(Constants.TempRunIntervalTable);
+				sqliteRunIntervalObject.createTable(Constants.TempRunIntervalTable);
+
+				SqlitePreferences.Update ("databaseVersion", "0.57", true); 
+				dbcon.Close();
+				
+				Log.WriteLine("Added simulated column to each event table on client");
+				currentVersion = "0.57";
 			}
 		}
 
@@ -443,9 +520,14 @@
 		SqliteEvent.createGraphLinkTable();
 	
 		//jumps
-		SqliteJump.createTable();
-		SqliteJump.rjCreateTable(Constants.JumpRjTable);
-		SqliteJump.rjCreateTable(Constants.TempJumpRjTable);
+		SqliteJump sqliteJumpObject = new SqliteJump();
+		SqliteJumpRj sqliteJumpRjObject = new SqliteJumpRj();
+		//SqliteJump.createTable(Constants.JumpTable);
+		//SqliteJumpRj.createTable(Constants.JumpRjTable);
+		//SqliteJumpRj.createTable(Constants.TempJumpRjTable);
+		sqliteJumpObject.createTable(Constants.JumpTable);
+		sqliteJumpRjObject.createTable(Constants.JumpRjTable);
+		sqliteJumpRjObject.createTable(Constants.TempJumpRjTable);
 
 		//jump Types
 		SqliteJumpType.createTableJumpType();
@@ -454,9 +536,14 @@
 		SqliteJumpType.initializeTableJumpRjType();
 		
 		//runs
-		SqliteRun.createTable();
-		SqliteRun.intervalCreateTable(Constants.RunIntervalTable);
-		SqliteRun.intervalCreateTable(Constants.TempRunIntervalTable);
+		SqliteRun sqliteRunObject = new SqliteRun();
+		SqliteRunInterval sqliteRunIntervalObject = new SqliteRunInterval();
+		//SqliteRun.createTable(Constants.RunTable);
+		//SqliteRun.intervalCreateTable(Constants.RunIntervalTable);
+		//SqliteRun.intervalCreateTable(Constants.TempRunIntervalTable);
+		sqliteRunObject.createTable(Constants.RunTable);
+		sqliteRunIntervalObject.createTable(Constants.RunIntervalTable);
+		sqliteRunIntervalObject.createTable(Constants.TempRunIntervalTable);
 		
 		//run Types
 		SqliteRunType.createTableRunType();
@@ -465,10 +552,12 @@
 		SqliteRunType.initializeTableRunIntervalType();
 		
 		//reactionTimes
-		SqliteReactionTime.createTable();
+		SqliteReactionTime sqliteReactionTimeObject = new SqliteReactionTime();
+		sqliteReactionTimeObject.createTable(Constants.ReactionTimeTable);
 		
 		//pulses and pulseTypes
-		SqlitePulse.createTable();
+		SqlitePulse sqlitePulseObject = new SqlitePulse();
+		sqlitePulseObject.createTable(Constants.PulseTable);
 		SqlitePulseType.createTablePulseType();
 		SqlitePulseType.initializeTablePulseType();
 	
@@ -487,6 +576,7 @@
 		SqlitePreferences.initializeTable(lastChronojumpDatabaseVersion);
 		
 		//changes [from - to - desc]
+		//0.56 - 0.57 Added simulated column to each event table on client
 		//0.55 - 0.56 Added session default sport stuff into session table
 		//0.54 - 0.55 Added undefined to speciallity table
 		//0.53 - 0.54 created sport tables. Added sport data, speciallity and level of practice to person table
@@ -576,5 +666,84 @@
 		dbcmd.ExecuteNonQuery();
 	}
 
+	protected internal static void convertTables(Sqlite sqliteObject, string tableName, int columnsBefore, ArrayList columnsToAdd) 
+	{
+		conversionSubRate = 1;
+		conversionSubRateTotal = -1; //unknown yet
+
+		//2st create convert temp table
+		sqliteObject.createTable(Constants.ConvertTempTable);
+
+		//2nd copy all data from event table to temp table adding the simulated column
+		ArrayList myArray = new ArrayList(2);
+		dbcmd.CommandText = "SELECT * " + 
+			"FROM " + tableName + " ORDER BY uniqueID"; 
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
 
+		while(reader.Read()) {
+			string [] myReaderStr = new String[columnsBefore + columnsToAdd.Count];
+			int i;
+			for (i=0; i < columnsBefore; i ++)
+				myReaderStr[i] = reader[i].ToString();
+		
+			//myReaderStr[i] = "-1";
+			foreach (string myStr in columnsToAdd) {
+				myReaderStr[i++] = myStr;
+			}
+	
+			Event myEvent =  new Event();	
+			switch (tableName) {
+				case Constants.JumpTable:
+					myEvent = new Jump(myReaderStr);
+					break;
+				case Constants.JumpRjTable:
+					myEvent = new JumpRj(myReaderStr);
+					break;
+				case Constants.RunTable:
+					myEvent = new Run(myReaderStr);
+					break;
+				case Constants.RunIntervalTable:
+					myEvent = new RunInterval(myReaderStr);
+					break;
+				case Constants.ReactionTimeTable:
+					myEvent = new ReactionTime(myReaderStr);
+					break;
+				case Constants.PulseTable:
+					myEvent = new Pulse(myReaderStr);
+					break;
+			}
+			myArray.Add(myEvent);
+		}
+		reader.Close();
+
+		conversionSubRateTotal = myArray.Count * 2;
+
+		foreach (Event myEvent in myArray) {
+			myEvent.InsertAtDB(true, Constants.ConvertTempTable);
+			conversionSubRate ++;
+		}
+
+		//3rd drop table of event
+		Sqlite.dropTable(tableName);
+
+		//4d create table event (now with simulated column)
+		sqliteObject.createTable(tableName);
+
+		//5th insert data in event table
+		foreach (Event myEvent in myArray) {
+			myEvent.InsertAtDB(true, tableName);
+			conversionSubRate ++;
+		}
+
+		//6th drop temp table
+		Sqlite.dropTable(Constants.ConvertTempTable);
+	}
+	
+	protected static string [] DataReaderToStringArray (SqliteDataReader reader, int columns) {
+		string [] myReaderStr = new String[columns];
+		for (int i=0; i < columns; i ++)
+			myReaderStr[i] = reader[i].ToString();
+		return myReaderStr;
+	}
 }

Modified: trunk/src/sqlite/person.cs
==============================================================================
--- trunk/src/sqlite/person.cs	(original)
+++ trunk/src/sqlite/person.cs	Thu Jun  5 13:11:19 2008
@@ -31,7 +31,7 @@
 
 class SqlitePerson : Sqlite
 {
-	//can be "Constants.PersonTable" or "Constants.TempPersonTable"
+	//can be "Constants.PersonTable" or "Constants.ConvertTempTable"
 	//temp is used to modify table between different database versions if needed
 	protected internal static void createTable(string tableName)
 	 {
@@ -50,7 +50,7 @@
 		dbcmd.ExecuteNonQuery();
 	 }
 
-	//can be "Constants.PersonTable" or "Constants.TempPersonTable"
+	//can be "Constants.PersonTable" or "Constants.ConvertTempTable"
 	//temp is used to modify table between different database versions if needed
 	//public static int Insert(bool dbconOpened, string tableName, string name, string sex, string dateBorn, int height, int weight, int sportID, bool sportUserDefined, int practice, string description)
 	public static int Insert(bool dbconOpened, string tableName, string name, string sex, string dateBorn, int height, int weight, int sportID, int speciallityID, int practice, string description)
@@ -421,13 +421,16 @@
 	{
 	}
 
+	/* 
+	 * don't do more like this, use Sqlite.convertTables()
+	 */
 	//change DB from 0.53 to 0.54	
 	protected internal static void convertTableToSportRelated() 
 	{
 		ArrayList myArray = new ArrayList(2);
 
 		//1st create a temp table
-		createTable(Constants.TempPersonTable);
+		createTable(Constants.ConvertTempTable);
 			
 		//2nd copy all data from person table to temp table
 		dbcmd.CommandText = "SELECT * " + 
@@ -446,7 +449,7 @@
 		reader.Close();
 
 		foreach (Person myPerson in myArray)
-			Insert(true, Constants.TempPersonTable,
+			Insert(true, Constants.ConvertTempTable,
 				myPerson.Name, myPerson.Sex, myPerson.DateBorn, 
 				myPerson.Height, myPerson.Weight, myPerson.SportID, myPerson.SpeciallityID, myPerson.Practice, myPerson.Description);
 
@@ -465,8 +468,7 @@
 
 
 		//6th drop temp table
-		Sqlite.dropTable(Constants.TempPersonTable);
-			
+		Sqlite.dropTable(Constants.ConvertTempTable);
 	}
 	
 	/*

Modified: trunk/src/sqlite/pulse.cs
==============================================================================
--- trunk/src/sqlite/pulse.cs	(original)
+++ trunk/src/sqlite/pulse.cs	Thu Jun  5 13:11:19 2008
@@ -31,14 +31,19 @@
 
 class SqlitePulse : Sqlite
 {
+	public SqlitePulse() {
+	}
+	
+	~SqlitePulse() {}
+
 	/*
 	 * create and initialize tables
 	 */
 	
-	protected internal static void createTable()
+	protected override void createTable(string tableName)
 	{
 		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.PulseTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"personID INT, " +
 			"sessionID INT, " +
@@ -46,7 +51,8 @@
 			"fixedPulse FLOAT, " +
 			"totalPulsesNum INT, " +
 			"timeString TEXT, " +
-			"description TEXT )";		
+			"description TEXT, " +
+			"simulated INT )";		
 		dbcmd.ExecuteNonQuery();
 	}
 	
@@ -55,18 +61,22 @@
 	 * Pulse class methods
 	 */
 	
-	public static int Insert(string uniqueID, int personID, int sessionID, string type, double fixedPulse, int totalPulsesNum, string timeString, string description)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double fixedPulse, int totalPulsesNum, string timeString, string description, int simulated)
 	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO " + Constants.PulseTable + 
-				" (uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timeString, description)" +
+		if(! dbconOpened)
+			dbcon.Open();
+	
+		dbcmd.CommandText = "INSERT INTO " + tableName + 
+				" (uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timeString, description, simulated)" +
 				" VALUES (" + uniqueID + ", " + personID + ", " + sessionID + ", '" + type + "', "
 				+ Util.ConvertToPoint(fixedPulse) + ", " + totalPulsesNum + ", '"
-				+ timeString + "', '" + description + "')" ;
+				+ timeString + "', '" + description + "', " + simulated + ")" ;
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myLast = dbcon.LastInsertRowId;
-		dbcon.Close();
+
+		if(! dbconOpened)
+			dbcon.Close();
 
 		return myLast;
 	}
@@ -102,7 +112,8 @@
 					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + //fixedPulse
 					reader[6].ToString() + ":" + //totalPulsesNum
 					Util.ChangeDecimalSeparator(reader[7].ToString()) + ":" + //timesString
-					reader[8].ToString() + ":"  	//description
+					reader[8].ToString() + ":" +  	//description
+					reader[9].ToString()	  	//simulated
 					);
 			count ++;
 		}
@@ -132,6 +143,8 @@
 		reader = dbcmd.ExecuteReader();
 		reader.Read();
 
+		Pulse myPulse = new Pulse(DataReaderToStringArray(reader, 9));
+		/*
 		Pulse myPulse = new Pulse(
 				Convert.ToInt32(reader[0]),	//uniqueID
 				Convert.ToInt32(reader[1]),	//personID
@@ -140,8 +153,10 @@
 				Convert.ToDouble(Util.ChangeDecimalSeparator(reader[4].ToString())), //fixedPulsel
 				Convert.ToInt32(reader[5]),	//totalPulsesNum
 				reader[6].ToString(),		//timesString
-				reader[7].ToString()		//description
+				reader[7].ToString(),		//description
+				reader[8].ToString()		//simulated
 				);
+				*/
 
 		dbcon.Close();
 		return myPulse;

Modified: trunk/src/sqlite/reactionTime.cs
==============================================================================
--- trunk/src/sqlite/reactionTime.cs	(original)
+++ trunk/src/sqlite/reactionTime.cs	Thu Jun  5 13:11:19 2008
@@ -31,20 +31,26 @@
 
 class SqliteReactionTime : Sqlite
 {
+	public SqliteReactionTime() {
+	}
+	
+	~SqliteReactionTime() {}
+
 	/*
 	 * create and initialize tables
 	 */
 	
-	protected internal static void createTable()
+	protected override void createTable(string tableName)
 	{
 		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.ReactionTimeTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"personID INT, " +
 			"sessionID INT, " +
 			"type TEXT, " + //now all as "default", but in the future...
 			"time FLOAT, " +
-			"description TEXT )";		
+			"description TEXT, " +
+			"simulated INT )";		
 		dbcmd.ExecuteNonQuery();
 	}
 	
@@ -53,18 +59,22 @@
 	 * ReactionTime class methods
 	 */
 	
-	public static int Insert(int personID, int sessionID, string type, double time, string description)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double time, string description, int simulated)
 	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO " + Constants.ReactionTimeTable +  
-				" (uniqueID, personID, sessionID, type, time, description)" +
-				" VALUES (NULL, "
+		if(! dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "INSERT INTO " + tableName +  
+				" (uniqueID, personID, sessionID, type, time, description, simulated)" +
+				" VALUES (" + uniqueID + ", "
 				+ personID + ", " + sessionID + ", '" + type + "', "
-				+ Util.ConvertToPoint(time) + ", '" + description + "')" ;
+				+ Util.ConvertToPoint(time) + ", '" + description + "', " + simulated + ")" ;
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myLast = dbcon.LastInsertRowId;
-		dbcon.Close();
+		
+		if(! dbconOpened)
+			dbcon.Close();
 
 		return myLast;
 	}
@@ -98,7 +108,8 @@
 					reader[3].ToString() + ":" + 	//jump.sessionID
 					reader[4].ToString() + ":" + 	//jump.type
 					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + 	//jump.time
-					reader[6].ToString() 		//description
+					reader[6].ToString() + ":" + 	//description
+					reader[7].ToString()		//simulated
 					);
 			count ++;
 		}
@@ -129,14 +140,18 @@
 		reader = dbcmd.ExecuteReader();
 		reader.Read();
 		
+		ReactionTime myRT = new ReactionTime(DataReaderToStringArray(reader, 7));
+		/*
 		ReactionTime myRT = new ReactionTime(
 				Convert.ToInt32(reader[0]),	//uniqueID
 				Convert.ToInt32(reader[1]),	//personID
 				Convert.ToInt32(reader[2]),	//sessionID
 				//reader[3].ToString(),		//type
 				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[4].ToString()) ),
-				reader[5].ToString() //description
+				reader[5].ToString(),  //description
+				Convert.ToInt32(reader[6]) //simulated
 				);
+				*/
 	
 		dbcon.Close();
 		return myRT;

Modified: trunk/src/sqlite/run.cs
==============================================================================
--- trunk/src/sqlite/run.cs	(original)
+++ trunk/src/sqlite/run.cs	Thu Jun  5 13:11:19 2008
@@ -31,89 +31,56 @@
 
 class SqliteRun : Sqlite
 {
+	public SqliteRun() {
+	}
+	
+	~SqliteRun() {}
+
 	/*
 	 * create and initialize tables
 	 */
 	
-	protected internal static void createTable()
+	protected override void createTable(string tableName)
 	{
 		dbcmd.CommandText = 
-			"CREATE TABLE " + Constants.RunTable + " ( " +
+			"CREATE TABLE " + tableName + " ( " +
 			"uniqueID INTEGER PRIMARY KEY, " +
 			"personID INT, " +
 			"sessionID INT, " +
 			"type TEXT, " +
 			"distance FLOAT, " +
 			"time FLOAT, " +
-			"description TEXT )";		
-		dbcmd.ExecuteNonQuery();
-	}
-	
-	protected internal static void intervalCreateTable(string tableName)
-	{
-		//values: 'runInterval' and 'tempRunInterval'
-
-		dbcmd.CommandText = 
-			"CREATE TABLE " + tableName  +
-			" (uniqueID INTEGER PRIMARY KEY, " +
-			"personID INT, " +
-			"sessionID INT, " +
-			"type TEXT, " +
-			"distanceTotal FLOAT, " +
-			"timeTotal FLOAT, " +
-			"distanceInterval FLOAT, " +
-			"intervalTimesString TEXT, " +
-			"tracks FLOAT, " +	//float because if we limit by time (runType tracksLimited false), we do n.nn tracks
 			"description TEXT, " +
-			"limited TEXT) ";
+			"simulated INT )";
 		dbcmd.ExecuteNonQuery();
 	}
-
+	
 	
 	/*
 	 * Run class methods
 	 */
 	
-	public static int Insert(int personID, int sessionID, string type, double distance, double time, string description)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double distance, double time, string description, int simulated)
 	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO " + Constants.RunTable + 
-				" (uniqueID, personID, sessionID, type, distance, time, description)" +
-				" VALUES (NULL, "
+		if(! dbconOpened)
+			dbcon.Open();
+		dbcmd.CommandText = "INSERT INTO " + tableName + 
+				" (uniqueID, personID, sessionID, type, distance, time, description, simulated)" +
+				" VALUES (" + uniqueID + ", " +
 				+ personID + ", " + sessionID + ", '" + type + "', "
 				+ Util.ConvertToPoint(distance) + ", " + Util.ConvertToPoint(time) + ", '" + 
-				description + "')" ;
+				description + "', " + simulated + ")" ;
 		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myLast = dbcon.LastInsertRowId;
-		dbcon.Close();
 
-		return myLast;
-	}
-	
-	public static int InsertInterval(string tableName, string uniqueID, int personID, int sessionID, string type, double distanceTotal, double timeTotal, double distanceInterval, string intervalTimesString, double tracks, string description, string limited )
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "INSERT INTO "+ tableName + 
-				" (uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, description, limited )" +
-				"VALUES (" + uniqueID + ", " +
-				personID + ", " + sessionID + ", '" + type + "', " +
-				Util.ConvertToPoint(distanceTotal) + ", " + 
-				Util.ConvertToPoint(timeTotal) + ", " + 
-				Util.ConvertToPoint(distanceInterval) + ", '" + 
-				Util.ConvertToPoint(intervalTimesString) + "', " +
-				Util.ConvertToPoint(tracks) + ", '" + 
-				description + "', '" + limited + "')" ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-		int myLast = dbcon.LastInsertRowId;
-
-		dbcon.Close();
+		if(! dbconOpened)
+			dbcon.Close();
 
 		return myLast;
 	}
-
-	public static string[] SelectAllNormalRuns(int sessionID) 
+	
+	public static string[] SelectAllRuns(int sessionID) 
 	{
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT person.name, run.* " +
@@ -143,56 +110,8 @@
 					reader[4].ToString() + ":" + 	//run.type
 					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + //run.distance
 					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + //run.time
-					reader[7].ToString() 		//description
-					);
-			count ++;
-		}
-
-		reader.Close();
-		dbcon.Close();
-
-		string [] myRuns = new string[count];
-		count =0;
-		foreach (string line in myArray) {
-			myRuns [count++] = line;
-		}
-
-		return myRuns;
-	}
-
-	public static string[] SelectAllIntervalRuns(int sessionID) 
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "SELECT person.name, runInterval.* " +
-			" FROM person, runInterval " +
-			" WHERE person.uniqueID == runInterval.personID" + 
-			" AND runInterval.sessionID == " + sessionID + 
-			" ORDER BY person.uniqueID, runInterval.uniqueID";
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-
-		ArrayList myArray = new ArrayList(2);
-
-		int count = new int();
-		count = 0;
-
-		while(reader.Read()) {
-			myArray.Add (reader[0].ToString() + ":" +	//person.name
-					reader[1].ToString() + ":" +	//runInterval.uniqueID
-					reader[2].ToString() + ":" + 	//runInterval.personID
-					reader[3].ToString() + ":" + 	//runInterval.sessionID
-					reader[4].ToString() + ":" + 	//runInterval.type
-					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + //distanceTotal
-					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + //timeTotal
-					Util.ChangeDecimalSeparator(reader[7].ToString()) + ":" + //distanceInterval
-					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + //intervalTimesString
-					Util.ChangeDecimalSeparator(reader[9].ToString()) + ":" + //tracks
-					reader[10].ToString() + ":" + 	//description
-					reader[11].ToString() 	 	//limited
+					reader[7].ToString() + ":" + 	//description
+					reader[8].ToString() 		//simulated
 					);
 			count ++;
 		}
@@ -209,7 +128,7 @@
 		return myRuns;
 	}
 
-	public static Run SelectNormalRunData(int uniqueID)
+	public static Run SelectRunData(int uniqueID)
 	{
 		dbcon.Open();
 
@@ -222,54 +141,13 @@
 		SqliteDataReader reader;
 		reader = dbcmd.ExecuteReader();
 		reader.Read();
-		
-		Run myRun = new Run(
-				Convert.ToInt32(reader[0]),	//uniqueID
-				Convert.ToInt32(reader[1]),	//personID
-				Convert.ToInt32(reader[2]),	//sessionID
-				reader[3].ToString(),		//type
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[4].ToString()) ),
-				Convert.ToDouble( Util.ChangeDecimalSeparator(reader[5].ToString()) ),
-				reader[6].ToString() //description
-				);
+	
+		Run myRun = new Run(DataReaderToStringArray(reader, 8));
 	
 		dbcon.Close();
 		return myRun;
 	}
 		
-	public static RunInterval SelectIntervalRunData(string tableName, int uniqueID)
-	{
-		//tableName can be runInterval or tempRunInterval
-
-		dbcon.Open();
-
-		dbcmd.CommandText = "SELECT * FROM " + tableName + " WHERE uniqueID == " + uniqueID;
-		
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-
-		SqliteDataReader reader;
-		reader = dbcmd.ExecuteReader();
-		reader.Read();
-
-		RunInterval myRun = new RunInterval(
-				Convert.ToInt32(reader[0]),	//uniqueID
-				Convert.ToInt32(reader[1]),	//personID
-				Convert.ToInt32(reader[2]),	//sessionID
-				reader[3].ToString(),		//type
-				Convert.ToDouble(Util.ChangeDecimalSeparator(reader[4].ToString())), //distanceTotal
-				Convert.ToDouble(Util.ChangeDecimalSeparator(reader[5].ToString())), //timeTotal
-				Convert.ToDouble(Util.ChangeDecimalSeparator(reader[6].ToString())), //distanceInterval
-				Util.ChangeDecimalSeparator(reader[7].ToString()),	//intervalTimesString
-				Convert.ToDouble(Util.ChangeDecimalSeparator(reader[8].ToString())), //tracks
-				reader[9].ToString(), 		//description
-				reader[10].ToString() 		//limited
-				);
-
-		dbcon.Close();
-		return myRun;
-	}
-
 	public static void Update(int runID, string type, string distance, string time, int personID, string description)
 	{
 		dbcon.Open();
@@ -285,18 +163,6 @@
 		dbcon.Close();
 	}
 
-	public static void IntervalUpdate(int runID, int personID, string description)
-	{
-		dbcon.Open();
-		dbcmd.CommandText = "UPDATE " + Constants.RunIntervalTable +
-			" SET personID = " + personID + 
-			", description = '" + description +
-			"' WHERE uniqueID == " + runID ;
-		Log.WriteLine(dbcmd.CommandText.ToString());
-		dbcmd.ExecuteNonQuery();
-		dbcon.Close();
-	}
-
 	public static void Delete(string runTable, string uniqueID)
 	{
 		dbcon.Open();
@@ -307,3 +173,4 @@
 		dbcon.Close();
 	}
 }
+

Added: trunk/src/sqlite/runInterval.cs
==============================================================================
--- (empty file)
+++ trunk/src/sqlite/runInterval.cs	Thu Jun  5 13:11:19 2008
@@ -0,0 +1,169 @@
+/*
+ * 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.IO;
+using System.Collections; //ArrayList
+//using Mono.Data.SqliteClient;
+//using System.Data.SqlClient;
+using Mono.Data.Sqlite;
+//using System.Data.SQLite;
+
+
+class SqliteRunInterval : SqliteRun
+{
+	public SqliteRunInterval() {
+	}
+	
+	~SqliteRunInterval() {}
+
+	protected override void createTable(string tableName)
+	{
+		//values: 'runInterval' and 'tempRunInterval'
+
+		dbcmd.CommandText = 
+			"CREATE TABLE " + tableName  +
+			" (uniqueID INTEGER PRIMARY KEY, " +
+			"personID INT, " +
+			"sessionID INT, " +
+			"type TEXT, " +
+			"distanceTotal FLOAT, " +
+			"timeTotal FLOAT, " +
+			"distanceInterval FLOAT, " +
+			"intervalTimesString TEXT, " +
+			"tracks FLOAT, " +	//float because if we limit by time (runType tracksLimited false), we do n.nn tracks
+			"description TEXT, " +
+			"limited TEXT, " +
+			"simulated INT )";
+		dbcmd.ExecuteNonQuery();
+	}
+
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double distanceTotal, double timeTotal, double distanceInterval, string intervalTimesString, double tracks, string description, string limited, int simulated )
+	{
+		if(! dbconOpened)
+			dbcon.Open();
+
+		dbcmd.CommandText = "INSERT INTO "+ tableName + 
+				" (uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, description, limited, simulated )" +
+				"VALUES (" + uniqueID + ", " +
+				personID + ", " + sessionID + ", '" + type + "', " +
+				Util.ConvertToPoint(distanceTotal) + ", " + 
+				Util.ConvertToPoint(timeTotal) + ", " + 
+				Util.ConvertToPoint(distanceInterval) + ", '" + 
+				Util.ConvertToPoint(intervalTimesString) + "', " +
+				Util.ConvertToPoint(tracks) + ", '" + 
+				description + "', '" + limited + "', " + simulated + ")" ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		int myLast = dbcon.LastInsertRowId;
+
+		if(! dbconOpened)
+			dbcon.Close();
+
+		return myLast;
+	}
+
+	public static string[] SelectAllRuns(int sessionID) 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT person.name, runInterval.* " +
+			" FROM person, runInterval " +
+			" WHERE person.uniqueID == runInterval.personID" + 
+			" AND runInterval.sessionID == " + sessionID + 
+			" ORDER BY person.uniqueID, runInterval.uniqueID";
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(2);
+
+		int count = new int();
+		count = 0;
+
+		while(reader.Read()) {
+			myArray.Add (reader[0].ToString() + ":" +	//person.name
+					reader[1].ToString() + ":" +	//runInterval.uniqueID
+					reader[2].ToString() + ":" + 	//runInterval.personID
+					reader[3].ToString() + ":" + 	//runInterval.sessionID
+					reader[4].ToString() + ":" + 	//runInterval.type
+					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + //distanceTotal
+					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + //timeTotal
+					Util.ChangeDecimalSeparator(reader[7].ToString()) + ":" + //distanceInterval
+					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + //intervalTimesString
+					Util.ChangeDecimalSeparator(reader[9].ToString()) + ":" + //tracks
+					reader[10].ToString() + ":" + 	//description
+					reader[11].ToString() + ":" +  	//limited
+					reader[12].ToString() 	 	//simulated
+					);
+			count ++;
+		}
+
+		reader.Close();
+		dbcon.Close();
+
+		string [] myRuns = new string[count];
+		count =0;
+		foreach (string line in myArray) {
+			myRuns [count++] = line;
+		}
+
+		return myRuns;
+	}
+
+	public static RunInterval SelectRunData(string tableName, int uniqueID)
+	{
+		//tableName can be runInterval or tempRunInterval
+
+		dbcon.Open();
+
+		dbcmd.CommandText = "SELECT * FROM " + tableName + " WHERE uniqueID == " + uniqueID;
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+		reader.Read();
+
+		RunInterval myRun = new RunInterval(DataReaderToStringArray(reader, 12));
+
+		dbcon.Close();
+		return myRun;
+	}
+
+	public static void Update(int runID, int personID, string description)
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "UPDATE " + Constants.RunIntervalTable +
+			" SET personID = " + personID + 
+			", description = '" + description +
+			"' WHERE uniqueID == " + runID ;
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		dbcon.Close();
+	}
+
+
+}

Modified: trunk/src/sqlite/session.cs
==============================================================================
--- trunk/src/sqlite/session.cs	(original)
+++ trunk/src/sqlite/session.cs	Thu Jun  5 13:11:19 2008
@@ -32,7 +32,7 @@
 
 class SqliteSession : Sqlite
 {
-	//can be "Constants.SessionTable" or "Constants.TempSessionTable"
+	//can be "Constants.SessionTable" or "Constants.ConvertTempTable"
 	//temp is used to modify table between different database versions if needed
 	protected internal static void createTable(string tableName)
 	{
@@ -454,13 +454,16 @@
 		}
 	}
 
+	/* 
+	 * don't do more like this, use Sqlite.convertTables()
+	 */
 	//change DB from 0.55 to 0.56
 	protected internal static void convertTableAddingSportStuff() 
 	{
 		ArrayList myArray = new ArrayList(2);
 
 		//1st create a temp table
-		createTable(Constants.TempSessionTable);
+		createTable(Constants.ConvertTempTable);
 			
 		//2nd copy all data from session table to temp table
 		dbcmd.CommandText = "SELECT * " + 
@@ -479,7 +482,7 @@
 		reader.Close();
 
 		foreach (Session mySession in myArray)
-			Insert(true, Constants.TempSessionTable,
+			Insert(true, Constants.ConvertTempTable,
 				mySession.Name, mySession.Place, mySession.Date, 
 				mySession.PersonsSportID, mySession.PersonsSpeciallityID, mySession.PersonsPractice, mySession.Comments);
 
@@ -497,7 +500,7 @@
 
 
 		//6th drop temp table
-		Sqlite.dropTable(Constants.TempSessionTable);
+		Sqlite.dropTable(Constants.ConvertTempTable);
 	}
 	
 

Modified: trunk/src/treeViewJump.cs
==============================================================================
--- trunk/src/treeViewJump.cs	(original)
+++ trunk/src/treeViewJump.cs	Thu Jun  5 13:11:19 2008
@@ -148,6 +148,7 @@
 		myJump.Tc = Convert.ToDouble(myStringOfData[6].ToString());
 		myJump.Fall = Convert.ToInt32(myStringOfData[7].ToString());
 		myJump.Description = myStringOfData[9].ToString();
+		myJump.Simulated = Convert.ToInt32(myStringOfData[10].ToString());
 
 		//we create the jump with a weight of percent or kk
 		if(weightPercentPreferred)
@@ -163,9 +164,14 @@
 	{
 		Jump newJump = (Jump)myObject;
 
+		string title = newJump.Type;
+		if(newJump.Simulated == 1)
+			title += " (s)";
+
 		string [] myData = new String [getColsNum()];
 		int count = 0;
-		myData[count++] = newJump.Type;
+		//myData[count++] = newJump.Type;
+		myData[count++] = title;
 		myData[count++] = Util.TrimDecimals(newJump.Tc.ToString(), pDN);
 		myData[count++] = Util.TrimDecimals(newJump.Tv.ToString(), pDN);
 		
@@ -231,6 +237,7 @@
 		myJumpRj.TcString = myStringOfData[13].ToString();
 		myJumpRj.Limited = myStringOfData[16].ToString();
 		myJumpRj.Description = myStringOfData[9].ToString();
+		myJumpRj.Simulated = Convert.ToInt32(myStringOfData[17].ToString());
 		
 		//we create the jump with a weight of percent or kk
 		if(weightPercentPreferred)
@@ -245,7 +252,11 @@
 	{
 		JumpRj newJumpRj = (JumpRj)myObject;
 
-		string myTypeComplet = newJumpRj.Type + "(" + Util.GetLimitedRounded(newJumpRj.Limited, pDN) + ")";
+		string title = newJumpRj.Type;
+		if(newJumpRj.Simulated == 1)
+			title += " (s) ";
+
+		string myTypeComplet = title + "(" + Util.GetLimitedRounded(newJumpRj.Limited, pDN) + ")";
 		
 		string [] myData = new String [getColsNum()];
 		int count = 0;

Modified: trunk/src/treeViewPulse.cs
==============================================================================
--- trunk/src/treeViewPulse.cs	(original)
+++ trunk/src/treeViewPulse.cs	Thu Jun  5 13:11:19 2008
@@ -62,6 +62,7 @@
 		myPulse.FixedPulse = Convert.ToDouble(myStringOfData[5].ToString());
 		myPulse.TimesString = myStringOfData[7].ToString();
 		myPulse.Description = myStringOfData[8].ToString();
+		myPulse.Simulated = Convert.ToInt32(myStringOfData[9].ToString());
 
 		return myPulse;
 	}
@@ -71,11 +72,13 @@
 		Pulse newPulse = (Pulse)myObject;
 		
 		//if fixedPulse is not defined, comparate each pulse with the averave
-		string myTypeComplet ="";
-		if(newPulse.FixedPulse == -1) 
-			myTypeComplet = newPulse.Type;
-		else
-			myTypeComplet = newPulse.Type + "(" + Util.TrimDecimals(newPulse.FixedPulse.ToString(), 3) + ")";
+		string myTypeComplet = newPulse.Type;
+		
+		if(newPulse.Simulated == 1)
+			myTypeComplet += " (s) ";
+		
+		if(newPulse.FixedPulse != -1) 
+			myTypeComplet += "(" + Util.TrimDecimals(newPulse.FixedPulse.ToString(), 3) + ")";
 		
 		
 		string [] myData = new String [getColsNum()];

Modified: trunk/src/treeViewReactionTime.cs
==============================================================================
--- trunk/src/treeViewReactionTime.cs	(original)
+++ trunk/src/treeViewReactionTime.cs	Thu Jun  5 13:11:19 2008
@@ -63,6 +63,7 @@
 		myReactionTime.UniqueID = Convert.ToInt32(myStringOfData[1].ToString()); 
 		myReactionTime.Time = Convert.ToDouble(myStringOfData[5].ToString());
 		myReactionTime.Description = myStringOfData[6].ToString();
+		myReactionTime.Simulated = Convert.ToInt32(myStringOfData[7].ToString());
 
 		return myReactionTime;
 	}
@@ -71,10 +72,14 @@
 	{
 		ReactionTime newReactionTime = (ReactionTime)myObject;
 
+		string title = "";
+		if(newReactionTime.Simulated == 1)
+			title += " (s) ";
+
 		string [] myData = new String [getColsNum()];
 		int count = 0;
 		//myData[count++] = newReactionTime.Type;
-		myData[count++] = "";
+		myData[count++] = title;
 		myData[count++] = Util.TrimDecimals(newReactionTime.Time.ToString(), pDN);
 		
 		myData[count++] = newReactionTime.Description;

Modified: trunk/src/treeViewRun.cs
==============================================================================
--- trunk/src/treeViewRun.cs	(original)
+++ trunk/src/treeViewRun.cs	Thu Jun  5 13:11:19 2008
@@ -71,6 +71,7 @@
 		myRun.Distance = Convert.ToDouble(myStringOfData[5].ToString());
 		myRun.Time = Convert.ToDouble(myStringOfData[6].ToString());
 		myRun.Description = myStringOfData[7].ToString();
+		myRun.Simulated = Convert.ToInt32(myStringOfData[8].ToString());
 		//speed is not needed to define
 
 		return myRun;
@@ -80,9 +81,13 @@
 	{
 		Run newRun = (Run)myObject;
 
+		string title = newRun.Type;
+		if(newRun.Simulated == 1)
+			title += " (s)";
+
 		string [] myData = new String [getColsNum()];
 		int count = 0;
-		myData[count++] = newRun.Type;
+		myData[count++] = title;
 		//myData[count++] = Util.TrimDecimals(newRun.Speed.ToString(), pDN); this doesn't know the metersSecondsPreferred
 		myData[count++] = Util.TrimDecimals(Util.GetSpeed(
 					newRun.Distance.ToString(),
@@ -139,6 +144,7 @@
 		myRunI.IntervalTimesString = myStringOfData[8].ToString();
 		myRunI.Limited = myStringOfData[11].ToString();
 		myRunI.Description = myStringOfData[10].ToString();
+		myRunI.Simulated = Convert.ToInt32(myStringOfData[12].ToString());
 		//speed is not needed to define
 		
 		return myRunI;
@@ -148,7 +154,11 @@
 	{
 		RunInterval newRunI = (RunInterval)myObject;
 		
-		string myTypeComplet = newRunI.Type + "(" + newRunI.DistanceInterval + "x" + Util.GetLimitedRounded(newRunI.Limited, pDN) + ")";
+		string title = newRunI.Type;
+		if(newRunI.Simulated == 1)
+			title += " (s) ";
+
+		string myTypeComplet = title + "(" + newRunI.DistanceInterval + "x" + Util.GetLimitedRounded(newRunI.Limited, pDN) + ")";
 		
 		string [] myData = new String [getColsNum()];
 		int count = 0;

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Thu Jun  5 13:11:19 2008
@@ -1 +1 @@
-0.7.2
+0.7.3



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