[chronojump] minor changes



commit dac10c1da31b302278e6cdd396f630fb9096542e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jan 24 17:41:22 2014 +0100

    minor changes

 encoder/graph.R                           |   16 ++++----
 images/encoder-linear-free-weight-inv.png |  Bin 12724 -> 12580 bytes
 images/svg/encoder-mode-icons.svg         |   63 +++++++++++++++++++++++-----
 src/utilEncoder.cs                        |    3 +-
 4 files changed, 61 insertions(+), 21 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 935879f..f6dea21 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -1599,13 +1599,13 @@ find.yrange <- function(singleFile, rawdata, curves) {
        return (c(y.min,y.max))
 }
 
-#encoderMode conversions
+#encoderConfiguration conversions
 #in signals and curves, need to do conversions (invert, inertiaMomentum, diameter)
-encoderModeConversions <- function(rawdata, encoderMode, diameter) {
+encoderConfigurationConversions <- function(rawdata, encoderConfiguration, diameter) {
        #write(rawdata, "debug-file.txt")
-       if(encoderMode == "LINEARINVERTED") {
+       if(encoderConfiguration == "LINEARINVERTED") {
                rawdata = -rawdata
-       } else if(encoderMode == "ROTARYAXIS") {
+       } else if(encoderConfiguration == "ROTARYAXIS") {
                ticksRotaryEncoder = 200 #our rotary axis encoder send 200 ticks by turn
                #diameter m -> mm
                rawdata = ( rawdata / ticksRotaryEncoder ) * 2 * pi * ( diameter * 1000 / 2 )
@@ -1661,7 +1661,7 @@ doProcess <- function(options) {
        
        AnalysisOptions=options[12]     
 
-       encoderMode=            options[13]     
+       encoderConfiguration=           options[13]     
        inertiaMomentum=        as.numeric(options[14])/10000   #comes in Kg*cm^2 eg: 100; convert it to 
Kg*m^2 eg: 0.010
        diameter=               as.numeric(options[15]) #in meters, eg: 0.0175
        
@@ -1685,7 +1685,7 @@ doProcess <- function(options) {
        #if nothing: "-;-"
        analysisOptionsTemp = unlist(strsplit(AnalysisOptions, "\\;"))
        isPropulsive = (analysisOptionsTemp[1] == "p")
-       inertialType = ""       #TODO: use encoderMode
+       inertialType = ""       #TODO: use encoderConfiguration
        if(length(analysisOptionsTemp) > 1) {
                inertialType = analysisOptionsTemp[2] #values: "" || "li" || "ri"
        }
@@ -1775,7 +1775,7 @@ doProcess <- function(options) {
                        #this removes all NAs on a curve
                        dataTempFile  = dataTempFile[!is.na(dataTempFile)]
 
-                       dataTempFile = encoderModeConversions(dataTempFile, encoderMode, diameter)
+                       dataTempFile = encoderConfigurationConversions(dataTempFile, encoderConfiguration, 
diameter)
 
                        dataTempPhase=dataTempFile
                        processTimes = 1
@@ -1868,7 +1868,7 @@ doProcess <- function(options) {
                #this removes all NAs
                rawdata  = rawdata[!is.na(rawdata)]
                        
-               rawdata = encoderModeConversions(rawdata, encoderMode, diameter)
+               rawdata = encoderConfigurationConversions(rawdata, encoderConfiguration, diameter)
 
                if(length(rawdata)==0) {
                        plot(0,0,type="n",axes=F,xlab="",ylab="")
diff --git a/images/encoder-linear-free-weight-inv.png b/images/encoder-linear-free-weight-inv.png
index 2f7c19f..d8a9e42 100644
Binary files a/images/encoder-linear-free-weight-inv.png and b/images/encoder-linear-free-weight-inv.png 
differ
diff --git a/images/svg/encoder-mode-icons.svg b/images/svg/encoder-mode-icons.svg
index daf4dcc..d4abf42 100644
--- a/images/svg/encoder-mode-icons.svg
+++ b/images/svg/encoder-mode-icons.svg
@@ -33,7 +33,7 @@
      showgrid="false"
      inkscape:zoom="0.034684653"
      inkscape:cx="5821.5191"
-     inkscape:cy="8188.0593"
+     inkscape:cy="8087.1501"
      inkscape:window-x="0"
      inkscape:window-y="27"
      inkscape:window-maximized="1"
@@ -9093,6 +9093,46 @@
        y1="4258.1187"
        x2="-833.49841"
        y2="3232.9158" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5962"
+       id="linearGradient5262"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(5340.0198,-2089.8184)"
+       x1="-1016.8681"
+       y1="4258.1187"
+       x2="-833.49841"
+       y2="3232.9158" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient30038-0-4-1-3-7-1-8-6"
+       id="linearGradient5264"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,0.61312061,-0.61312061,0,1348.9903,1639.9467)"
+       x1="175.72"
+       y1="737.02002"
+       x2="470"
+       y2="737.02002" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient30038-0-4-1-3-8-11-1-4"
+       id="linearGradient5266"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,0.27444602,-0.27444602,0,688.33761,440.17634)"
+       x1="175.72"
+       y1="737.02002"
+       x2="470"
+       y2="737.02002" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient30038-0-4-1-3-7-1-5"
+       id="linearGradient5268"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0,0.27444602,-0.27444602,0,688.33761,440.17634)"
+       x1="175.72"
+       y1="737.02002"
+       x2="470"
+       y2="737.02002" />
   </defs>
   <metadata
      id="metadata5687">
@@ -9476,20 +9516,19 @@
     </g>
   </g>
   <g
-     id="g6705"
-     transform="translate(3266.378,-2089.8182)"
+     id="g5270"
      
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/encoder-linear-free-weight-inv.png"
-     inkscape:export-xdpi="15.721952"
-     inkscape:export-ydpi="15.721952">
+     inkscape:export-xdpi="15.721946"
+     inkscape:export-ydpi="15.721946">
     <rect
-       y="3202.9993"
-       x="211.91791"
+       y="1113.181"
+       x="3478.2959"
        height="1144.896"
        width="1643.2404"
        id="rect5960-9"
-       style="fill:url(#linearGradient4413);fill-opacity:1;stroke:none" />
+       style="fill:url(#linearGradient5262);fill-opacity:1;stroke:none" />
     <g
-       transform="translate(-1351.8607,972.509)"
+       transform="translate(1872.6497,-1117.3092)"
        id="g5850">
       <g
          id="g5197-6"
@@ -9561,7 +9600,7 @@
            d="m 942.8667,1747.66 -0.38321,0 c 0.1269,0.014 0.25665,0.027 0.38321,0.038 l 0,-0.038 z m 
0,180.3289 c -0.42988,0.039 -0.86926,0.077 -1.30284,0.077 l 1.30284,0 0,-0.077 z m -1.30284,0.077 c 
-19.58094,0 -35.46476,-40.425 -35.46476,-90.2243 -2e-5,-49.0212 15.38688,-88.9493 34.54503,-90.1852 l 
-52.92004,0 c -0.30409,-0.02 -0.59456,-0.02 -0.90051,-0.02 -0.29331,0 -0.58976,0 -0.88137,0.02 
-19.17636,1.1858 -34.60227,41.1327 -34.60227,90.1852 0,49.0539 15.42591,89.0002 34.60227,90.1853 l 0,0.038 
55.62068,0 z"
            id="path30018-4-3-3-7-0-9-8-3"
            inkscape:connector-curvature="0"
-           style="fill:url(#linearGradient4415)" />
+           style="fill:url(#linearGradient5264)" />
         <path
            d="m 938.82116,1928.1019 c -19.59124,0 -35.47213,-40.3912 -35.47213,-90.2146 0,-49.8252 
15.88226,-90.2145 35.47213,-90.2145 19.59121,0 35.4721,40.3911 35.4721,90.2145 0,49.8253 -15.88223,90.2146 
-35.4721,90.2146 z"
            id="path30020-0-3-7-7-6-5-5-5"
@@ -9625,7 +9664,7 @@
                d="m 506.54791,488.39117 -0.17153,0 c 0.0568,0.006 0.11488,0.0122 0.17153,0.0169 l 0,-0.0169 
z m 0,80.71907 c -0.19242,0.0175 -0.3891,0.0344 -0.58318,0.0344 l 0.58318,0 0,-0.0344 z m -0.58318,0.0344 c 
-8.76485,0 -15.87479,-18.09512 -15.87479,-40.38633 -1e-5,-21.94298 6.8875,-39.81566 15.4631,-40.36885 l 
-23.68815,0 c -0.13612,-0.009 -0.26614,-0.009 -0.40309,-0.009 -0.13129,0 -0.26399,5.3e-4 -0.39452,0.009 
-8.58375,0.53077 -15.48872,18.41189 -15.48872,40.36885 0,21.95755 6.90497,39.83838 15.48872,40.36886 l 
0,0.0169 24.89702,0 z"
                id="path30018-4-3-3-7-1-8-2-3"
                inkscape:connector-curvature="0"
-               style="fill:url(#linearGradient4417)" />
+               style="fill:url(#linearGradient5266)" />
             <path
                d="m 504.73704,569.16084 c -8.76946,0 -15.87809,-18.07996 -15.87809,-40.38199 0,-22.30286 
7.10924,-40.38199 15.87809,-40.38199 8.76945,0 15.87808,18.07996 15.87808,40.38199 0,22.30285 
-7.10923,40.38199 -15.87808,40.38199 z"
                id="path30020-0-3-7-7-0-7-1-6"
@@ -9644,7 +9683,7 @@
                d="m 506.54791,488.39117 -0.17153,0 c 0.0568,0.006 0.11488,0.0122 0.17153,0.0169 l 0,-0.0169 
z m 0,80.71907 c -0.19242,0.0175 -0.3891,0.0344 -0.58318,0.0344 l 0.58318,0 0,-0.0344 z m -0.58318,0.0344 c 
-8.76485,0 -15.87479,-18.09512 -15.87479,-40.38633 -1e-5,-21.94298 6.8875,-39.81566 15.4631,-40.36885 l 
-23.68815,0 c -0.13612,-0.009 -0.26614,-0.009 -0.40309,-0.009 -0.13129,0 -0.26399,5.3e-4 -0.39452,0.009 
-8.58375,0.53077 -15.48872,18.41189 -15.48872,40.36885 0,21.95755 6.90497,39.83838 15.48872,40.36886 l 
0,0.0169 24.89702,0 z"
                id="path30018-4-3-3-7-0-9-4"
                inkscape:connector-curvature="0"
-               style="fill:url(#linearGradient4419)" />
+               style="fill:url(#linearGradient5268)" />
             <path
                d="m 504.73704,569.16084 c -8.76946,0 -15.87809,-18.07996 -15.87809,-40.38199 0,-22.30286 
7.10924,-40.38199 15.87809,-40.38199 8.76945,0 15.87808,18.07996 15.87808,40.38199 0,22.30285 
-7.10923,40.38199 -15.87808,40.38199 z"
                id="path30020-0-3-7-7-6-5-7"
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index 7392573..153f25d 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -441,8 +441,9 @@ public class UtilEncoder
                return fileCurve;
        }
 
+       //this == encoder/graph.R encoderConfigurationConversions
+       
        public static double EncoderConfigurationConversions(
-                       //int byteReaded, string encoderMode, int inertiaMomentum, double diameter) {
                        int byteReaded, EncoderConfiguration ec) {
                double byteConverted = byteReaded;
 


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