[chronojump] Realtime No-RDotNet capture perfect data on ecS



commit b596588047ba79c4aa9dd400b4380af7dc1b9733
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Feb 9 18:01:35 2015 +0100

    Realtime No-RDotNet capture perfect data on ecS

 encoder/capture.R  |   15 ++++++++++++++-
 encoder/graph.R    |    1 -
 encoder/util.R     |    1 +
 src/gui/encoder.cs |    5 +++++
 4 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/encoder/capture.R b/encoder/capture.R
index 2ceb55d..7bfcb9a 100644
--- a/encoder/capture.R
+++ b/encoder/capture.R
@@ -73,6 +73,8 @@ while(input[1] != "Q") {
                displacement = displacement[start:end]
        }
 
+       position = cumsum(displacement)
+
        g = 9.81
                    
        #read AnalysisOptions
@@ -85,11 +87,22 @@ while(input[1] != "Q") {
        #simplify on capture and have the SmoothingEC == SmoothingC
        SmoothingsEC = op$SmoothingOneC
 
+       #if ecS go kinematics first time with "e" and second with "c"
+       #ceS do the opposite
+       myEcconKn = op$Eccon
+       if(myEcconKn == "ecS" || myEcconKn == "ceS") { 
+               if(mean(displacement) < 0)
+                       myEcconKn = "e"
+               else
+                       myEcconKn = "c"
+       }
+
+
        kinematicsResult <- kinematicsF(displacement, 
                    op$MassBody, op$MassExtra, op$ExercisePercentBodyWeight,
                    op$EncoderConfigurationName, op$diameter, op$diameterExt, op$anglePush, op$angleWeight, 
op$inertiaMomentum, op$gearedDown,
                    SmoothingsEC, op$SmoothingOneC, 
-                   g, op$Eccon, isPropulsive)
+                   g, myEcconKn, isPropulsive)
 
        paf = data.frame()
        paf = pafGenerate(op$Eccon, kinematicsResult, op$MassBody, op$MassExtra)
diff --git a/encoder/graph.R b/encoder/graph.R
index cc31e6d..13f7419 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -1924,7 +1924,6 @@ doProcess <- function(options)
                print("curves after reduceCurveBySpeed")
                print(curves)
 
-               
                if(curvesPlot) {
                        #/10 mm -> cm
                        for(i in 1:length(curves[,1])) { 
diff --git a/encoder/util.R b/encoder/util.R
index 63839bb..63f7c8a 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -355,6 +355,7 @@ kinematicsF <- function(displacement, massBody, massExtra, exercisePercentBodyWe
                smoothing = smoothingOneC
        else
                smoothing = smoothingOneEC
+       
 
 #print(c(" smoothing:",smoothing))
 
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 76d4411..3b227ac 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4858,6 +4858,9 @@ LogB.Debug("D");
                        LogB.Information("With trim");
                        LogB.Information(trimmed);
 
+                       //fix if data couldn't be calculated from R
+                       trimmed = trimmed.Replace("NA","0");
+
                        /*      
                        encoderCaptureStringR += 
string.Format("\n{0},2,a,3,4,{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},7",
                                        ecca.curvesAccepted +1,
@@ -4878,6 +4881,8 @@ LogB.Debug("D");
                                        strs[5], strs[6], strs[7],      //powers
                                        strs[8]);                       //pp/ppt
                        
+                       LogB.Debug("encoderCaptureStringR");
+                       LogB.Debug(encoderCaptureStringR);
 
                        double meanSpeed = Convert.ToDouble(Util.ChangeDecimalSeparator(strs[2]));
                        double maxSpeed = Convert.ToDouble(Util.ChangeDecimalSeparator(strs[3]));


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