[chronojump] Doing encoder concentric-eccentric



commit da420430881d2b0e3f1a74b985c9c70ead041be6
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jul 21 12:12:36 2013 +0200

    Doing encoder concentric-eccentric

 encoder/graph.R    |   23 +++++++++++++++++++----
 src/gui/encoder.cs |   20 +++++++++++++++++++-
 2 files changed, 38 insertions(+), 5 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 2d3a558..3723d64 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -877,9 +877,11 @@ paintPowerPeakPowerBars <- function(singleFile, title, paf, myEccons, Eccon, hei
        height = abs(height/10)
        load = paf[,findPosInPaf("Load","")]
        
-       if(Eccon=="ecS") {
+       if(Eccon=="ecS" || Eccon=="ceS") {
                if(singleFile) {
                        myEc=c("c","e")
+                       if(Eccon=="ceS")
+                               myEc=c("e","c")
                        myNums = as.numeric(rownames(paf))
                        myNums = paste(trunc((myNums+1)/2),myEc[((myNums%%2)+1)],sep="")
                }
@@ -916,7 +918,7 @@ paintPowerPeakPowerBars <- function(singleFile, title, paf, myEccons, Eccon, hei
        mtext("Curve\nLoad",side=1,at=1,adj=0,line=1,cex=.9)
        par(new=T, xpd=T)
        #on ecS, concentric has high value of time to peak power and eccentric has it very low. Don't draw 
lines
-       if(Eccon=="ecS")
+       if(Eccon=="ecS" || Eccon=="ceS")
                plot(bp[2,],paf[,findPosInPaf("Power","time")],type="p",lwd=2,
                     xlim=c(1,n*3+.5),ylim=c(0,max(paf[,findPosInPaf("Power","time")])),
                     axes=F,xlab="",ylab="",col="blue", bg="lightblue",cex=1.5,pch=21)
@@ -1014,9 +1016,11 @@ paintCrossVariables <- function (paf, varX, varY, option, isAlone, title, single
        #if only one series
        if(length(unique(seriesName)) == 1) {
                myNums = rownames(paf)
-               if(Eccon=="ecS") {
+               if(Eccon=="ecS" || Eccon=="ceS") {
                        if(singleFile) {
                                myEc=c("c","e")
+                               if(Eccon=="ceS")
+                                       myEc=c("e","c")
                                myNums = as.numeric(rownames(paf))
                                myNums = paste(trunc((myNums+1)/2),myEc[((myNums%%2)+1)],sep="")
                        }
@@ -1378,7 +1382,7 @@ doProcess <- function(options) {
                        processTimes = 1
                        changePos = 0
                        #if this curve is ecc-con and we want separated, divide the curve in two
-                       if(as.vector(inputMultiData$eccon[i]) != "c" & Eccon =="ecS") {
+                       if(as.vector(inputMultiData$eccon[i]) != "c" & (Eccon=="ecS" || Eccon=="ceS") ) {
                                changePos = mean(which(cumsum(dataTempFile) == min(cumsum(dataTempFile))))
                                processTimes = 2
                        }
@@ -1667,6 +1671,11 @@ doProcess <- function(options) {
                                        discardingCurves = TRUE
                                        next;
                                }
+                               else if( (Analysis == "1RMBadillo2010" || analysisCross[1] == 
"1RMAnyExercise") & Eccon == "ceS" & i%%2 == 0) {
+                                       discardedCurves = c(i,discardedCurves)
+                                       discardingCurves = TRUE
+                                       next;
+                               }
                        }
 
                        print("i:")
@@ -1680,6 +1689,12 @@ doProcess <- function(options) {
                               else
                                       myEcconKn = "c"
                        }
+                       else if(Eccon=="ceS") {
+                              if(i%%2 == 1)
+                                      myEcconKn = "c"
+                              else
+                                      myEcconKn = "e"
+                       }
                        paf=rbind(paf,(powerBars(myEccon,
                                                 kinematicsF(rawdata[curves[i,1]:curves[i,2]], 
                                                             myMass, SmoothingOneEC,SmoothingOneC, 
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 1aacfb3..67411b6 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -2933,7 +2933,7 @@ Log.WriteLine(str);
                if(ecconLast == "c")
                        (cell as Gtk.CellRendererText).Text = 
                                String.Format(UtilGtk.TVNumPrint(curve.N,1,0),Convert.ToInt32(curve.N));
-               else {
+               else if (ecconLast=="ec" || ecconLast =="ecS") {
                        string phase = "e";
                        bool isEven = Util.IsEven(Convert.ToInt32(curve.N));
                        if(isEven)
@@ -2941,6 +2941,14 @@ Log.WriteLine(str);
                                
                        (cell as Gtk.CellRendererText).Text = 
                                decimal.Truncate((Convert.ToInt32(curve.N) +1) /2).ToString() + phase;
+               } else {        //(ecconLast=="ce" || ecconLast =="ceS") {
+                       string phase = "c";
+                       bool isEven = Util.IsEven(Convert.ToInt32(curve.N));
+                       if(isEven)
+                               phase = "e";
+                               
+                       (cell as Gtk.CellRendererText).Text = 
+                               decimal.Truncate((Convert.ToInt32(curve.N) +1) /2).ToString() + phase;
                }
        }
        //from analyze, don't checks ecconLast
@@ -2957,6 +2965,16 @@ Log.WriteLine(str);
 
                        (cell as Gtk.CellRendererText).Text = 
                                decimal.Truncate((Convert.ToInt32(curve.N) +1) /2).ToString() + phase;
+               }
+               else if(radiobutton_encoder_analyze_data_current_signal.Active && findEccon(false) == "ceS") 
+               {
+                       string phase = "c";
+                       bool isEven = Util.IsEven(Convert.ToInt32(curve.N));
+                       if(isEven)
+                               phase = "e";
+
+                       (cell as Gtk.CellRendererText).Text = 
+                               decimal.Truncate((Convert.ToInt32(curve.N) +1) /2).ToString() + phase;
                } else
                        (cell as Gtk.CellRendererText).Text = curve.N;
        }


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