[chronojump/optimizeRFD] Added values of force and time in PERCENT_F_MAX option



commit bc579a2b0c06f9ce43c53cb3d3c177dbe9498ae5
Author: Xavier Padullés <testing chronojump org>
Date:   Sun Jan 3 18:05:32 2021 +0100

    Added values of force and time in PERCENT_F_MAX option

 r-scripts/maximumIsometricForce.R | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index a8ead7933..f122ea700 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -217,7 +217,7 @@ getDynamicsFromLoadCellFile <- function(captureOptions, inputFile, averageLength
 drawDynamicsFromLoadCell <- function(
     dynamics, captureOptions, vlineT0=T, vline50fmax.raw=F, vline50fmax.fitted=F,
     hline50fmax.raw=F, hline50fmax.fitted=F,
-    rfdDrawingOptions, triggersOn = "", triggersOff = "", xlimits = NA)
+    rfdDrawingOptions, triggersOn = "", triggersOff = "", xlimits = NA, forceLines = TRUE, timeLines = TRUE)
 {
     print("Dynamics in Draw:")
     # print(dynamics$time)
@@ -556,6 +556,7 @@ drawDynamicsFromLoadCell <- function(
                     
                     legendText = c(legendText, paste("RFD", percent, "%Fmax", " = ", round(RFD, digits = 1), 
" N/s", sep = ""))
                     legendColor = c(legendColor, "blue")
+                    valuesCol = "blue"
                     
                 } else if(RFDoptions$rfdFunction == "RAW")
                 {
@@ -569,8 +570,18 @@ drawDynamicsFromLoadCell <- function(
                     
                     legendText = c(legendText, paste("RFD", percent, "%", "Fmax", " = ", round(RFD, digits = 
1), " N/s", sep = ""))
                     legendColor = c(legendColor, "black")
+                    valuesCol = "black"
                     
                 }
+                
+                if(timeLines){
+                  abline(v=time1, lty = 3, col ="brown1")
+                  text(x = time1, y = 0, labels = paste(round(time1, digits = 3),"s"), pos = 3, col = 
valuesCol)
+                }
+                if(forceLines){
+                  abline(h=force1, lty = 3, col ="brown1")
+                  text(x = xmin, y = force1, labels = paste(round(force1, digits = 2),"N"), pos = 4, col = 
valuesCol)
+                }
             } else if(RFDoptions$type == "RFD_MAX")
             {
                 


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