[chronojump] Fixed on encoder recalculate does not store change of extraWeight (and sure other params except powe



commit 1a2cff0674c2dce7d79896a221937f1cfb66536e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jun 10 19:34:23 2022 +0200

    Fixed on encoder recalculate does not store change of extraWeight (and sure other params except power, 
speed, force)
    since commit: Fixed: Repetition wrong sorting in encoder (on analyze currentPerson, currentSession)
    3 months ago (so this mistake is on 2.2.1)

 src/encoder.cs          | 12 ++++++++++++
 src/gui/app1/encoder.cs | 10 ++++++----
 src/sqlite/encoder.cs   |  3 ++-
 3 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index 92b5d5fab..076ba9917 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -1116,6 +1116,18 @@ public class EncoderSQL
                return str;
        }
 
+       public override string ToString ()       //debug
+       {
+               return string.Format (
+                               "uniqueID: {0},  personID: {1},  sessionID: {2},  exerciseID: {3},  eccon: 
{4}, " +
+                               "laterality: {5},  extraWeight: {6},  signalOrCurve: {7},  filename: {8}, " +
+                               "url: {9},  time: {10},  minHeight: {11},  description: {12}, " +
+                               "status: {13},  videoURL: {14},  encoderConfiguration: {15},  future1: {16}, 
" +
+                               "future2: {17},  future3: {18},   repCriteria: {19},  exerciseName: {20}",
+                               uniqueID, personID, sessionID, exerciseID, eccon, laterality, extraWeight, 
signalOrCurve, filename,
+                               url, time, minHeight, description, status, videoURL, encoderConfiguration, 
future1, future2, future3,  repCriteria, exerciseName);
+       }
+
        //uniqueID:name
        public EncoderSQL ChangePerson(string newIDAndName) {
                int newPersonID = Util.FetchID(newIDAndName);
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index b49eadb4c..bbab89bec 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -3231,11 +3231,11 @@ public partial class ChronoJumpWindow
                }
                else {
                        LogB.Warning("TOSTRING1");
-                       eSQL.ToString();
+                       LogB.Information (eSQL.ToString());
                        //only signal is updated
                        SqliteEncoder.Update(dbconOpened, eSQL); //Adding on SQL
                        LogB.Warning("TOSTRING2");
-                       eSQL.ToString();
+                       LogB.Information (eSQL.ToString());
                        feedback = Catalog.GetString("Set updated");
                }
                
@@ -7755,16 +7755,18 @@ public partial class ChronoJumpWindow
                 * (2) update analyze labels and combos
                 */
 
+               // get the signal
                ArrayList array = SqliteEncoder.Select(
                                true, Convert.ToInt32(encoderSignalUniqueID), 0, 0, getEncoderGI(),
-                               -1, "", EncoderSQL.Eccons.ALL, "",
-                               false, true, true);
+                               -1, "signal", EncoderSQL.Eccons.ALL, "",
+                               false, true, false);
 
                if(array.Count == 0)
                        return;
 
                EncoderSQL currentSignalSQL = (EncoderSQL) array[0];
 
+               // get the curves sorted by position in set
                ArrayList data = SqliteEncoder.Select(
                                true, -1, currentPerson.UniqueID, currentSession.UniqueID, getEncoderGI(),
                                -1, "curve", EncoderSQL.Eccons.ALL, "",
diff --git a/src/sqlite/encoder.cs b/src/sqlite/encoder.cs
index ed81903e1..4d53d7040 100644
--- a/src/sqlite/encoder.cs
+++ b/src/sqlite/encoder.cs
@@ -216,12 +216,13 @@ class SqliteEncoder : Sqlite
           eg if you save only the best (maybe the 4th), will have uniqueID 1, and then if you save it all,
           then they will be saved as 2, 3, (4 not saved becuase it is already one), 4, 5, ... So 4th in 
order will be 1
           orderRepsByPosInSet fixes this problem. this is used eg. in analyze session to sort them correctly
+          but note it Select will only work ok for curves
         */
        public static ArrayList Select (
                        bool dbconOpened, int uniqueID, int personID, int sessionID, Constants.EncoderGI 
encoderGI, 
                        int exerciseID, string signalOrCurve, EncoderSQL.Eccons ecconSelect, string 
lateralityEnglish,
                        bool onlyActive, bool orderIDascendent,
-                       bool orderRepsByPosInSet)
+                       bool orderRepsByPosInSet) // Attention! note this only selects curves
        {
                if(! dbconOpened)
                        Sqlite.Open();


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