[chronojump] Encoder overview reps: show contraction



commit cf86fc11d59b4f89f588307743a5decf7be7d7db
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Apr 7 14:07:26 2022 +0200

    Encoder overview reps: show contraction

 src/encoder.cs        | 17 ++++++++++++-----
 src/gui/overview.cs   | 13 +++++++++----
 src/sqlite/encoder.cs | 19 ++++++++++++-------
 3 files changed, 33 insertions(+), 16 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index b66ba5ded..d64625772 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -1001,12 +1001,19 @@ public class EncoderSQL
                this.future3 = future3; //on curves: meanForce
                this.exerciseName = exerciseName;
 
-               if(eccon == "c")
-                       ecconLong = Catalog.GetString("Concentric");
-               else if(eccon == "ec" || eccon == "ecS")
-                       ecconLong = Catalog.GetString("Eccentric-concentric");
+               ecconLong = EcconLong(eccon);
+       }
+
+       public static string EcconLong (string ecconChars)
+       {
+               if(ecconChars == "c")
+                       return Catalog.GetString("Concentric");
+               else if(ecconChars == "ec" || ecconChars == "ecS")
+                       return Catalog.GetString("Eccentric-concentric");
+               else if(ecconChars == "ce" || ecconChars == "ceS")
+                       return Catalog.GetString("Concentric-eccentric");
                else
-                       ecconLong = Catalog.GetString("Concentric-eccentric");
+                       return "";
        }
 
        //used on encoder table
diff --git a/src/gui/overview.cs b/src/gui/overview.cs
index 677ff96d0..3beefc413 100644
--- a/src/gui/overview.cs
+++ b/src/gui/overview.cs
@@ -290,6 +290,7 @@ public class EncoderOverviewWindow : OverviewWindow
                        if(encoderGI == Constants.EncoderGI.GRAVITATORY)
                                tv.AppendColumn (Catalog.GetString ("Extra mass"), new CellRendererText(), 
"text", count++);
 
+                       tv.AppendColumn (Catalog.GetString ("Contraction"), new CellRendererText(), "text", 
count++);
                        tv.AppendColumn (Catalog.GetString ("Power"), new CellRendererText(), "text", 
count++);
                        tv.AppendColumn (Catalog.GetString ("Speed"), new CellRendererText(), "text", 
count++);
                        tv.AppendColumn (Catalog.GetString ("Force"), new CellRendererText(), "text", 
count++);
@@ -302,14 +303,18 @@ public class EncoderOverviewWindow : OverviewWindow
                if(type == treeviewType.SETS)
                {
                        if(encoderGI == Constants.EncoderGI.GRAVITATORY)
-                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string)); //personID (hidden), person name, sex, 
encoderConfiguration, exercise, displaced mass, sets
+                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string));
+                               //personID (hidden), person name, sex, encoderConfiguration, exercise, 
displaced mass, sets
                        else
-                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string)); //personID (hidden), person name, sex, encoderConfiguration, 
exercise, sets
+                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string));
+                               //personID (hidden), person name, sex, encoderConfiguration, exercise, sets
                } else {
                        if(encoderGI == Constants.EncoderGI.GRAVITATORY)
-                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string)); //personID 
(hidden), person name, sex, encoderConfiguration, exercise, extra mass, power, speed, force
+                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string), typeof 
(string));
+                               //personID (hidden), person name, sex, encoderConfiguration, exercise, extra 
mass, contraction, power, speed, force
                        else
-                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string), typeof (string)); //personID (hidden), person 
name, sex, encoderConfiguration, exercise, power, speed, force
+                               s = new TreeStore(typeof (string), typeof (string), typeof (string), typeof 
(string), typeof (string), typeof (string), typeof (string), typeof (string), typeof (string));
+                               //personID (hidden), person name, sex, encoderConfiguration, exercise, 
contraction, power, speed, force
                }
 
                return s;
diff --git a/src/sqlite/encoder.cs b/src/sqlite/encoder.cs
index 3d59f50e0..be06984e6 100644
--- a/src/sqlite/encoder.cs
+++ b/src/sqlite/encoder.cs
@@ -576,7 +576,8 @@ class SqliteEncoder : Sqlite
                        Sqlite.Open();
 
                dbcmd.CommandText =
-                       "SELECT person77.uniqueID, person77.name, person77.sex, encoder.encoderConfiguration, 
encoderExercise.name, encoder.extraWeight, encoder.future1, encoder.future2, encoder.future3 " +
+                       "SELECT person77.uniqueID, person77.name, person77.sex, encoder.encoderConfiguration, 
encoderExercise.name, " + 
+                       "encoder.extraWeight, encoder.eccon, encoder.future1, encoder.future2, 
encoder.future3 " +
                        "FROM person77, encoderExercise, encoder " +
                        "WHERE sessionID = " + sessionID.ToString() +
                        " AND signalOrCurve = \"curve\" " +
@@ -613,9 +614,11 @@ class SqliteEncoder : Sqlite
                                        econf.ToStringPretty(), //encoder configuration
                                        reader[4].ToString(),   //encoder exercise name
                                        Util.ChangeDecimalSeparator(reader[5].ToString()),      //extra mass
-                                       reader[6].ToString(),   //power
-                                       reader[7].ToString(),   //speed
-                                       reader[8].ToString()    //force
+                                       EncoderSQL.EcconLong(reader[6].ToString()),
+                                       reader[7].ToString(),   //power
+                                       reader[8].ToString(),   //speed
+                                       reader[9].ToString()    //force
+                                               //TODO repCriteria
                                };
                                array.Add (s);
                        } else {
@@ -625,9 +628,11 @@ class SqliteEncoder : Sqlite
                                        reader[2].ToString(),   //person sex
                                        econf.ToStringPretty(), //encoder configuration
                                        reader[4].ToString(),   //encoder exercise name
-                                       reader[6].ToString(),   //power
-                                       reader[7].ToString(),   //speed
-                                       reader[8].ToString()    //force
+                                       EncoderSQL.EcconLong(reader[6].ToString()),
+                                       reader[7].ToString(),   //power
+                                       reader[8].ToString(),   //speed
+                                       reader[9].ToString()    //force
+                                               //TODO repCriteria
                                };
                                array.Add (s);
                        }


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