[chronojump] ForceSensor export adds a columnt with maxAVGForceInWindow
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor export adds a columnt with maxAVGForceInWindow
- Date: Tue, 16 Feb 2021 19:53:04 +0000 (UTC)
commit 49d1a111f44edc192bf50998b3d58af1fe334838
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Feb 16 20:52:34 2021 +0100
ForceSensor export adds a columnt with maxAVGForceInWindow
r-scripts/maximumIsometricForce.R | 3 ++-
src/forceSensor.cs | 19 +++++++++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index b76502b3..a9e51bce 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -1123,7 +1123,7 @@ start <- function(op)
exportModelVectorOnFail = c(exportModelVectorOnFail, NA) #impulse
#preparing header row (each set will have this in the result dataframe to be able to combine
them)
- exportNames = c("Name","Exercise","Fmax")
+ exportNames = c("Name","Exercise","MaxAvgForceInWindow","Fmax")
for(i in 1:length(op$drawRfdOptions))
{
RFDoptions = readRFDOptions(op$drawRfdOptions[i])
@@ -1170,6 +1170,7 @@ start <- function(op)
#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$exercise[i])
+ exportSetDF = cbind (exportSetDF, dataFiles$maxAvgForceInWindow[i])
for(j in 1:length(exportModelVector))
exportSetDF = cbind (exportSetDF, exportModelVector[j])
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index cab1cbf3..2a5d0e8b 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1510,8 +1510,12 @@ public class ForceSensorImpulse : ForceSensorRFD
//can be just one on analyze or multiple (as a list) on export
public class ForceSensorGraphAB
{
+ //for export
public string fullURL;
public bool decimalIsPoint;
+ public double maxAvgForceInWindow; //TODO: need to pass the window widht in seconds on graph.R
+
+ //for graph and for export
public ForceSensor.CaptureOptions fsco;
public int startSample;
public int endSample;
@@ -1542,12 +1546,13 @@ public class ForceSensorGraphAB
//constructor for export
public ForceSensorGraphAB (
- string fullURL, bool decimalIsPoint,
+ string fullURL, bool decimalIsPoint, double maxAvgForceInWindow,
ForceSensor.CaptureOptions fsco, int startSample, int endSample,
string title, string exercise, string datetime, TriggerList triggerList)
{
assignParams(fsco, startSample, endSample, title, exercise, datetime, triggerList);
+ this.maxAvgForceInWindow = maxAvgForceInWindow;
this.fullURL = fullURL;
this.decimalIsPoint = decimalIsPoint;
}
@@ -1565,6 +1570,7 @@ public class ForceSensorGraphAB
return fullURL + ";" +
decimalChar + ";" +
+ Util.ConvertToPoint(maxAvgForceInWindow) + ";" +
fsco.ToString() + ";" +
title + ";" +
exercise + ";" +
@@ -1576,7 +1582,8 @@ public class ForceSensorGraphAB
public static string PrintCSVHeaderOnExport()
{
- return "fullURL;decimalChar;captureOptions;title;exercise;datetime;" +
+ return "fullURL;decimalChar;maxAvgForceInWindow;" +
+ "captureOptions;title;exercise;datetime;" +
"triggersON;triggersOFF;" + //unused on export
"startSample;endSample";
}
@@ -2671,14 +2678,22 @@ public class ForceSensorExport
if(rep.type == ForceSensorRepetition.Types.CON)
repConcentricSampleStart = rep.sampleStart;
else if(rep.type == ForceSensorRepetition.Types.ECC &&
repConcentricSampleStart != -1)
+ {
+ double maxAvgForceInWindow = 0;
+ bool success = fsAI.CalculateRangeParams(repConcentricSampleStart,
rep.sampleEnd, 1);
+ if(success)
+ maxAvgForceInWindow = fsAI.ForceMaxAvgInWindow;
+
fsgAB_l.Add(new ForceSensorGraphAB (
fs.FullURL,
Util.CSVDecimalColumnIsPoint(fs.FullURL, 1),
+ maxAvgForceInWindow,
fs.CaptureOption,
repConcentricSampleStart, //start of
concentric rep
rep.sampleEnd, //end of
eccentric rep
title, exercise, fs.DateTimePublic, new
TriggerList()
));
+ }
}
//TODO: or check cancel when there is a thread, also R should write something blank
if there is any problem
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]