[chronojump] v. 0.8.17, db: 0.76 fixed 607015 - jump extra weight and fall height should have decimals (also Rj)



commit 79539219742398d548d440068b1949b20bdb85b2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Feb 23 16:41:43 2010 +0800

    v. 0.8.17, db: 0.76
    fixed 607015 -  jump extra weight and fall height should have decimals (also Rj)
    server query result with TrimDecimals

 Makefile.win32                              |    4 +-
 chronojump_server/bin/chronojumpServer.dll  |  Bin 275456 -> 275456 bytes
 chronojump_server/chronojumpServerCSharp.cs |    2 +-
 configure.ac                                |    2 +-
 glade/chronojump.glade                      |  133 +++++++++++++--------------
 images/chronojump_320.png                   |  Bin 32313 -> 28418 bytes
 sqlite_diagrams/chronojump_sqlite.dia       |  Bin 10897 -> 10942 bytes
 sqlite_diagrams/chronojump_sqlite.png       |  Bin 274424 -> 274981 bytes
 src/Makefile.am                             |    4 +-
 src/chronojump.cs                           |    8 +-
 src/constants.cs                            |    6 +-
 src/execute/jump.cs                         |    6 +-
 src/gui/chronojump.cs                       |    6 +-
 src/gui/jump.cs                             |   16 ++--
 src/gui/person.cs                           |    2 -
 src/gui/queryServer.cs                      |   12 ++-
 src/jump.cs                                 |   12 +-
 src/sqlite/jump.cs                          |    8 +-
 src/sqlite/jumpRj.cs                        |    9 +-
 src/sqlite/main.cs                          |   27 +++++-
 src/sqlite/person.cs                        |    2 +-
 src/sqlite/personSession.cs                 |    5 -
 src/sqlite/stat.cs                          |    5 +-
 src/treeViewJump.cs                         |    8 +-
 24 files changed, 150 insertions(+), 127 deletions(-)
---
diff --git a/Makefile.win32 b/Makefile.win32
index 83f75db..46e08c9 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -238,7 +238,9 @@ CHRONOJUMP_RESOURCES =  \
 	-resource:../images/gtk-zoom-in-with-text.png,gtk-zoom-in-with-text.png \
 	-resource:../images/chronojump_320.png,chronojump_320.png \
 	-resource:../images/calendar.png,calendar.png \
-	-resource:../images/chronojump_logo.png,chronojump_logo.png
+	-resource:../images/chronojump_logo.png,chronojump_logo.png \
+	-resource:../images/chronojump-boscosystem.png,chronojump-boscosystem.png \
+	-resource:../images/chronojump-boscosystem_320.png,chronojump-boscosystem_320.png
 
 CHRONOJUMP_REFERENCES = \
 	-pkg:glade-sharp-2.0 \
diff --git a/chronojump_server/bin/chronojumpServer.dll b/chronojump_server/bin/chronojumpServer.dll
index cdf632e..d00d019 100755
Binary files a/chronojump_server/bin/chronojumpServer.dll and b/chronojump_server/bin/chronojumpServer.dll differ
diff --git a/chronojump_server/chronojumpServerCSharp.cs b/chronojump_server/chronojumpServerCSharp.cs
index de399d0..6bfc0cb 100755
--- a/chronojump_server/chronojumpServerCSharp.cs
+++ b/chronojump_server/chronojumpServerCSharp.cs
@@ -86,7 +86,7 @@ public class ChronojumpServer {
 		else 
 			return false; //"for if the flyes"
 
-		if(action == Constants.ServerActionUploadSession && cv >= new Version(0,8,16))
+		if(action == Constants.ServerActionUploadSession && cv >= new Version(0,8,17))
 			return true;
 		else if(action == Constants.ServerActionStats && cv >= new Version(0,8))
 			return true;
diff --git a/configure.ac b/configure.ac
index c0666f6..a0368a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl Warning: This is an automatically generated file, do not edit!
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.54])
-AC_INIT([chronojump], [0.8.16])
+AC_INIT([chronojump], [0.8.17])
 AM_INIT_AUTOMAKE([foreign])
 
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 328e5ee..30f5ad5 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -2110,6 +2110,7 @@ weight</property>
                 <property name="can_focus">True</property>
                 <property name="adjustment">10 0 200 1 10 0</property>
                 <property name="climb_rate">1</property>
+                <property name="digits">1</property>
                 <property name="numeric">True</property>
               </widget>
               <packing>
@@ -2127,6 +2128,7 @@ weight</property>
                 <property name="can_focus">True</property>
                 <property name="adjustment">20 0 200 1 10 0</property>
                 <property name="climb_rate">1</property>
+                <property name="digits">1</property>
                 <property name="numeric">True</property>
               </widget>
               <packing>
@@ -2165,6 +2167,7 @@ weight</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="adjustment">10 1 100 1 10 0</property>
+                <property name="digits">1</property>
                 <property name="snap_to_ticks">True</property>
                 <property name="numeric">True</property>
                 <property name="wrap">True</property>
@@ -13322,6 +13325,7 @@ comments</property>
     <child>
       <widget class="GtkVBox" id="vbox120">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <child>
           <widget class="GtkImage" id="image_logo">
             <property name="visible">True</property>
@@ -17776,95 +17780,88 @@ by you</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label197">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">&lt;b&gt;persons&lt;/b&gt;</property>
-                            <property name="use_markup">True</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkAlignment" id="alignment_image_test">
-                        <property name="visible">True</property>
-                        <property name="top_padding">6</property>
-                        <property name="bottom_padding">4</property>
-                        <child>
-                          <widget class="GtkVBox" id="vbox_image_test">
-                            <property name="visible">True</property>
-                            <child>
-                              <widget class="GtkHBox" id="hbox230">
-                                <property name="visible">True</property>
-                                <child>
-                                  <widget class="GtkLabel" id="label_image_test">
-                                    <property name="visible">True</property>
-                                    <property name="use_markup">True</property>
-                                    <property name="ellipsize">end</property>
-                                    <property name="width_chars">15</property>
-                                  </widget>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
-                                  </packing>
-                                </child>
                                 <child>
-                                  <widget class="GtkAlignment" id="alignment106">
+                                  <widget class="GtkVBox" id="vbox_image_test">
                                     <property name="visible">True</property>
-                                    <property name="xalign">1</property>
+                                    <property name="orientation">vertical</property>
                                     <child>
-                                      <widget class="GtkButton" id="button_image_test_zoom">
+                                      <widget class="GtkHBox" id="hbox230">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">False</property>
-                                        <property name="tooltip" translatable="yes">Expand image and show description</property>
-                                        <signal name="clicked" handler="on_button_image_test_zoom_clicked"/>
                                         <child>
-                                          <widget class="GtkImage" id="image_test_zoom">
+                                          <widget class="GtkLabel" id="label_image_test">
                                             <property name="visible">True</property>
+                                            <property name="use_markup">True</property>
+                                            <property name="ellipsize">end</property>
+                                            <property name="width_chars">15</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkAlignment" id="alignment106">
+                                            <property name="visible">True</property>
+                                            <property name="xalign">1</property>
+                                            <child>
+                                              <widget class="GtkButton" id="button_image_test_zoom">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <property name="has_tooltip">True</property>
+                                                <signal name="clicked" handler="on_button_image_test_zoom_clicked"/>
+                                                <child>
+                                                  <widget class="GtkImage" id="image_test_zoom">
+                                                    <property name="visible">True</property>
+                                                  </widget>
+                                                </child>
+                                              </widget>
+                                            </child>
                                           </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="pack_type">end</property>
+                                            <property name="position">1</property>
+                                          </packing>
                                         </child>
                                       </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkImage" id="image_test">
+                                        <property name="visible">True</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="position">1</property>
+                                      </packing>
                                     </child>
                                   </widget>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="pack_type">end</property>
-                                    <property name="position">1</property>
+                                    <property name="position">2</property>
                                   </packing>
                                 </child>
                               </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkImage" id="image_test">
-                                <property name="visible">True</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="position">1</property>
-                              </packing>
                             </child>
                           </widget>
                         </child>
+                        <child>
+                          <widget class="GtkLabel" id="label197">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;persons&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="type">label_item</property>
+                          </packing>
+                        </child>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
+                        <property name="position">0</property>
                       </packing>
                     </child>
                   </widget>
diff --git a/images/chronojump_320.png b/images/chronojump_320.png
index 2b5b9f1..55a730d 100644
Binary files a/images/chronojump_320.png and b/images/chronojump_320.png differ
diff --git a/sqlite_diagrams/chronojump_sqlite.dia b/sqlite_diagrams/chronojump_sqlite.dia
index 722228e..76b3ac2 100644
Binary files a/sqlite_diagrams/chronojump_sqlite.dia and b/sqlite_diagrams/chronojump_sqlite.dia differ
diff --git a/sqlite_diagrams/chronojump_sqlite.png b/sqlite_diagrams/chronojump_sqlite.png
index d19ddcc..3b8a26d 100644
Binary files a/sqlite_diagrams/chronojump_sqlite.png and b/sqlite_diagrams/chronojump_sqlite.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index 3a893ba..2fe84a2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -292,7 +292,9 @@ RESOURCES = \
 	../images/gtk-zoom-in-with-text.png,gtk-zoom-in-with-text.png \
 	../images/chronojump_320.png,chronojump_320.png \
 	../images/calendar.png,calendar.png \
-	../images/chronojump_logo.png,chronojump_logo.png 
+	../images/chronojump_logo.png,chronojump_logo.png \
+	../images/chronojump-boscosystem.png,chronojump-boscosystem.png \
+	../images/chronojump-boscosystem_320.png,chronojump-boscosystem_320.png 
 
 
 EXTRAS = \
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 212882a..3fbc480 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -230,7 +230,7 @@ Log.WriteLine("doing backup");
 
 			if(Sqlite.ChangeDjToDJna())
 				messageToShowOnBoot += Catalog.GetString("All DJ jumps have been renamed as 'DJna' (Drop Jumps with No Arms).") + "\n\n"+ 
-					Catalog.GetString("If your Drop Jumps were executed using the arms, please rename them manually as 'DJa'.");
+					Catalog.GetString("If your Drop Jumps were executed using the arms, please rename them manually as 'DJa'.") + "\n";
 
 			bool softwareIsNew = Sqlite.ConvertToLastChronojumpDBVersion();
 			updatingDB = false;
@@ -282,7 +282,8 @@ Log.WriteLine("doing backup");
 		}
 
 		string versionAvailableKnown = SqlitePreferences.Select("versionAvailable");
-		if( versionAvailable != Constants.ServerOffline && versionAvailable != progVersion ) {
+		//if( versionAvailable != Constants.ServerOffline && versionAvailable != progVersion ) {
+		if( versionAvailable != Constants.ServerOffline && new Version(versionAvailable) > new Version(progVersion) ) {
 			//check if available version is higher than known available version
 			Version versionAvailableAsV = new Version(versionAvailable);
 
@@ -311,7 +312,8 @@ Log.WriteLine("doing backup");
 
 		//if chronojump chrashed before
 		if(crashedBefore) {
-			if( versionAvailableKnown.Length > 0 && versionAvailableKnown != progVersion ) 
+			//if( versionAvailableKnown.Length > 0 && versionAvailableKnown != progVersion ) 
+			if( versionAvailableKnown.Length > 0 && new Version(versionAvailableKnown) > new Version(progVersion) ) 
 				messageToShowOnBoot += "\n" + Catalog.GetString("Chronojump crashed before.") + "\n" +
 				       Catalog.GetString("Please, update to new version: ") + versionAvailableKnown + "\n";
 			else
diff --git a/src/constants.cs b/src/constants.cs
index ec9d248..55793d0 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -231,8 +231,10 @@ public class Constants
 	public static string AllPulsesName = Catalog.GetString("See all pulses");
 
 	//fileNames
-	public static string FileNameLogo = "chronojump_logo.png";
-	public static string FileNameLogo320 = "chronojump_320.png";
+	//public static string FileNameLogo = "chronojump_logo.png";
+	//public static string FileNameLogo320 = "chronojump_320.png";
+	public static string FileNameLogo = "chronojump-boscosystem.png";
+	public static string FileNameLogo320 = "chronojump-boscosystem_320.png";
 	public static string FileNameCSS = "report_web_style.css";
 	public static string FileNameIcon = "chronojump_icon.png";
 	public static string FileNameIconGraph = "chronojump_icon_graph.png";
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index e9af6b4..87cf66f 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -30,7 +30,7 @@ public class JumpExecute : EventExecute
 {
 	protected double tv;
 	protected double tc;
-	protected int fall;
+	protected double fall;
 	protected double weight; //always write in % (not kg or %) then sqlite can do avgs
 
 	//for not checking always in database
@@ -48,7 +48,7 @@ public class JumpExecute : EventExecute
 	}
 
 	//jump execution
-	public JumpExecute(EventExecuteWindow eventExecuteWin, int personID, string personName, int sessionID, string type, int fall, double weight,  
+	public JumpExecute(EventExecuteWindow eventExecuteWin, int personID, string personName, int sessionID, string type, double fall, double weight,  
 			Chronopic cp, Gtk.Statusbar appbar, Gtk.Window app, int pDN, bool volumeOn)
 	{
 		this.eventExecuteWin = eventExecuteWin;
@@ -449,7 +449,7 @@ public class JumpRjExecute : JumpExecute
 
 	//jump execution
 	public JumpRjExecute(EventExecuteWindow eventExecuteWin, int personID, string personName, 
-			int sessionID, string type, int fall, double weight, 
+			int sessionID, string type, double fall, double weight, 
 			double limitAsDouble, bool jumpsLimited, 
 			Chronopic cp, Gtk.Statusbar appbar, Gtk.Window app, int pDN, bool allowFinishAfterTime, 
 			bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin)
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index cbc3e3c..209d374 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -853,7 +853,7 @@ public class ChronoJumpWindow
 	
 	private void on_menuitem_server_query_activate (object o, EventArgs args) {
 		if(connectedAndCanI(Constants.ServerActionQuery)) 
-			queryServerWin = QueryServerWindow.Show();
+			queryServerWin = QueryServerWindow.Show(prefsDigitsNumber);
 	}
 	
 	private void on_menuitem_server_ping (object o, EventArgs args) {
@@ -2891,7 +2891,7 @@ Console.WriteLine("X");
 				jumpWeight = Util.WeightFromKgToPercent(jumpExtraWin.Weight, currentPerson.Weight);
 			}
 		}
-		int myFall = 0;
+		double myFall = 0;
 		bool arms = false;
 		if(currentJumpType.Name == Constants.TakeOffName || currentJumpType.Name == Constants.TakeOffWeightName)
 			myFall = 0;
@@ -3096,7 +3096,7 @@ Console.WriteLine("X");
 				jumpWeight = Util.WeightFromKgToPercent(jumpExtraWin.Weight, currentPerson.Weight);
 			}
 		}
-		int myFall = 0;
+		double myFall = 0;
 		if( ! currentJumpType.StartIn || currentJumpType.Name	== Constants.RunAnalysisName)
 			myFall = jumpExtraWin.Fall;
 			
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 4563691..2c32d27 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -795,14 +795,14 @@ public class JumpExtraWindow
 	
 	//for RunAnalysis
 	//but will be used and recorded with "fall"
-	static int distance;
+	static double distance;
 
 	static string option = "Kg";
 	static double limited = 10;
 	static bool jumpsLimited;
-	static int weight = 20;
+	static double weight = 20;
 	static bool arms = false;
-	static int fall = 20;
+	static double fall = 20;
 	
 	static JumpExtraWindow JumpExtraWindowBox;
 	Gtk.Window parent;
@@ -923,9 +923,9 @@ public class JumpExtraWindow
 	void on_button_accept_clicked (object o, EventArgs args)
 	{
 		limited = (double) spinbutton_limit.Value;
-		weight = (int) spinbutton_weight.Value;
-		fall = (int) spinbutton_fall.Value;
-		distance = (int) spinbutton_fall.Value;
+		weight = (double) spinbutton_weight.Value;
+		fall = (double) spinbutton_fall.Value;
+		distance = (double) spinbutton_fall.Value;
 		arms = check_dj_arms.Active;
 		
 		JumpExtraWindowBox.jump_extra.Hide();
@@ -972,7 +972,7 @@ public class JumpExtraWindow
 		}
 	}
 	
-	public int Weight {
+	public double Weight {
 		get { return weight; }
 	}
 	
@@ -980,7 +980,7 @@ public class JumpExtraWindow
 		get { return arms; }
 	}
 
-	public int Fall {
+	public double Fall {
 		get { return fall; }
 	}
 }
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 42bd9a4..55bc52f 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -1119,14 +1119,12 @@ public class PersonAddModifyWindow
 			else
 				label_date.Text = dateTime.ToLongDateString();
 
-			Log.WriteLine("jjjjjjjjjjjjjjjjjjjjjj");
 Log.WriteLine(myPerson.Height.ToString());
 Log.WriteLine(myPerson.Weight.ToString());
 			spinbutton_height.Value = myPerson.Height;
 			spinbutton_weight.Value = myPerson.Weight;
 Log.WriteLine(spinbutton_height.Value.ToString());
 Log.WriteLine(spinbutton_weight.Value.ToString());
-			Log.WriteLine("kkkkkkkkkkkkkkkkkkkkkkkk");
 
 			weightIni = myPerson.Weight; //store for tracking if changes
 		
diff --git a/src/gui/queryServer.cs b/src/gui/queryServer.cs
index b717290..81bcf5e 100644
--- a/src/gui/queryServer.cs
+++ b/src/gui/queryServer.cs
@@ -152,24 +152,28 @@ public class QueryServerWindow
 	string [] countries;
 	string [] countriesTranslated;
 	
+	int pDN; //prefsDigitsNumber;
+	
 	static QueryServerWindow QueryServerWindowBox;
 	
-	public QueryServerWindow ()
+	public QueryServerWindow (int newPrefsDigitsNumber)
 	{
 		Glade.XML gladeXML;
 		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "query_server_window", null);
 		gladeXML.Autoconnect(this);
 		
+		this.pDN = newPrefsDigitsNumber;
+		
 		//put an icon to window
 		UtilGtk.IconWindow(query_server_window);
 		
 		createAllCombos();
 	}
 
-	static public QueryServerWindow Show ()
+	static public QueryServerWindow Show (int newPrefsDigitsNumber)
 	{
 		if (QueryServerWindowBox == null) {
-			QueryServerWindowBox = new QueryServerWindow();
+			QueryServerWindowBox = new QueryServerWindow(newPrefsDigitsNumber);
 		}
 		QueryServerWindowBox.query_server_window.Show ();
 		
@@ -727,7 +731,7 @@ public class QueryServerWindow
 
 				string [] resultFull = result.Split(new char[] {':'});
 				label_results_num.Text = resultFull[0];
-				label_results_avg.Text = resultFull[1];
+				label_results_avg.Text = Util.TrimDecimals(resultFull[1], pDN);
 			}
 
 			return sqlString;
diff --git a/src/jump.cs b/src/jump.cs
index 7ca516d..682d847 100644
--- a/src/jump.cs
+++ b/src/jump.cs
@@ -28,7 +28,7 @@ public class Jump : Event
 {
 	protected double tv;
 	protected double tc;
-	protected int fall;
+	protected double fall;
 	protected double weight; //always write in % (not kg or %) then sqlite can do avgs
 
 	//for not checking always in database
@@ -39,7 +39,7 @@ public class Jump : Event
 	}
 	
 	//after inserting database (SQL)
-	public Jump(int uniqueID, int personID, int sessionID, string type, double tv, double tc, int fall, double weight, string description, double angle, int simulated)
+	public Jump(int uniqueID, int personID, int sessionID, string type, double tv, double tc, double fall, double weight, string description, double angle, int simulated)
 	{
 		this.uniqueID = uniqueID;
 		this.personID = personID;
@@ -63,7 +63,7 @@ public class Jump : Event
 		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.fall = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[6]));
 		this.weight = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[7]));
 		this.description = eventString[8].ToString();
 		this.angle = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[9]));
@@ -102,7 +102,7 @@ public class Jump : Event
 		set { tc = value; }
 	}
 	
-	public int Fall {
+	public double Fall {
 		get { return fall; }
 		set { fall = value; }
 	}
@@ -142,7 +142,7 @@ public class JumpRj : Jump
 	
 	//after inserting database (SQL)
 	public JumpRj(int uniqueID, int personID, int sessionID, string type, 
-			string tvString, string tcString, int fall, double weight, 
+			string tvString, string tcString, double fall, double weight, 
 			string description, int jumps, double time, string limited, string angleString, int simulated)
 	{
 		this.uniqueID = uniqueID;
@@ -173,7 +173,7 @@ public class JumpRj : Jump
 		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.fall = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[6]));
 		this.weight = Convert.ToDouble(Util.ChangeDecimalSeparator(eventString[7]));
 		this.description = eventString[8].ToString();
 		this.jumps = Convert.ToInt32(eventString[13]);
diff --git a/src/sqlite/jump.cs b/src/sqlite/jump.cs
index 18923cd..2f88a7d 100644
--- a/src/sqlite/jump.cs
+++ b/src/sqlite/jump.cs
@@ -47,7 +47,7 @@ class SqliteJump : Sqlite
 			"type TEXT, " +
 			"tv FLOAT, " +
 			"tc FLOAT, " +
-			"fall INT, " +  
+			"fall FLOAT, " +  
 			"weight TEXT, " + //string because can contain "33%" or "50Kg"
 			"description TEXT, " +
 			"angle FLOAT, " + //-1.0 if undef
@@ -64,7 +64,7 @@ class SqliteJump : Sqlite
 	 */
 	
 	//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, double angle, int simulated)
+	public static int Insert(bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double tv, double tc, double fall, double weight, string description, double angle, int simulated)
 	{
 		if(! dbconOpened)
 			dbcon.Open();
@@ -76,7 +76,7 @@ class SqliteJump : Sqlite
 				" (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(tv) + ", " + Util.ConvertToPoint(tc) + ", " + Util.ConvertToPoint(fall) + ", '" 
 				+ Util.ConvertToPoint(weight) + "', '" + description + "', "
 				+ Util.ConvertToPoint(angle) + ", " + simulated +")" ;
 		Log.WriteLine(dbcmd.CommandText.ToString());
@@ -142,7 +142,7 @@ class SqliteJump : Sqlite
 					reader[4].ToString() + ":" + 	//jump.type
 					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + 	//jump.tv
 					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + 	//jump.tc
-					reader[7].ToString() + ":" + 	//fall
+					Util.ChangeDecimalSeparator(reader[7].ToString()) + ":" + 	//fall
 					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + 	//weight
 					reader[9].ToString() + ":" +	//description
 					Util.ChangeDecimalSeparator(reader[10].ToString()) + ":" +	//angle
diff --git a/src/sqlite/jumpRj.cs b/src/sqlite/jumpRj.cs
index ed9f6a7..087cf69 100644
--- a/src/sqlite/jumpRj.cs
+++ b/src/sqlite/jumpRj.cs
@@ -43,7 +43,7 @@ class SqliteJumpRj : SqliteJump
 			"type TEXT, " + 
 			"tvMax FLOAT, " +
 			"tcMax FLOAT, " +
-			"fall INT, " +  
+			"fall FLOAT, " +  
 			"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
@@ -58,8 +58,7 @@ class SqliteJumpRj : SqliteJump
 		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 )
+	public static int Insert (bool dbconOpened, string tableName, string uniqueID, int personID, int sessionID, string type, double tvMax, double tcMax, double 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();
@@ -73,7 +72,7 @@ class SqliteJumpRj : SqliteJump
 				"VALUES (" + uniqueID + ", " +
 				personID + ", " + sessionID + ", '" + type + "', " +
 				Util.ConvertToPoint(tvMax) + ", " + Util.ConvertToPoint(tcMax) + ", '" + 
-				fall + "', '" + Util.ConvertToPoint(weight) + "', '" + description + "', " +
+				Util.ConvertToPoint(fall) + "', '" + Util.ConvertToPoint(weight) + "', '" + description + "', " +
 				Util.ConvertToPoint(tvAvg) + ", " + Util.ConvertToPoint(tcAvg) + ", '" + 
 				Util.ConvertToPoint(tvString) + "', '" + Util.ConvertToPoint(tcString) + "', " +
 				jumps + ", " + Util.ConvertToPoint(time) + ", '" + limited + "', '" + angleString + "', " + simulated +")" ;
@@ -136,7 +135,7 @@ class SqliteJumpRj : SqliteJump
 					reader[4].ToString() + ":" + 	//jumpRj.type
 					Util.ChangeDecimalSeparator(reader[5].ToString()) + ":" + 	//tvMax
 					Util.ChangeDecimalSeparator(reader[6].ToString()) + ":" + 	//tcMax
-					reader[7].ToString() + ":" + 	//fall
+					Util.ChangeDecimalSeparator(reader[7].ToString()) + ":" + 	//fall
 					Util.ChangeDecimalSeparator(reader[8].ToString()) + ":" + 	//weight
 					reader[9].ToString() + ":" + 	//description
 					Util.ChangeDecimalSeparator(reader[10].ToString()) + ":" + 	//tvAvg,
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 0929170..d66d9f0 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -72,7 +72,7 @@ class Sqlite
 	 * Important, change this if there's any update to database
 	 * Important2: if database version get numbers higher than 1, check if the comparisons with currentVersion works ok
 	 */
-	static string lastChronojumpDatabaseVersion = "0.75";
+	static string lastChronojumpDatabaseVersion = "0.76";
 
 	public Sqlite() {
 	}
@@ -463,6 +463,7 @@ class Sqlite
 			Log.WriteLine("Old database, need to convert");
 			Log.WriteLine("db version: " + currentVersion);
 			bool needToConvertPersonToSport = false;
+			bool jumpFallAsDouble = false;
 
 			SqliteJumpRj sqliteJumpRjObject = new SqliteJumpRj();
 			SqliteRunInterval sqliteRunIntervalObject = new SqliteRunInterval();
@@ -762,6 +763,9 @@ class Sqlite
 				SqlitePreferences.Insert ("showAngle", "False"); 
 				alterTableColumn(new SqliteJump(), Constants.JumpTable, 11);
 
+				//jump fall is also converted to double (don't need to do at conversion to 0.76)
+				jumpFallAsDouble = true;
+
 				SqlitePreferences.Update ("databaseVersion", "0.59", true); 
 				Log.WriteLine("Converted DB to 0.59 (added 'showAngle' to preferences, changed angle on jump to double)"); 
 				conversionRate = 2;
@@ -988,9 +992,25 @@ class Sqlite
 				dbcon.Close();
 				currentVersion = "0.75";
 			}
-				
-
+			if(currentVersion == "0.75") {
+				conversionRateTotal = 3;
+				conversionRate = 1;
+				dbcon.Open();
 
+				if(!jumpFallAsDouble)
+					alterTableColumn(new SqliteJump(), Constants.JumpTable, 11);
+				
+				conversionRate++;
+				
+				alterTableColumn(new SqliteJumpRj(), Constants.JumpRjTable, 18);
+				
+				SqlitePreferences.Update ("databaseVersion", "0.76", true); 
+				conversionRate++;
+				
+				Log.WriteLine("Converted DB to 0.76 (jump & jumpRj falls as double)"); 
+				dbcon.Close();
+				currentVersion = "0.76";
+			}
 		}
 
 		//if changes are made here, remember to change also in CreateTables()
@@ -1123,6 +1143,7 @@ class Sqlite
 		SqliteCountry.initialize();
 		
 		//changes [from - to - desc]
+		//0.75 - 0.76 Converted DB to 0.76 (jump & jumpRj falls as double)
 		//0.74 - 0.75 Converted DB to 0.75 (person, and personSessionWeight have height and weight as double)
 		//0.73 - 0.74 Converted DB to 0.74 (All DJ converted to DJna)
 		//0.72 - 0.73 Converted DB to 0.73 (deleted orphaned persons (in person table but not in personSessionWeight table))
diff --git a/src/sqlite/person.cs b/src/sqlite/person.cs
index 6566bde..d0882d3 100644
--- a/src/sqlite/person.cs
+++ b/src/sqlite/person.cs
@@ -68,7 +68,7 @@ class SqlitePerson : Sqlite
 		string myString = "INSERT INTO " + tableName + 
 			" (uniqueID, name, sex, dateBorn, height, weight,  sportID, speciallityID, practice, description, race, countryID, serverUniqueID) VALUES (" + uniqueID + ", '" +
 			name + "', '" + sex + "', '" + UtilDate.ToSql(dateBorn) + "', " + 
-			height + ", " + "-1" + ", " + //"-1" is weight because it's defined in personSesionWeight for allow change between sessions
+			Util.ConvertToPoint(height) + ", " + "-1" + ", " + //"-1" is weight because it's defined in personSesionWeight for allow change between sessions
 			sportID + ", " + speciallityID + ", " + practice + ", '" + description + "', " + 
 			race + ", " + countryID + ", " + serverUniqueID + ")" ;
 		
diff --git a/src/sqlite/personSession.cs b/src/sqlite/personSession.cs
index 1c02815..daa508e 100644
--- a/src/sqlite/personSession.cs
+++ b/src/sqlite/personSession.cs
@@ -202,11 +202,6 @@ class SqlitePersonSession : Sqlite
 			values[11] = reader[11].ToString();
 		}
 
-		Log.WriteLine("11111111111111111");
-		Log.WriteLine(values[3]);
-		Log.WriteLine(values[4]);
-		Log.WriteLine("22222222222222222");
-
 		Person myPerson = new Person(uniqueID, values[0], 
 			values[1], UtilDate.FromSql(values[2]), 
 			Convert.ToDouble(Util.ChangeDecimalSeparator(values[3])), //height
diff --git a/src/sqlite/stat.cs b/src/sqlite/stat.cs
index 8589b7f..0ab4eb1 100644
--- a/src/sqlite/stat.cs
+++ b/src/sqlite/stat.cs
@@ -176,6 +176,7 @@ class SqliteStat : Sqlite
 			}
 			//manage allJumps (show jumpType beside name (and sex)) 
 			//but only if it's not an AVG of different jumps
+			//TODO:Catalog?
 			if(jumpType == Constants.AllJumpsName && operationString != "AVG") {
 				showJumpTypeString = " (" + reader[6].ToString() + ")";
 			}
@@ -201,7 +202,7 @@ class SqliteStat : Sqlite
 						+ ":" + Util.ChangeDecimalSeparator(reader[3].ToString())
 						+ ":" + convertWeight(
 							Util.ChangeDecimalSeparator(reader[4].ToString()), 
-							Convert.ToInt32(reader[5].ToString()), weightPercentPreferred
+							Convert.ToDouble(reader[5].ToString()), weightPercentPreferred
 							)
 					    );
 			}
@@ -211,7 +212,7 @@ class SqliteStat : Sqlite
 		return myArray;
 	}
 
-	private static string convertWeight (string jumpW, int personW, bool percentDesired) {
+	private static string convertWeight (string jumpW, double personW, bool percentDesired) {
 		//if it was a non weight jump, return 0
 		if(jumpW.Length == 0) {
 			return "0";
diff --git a/src/treeViewJump.cs b/src/treeViewJump.cs
index 56762ab..391f69e 100644
--- a/src/treeViewJump.cs
+++ b/src/treeViewJump.cs
@@ -163,7 +163,7 @@ public class TreeViewJumps : TreeViewEvent
 		myJump.Type = myStringOfData[4].ToString();
 		myJump.Tv = Convert.ToDouble(myStringOfData[5].ToString());
 		myJump.Tc = Convert.ToDouble(myStringOfData[6].ToString());
-		myJump.Fall = Convert.ToInt32(myStringOfData[7].ToString());
+		myJump.Fall = Convert.ToDouble(myStringOfData[7].ToString());
 		myJump.Angle = Convert.ToDouble(myStringOfData[10].ToString());
 		myJump.Description = myStringOfData[9].ToString();
 		myJump.Simulated = Convert.ToInt32(myStringOfData[11].ToString());
@@ -197,7 +197,7 @@ public class TreeViewJumps : TreeViewEvent
 		
 		myData[count++] = Util.TrimDecimals(newJump.Weight.ToString(), pDN);
 
-		myData[count++] = newJump.Fall.ToString();
+		myData[count++] = Util.TrimDecimals(newJump.Fall.ToString(), pDN);
 		if (showHeight)  
 			myData[count++] = Util.TrimDecimals(Util.GetHeightInCentimeters(newJump.Tv.ToString()), pDN);
 		if (showPower)  {
@@ -261,7 +261,7 @@ public class TreeViewJumpsRj : TreeViewJumps
 		JumpRj myJumpRj = new JumpRj();
 		myJumpRj.UniqueID = Convert.ToInt32(myStringOfData[1].ToString()); 
 		myJumpRj.Type = myStringOfData[4].ToString();
-		myJumpRj.Fall = Convert.ToInt32(myStringOfData[7].ToString());
+		myJumpRj.Fall = Convert.ToDouble(myStringOfData[7].ToString());
 		myJumpRj.TvString = myStringOfData[12].ToString();
 		myJumpRj.TcString = myStringOfData[13].ToString();
 		myJumpRj.Limited = myStringOfData[16].ToString();
@@ -299,7 +299,7 @@ public class TreeViewJumpsRj : TreeViewJumps
 		
 		myData[count++] = Util.TrimDecimals(newJumpRj.Weight.ToString(), pDN);
 
-		myData[count++] = newJumpRj.Fall.ToString();
+		myData[count++] = Util.TrimDecimals(newJumpRj.Fall.ToString(), pDN);
 		if (showHeight)  
 			myData[count++] = "";
 		if (showInitialSpeed) 



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