[chronojump/michrolab] ForceSensor load shows elastic column only on elastic mode



commit 20ff274eb6970f5d2c13491202aa2f081f9c5dfb
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 30 18:24:49 2022 +0200

    ForceSensor load shows elastic column only on elastic mode

 src/forceSensor.cs          | 12 ++++++++---
 src/gui/app1/forceSensor.cs | 49 ++++++++++++++++++++++++++++++---------------
 2 files changed, 42 insertions(+), 19 deletions(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 7da78c784..6d3b02fcb 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -155,15 +155,21 @@ public class ForceSensor
        }
 
        //for load window
-       public string [] ToStringArray (int count)
+       public string [] ToStringArray (int count, Constants.Modes mode)
        {
-               int all = 11;
+               int all = 10;
+               if (mode == Constants.Modes.FORCESENSORELASTIC)
+                       all = 11;       //only show stiffness on elastic
+
                string [] str = new String [all];
                int i=0;
                str[i++] = uniqueID.ToString();
                str[i++] = count.ToString();
                str[i++] = exerciseName;
-               str[i++] = exerciseElasticStiffnessString();
+
+               if (mode == Constants.Modes.FORCESENSORELASTIC)
+                       str[i++] = exerciseElasticStiffnessString();
+
                str[i++] = Catalog.GetString(GetCaptureOptionsString(captureOption));
                str[i++] = Catalog.GetString(laterality);
                if(maxForceRaw == -1)
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 41b4e7b17..76712bb62 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -2163,22 +2163,39 @@ LogB.Information(" fs R ");
 
                ArrayList dataPrint = new ArrayList();
                int count = 1;
-               foreach(ForceSensor fs in data)
-                       dataPrint.Add(fs.ToStringArray(count++));
-
-               string [] columnsString = {
-                       Catalog.GetString("ID"),
-                       Catalog.GetString("Set"),
-                       Catalog.GetString("Exercise"),
-                       Catalog.GetString("Elastic") + " (N/m)",
-                       Catalog.GetString("Capture option"),
-                       Catalog.GetString("Laterality"),
-                       Catalog.GetString("Max force") + " (" + Catalog.GetString("Raw data") + ") (N)",
-                       string.Format(Catalog.GetString("Max AVG Force in {0} s"), 1) + " (N)",
-                       Catalog.GetString("Date"),
-                       Catalog.GetString("Video"),
-                       Catalog.GetString("Comment")
-               };
+               foreach (ForceSensor fs in data)
+                       dataPrint.Add (fs.ToStringArray (count++, current_mode));
+
+               string [] columnsString;
+               if (current_mode == Constants.Modes.FORCESENSORISOMETRIC)
+                       columnsString = new String [] {
+                               Catalog.GetString("ID"),
+                                       Catalog.GetString("Set"),
+                                       Catalog.GetString("Exercise"),
+                                       Catalog.GetString("Capture option"),
+                                       Catalog.GetString("Laterality"),
+                                       Catalog.GetString("Max force") + " (" + Catalog.GetString("Raw data") 
+ ") (N)",
+                                       string.Format(Catalog.GetString("Max AVG Force in {0} s"), 1) + " 
(N)",
+                                       Catalog.GetString("Date"),
+                                       Catalog.GetString("Video"),
+                                       Catalog.GetString("Comment")
+                       };
+               else //if (current_mode == Constants.Modes.FORCESENSORELASTIC)
+               {
+                       columnsString = new String [] {
+                               Catalog.GetString("ID"),
+                                       Catalog.GetString("Set"),
+                                       Catalog.GetString("Exercise"),
+                                       Catalog.GetString("Elastic") + " (N/m)",
+                                       Catalog.GetString("Capture option"),
+                                       Catalog.GetString("Laterality"),
+                                       Catalog.GetString("Max force") + " (" + Catalog.GetString("Raw data") 
+ ") (N)",
+                                       string.Format(Catalog.GetString("Max AVG Force in {0} s"), 1) + " 
(N)",
+                                       Catalog.GetString("Date"),
+                                       Catalog.GetString("Video"),
+                                       Catalog.GetString("Comment")
+                       };
+               }
 
                ArrayList bigArray = new ArrayList();
                ArrayList a1 = new ArrayList();


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