[chronojump] ForceSensor export includes comments



commit 918b345d09370377985c628c491a4c8962532c27
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 19 12:19:47 2021 +0100

    ForceSensor export includes comments

 r-scripts/maximumIsometricForce.R |  3 +++
 src/forceSensor.cs                | 11 ++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index 89ba8af3..7e10643e 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -1143,6 +1143,8 @@ start <- function(op)
                        exportNames = c(exportNames, paste("Impulse", impulseOptions$impulseFunction, 
impulseOptions$type,
                                        impulseOptions$start, impulseOptions$end, sep ="_"))
 
+               exportNames = c(exportNames, "comments (set)");
+
                #2) read the csv
                dataFiles = read.csv(file = paste(tempPath, "/maximumIsometricForceInputMulti.csv", sep=""), 
sep=";", stringsAsFactors=F)
 
@@ -1180,6 +1182,7 @@ start <- function(op)
                        exportSetDF = cbind (exportSetDF, dataFiles$maxAvgForceInWindow[i])
                        for(j in 1:length(exportModelVector))
                                exportSetDF = cbind (exportSetDF, exportModelVector[j])
+                       exportSetDF = cbind (exportSetDF, dataFiles$comments[i])
 
                        colnames(exportSetDF) = exportNames
 
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 9a3a439a..8178af53 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1577,11 +1577,12 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
        public double forceSensorAnalyzeMaxAVGInWindowSeconds;
        public int setCount;
        public int repCount;
+       public string commentOfSet;
 
        public ForceSensorGraphABExport (
                        string fullURL, bool decimalIsPoint, double maxForceRaw,
                        double maxAvgForceInWindow, double forceSensorAnalyzeMaxAVGInWindowSeconds,
-                       int setCount, int repCount,
+                       int setCount, int repCount, string commentOfSet,
                        ForceSensor.CaptureOptions fsco, int startSample, int endSample,
                        string title, string exercise, string date, string time, TriggerList triggerList)
        {
@@ -1594,6 +1595,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
                this.forceSensorAnalyzeMaxAVGInWindowSeconds = forceSensorAnalyzeMaxAVGInWindowSeconds;
                this.setCount = setCount;
                this.repCount = repCount;
+               this.commentOfSet = commentOfSet;
        }
 
        public string ToCSVRowOnExport()
@@ -1620,7 +1622,8 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
                        repCount + ";" +
                        "\"\";\"\";" +  // triggers unused on export
                        startSample.ToString() + ";" +
-                       endSample.ToString();
+                       endSample.ToString() + ";" +
+                       Util.RemoveChar(commentOfSet, ';');  //TODO: check this really removes
        }
 
        public static string PrintCSVHeaderOnExport()
@@ -1628,7 +1631,7 @@ public class ForceSensorGraphABExport: ForceSensorGraphAB
                return "fullURL;decimalChar;maxForceRaw;maxAvgForceInWindow;" +
                        "captureOptions;title;exercise;date;time;set;rep;" +
                        "triggersON;triggersOFF;" + //unused on export
-                       "startSample;endSample";
+                       "startSample;endSample;comments";
        }
 }
 
@@ -2845,6 +2848,7 @@ public class ForceSensorExport
                                                                forceSensorAnalyzeMaxAVGInWindowSeconds, //raw
                                                                fsesm.GetCount(p.UniqueID, 
fsEx.UniqueID),//setCount,
                                                                repCount ++,
+                                                               fs.Comments,
                                                                fs.CaptureOption,
                                                                repConcentricSampleStart,       //start of 
concentric rep
                                                                rep.sampleEnd,                  //end of 
eccentric rep
@@ -2893,6 +2897,7 @@ public class ForceSensorExport
                                                        forceSensorAnalyzeMaxAVGInWindowSeconds, //raw
                                                        fsesm.GetCount(p.UniqueID, fsEx.UniqueID),//setCount,
                                                        repCount ++,
+                                                       fs.Comments,
                                                        fs.CaptureOption,
                                                        sampleA,
                                                        sampleB,


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