[chronojump] Encoder: curves powers fixed



commit c5e72ed6b1c9c6687166364c18d6fd62764c1109
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Mar 31 21:12:35 2012 +0800

    Encoder: curves powers fixed

 encoder/graph.R        |   10 ++++++++--
 glade/chronojump.glade |    2 +-
 src/gui/encoder.cs     |   12 ++++++++----
 3 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 7e63e62..4701ac9 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -299,6 +299,10 @@ paint <- function(rawdata, eccon, xmin, xmax, yrange, knRanges, superpose, highl
 
 paintPowerPeakPowerBars <- function(paf) {
 	pafColors=c("tomato1","tomato4",topo.colors(10)[3])
+
+
+print(paf[,3])
+
 	bp <- barplot(rbind(paf[,3],paf[,4]),beside=T,col=pafColors[1:2],width=c(1.4,.6),
 			names.arg=1:n,xlim=c(1,n*3+.5),xlab="",ylab="Power (W)")
 	par(new=T)
@@ -420,12 +424,14 @@ if(length(args) < 3) {
 		for(i in 1:n) { 
 			paf=rbind(paf,(powerBars(kinematicsF(rawdata[curves[i,1]:curves[i,2]], mass, g))))
 		}
-		if(analysis=="powerBars")
+		if(analysis=="powerBars") {
 			paintPowerPeakPowerBars(paf)
+			#print(paf)
+		} 
 		if(analysis=="curves") {
 			paf=cbind(curves[,2]-curves[,1],rawdata.cumsum[curves[,2]]-curves[,3],paf)
 			colnames(paf)=c("width","height","meanSpeed","maxSpeed","meanPower","peakPower","peakPowerT")
-			print(paf)
+			#print(paf)
 			write.csv(paf, outputData1, quote=FALSE)
 		}
 	}
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 61bae90..046398f 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -14578,7 +14578,7 @@ Chronopic</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkSpinButton" id="spin_encoder_analyze_smooth">
+                                                  <widget class="GtkSpinButton" id="spin_encoder_smooth">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="invisible_char">â</property>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 710c9be..f77fd98 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -30,7 +30,7 @@ public partial class ChronoJumpWindow
 {
 	[Widget] Gtk.SpinButton spin_encoder_bar_limit;
 	[Widget] Gtk.SpinButton spin_encoder_jump_limit;
-	[Widget] Gtk.SpinButton spin_encoder_analyze_smooth;
+	[Widget] Gtk.SpinButton spin_encoder_smooth;
 
 	[Widget] Gtk.Button button_encoder_capture;
 	[Widget] Gtk.Label label_encoder_person_weight;
@@ -88,7 +88,7 @@ public partial class ChronoJumpWindow
 		EncoderParams ep = new EncoderParams(
 				(int) spin_encoder_capture_time.Value, 
 				findMass(),
-				Util.ConvertToPoint((double) spin_encoder_analyze_smooth.Value), //R decimal: '.'
+				Util.ConvertToPoint((double) spin_encoder_smooth.Value), //R decimal: '.'
 				findEccon()
 				); 
 
@@ -120,7 +120,9 @@ public partial class ChronoJumpWindow
 				false,			//isJump (1st) is not used in "curves"
 				findMass(),
 				findEccon(), "curves",
-				"0", 0, w, h); 		//smoothOne, and curve are not used in "curves"
+				Util.ConvertToPoint((double) spin_encoder_smooth.Value), //R decimal: '.'
+			       	0, 			//curve is not used here
+				w, h); 
 
 		EncoderStruct es = new EncoderStruct(
 				Util.GetEncoderDataTempFileName(), 
@@ -146,7 +148,7 @@ public partial class ChronoJumpWindow
 				!radiobutton_encoder_capture_bar.Active,
 				findMass(),
 				findEccon(), encoderAnalysis,
-				Util.ConvertToPoint((double) spin_encoder_analyze_smooth.Value), //R decimal: '.'
+				Util.ConvertToPoint((double) spin_encoder_smooth.Value), //R decimal: '.'
 				(int) spin_encoder_analyze_curve_num.Value, w, h);
 
 		EncoderStruct es = new EncoderStruct(
@@ -161,6 +163,8 @@ public partial class ChronoJumpWindow
 		image_encoder_analyze.Pixbuf = pixbuf;
 	}
 
+//TODO: auto close capturing window
+
 	//show curve_num only on simple and superpose
 	public void on_radiobutton_encoder_analyze_single_toggled (object obj, EventArgs args) {
 		label_encoder_analyze_curve_num.Sensitive=true;



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