[chronojump] DB 2.10 Inserted prefs: encoderCaptureShowLoss, runEncoderPPS



commit 436d93282f35ec91d830dec2658c8aa3b07c4c1c
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Dec 31 13:27:14 2020 +0100

    DB 2.10 Inserted prefs: encoderCaptureShowLoss, runEncoderPPS

 src/preferences.cs        |  2 ++
 src/sqlite/main.cs        | 12 +++++++++++-
 src/sqlite/preferences.cs |  8 ++++++++
 3 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences.cs b/src/preferences.cs
index a924383c..45c42f77 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -129,6 +129,7 @@ public class Preferences
 
        //runEncoder
        public double runEncoderMinAccel;
+       public double runEncoderPPS;
 
        public static string runEncoderAnalyzeAFPSqlNO = "NO";
        public static string runEncoderAnalyzeAFPSqlFITTED = "FITTED";
@@ -227,6 +228,7 @@ public class Preferences
        public int encoderCaptureMainVariableLowerValue;
        public enum EncoderPhasesEnum { BOTH, ECC, CON}
        public EncoderPhasesEnum encoderCaptureFeedbackEccon;
+       public bool encoderCaptureShowLoss;
 
        //forceSensor
        public string forceSensorTareDateTime;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 7bcbb0f2..2adbb681 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.09";
+       static string lastChronojumpDatabaseVersion = "2.10";
 
        public Sqlite()
        {
@@ -2852,6 +2852,15 @@ class Sqlite
 
                                currentVersion = updateVersion("2.09");
                        }
+                       if(currentVersion == "2.09")
+                       {
+                               LogB.SQL("Inserted prefs: encoderCaptureShowLoss, runEncoderPPS");
+
+                               SqlitePreferences.Insert (SqlitePreferences.EncoderCaptureShowLoss, "True");
+                               SqlitePreferences.Insert (SqlitePreferences.RunEncoderPPS, "10");
+
+                               currentVersion = updateVersion("2.10");
+                       }
 
                        /*
                        if(currentVersion == "1.79")
@@ -3070,6 +3079,7 @@ class Sqlite
 //just testing: 1.79 - 1.80 Converted DB to 1.80 Created table ForceSensorElasticBandGlue and moved 
stiffnessString records there
 
 
+               //2.09 - 2.10 Converted DB to 2.10 Inserted prefs: encoderCaptureShowLoss, runEncoderPPS
                //2.08 - 2.09 Converted DB to 2.09 Inserted into preferences: 
forceSensorAnalyzeABSliderIncrement
                //2.07 - 2.08 Converted DB to 2.08 Create table news and insert newsLanguageEs on preferences
                //2.06 - 2.07 Converted DB to 2.07 Inserted into preferences: forceSensorVariabilityMethod
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index d90644e3..1d0f616c 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -73,6 +73,7 @@ class SqlitePreferences : Sqlite
        public const string EncoderCaptureMainVariableLowerValue = "encoderCaptureMainVariableLowerValue";
        public const string EncoderCaptureFeedbackEccon = "encoderCaptureFeedbackEccon";
        public const string EncoderCaptureInertialEccOverloadMode = "encoderCaptureInertialEccOverloadMode";
+       public const string EncoderCaptureShowLoss = "encoderCaptureShowLoss";
 
        //forceSensor
        public const string ForceSensorCaptureWidthSeconds = "forceSensorCaptureWidthSeconds";
@@ -100,6 +101,7 @@ class SqlitePreferences : Sqlite
 
        //runEncoder
        public const string RunEncoderMinAccel = "runEncoderMinAccel";
+       public const string RunEncoderPPS = "runEncoderPPS";
 
        //advanced
        public const string ImporterPythonVersion = "importerPythonVersion";
@@ -214,6 +216,7 @@ class SqlitePreferences : Sqlite
                                Insert (EncoderCaptureMainVariableGreaterValue, "90", dbcmdTr);
                                Insert (EncoderCaptureMainVariableLowerActive, "False", dbcmdTr);
                                Insert (EncoderCaptureMainVariableLowerValue, "70", dbcmdTr);
+                               Insert (EncoderCaptureShowLoss, "True", dbcmdTr);
                                Insert ("encoderCaptureMinHeightGravitatory", "20", dbcmdTr);
                                Insert ("encoderCaptureMinHeightInertial", "5", dbcmdTr);
                                Insert ("encoderCaptureInertialDiscardFirstN", "3", dbcmdTr);
@@ -286,6 +289,7 @@ class SqlitePreferences : Sqlite
 
                                //runEncoder
                                Insert (RunEncoderMinAccel, "10.0", dbcmdTr);
+                               Insert (RunEncoderPPS, "10", dbcmdTr);
 
                                Insert (Preferences.runEncoderAnalyzeAccel.Name,
                                        Preferences.runEncoderAnalyzeAccel.SqlDefaultName, dbcmdTr);
@@ -516,6 +520,8 @@ class SqlitePreferences : Sqlite
                                preferences.encoderCaptureMainVariableLowerActive = reader[1].ToString() == 
"True";
                        else if(reader[0].ToString() == EncoderCaptureMainVariableLowerValue)
                                preferences.encoderCaptureMainVariableLowerValue = 
Convert.ToInt32(reader[1].ToString());
+                       else if(reader[0].ToString() == EncoderCaptureShowLoss)
+                               preferences.encoderCaptureShowLoss = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "encoderCaptureMinHeightGravitatory")
                                preferences.encoderCaptureMinHeightGravitatory = 
Convert.ToInt32(reader[1].ToString());
                        else if(reader[0].ToString() == "encoderCaptureMinHeightInertial")
@@ -703,6 +709,8 @@ class SqlitePreferences : Sqlite
                        else if(reader[0].ToString() == RunEncoderMinAccel)
                                preferences.runEncoderMinAccel = Convert.ToDouble(
                                                Util.ChangeDecimalSeparator(reader[1].ToString()));
+                       else if(reader[0].ToString() == RunEncoderPPS)
+                               preferences.runEncoderPPS = Convert.ToInt32(reader[1].ToString());
 
                        else if(reader[0].ToString() == Preferences.runEncoderAnalyzeAccel.Name)
                                Preferences.runEncoderAnalyzeAccel.SetCurrentFromSQL(reader[1].ToString());


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