[chronojump] Added RSA RAST Test



commit 92d7d224c2a2159d64020b920e97ed85d48b2843
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 16 16:25:13 2014 +0200

    Added RSA RAST Test

 src/sqlite/main.cs    |   35 ++++++++++++++++++++++++++++++++++-
 src/sqlite/runType.cs |    5 +++--
 2 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 25c755e..65eada7 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -74,7 +74,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 = "1.09";
+       static string lastChronojumpDatabaseVersion = "1.10";
 
        public Sqlite() {
        }
@@ -478,6 +478,7 @@ class Sqlite
                        bool needToConvertPersonToSport = false;
                        bool jumpFallAsDouble = false;
                        bool runAndRunIntervalInitialSpeedAdded = false;
+                       bool addedRSA = false;
 
                        SqliteJumpRj sqliteJumpRjObject = new SqliteJumpRj();
                        SqliteRunInterval sqliteRunIntervalObject = new SqliteRunInterval();
@@ -1199,6 +1200,7 @@ class Sqlite
                                
                                //add know RSAs
                                SqliteRunIntervalType.addRSA();
+                               addedRSA = true;
 
                                Log.WriteLine("Deleted fake RSA test and added known RSA tests.");
                                
@@ -1595,6 +1597,36 @@ class Sqlite
 
                                currentVersion = "1.09";
                        }
+                       if(currentVersion == "1.09") {
+                               dbcon.Open();
+                       
+                               Log.WriteLine("Added RSA RAST on runType");
+
+                               /*
+                                * addRSA() contains RAST since 1.10
+                                * database started at 1.10 or more contains RAST
+                                * database started before 0.87 adds RAST on the addRSA() method
+                                * satabase started after 0.87 adds RAST now
+                                */
+                               if(! addedRSA) {
+                                       RunType type = new RunType();
+                                       type.Name = "RSA RAST 35, R10 x 6";
+                                       type.Distance = -1;
+                                       type.TracksLimited = true;
+                                       type.FixedValue = 12;
+                                       type.Unlimited = false;
+                                       type.Description = "RSA RAST Test";
+                                       type.DistancesString = "35-R10";
+                                       
+                                       SqliteRunIntervalType.Insert(type, Constants.RunIntervalTypeTable, 
true);
+                                       addedRSA = true;
+                               }
+                               
+                               SqlitePreferences.Update ("databaseVersion", "1.10", true); 
+                               dbcon.Close();
+
+                               currentVersion = "1.10";
+                       }
                
                
 
@@ -1739,6 +1771,7 @@ class Sqlite
                SqliteCountry.initialize();
                
                //changes [from - to - desc]
+               //1.09 - 1.10 Converted DB to 1.10 Added RSA RAST on runType
                //1.08 - 1.09 Converted DB to 1.09 Added option on preferences to useHeightsOnJumpIndexes 
(default) or not
                //1.07 - 1.08 Converted DB to 1.08 Added translate statistics graph option to preferences
                //1.06 - 1.07 Converted DB to 1.07 Added jump_dj_a.png
diff --git a/src/sqlite/runType.cs b/src/sqlite/runType.cs
index 6356651..fbc7a18 100644
--- a/src/sqlite/runType.cs
+++ b/src/sqlite/runType.cs
@@ -311,7 +311,7 @@ class SqliteRunIntervalType : SqliteRunType
        protected internal static new void initializeTable()
        {
                string [] iniRunTypes = {
-                       //name:distance:tracksLimited:fixedValue:unlimited:description
+                       //name:distance:tracksLimited:fixedValue:unlimited:description:distancesString
                        "byLaps:0:1:0:0:Run n laps x distance:",
                        "byTime:0:0:0:0:Make max laps in n seconds:",
                        "unlimited:0:0:0:1:Continue running in n distance:",    //suppose limited by time
@@ -343,7 +343,7 @@ class SqliteRunIntervalType : SqliteRunType
        protected internal static void addRSA()
        {
                string [] iniRunTypes = {
-                       //name:distance:tracksLimited:fixedValue:unlimited:description
+                       //name:distance:tracksLimited:fixedValue:unlimited:description:distancesString
                        "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",
@@ -352,6 +352,7 @@ class SqliteRunIntervalType : SqliteRunType
                        "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 RAST 35, R10 x 6:-1:1:12:0:RSA RAST Test:35-R10",                  //this is 
added on DB 1.10
                        "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"


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