[chronojump] Fixed crash on recalculate when 1 c cannot be changed to 1 ec



commit 0c58ed855d444160231cb1368f26e92fc8566bfa
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 2 12:50:36 2016 +0200

    Fixed crash on recalculate when 1 c cannot be changed to 1 ec

 encoder/graph.R |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 8ae136c..d2fe54e 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -2112,8 +2112,9 @@ quitIfNoData <- function(n, curves, outputData1) {
         debugParameters(listN(n, curves, outputData1), "quitIfNoData")
         
        #if not found curves with this data, plot a "sorry" message and exit
-       if( n == 1 && 
-          (is.na(curves[1,1]) || curves[1,1] == 0 || is.na(curves[1,2]) || curves[1,2] <= 0) ) { #bad 
curves[1,2] on inertial returns -1
+       if( n== 0 || 
+          ( n == 1 && (is.na(curves[1,1]) || curves[1,1] == 0 || is.na(curves[1,2]) || curves[1,2] <= 0) )  
#bad curves[1,2] on inertial returns -1
+          ) {
                plot(0,0,type="n",axes=F,xlab="",ylab="")
                text(x=0,y=0,translateToPrint("Sorry, no curves matched your criteria."),cex=1.5)
                dev.off()
@@ -2445,8 +2446,8 @@ doProcess <- function(options)
                n=length(curves[,1])
                quitIfNoData(n, curves, op$OutputData1)
                
-               #print("curves before reduceCurveBySpeed")
-               #print(curves)
+               print("curves before reduceCurveBySpeed")
+               print(curves)
        
                #reduceCurveBySpeed, don't do in inertial because it doesn't do a good right adjust on 
changing phase
                #what reduceCurveBySpeed is doing in inertial is adding a value at right, and this value is a 
descending value


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