[chronojump] Fixed propulsiveEnd crash on single, vert line ok
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed propulsiveEnd crash on single, vert line ok
- Date: Mon, 14 Apr 2014 20:47:12 +0000 (UTC)
commit e9e8c5fb104278258e9f24895b1e7549edc35fc9
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Apr 14 22:45:25 2014 +0200
Fixed propulsiveEnd crash on single, vert line ok
encoder/graph.R | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index c1af806..2b17d44 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -575,7 +575,7 @@ findPropulsiveEnd <- function(accel, concentric) {
if(length(which(accel[concentric]<=-g)) > 0)
propulsiveEnd = min(which(accel[concentric] <= -g))
else
- propulsiveEnd = max(concentric)
+ propulsiveEnd = length(concentric)
return (propulsiveEnd)
}
@@ -619,7 +619,7 @@ print(c(" |Ms|",round(max(abs(speed$y)),5)," |Ma|",round(max(abs(accel$y)),5)))
concentric = 0
propulsiveEnd = 0
-print(c("at kinematicsF eccon==", eccon))
+ print(c("at kinematicsF eccon: ", eccon, " length(displacement): ",length(displacement)))
#search propulsiveEnd
if(isPropulsive) {
@@ -632,6 +632,7 @@ print(c("at kinematicsF eccon==", eccon))
isometric = phases$isometric
concentric = phases$concentric
propulsiveEnd = length(eccentric) + length(isometric) +
findPropulsiveEnd(accel$y,concentric)
+ print(c("lengths: ", length(eccentric), length(isometric),
findPropulsiveEnd(accel$y,concentric), propulsiveEnd))
} else if(eccon=="e") {
#not eccon="e" because not propulsive calculations on eccentric
} else { #ecS
@@ -681,7 +682,6 @@ pafGenerate <- function(eccon, kinematics, massBody, massExtra) {
meanForce <- mean(kinematics$force)
maxForce <- max(abs(kinematics$force))
-
#here paf is generated
#mass is not used by pafGenerate, but used by Kg/W (loadVSPower)
#meanForce and maxForce are not used by pafGenerate, but used by F/S (forceVSSpeed)
@@ -952,13 +952,15 @@ paint <- function(displacement, eccon, xmin, xmax, yrange, knRanges, superpose,
#accel2 <- accel2 * 1000
#print(accel2)
- #propulsive phase ends when accel is -9.8
- if(length(which(accel$y[concentric]<=-g)) > 0 & isPropulsive) {
- propulsiveEnd = min(which(accel$y[concentric]<=-g))
- } else {
- propulsiveEnd = max(concentric)
+ if(isPropulsive) {
+ propulsiveEnd = findPropulsiveEnd(accel$y, concentric)
+ if(eccon != "c")
+ propulsiveEnd = length(eccentric) + length(isometric) + propulsiveEnd
}
+
+ print(c("propulsiveEnd at paint", propulsiveEnd))
+
meanSpeedC = mean(speed$y[min(concentric):max(concentric)])
if(isPropulsive) {
meanSpeedC = mean(speed$y[min(concentric):propulsiveEnd])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]