[chronojump] Added RSA tests



commit 0702860ed5239c2142a6885c085633b320d9bd4f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 1 20:29:02 2013 +0100

    Added RSA tests

 glade/chronojump.glade |   34 +++++-----------------------------
 src/gui/run.cs         |    4 ++--
 src/gui/runType.cs     |   13 +++++++------
 src/sqlite/main.cs     |   24 +++++++++++++++++++++++-
 src/sqlite/runType.cs  |   40 +++++++++++++++++++++++++++++++++++++---
 5 files changed, 74 insertions(+), 41 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index e649c8d..4f6fb30 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -2663,31 +2663,6 @@ Chronopic</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" id="extra_window_radio_run_interval_rsa_test_1">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">False</property>
-                                                            <property name="has_tooltip">True</property>
-                                                            <property name="use_action_appearance">False</property>
-                                                            <property name="relief">none</property>
-                                                            <property name="draw_indicator">False</property>
-                                                            <property name="group">extra_window_radio_run_interval_by_laps</property>
-                                                            <signal name="toggled" handler="on_extra_window_runs_interval_test_changed" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label_extra_window_radio_run_interval_rsa_test_1">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">RSA test 1</property>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">4</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkRadioButton" id="extra_window_radio_run_interval_more">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -2718,7 +2693,7 @@ Chronopic</property>
                                                             <widget class="GtkLabel" id="label_extra_window_radio_run_interval_more">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">All intervallic runs</property>
+                                                            <property name="label" translatable="yes">All intervallic runs (including RSA)</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -2733,7 +2708,7 @@ Chronopic</property>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
                                                             <property name="padding">8</property>
-                                                            <property name="position">5</property>
+                                                            <property name="position">4</property>
                                                             </packing>
                                                             </child>
                                                           </widget>
@@ -29611,7 +29586,8 @@ options</property>
                   <widget class="GtkLabel" id="label139">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Limited by</property>
+                    <property name="label" translatable="yes">Limited by
+(how it finishes)</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
@@ -29923,7 +29899,7 @@ options</property>
                     <child>
                       <widget class="GtkRadioButton" id="radiobutton_dist_different">
                         <property name="label" translatable="yes">Different (each track have different distance
-suitable for agility tests)</property>
+suitable for agility tests and RSA)</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
diff --git a/src/gui/run.cs b/src/gui/run.cs
index bd7abd9..e167c39 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -1019,7 +1019,7 @@ partial class ChronoJumpWindow
 		else if(extra_window_radio_run_interval_by_time.Active) currentRunIntervalType = new RunType("byTime");
 		else if(extra_window_radio_run_interval_unlimited.Active) currentRunIntervalType = new RunType("unlimited");
 		else if(extra_window_radio_run_interval_mtgug.Active) currentRunIntervalType = new RunType("MTGUG");
-		else if(extra_window_radio_run_interval_rsa_test_1.Active) currentRunIntervalType = new RunType("RSA 8-4-R3-5");
+		//else if(extra_window_radio_run_interval_rsa_test_1.Active) currentRunIntervalType = new RunType("RSA 8-4-R3-5");
 
 		extra_window_runs_interval_initialize(currentRunIntervalType);
 	}
@@ -1222,7 +1222,7 @@ partial class ChronoJumpWindow
 		else if(type.Name == "byTime") extra_window_radio_run_interval_by_time.Active = true;
 		else if(type.Name == "unlimited") extra_window_radio_run_interval_unlimited.Active = true;
 		else if(type.Name == "MTGUG") extra_window_radio_run_interval_mtgug.Active = true;
-		else if(type.Name == "RSA 8-4-R3-5") extra_window_radio_run_interval_rsa_test_1.Active = true;
+		//else if(type.Name == "RSA 8-4-R3-5") extra_window_radio_run_interval_rsa_test_1.Active = true;
 		else {
 			//don't do this:
 			//extra_window_radio_run_interval_more.Active = true;
diff --git a/src/gui/runType.cs b/src/gui/runType.cs
index 60dc07e..fd39b0c 100644
--- a/src/gui/runType.cs
+++ b/src/gui/runType.cs
@@ -359,12 +359,13 @@ public class RunTypeAddWindow
 		new DialogMessage(Constants.MessageTypes.HELP, 
 				Catalog.GetString("On RSA tests, rest time counts as a \"track\".") + 
 				"\n" + 	Catalog.GetString("You should write the time in seconds after a capital 'R' (meaning \"Rest\").") + 
-				"\n\n" + 	Catalog.GetString("Eg. A test that repeats 5 times the following sequence:") + 
-				"\n\n\t" + Catalog.GetString("Run 10 meters, run 8 meters, rest 4 seconds.") + 
-				"\n\n" + Catalog.GetString("Will be limited by tracks with a fixed value of 15") + 
-				"\n" + Catalog.GetString("(3 different tracks x 5 times)") + 
-				"\n\n" + Catalog.GetString("And the 'distance' of each track will be:") + 
-				"\n\n\t10, 8, R4"
+				"\n\n" + 	Catalog.GetString("Eg. Aziz et al. (2000) test repeats 8 times the following sequence:") + 
+				"\n\n\t" + Catalog.GetString("Run 40 meters, rest 30 seconds.") + 
+				"\n\n" + Catalog.GetString("Will be limited by tracks with a fixed value of 16") + 
+				"\n" + Catalog.GetString("because there are 16 tracks:") + 
+				"\n" + Catalog.GetString("2 different tracks: ('Run' and 'rest') x 8 times") + 
+				"\n\n" + Catalog.GetString("And the 'distance' of each different track will be:") + 
+				"\n\n\t40, R30"
 				);
 	}
 
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 53d8016..afd56fe 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.87";
+	static string lastChronojumpDatabaseVersion = "0.88";
 
 	public Sqlite() {
 	}
@@ -1184,6 +1184,27 @@ class Sqlite
 				dbcon.Close();
 				currentVersion = "0.87";
 			}
+			if(currentVersion == "0.87") {
+				//delete runInterval type
+				SqliteRunIntervalType.Delete("RSA 8-4-R3-5");
+
+				//delete all it's runs
+				dbcon.Open();
+				dbcmd.CommandText = "Delete FROM " + Constants.RunIntervalTable +
+					" WHERE type == 'RSA 8-4-R3-5'";
+				Log.WriteLine(dbcmd.CommandText.ToString());
+				dbcmd.ExecuteNonQuery();
+				
+				//add know RSAs
+				SqliteRunIntervalType.addRSA();
+
+				Log.WriteLine("Deleted fake RSA test and added known RSA tests.");
+				
+				SqlitePreferences.Update ("databaseVersion", "0.88", true); 
+				dbcon.Close();
+
+				currentVersion = "0.88";
+			}
 		}
 
 		//if changes are made here, remember to change also in CreateTables()
@@ -1322,6 +1343,7 @@ class Sqlite
 		SqliteCountry.initialize();
 		
 		//changes [from - to - desc]
+		//0.87 - 0.88 Converted DB to 0.88 Deleted fake RSA test and added known RSA tests
 		//0.86 - 0.87 Converted DB to 0.87 Added run speed start preferences on sqlite
 		//0.85 - 0.86 Converted DB to 0.86 videoOn: TRUE
 		//0.84 - 0.85 Converted DB to 0.85 Added slCMJ jump 
diff --git a/src/sqlite/runType.cs b/src/sqlite/runType.cs
index 4cec275..3402dfd 100644
--- a/src/sqlite/runType.cs
+++ b/src/sqlite/runType.cs
@@ -317,8 +317,7 @@ class SqliteRunIntervalType : SqliteRunType
 			"20m10times:20:1:10:0:Run 10 times a 20m distance:",	//only in more runs
 			"7m30seconds:7:0:30:0:Make max laps in 30 seconds:",	//only in more runs
 			"20m endurance:20:0:0:1:Continue running in 20m distance:",	//only in more runs
-			"MTGUG:-1:1:3:0:Modified time Getup and Go test:1-7-19",
-			"RSA 8-4-R3-5:-1:1:4:0:RSA testing:8-4-R3-5"
+			"MTGUG:-1:1:3:0:Modified time Getup and Go test:1-7-19"
 		};
 		foreach(string myString in iniRunTypes) {
 			//RunIntervalTypeInsert(myString, true);
@@ -334,9 +333,44 @@ class SqliteRunIntervalType : SqliteRunType
 			Insert(type, Constants.RunIntervalTypeTable, true);
 		}
 		
-		AddGraphLinksRunInterval();	
+		AddGraphLinksRunInterval();
+
+		addRSA();
+	}
+
+	protected internal static void addRSA()
+	{
+		string [] iniRunTypes = {
+			//name:distance:tracksLimited:fixedValue:unlimited:description
+			"RSA Aziz 2000 40, R30 x 8:-1:1:16:0:RSA Aziz et al. 2000:40-R30",
+			"RSA Balsom 15, R30 x 40:-1:1:80:0:RSA Balsom et al. 1992:15-R30",
+			"RSA Balsom 30, R30 x 20:-1:1:40:0:RSA Balsom et al. 1992:30-R30",
+			"RSA Balsom 40, R30 x 15:-1:1:30:0:RSA Balsom et al. 1992:40-R30",
+			"RSA Dawson 40, R24 x 6:-1:1:12:0:RSA Dawson et al. 1998:40-R24",
+			"RSA Fitzsimons 40, R24 x 6:-1:1:12:0:RSA Fitzsimons et al. 1993:40-R24",
+			"RSA Gaitanos 6, R30 x 10:-1:1:20:0:RSA Gaitanos et al. 1991:6-R30",
+			"RSA Hamilton 6, R30 x 10:-1:1:20:0:RSA Hamilton et al. 1991:6-R30",
+			"RSA Mujica 15, R24 x 6:-1:1:12:0:RSA Mujica et al. 2000:15-R24",
+			"RSA Wadley 20, R17 x 12:-1:1:24:0:RSA Wadley and Le Rossignol 1998:20-R17",
+			"RSA Wragg 34.2, R25 x 7:-1:1:14:0:RSA Wragg et al. 2000:34.2-R25"
+		};
+		foreach(string myString in iniRunTypes) {
+			//RunIntervalTypeInsert(myString, true);
+			string [] s = myString.Split(new char[] {':'});
+			RunType type = new RunType();
+			type.Name = s[0];
+			type.Distance = Convert.ToDouble(Util.ChangeDecimalSeparator(s[1]));
+			type.TracksLimited = Util.IntToBool(Convert.ToInt32(s[2]));
+			type.FixedValue = Convert.ToInt32(s[3]);
+			type.Unlimited = Util.IntToBool(Convert.ToInt32(s[4]));
+			type.Description = s[5];
+			type.DistancesString = s[6];
+			Insert(type, Constants.RunIntervalTypeTable, true);
+		}
 	}
 
+
+
 	//public static void RunIntervalTypeInsert(string myRun, bool dbconOpened)
 	public static new int Insert(RunType t, string tableName, bool dbconOpened)
 	{



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