[chronojump] DB: 1.66 preferences: encoderCaptureSecondaryVariableShow



commit c41cf4ea4d310ab84ddb1790ada307fe527656b8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 31 17:42:26 2019 +0200

    DB: 1.66 preferences: encoderCaptureSecondaryVariableShow

 src/preferences.cs        |  1 +
 src/sqlite/main.cs        | 11 ++++++++++-
 src/sqlite/preferences.cs |  3 +++
 3 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/preferences.cs b/src/preferences.cs
index 7255f216..42b03921 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -60,6 +60,7 @@ public class Preferences
        public int encoderCaptureInactivityEndTime; // -1 if not automatically end
        public Constants.EncoderVariablesCapture encoderCaptureMainVariable;
        public Constants.EncoderVariablesCapture encoderCaptureSecondaryVariable;
+       public bool encoderCaptureSecondaryVariableShow;
        public int encoderCaptureMinHeightGravitatory;
        public int encoderCaptureMinHeightInertial;
        public int encoderCaptureInertialDiscardFirstN;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index c4c630ea..88059800 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -125,7 +125,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.65";
+       static string lastChronojumpDatabaseVersion = "1.66";
 
        public Sqlite() {
        }
@@ -2411,6 +2411,14 @@ class Sqlite
 
                                currentVersion = updateVersion("1.65");
                        }
+                       if(currentVersion == "1.65")
+                       {
+                               LogB.SQL("Added to preferences: encoderCaptureSecondaryVariableShow");
+
+                               SqlitePreferences.Insert ("encoderCaptureSecondaryVariableShow", "True");
+
+                               currentVersion = updateVersion("1.66");
+                       }
 
 
 
@@ -2600,6 +2608,7 @@ class Sqlite
                SqliteJson.createTableUploadExhibitionTestTemp ();
 
                //changes [from - to - desc]
+               //1.65 - 1.66 Converted DB to 1.66 Added to preferences: encoderCaptureSecondaryVariableShow
                //1.64 - 1.65 Converted DB to 1.65 Added to preferences: encoderCaptureSecondaryVariable
                //1.63 - 1.64 Converted DB to 1.64 Added to preferences: videoDevicePixelFormat
                //1.62 - 1.63 Converted DB to 1.63 Added to preferences: encoderCaptureInertialDiscardFirstN
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 7bb10e7e..674364ca 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -126,6 +126,7 @@ class SqlitePreferences : Sqlite
                                Insert ("encoderCaptureInactivityEndTime", "3", dbcmdTr);
                                Insert ("encoderCaptureMainVariable", 
Constants.EncoderVariablesCapture.MeanPower.ToString(), dbcmdTr);
                                Insert ("encoderCaptureSecondaryVariable", 
Constants.EncoderVariablesCapture.RangeAbsolute.ToString(), dbcmdTr);
+                               Insert ("encoderCaptureSecondaryVariableShow", "True", dbcmdTr);
                                Insert ("encoderCaptureMinHeightGravitatory", "20", dbcmdTr);
                                Insert ("encoderCaptureMinHeightInertial", "5", dbcmdTr);
                                Insert ("encoderCaptureInertialDiscardFirstN", "3", dbcmdTr);
@@ -322,6 +323,8 @@ class SqlitePreferences : Sqlite
                        else if(reader[0].ToString() == "encoderCaptureSecondaryVariable")
                                preferences.encoderCaptureSecondaryVariable = 
(Constants.EncoderVariablesCapture)
                                        Enum.Parse(typeof(Constants.EncoderVariablesCapture), 
reader[1].ToString());
+                       else if(reader[0].ToString() == "encoderCaptureSecondaryVariableShow")
+                               preferences.encoderCaptureSecondaryVariableShow = reader[1].ToString() == 
"True";
                        else if(reader[0].ToString() == "encoderCaptureMinHeightGravitatory")
                                preferences.encoderCaptureMinHeightGravitatory = 
Convert.ToInt32(reader[1].ToString());
                        else if(reader[0].ToString() == "encoderCaptureMinHeightInertial")


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