[chronojump] LastJumpRjType creation on DB



commit ad884e28dd20184e1dcf522d274411168b0631a9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 12 15:36:31 2021 +0200

    LastJumpRjType creation on DB

 src/constants.cs       |  1 +
 src/jumpType.cs        |  2 +-
 src/sqlite/jumpType.cs | 13 +++++++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index 1f2726c6..74a8eaaf 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -184,6 +184,7 @@ public class Constants
        public const string RunEncoderExerciseTable = "runEncoderExercise";
 
        public const string LastJumpSimpleTypeParamsTable = "lastJumpSimpleTypeParams";
+       public const string LastJumpRjTypeParamsTable = "lastJumpRjTypeParams";
 
        // Dummy variables that exists for translating purposes
        // pragma warning is to avoid warnings of "defined and not used" for these variables.
diff --git a/src/jumpType.cs b/src/jumpType.cs
index 3e3f8a25..2828fbef 100644
--- a/src/jumpType.cs
+++ b/src/jumpType.cs
@@ -28,7 +28,7 @@ public class JumpType : EventType
        protected bool hasWeight;
        protected bool isRepetitive;
        protected bool jumpsLimited;
-       protected double fixedValue;    //0 no fixed value
+       protected double fixedValue;    //0 no fixed value //why this is a double and not an int?
        protected bool unlimited;
 
 
diff --git a/src/sqlite/jumpType.cs b/src/sqlite/jumpType.cs
index 33893351..902666b1 100644
--- a/src/sqlite/jumpType.cs
+++ b/src/sqlite/jumpType.cs
@@ -737,4 +737,17 @@ class SqliteJumpType : Sqlite
        // **** lastJumpRjTypeParams **
        // ****************************
        //for store default params of each jump (multiple)
+       protected internal static void createTableLastJumpRjTypeParams()
+       {
+               dbcmd.CommandText =
+                       "CREATE TABLE " + Constants.LastJumpRjTypeParamsTable + " ( " +
+                       "uniqueID INTEGER PRIMARY KEY, " + //to order if there are more than one by import 
problems
+                       "name TEXT, " +
+                       "limitedValue INT, " +
+                       "weightIsPercent INT, " +        //boolean
+                       "weightValue FLOAT, " +         //decimal is point
+                       "fallmm INT)"; //-1: start in; >=0: falling height in mm (to be int, can be 0 like 
int he gui can be 0)
+               dbcmd.ExecuteNonQuery();
+       }
+
 }      


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