[chronojump] ForceSensor export exports name & exercise
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor export exports name & exercise
- Date: Wed, 10 Feb 2021 16:14:57 +0000 (UTC)
commit 797f81290b44123ddd3af702fb2d3ec0bb2a0202
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Feb 10 17:14:41 2021 +0100
ForceSensor export exports name & exercise
r-scripts/maximumIsometricForce.R | 11 ++++++-----
src/forceSensor.cs | 8 ++++----
2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index 5be4aac2..786c07f9 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -208,13 +208,15 @@ getDynamicsFromLoadCellFile <- function(captureOptions, inputFile, decimalChar,
))
}
-drawDynamicsFromLoadCell <- function(titleFull, datetime,
+drawDynamicsFromLoadCell <- function(title, exercise, datetime,
dynamics, captureOptions, vlineT0=T, vline50fmax.raw=F, vline50fmax.fitted=F,
hline50fmax.raw=F, hline50fmax.fitted=F,
rfdDrawingOptions, triggersOn = "", triggersOff = "", xlimits = NA, forceLines = TRUE, timeLines = TRUE)
{
print("Dynamics in Draw:")
# print(dynamics$time)
+
+ titleFull = paste(title, exercise, sep=" - ")
dynamics$time = dynamics$time - dynamics$startTime
dynamics$tfmax.raw = dynamics$tfmax.raw - dynamics$startTime
dynamics$endTime = dynamics$endTime - dynamics$startTime
@@ -440,7 +442,7 @@ drawDynamicsFromLoadCell <- function(titleFull, datetime,
)
legendColor = c("blue", "blue", "blue")
- exportValues = dynamics$fmax.fitted
+ exportValues = c(title, exercise, dynamics$fmax.fitted)
#The coordinates where the lines and dots are plotted are calculated with the sampled data in raw and
fitted data.
#The slopes are calculated in that points
@@ -1078,7 +1080,6 @@ doProcess <- function(pngFile, dataFile, decimalChar, title, exercise, datetime,
{
title = fixTitleAndOtherStrings(title)
exercise = fixTitleAndOtherStrings(exercise)
- titleFull = paste(title, exercise, sep=" - ")
datetime = fixDatetime(datetime)
print("Going to enter prepareGraph")
@@ -1088,7 +1089,7 @@ doProcess <- function(pngFile, dataFile, decimalChar, title, exercise, datetime,
dynamics = getDynamicsFromLoadCellFile(captureOptions, dataFile, decimalChar, op$averageLength,
op$percentChange, testLength = op$testLength, startSample, endSample)
print("Going to draw")
- drawDynamicsFromLoadCell(titleFull, datetime, dynamics, captureOptions, op$vlineT0,
op$vline50fmax.raw, op$vline50fmax.fitted, op$hline50fmax.raw, op$hline50fmax.fitted,
+ drawDynamicsFromLoadCell(title, exercise, datetime, dynamics, captureOptions, op$vlineT0,
op$vline50fmax.raw, op$vline50fmax.fitted, op$hline50fmax.raw, op$hline50fmax.fitted,
op$drawRfdOptions, triggersOn = op$triggersOnList, triggersOff = op$triggersOffList)
# op$drawRfdOptions, xlimits = c(0.5, 1.5))
endGraph()
@@ -1138,7 +1139,7 @@ if(op$singleOrMultiple == "TRUE")
print(dfExport)
#preparing header row
- exportNames = "Fmax"
+ exportNames = c("Name","Exercise","Fmax")
for(i in 1:length(op$drawRfdOptions))
{
RFDoptions = readRFDOptions(op$drawRfdOptions[i])
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 3ffc21bd..71bf7e4d 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1412,7 +1412,7 @@ public class ForceSensorGraphAB
this.triggerList = triggerList;
}
- public string ToCSVRow()
+ public string ToCSVRowOnExport()
{
//since 2.0.3 decimalChar is . (before it was locale specific)
string decimalChar = ".";
@@ -1434,7 +1434,7 @@ public class ForceSensorGraphAB
endSample.ToString();
}
- public static string PrintCSVHeader()
+ public static string PrintCSVHeaderOnExport()
{
return "fullURL;decimalChar;captureOptions;title;exercise;datetime;" +
"triggersON;triggersOFF;" + //unused on export
@@ -1628,11 +1628,11 @@ public class ForceSensorGraph
TextWriter writer = File.CreateText(UtilEncoder.GetmifCSVInputMulti());
//write header
- writer.WriteLine(ForceSensorGraphAB.PrintCSVHeader());
+ writer.WriteLine(ForceSensorGraphAB.PrintCSVHeaderOnExport());
//write fsgAB_l for
foreach(ForceSensorGraphAB fsgAB in fsgAB_l)
- writer.WriteLine(fsgAB.ToCSVRow());
+ writer.WriteLine(fsgAB.ToCSVRowOnExport());
writer.Flush();
writer.Close();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]