[chronojump] Bug fixes



commit 337ea8bd71524ce4eaf767344a864e2947e09ef0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Feb 25 18:56:21 2014 +0100

    Bug fixes

 encoder/graph.R    |   10 +++++++---
 src/gui/encoder.cs |    4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index f941b74..cf480f1 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -1735,6 +1735,10 @@ getMass <- function(mass, gearedDown, angle) {
        if(mass == 0)
                return (0)
 
+       #default value of angle is 90 degrees. If is not selected, it's -1
+       if(angle == -1)
+               angle = 90
+
        return ( ( mass / gearedDown ) * sin( angle * pi / 180 ) )
 }
 
@@ -1915,10 +1919,10 @@ doProcess <- function(options) {
        EncoderConfigurationName=       options[14]     #just the name of the EncoderConfiguration      
        diameter=       as.numeric(options[15]) #in meters, eg: 0.0175
        diameterExt=    as.numeric(options[16]) #in meters, eg: 0.0175
-       anglePush =     options[17]
-       angleWeight =   options[18]
+       anglePush =     as.numeric(options[17])
+       angleWeight =   as.numeric(options[18])
        inertiaMomentum=as.numeric(options[19])/10000.0 #comes in Kg*cm^2 eg: 100; convert it to Kg*m^2 eg: 
0.010
-       gearedDown =    options[20]
+       gearedDown =    as.numeric(options[20])
 
        SmoothingOneC=options[21]
        Jump=options[22]
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index f3fda7f..4e3735a 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4179,9 +4179,9 @@ Log.WriteLine(str);
 
                int graphWidth=encoder_capture_curves_bars_drawingarea.Allocation.Width;
                int graphHeight=encoder_capture_curves_bars_drawingarea.Allocation.Height;
-               
+       
                //search max
-               double max = 0;
+               double max = -100000;
                foreach(double d in data)
                        if(d > max)
                                max = d;


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