[chronojump] DB: 2.28. ShowJumpRSI on preferences



commit 68ab5c11aeb6f4e825402dd6e054db533104dd69
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Oct 15 13:09:09 2021 +0200

    DB: 2.28. ShowJumpRSI on preferences

 src/preferences.cs        |  3 ++-
 src/sqlite/main.cs        | 10 ++++++++--
 src/sqlite/preferences.cs |  4 ++++
 3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/preferences.cs b/src/preferences.cs
index 1fdade86f..974cd3c58 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -73,7 +73,8 @@ public class Preferences
        public bool showPower;
        public bool showStiffness;
        public bool showInitialSpeed;
-       public bool showAngle;
+       public bool showJumpRSI;
+       public bool showAngle; //unused
        public bool showQIndex;
        public bool showDjIndex;
        public bool weightStatsPercent;         //AKA weightPercentPreferred
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index b1efef56b..888945aaf 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -129,7 +129,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "2.27";
+       static string lastChronojumpDatabaseVersion = "2.28";
 
        public Sqlite()
        {
@@ -3059,7 +3059,12 @@ class Sqlite
 
                                currentVersion = updateVersion("2.27");
                        }
-
+                       if(currentVersion == "2.27")
+                       {
+                               LogB.SQL("Inserted at preferences showJumpRSI");
+                               SqlitePreferences.Insert (SqlitePreferences.ShowJumpRSI, "True");
+                               currentVersion = updateVersion("2.28");
+                       }
 
                        /*
                        if(currentVersion == "1.79")
@@ -3279,6 +3284,7 @@ class Sqlite
                //changes [from - to - desc]
 //just testing: 1.79 - 1.80 Converted DB to 1.80 Created table ForceSensorElasticBandGlue and moved 
stiffnessString records there
 
+               //2.27 - 2.28 Converted DB to 2.28 Inserted at preferences showJumpRSI
                //2.26 - 2.27 Converted DB to 2.27 Inserted lastBackupDir, lastBackupDatetime, 
backupScheduledCreatedDate, backupScheduledNextDays
                //2.25 - 2.26 Converted DB to 2.26 contactsCaptureDisplay with BooleansInt, and bool 
runEncoderCaptureDisplaySimple
                //2.24 - 2.25 Converted DB to 2.25 encoderCaptureShowOnlyBars now uses BooleansInt
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index a431682b4..dccdecd61 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -62,6 +62,7 @@ class SqlitePreferences : Sqlite
 
        public const string RunsEvolutionOnlyBestInSession = "runsEvolutionOnlyBestInSession";
        public const string RunsEvolutionShowTime = "runsEvolutionShowTime";
+       public const string ShowJumpRSI = "showJumpRSI";
 
        //encoder
        public const string EncoderCaptureInfinite = "encoderCaptureInfinite";
@@ -209,6 +210,7 @@ class SqlitePreferences : Sqlite
                                Insert ("showPower", "True", dbcmdTr);
                                Insert ("showStiffness", "True", dbcmdTr);
                                Insert ("showInitialSpeed", "True", dbcmdTr);
+                               Insert (ShowJumpRSI, "True", dbcmdTr);
                                Insert ("showAngle", "False", dbcmdTr); //for treeviewjumps
                                Insert ("showQIndex", "False", dbcmdTr); //for treeviewJumps
                                Insert ("showDjIndex", "False", dbcmdTr); //for treeviewJumps
@@ -575,6 +577,8 @@ class SqlitePreferences : Sqlite
                                preferences.showStiffness = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "showInitialSpeed")
                                preferences.showInitialSpeed = reader[1].ToString() == "True";
+                       else if(reader[0].ToString() == ShowJumpRSI)
+                               preferences.showJumpRSI = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "showAngle") {
                                //preferences.showAngle = reader[1].ToString() == "True";
                                preferences.showAngle = false;


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