[chronojump] Fixed SqliteForceSensor.Select (elastic according to elastic and forceResultant)



commit ecb5e8d60b93bb794db23aaf8e2c976097e191b1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri May 27 19:36:33 2022 +0200

    Fixed SqliteForceSensor.Select (elastic according to elastic and forceResultant)

 src/sqlite/forceSensor.cs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/sqlite/forceSensor.cs b/src/sqlite/forceSensor.cs
index dcd26cd1b..11e1af839 100644
--- a/src/sqlite/forceSensor.cs
+++ b/src/sqlite/forceSensor.cs
@@ -606,7 +606,12 @@ class SqliteForceSensorExercise : Sqlite
                string elasticStr = "";
                if(elastic != -1)
                {
-                       elasticStr = whereOrAndStr + table + ".elastic = " + elastic;
+                       //note for elastic need: elastic = 1 && forceResultant = 1 (like 
ForceSensor.ComputeAsElastic does)
+                       if (elastic == 1)
+                               elasticStr = whereOrAndStr + table + ".elastic = 1 AND " + table + 
".forceResultant = 1";
+                       else //elastic == 0
+                               elasticStr = whereOrAndStr + table + ".elastic = 0";
+
                        whereOrAndStr = " AND ";
                }
 


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