[chronojump] Fixed display of inertial curves
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed display of inertial curves
- Date: Thu, 29 Jan 2015 21:36:52 +0000 (UTC)
commit bcf316727756af5f07f811b2f1439c8636395df7
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jan 29 22:35:46 2015 +0100
Fixed display of inertial curves
encoder/capture.R | 1 +
encoder/util.R | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/encoder/capture.R b/encoder/capture.R
index ce190dd..2ceb55d 100644
--- a/encoder/capture.R
+++ b/encoder/capture.R
@@ -54,6 +54,7 @@ while(input[1] != "Q") {
position = cumsum(displacement)
start = 1
+#TODO................. #in inertial here it can be two phases: first, second or both
end = length(displacement)
if( ! isInertial(op$EncoderConfigurationName)) {
reduceTemp = reduceCurveBySpeed(op$Eccon, 1,
diff --git a/encoder/util.R b/encoder/util.R
index ea6211f..63839bb 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -693,6 +693,7 @@ getDisplacementInertialBody <- function(displacement, draw, title)
position.ext=extrema(position)
}
+ #unused
firstDownPhaseTime = position.ext$minindex[1]
downHeight = abs(position[1] - position[firstDownPhaseTime])
}
@@ -700,6 +701,8 @@ getDisplacementInertialBody <- function(displacement, draw, title)
positionPerson = abs(cumsum(displacement))*-1
#this is to make "inverted cumsum"
displacementPerson = c(0,diff(positionPerson))
+
+ #write(displacementPerson,stderr())
if(draw) {
col="black"
@@ -707,6 +710,7 @@ getDisplacementInertialBody <- function(displacement, draw, title)
,position/10, #mm -> cm
type="l",
xlim=c(1,length(position))/1000, #ms -> s
+ ylim=c(min(positionPerson)/10,max(position/10)),
xlab="",ylab="",axes=T,
lty=2,col=col)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]