[chronojump] code clean
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] code clean
- Date: Fri, 1 Apr 2016 07:16:22 +0000 (UTC)
commit 8d2087a48165d879bb1db9ce3dd402eea0cb6360
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Apr 1 09:13:25 2016 +0200
code clean
encoder/capture.R | 15 +--------------
encoder/graph.R | 2 +-
encoder/util.R | 2 +-
3 files changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/encoder/capture.R b/encoder/capture.R
index 3ada1f2..12dcfa6 100644
--- a/encoder/capture.R
+++ b/encoder/capture.R
@@ -134,8 +134,6 @@ doProcess <- function(options)
#print (op)
curveNum = 0
- inertialPositionCurveSentStart = 0
- inertialPositionCurveSentEnd = 0
#Don't measure on first phase (initial eccentric)
#inertialCapturingFirstPhase = TRUE
@@ -167,8 +165,6 @@ doProcess <- function(options)
curveNum = 0
- inertialPositionCurveSentStart = 0
- inertialPositionCurveSentEnd = 0
#inertialCapturingFirstPhase = TRUE
input <- readLines(f, n = 1L)
@@ -212,13 +208,6 @@ doProcess <- function(options)
diametersPerTick = getInertialDiametersPerMs(displacement, op$diameter)
displacement = getDisplacementInertial(displacement, op$EncoderConfigurationName,
diametersPerTick, op$diameterExt,
op$gearedDown)
-
- #need to do this before getDisplacementInertialBody cuts the curve: /|\
- positionTemp = cumsum(displacement)
- inertialPositionCurveSentEnd = inertialPositionCurveSentStart +
positionTemp[length(positionTemp)]
-
- #since 1.6.1 sign change from con to ecc is done in C#
- #displacement = getDisplacementInertialBody(inertialPositionCurveSentStart,
displacement, FALSE, op$Title) #draw: FALSE
} else {
displacement = getDisplacement(op$EncoderConfigurationName, displacement,
op$diameter, op$diameterExt)
}
@@ -226,7 +215,7 @@ doProcess <- function(options)
start = 1
end = length(displacement)
if( ! isInertial(op$EncoderConfigurationName)) {
- reduceTemp = reduceCurveBySpeed(op$Eccon, 1,
+ reduceTemp = reduceCurveBySpeed(op$Eccon,
1, 0, #startT, startH
displacement, #displacement
op$SmoothingOneC #SmoothingOneC
@@ -257,8 +246,6 @@ doProcess <- function(options)
}
- inertialPositionCurveSentStart = inertialPositionCurveSentEnd
-
#if(debug)
# write("doProcess 4", stderr())
diff --git a/encoder/graph.R b/encoder/graph.R
index af33478..6b59ef2 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -2447,7 +2447,7 @@ doProcess <- function(options)
#and this produces a high acceleration there
if( ! isInertial(op$EncoderConfigurationName)) {
for(i in 1:n) {
- reduceTemp=reduceCurveBySpeed(op$Eccon, i,
+ reduceTemp=reduceCurveBySpeed(op$Eccon,
curves[i,1], curves[i,3], #startT, startH
displacement[curves[i,1]:curves[i,2]],
#displacement
op$SmoothingOneC
diff --git a/encoder/util.R b/encoder/util.R
index c8dd608..ebeb410 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -311,7 +311,7 @@ getMass <- function(mass, gearedDown, angle) {
#used in alls eccons
-reduceCurveBySpeed <- function(eccon, row, startT, startH, displacement, smoothingOneC)
+reduceCurveBySpeed <- function(eccon, startT, startH, displacement, smoothingOneC)
{
#In 1.4.0 and before, we use smoothingOneEC on "ec", "ce"
#but the problem is findSmoothingsEC has problems knowing the smoothingEC when users stays stand up
lot of time before jump.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]