[chronojump] Encoder fixed curves detection on ec



commit 89874683d8b853dffee32c104a3bb045ddfc35a9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Apr 1 23:22:40 2012 +0800

    Encoder fixed curves detection on ec

 encoder/graph.R    |   11 +++++++----
 src/gui/encoder.cs |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index bd1565d..8087d96 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -35,14 +35,17 @@ findCurves <- function(rawdata, eccon, min_height, draw) {
 			bottom=min(a[tempStart:tempEnd]) #find min value between the two tops
 			mintop=min(c(a[tempStart],a[tempEnd])) #find wich top is lower
 			height=mintop-bottom
-#			print(paste(height,i,j))
 			if(height >= min_height) { 
 				start[row] = tempStart
 				end[row]   = tempEnd
 				startH[row] = a[b$maxindex[i,1]]		#height at start
-				row=row+1; i=j; 
-#				if(eccon=="ec-con") { break } #ec-con only needs one result
-			} 
+				row=row+1
+				i=j
+			} else {
+				if(a[tempEnd] >= a[tempStart]) {
+					i=j
+				}
+			}
 			j=j+1
 		}
 	}
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 22985e9..13ef562 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -64,7 +64,7 @@ public partial class ChronoJumpWindow
 	//TODO: improve formatting of data.ataany column show same number of digits at left of dec point
 	//TODO: campanes a l'encoder pq mostri colors i sons en funcio del que passa
 	//TODO: in ec, curves and powerBars have to be different on ec than on c
-	//
+	//TODO: smaller zoom button on analysis
 	
 	public void on_radiobutton_encoder_capture_bar_toggled (object obj, EventArgs args) {
 		spin_encoder_bar_limit.Sensitive = true;



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