[chronojump/michrolab] Better message on SprintEncoder analyze when no enough accel or no sprint



commit bdf3de4673095504baa9c4a756d27cf6fa771a47
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jul 20 09:37:32 2022 +0200

    Better message on SprintEncoder analyze when no enough accel or no sprint

 r-scripts/sprintEncoder.R | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index d063548b1..2fee11933 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -183,13 +183,13 @@ getSprintFromEncoder <- function(filename, testLength, Mass, Temperature = 25, H
        #plot error if no enough acceleration
        if(trimmingSamples$start == -1 & trimmingSamples$end == -1)
        {
-               plot(position, type = "l", ylab = "Position (m)")
-                text(x = length(position)/2, y = max(position)/2,
-                     labels = "The capture has not enough accel", cex = 2, pos = 3)
-                text(x = length(position)/2, y = max(position)/3,
-                     labels = paste("Max raw detected accel: ", round(max(accel),2), "\nMinimum raw accel 
needed: ", startAccel), cex = 2, pos = 3)
-                text(x = length(position)/2, y = max(position)/4,
-                     labels = "or does not seem a sprint", cex = 2, pos = 3)
+               plot(position, type = "n", ylab = "Position (m)")
+                text(x = length(position)/2, y = max(position) * .75,
+                     labels = "The capture has not enough accel", cex = 2)
+                text(x = length(position)/2, y = max(position) *.5,
+                     labels = paste("Max raw detected accel: ", round(max(accel),2), "\nMinimum raw accel 
needed: ", startAccel), cex = 2)
+                text(x = length(position)/2, y = max(position) * .25,
+                     labels = "or does not seem a sprint", cex = 2)
                print("Capture has not enough accel")
                 return(list(longEnough = longEnough, regressionDone = FALSE))
        }


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