[chronojump] ForceSensor export includes laterality



commit 0524c9477eb2d970fb0907d31c9dbd039194e868
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 19 12:32:13 2021 +0100

    ForceSensor export includes laterality

 r-scripts/maximumIsometricForce.R |  5 +++--
 src/forceSensor.cs                | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index 7e10643e..7435b60c 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -1129,7 +1129,7 @@ start <- function(op)
                if(op$decimalCharAtExport == ",")
                        maxAvgWindowSecondsHeader = format(maxAvgWindowSecondsHeader, decimal.mark=",")
 
-               exportNames = c("Name","Date","Time","Exercise","Set","Repetition","MaxForce 
(raw)",paste("Max AVG Force in", maxAvgWindowSecondsHeader, "s (raw)"),"MaxForce (model)")
+               exportNames = c("Name","Date","Time","Exercise","Laterality","Set","Repetition","MaxForce 
(raw)",paste("Max AVG Force in", maxAvgWindowSecondsHeader, "s (raw)"),"MaxForce (model)")
                for(i in 1:length(op$drawRfdOptions))
                {
                        RFDoptions = readRFDOptions(op$drawRfdOptions[i])
@@ -1177,7 +1177,8 @@ start <- function(op)
                                exportModelVector = exportModelVectorOnFail #done here and not on the catch, 
because it didn't worked there
 
                        #mix strings and numbers directly in a data frame to not have numbers as text (and 
then cannot export with decimal , or .)
-                       exportSetDF = data.frame(dataFiles$title[i], dataFiles$date[i], dataFiles$time[i], 
dataFiles$exercise[i], dataFiles$set[i], dataFiles$rep[i])
+                       exportSetDF = data.frame(dataFiles$title[i], dataFiles$date[i], dataFiles$time[i],
+                                       dataFiles$exercise[i], dataFiles$laterality[i], dataFiles$set[i], 
dataFiles$rep[i])
                        exportSetDF = cbind (exportSetDF, dataFiles$maxForceRaw[i])
                        exportSetDF = cbind (exportSetDF, dataFiles$maxAvgForceInWindow[i])
                        for(j in 1:length(exportModelVector))
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 8178af53..1bd342e8 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1575,6 +1575,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
        public double maxForceRaw;
        public double maxAvgForceInWindow;
        public double forceSensorAnalyzeMaxAVGInWindowSeconds;
+       public string laterality;
        public int setCount;
        public int repCount;
        public string commentOfSet;
@@ -1582,7 +1583,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
        public ForceSensorGraphABExport (
                        string fullURL, bool decimalIsPoint, double maxForceRaw,
                        double maxAvgForceInWindow, double forceSensorAnalyzeMaxAVGInWindowSeconds,
-                       int setCount, int repCount, string commentOfSet,
+                       string laterality, int setCount, int repCount, string commentOfSet,
                        ForceSensor.CaptureOptions fsco, int startSample, int endSample,
                        string title, string exercise, string date, string time, TriggerList triggerList)
        {
@@ -1593,6 +1594,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
                this.maxForceRaw = maxForceRaw;
                this.maxAvgForceInWindow = maxAvgForceInWindow;
                this.forceSensorAnalyzeMaxAVGInWindowSeconds = forceSensorAnalyzeMaxAVGInWindowSeconds;
+               this.laterality = laterality;
                this.setCount = setCount;
                this.repCount = repCount;
                this.commentOfSet = commentOfSet;
@@ -1618,6 +1620,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
                        exercise + ";" +
                        date + ";" +
                        time + ";" +
+                       laterality + ";" +
                        setCount + ";" +
                        repCount + ";" +
                        "\"\";\"\";" +  // triggers unused on export
@@ -1629,7 +1632,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
        public static string PrintCSVHeaderOnExport()
        {
                return "fullURL;decimalChar;maxForceRaw;maxAvgForceInWindow;" +
-                       "captureOptions;title;exercise;date;time;set;rep;" +
+                       "captureOptions;title;exercise;date;time;laterality;set;rep;" +
                        "triggersON;triggersOFF;" + //unused on export
                        "startSample;endSample;comments";
        }
@@ -2846,6 +2849,7 @@ public class ForceSensorExport
                                                                fsAI.ForceMAX,                  //raw
                                                                maxAvgForceInWindow,            //raw
                                                                forceSensorAnalyzeMaxAVGInWindowSeconds, //raw
+                                                               fs.Laterality,
                                                                fsesm.GetCount(p.UniqueID, 
fsEx.UniqueID),//setCount,
                                                                repCount ++,
                                                                fs.Comments,
@@ -2863,6 +2867,7 @@ public class ForceSensorExport
                         *1 if the last rep is con, also send to R (no problem if there is no ending ecc 
phase)
                         *2 if we have not found any rep on this set, just pass from A to B on the set.
                                This happens eg if the person starts with the maximum force (or using the 
forceSensor to weight things)
+                               or where the test has no force increase at all.
                        */
                        if(
                                        (lastIsCon && repLast != null)          // *1
@@ -2895,6 +2900,7 @@ public class ForceSensorExport
                                                        fsAI.ForceMAX,                  //raw
                                                        maxAvgForceInWindow,            //raw
                                                        forceSensorAnalyzeMaxAVGInWindowSeconds, //raw
+                                                       fs.Laterality,
                                                        fsesm.GetCount(p.UniqueID, fsEx.UniqueID),//setCount,
                                                        repCount ++,
                                                        fs.Comments,


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