[chronojump] Gui improvements



commit a5a9ca0a09662e2829dfdb4bb941e5e8b809864b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jun 6 21:10:08 2012 +0200

    Gui improvements

 encoder/graph.R           |   12 +--
 encoder/pyserial_pyper.py |    5 +-
 glade/chronojump.glade    |  282 +++++++++++++++++++++++++++++++--------------
 src/gui/chronojump.cs     |    6 +
 src/gui/encoder.cs        |    2 +
 5 files changed, 208 insertions(+), 99 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 52c5610..8a939d6 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -412,8 +412,6 @@ paintPowerPeakPowerBars <- function(paf, myEccons) {
 
 #see paf for more info
 findPosInPaf <- function(var, option) {
-print("fPIP option")
-print(option)
 	pos = 0
 	if(var == "Speed")
 		pos = 1
@@ -430,8 +428,6 @@ print(option)
 
 #option: mean or max
 paintCrossVariables <- function (paf, varX, varY, option) {
-print("pCV option")
-print(option)
 	x = (paf[,findPosInPaf(varX, option)])
 	y = (paf[,findPosInPaf(varY, option)])
 
@@ -445,14 +441,14 @@ print(option)
 		nums=as.character(1:length(x))
 	} else if (suboption == "side") {
 		cexBalls = 1.8
-		cexNums = .8
+		cexNums = 1
 		adjHor = 0
 		nums=paste("  ",as.character(1:length(x)))
 	}
 
 	plot(x,y, xlab=varX, ylab=varY, pch=21,col="blue",bg="lightblue",cex=cexBalls)
 	text(x,y,nums,adj=c(adjHor,.5),cex=cexNums)
-	lines(smooth.spline(x,y),col="darkblue")
+	lines(smooth.spline(x,y,spar=.5),col="darkblue")
 }
 			
 find.mfrow <- function(n) {
@@ -520,7 +516,7 @@ if(length(args) < 3) {
 	exercisePercentBodyWeight=as.numeric(args[6])	#was isJump=as.logical(args[6])
 	mass=as.numeric(args[7])
 	eccon=args[8]
-	analysis=args[9]	#in cross comes as "cross.force.speed"
+	analysis=args[9]	#in cross comes as "cross.Force.Speed.mean"
 	smoothingOne=args[10]
 	jump=args[11]
 	width=as.numeric(args[12])
@@ -728,11 +724,9 @@ if(length(args) < 3) {
 		#print(knRanges)
 	}
 
-	print(analysis)
 	#analysis in cross variables comes as:
 	#"cross.Speed.Force.mean" 	#2nd is X, 3d is X. "mean" can also be "max"
 	analysisCross = unlist(strsplit(analysis, "\\."))
-	print(analysisCross)
 	if(
 			analysis == "powerBars" || analysisCross[1] == "cross" || analysis == "curves") 
 	{
diff --git a/encoder/pyserial_pyper.py b/encoder/pyserial_pyper.py
index c2611c3..c7ae946 100644
--- a/encoder/pyserial_pyper.py
+++ b/encoder/pyserial_pyper.py
@@ -235,7 +235,8 @@ def calculate_all_in_r(temp, top_values, bottom_values, direction_now, smoothing
 
 		if eccon == "ec" or direction_now == -1:
 			if height >= minHeight:
-				print phaseCol + colorize(heightF,colorHeight,colorHeight!=BLACK) + colorize(meanSpeedF,colorMeanSpeed,colorMeanSpeed!=BLACK) + colorize(maxSpeedF,colorMaxSpeed,colorMaxSpeed!=BLACK) + colorize(meanPowerF,colorMeanPower,colorMeanPower!=BLACK) + colorize(peakPowerF,colorPeakPower,colorPeakPower!=BLACK) + "%10.2f" % peakPowerT  + "%10.2f" % pp_ppt 
+				#print phaseCol + colorize(heightF,colorHeight,colorHeight!=BLACK) + colorize(meanSpeedF,colorMeanSpeed,colorMeanSpeed!=BLACK) + colorize(maxSpeedF,colorMaxSpeed,colorMaxSpeed!=BLACK) + colorize(meanPowerF,colorMeanPower,colorMeanPower!=BLACK) + colorize(peakPowerF,colorPeakPower,colorPeakPower!=BLACK) + "%10.2f" % peakPowerT  + "%10.2f" % pp_ppt 
+				print phaseCol + colorize(heightF,colorHeight,colorHeight!=BLACK) + colorize(meanSpeedF,colorMeanSpeed,colorMeanSpeed!=BLACK) + colorize(maxSpeedF,colorMaxSpeed,colorMaxSpeed!=BLACK) + colorize(meanPowerF,colorMeanPower,colorMeanPower!=BLACK) + colorize(peakPowerF,colorPeakPower,colorPeakPower!=BLACK) + "%10.2f" % peakPowerT
 				if play:
 					playsound(soundFile)
 			else:
@@ -302,7 +303,7 @@ if __name__ == '__main__':
 
 	print("START!\n")
 	playsound(soundFileStart)
-	print("phase, range, meanSpeed, maxSpeed, meanPower, peakPower, peakPowerT, peakPower/ppt")
+	print("phase, range, meanSpeed, MaxSpeed, meanPower, PeakPower, PeakPowerT")#, PPower/PPT")
 	for i in xrange(record_time):
 		#if ser.readable(): #commented because don't work on linux
 		byte_data = ser.read()
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 6a02839..8b8160e 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -24519,147 +24519,212 @@ Evaluator can use real name or nickname.</property>
                                                 <property name="visible">True</property>
                                                 <property name="left_padding">12</property>
                                                 <child>
-                                                  <widget class="GtkHBox" id="hbox72">
+                                                  <widget class="GtkVBox" id="vbox4">
                                                     <property name="visible">True</property>
-                                                    <property name="spacing">20</property>
-                                                    <child>
-                                                      <widget class="GtkButton" id="button_encoder_capture">
-                                                        <property name="label" translatable="yes">Capture from encoder</property>
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="can_default">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="use_underline">True</property>
-                                                        <signal name="clicked" handler="on_button_encoder_capture_clicked"/>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
                                                     <child>
-                                                      <widget class="GtkVBox" id="vbox4">
+                                                      <widget class="GtkHBox" id="hbox76">
                                                         <property name="visible">True</property>
-                                                        <property name="spacing">6</property>
+                                                        <property name="spacing">10</property>
                                                         <child>
-                                                          <widget class="GtkProgressBar" id="encoder_pulsebar_capture">
+                                                          <widget class="GtkButton" id="button_encoder_capture">
                                                             <property name="visible">True</property>
-                                                            <property name="activity_mode">True</property>
-                                                            <property name="show_text">True</property>
-                                                            <property name="pulse_step">0.10000000149</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="xalign">0</property>
+                                                            <signal name="clicked" handler="on_button_encoder_capture_clicked"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox83">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image13">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-media-record</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label93">
+                                                            <property name="visible">True</property>
+                                                            <property name="label" translatable="yes">Capture from encoder</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
                                                           </widget>
                                                           <packing>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                           </packing>
                                                         </child>
                                                         <child>
-                                                          <widget class="GtkButton" id="button_encoder_capture_cancel">
-                                                            <property name="label" translatable="yes">Cancel</property>
+                                                          <widget class="GtkHBox" id="hbox82">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkProgressBar" id="encoder_pulsebar_capture">
+                                                            <property name="width_request">150</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="activity_mode">True</property>
+                                                            <property name="show_text">True</property>
+                                                            <property name="pulse_step">0.10000000149</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" id="button_encoder_capture_cancel">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Cancel process</property>
                                                             <property name="use_underline">True</property>
                                                             <signal name="clicked" handler="on_button_encoder_cancel_clicked"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image8">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-cancel</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                           </widget>
                                                           <packing>
-                                                            <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                           </packing>
                                                         </child>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">1</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkTable" id="table7">
-                                                        <property name="visible">True</property>
-                                                        <property name="n_rows">2</property>
-                                                        <property name="n_columns">2</property>
-                                                        <property name="column_spacing">20</property>
-                                                        <property name="row_spacing">6</property>
                                                         <child>
                                                           <widget class="GtkButton" id="button_encoder_recalculate">
-                                                            <property name="label" translatable="yes">Recalculate</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Recalculate signal with changed parameters</property>
                                                             <property name="use_underline">True</property>
                                                             <signal name="clicked" handler="on_button_encoder_recalculate_clicked"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image23">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-refresh</property>
+                                                            </widget>
+                                                            </child>
                                                           </widget>
+                                                          <packing>
+                                                            <property name="position">2</property>
+                                                          </packing>
                                                         </child>
                                                         <child>
-                                                          <widget class="GtkHBox" id="hbox81">
+                                                          <widget class="GtkHBox" id="hbox85">
                                                             <property name="visible">True</property>
-                                                            <property name="spacing">6</property>
+                                                            <property name="spacing">2</property>
                                                             <child>
                                                             <widget class="GtkEntry" id="entry_encoder_signal_comment">
-                                                            <property name="width_request">100</property>
+                                                            <property name="width_request">125</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="invisible_char">â</property>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
                                                             <widget class="GtkButton" id="button_encoder_update_signal">
-                                                            <property name="label">Update</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Update signal (save it again if changed)</property>
                                                             <signal name="clicked" handler="on_button_encoder_save_clicked"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image19">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-save</property>
+                                                            </widget>
+                                                            </child>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                           </widget>
                                                           <packing>
-                                                            <property name="top_attach">1</property>
-                                                            <property name="bottom_attach">2</property>
-                                                            <property name="x_options"></property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">3</property>
                                                           </packing>
                                                         </child>
                                                         <child>
-                                                          <widget class="GtkButton" id="button_encoder_load_signal">
-                                                            <property name="label">Load</property>
+                                                          <widget class="GtkHBox" id="hbox87">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkButton" id="button_encoder_load_signal">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Load signal</property>
                                                             <signal name="clicked" handler="on_button_encoder_load_signal_clicked"/>
-                                                          </widget>
-                                                          <packing>
-                                                            <property name="left_attach">1</property>
-                                                            <property name="right_attach">2</property>
-                                                          </packing>
-                                                        </child>
-                                                        <child>
-                                                          <widget class="GtkButton" id="button_encoder_delete_signal">
-                                                            <property name="label">Delete</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image24">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-open</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" id="button_encoder_delete_signal">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Delete signal</property>
                                                             <signal name="clicked" handler="on_button_encoder_delete_signal_clicked"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image_encoder_signal_delete">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-delete</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                           </widget>
                                                           <packing>
-                                                            <property name="left_attach">1</property>
-                                                            <property name="right_attach">2</property>
-                                                            <property name="top_attach">1</property>
-                                                            <property name="bottom_attach">2</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">4</property>
                                                           </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">2</property>
+                                                        <property name="position">0</property>
                                                       </packing>
                                                     </child>
                                                   </widget>
@@ -24767,7 +24832,7 @@ Evaluator can use real name or nickname.</property>
                                                 <property name="spacing">8</property>
                                                 <child>
                                                   <widget class="GtkEntry" id="entry_encoder_curve_comment">
-                                                    <property name="width_request">150</property>
+                                                    <property name="width_request">125</property>
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="invisible_char">â</property>
@@ -25247,7 +25312,6 @@ Evaluator can use real name or nickname.</property>
                                             <property name="spacing">10</property>
                                             <child>
                                               <widget class="GtkButton" id="button_encoder_analyze">
-                                                <property name="label" translatable="yes">Analyze</property>
                                                 <property name="width_request">150</property>
                                                 <property name="visible">True</property>
                                                 <property name="sensitive">False</property>
@@ -25256,6 +25320,31 @@ Evaluator can use real name or nickname.</property>
                                                 <property name="receives_default">True</property>
                                                 <property name="use_underline">True</property>
                                                 <signal name="clicked" handler="on_button_encoder_analyze_clicked"/>
+                                                <child>
+                                                  <widget class="GtkHBox" id="hbox81">
+                                                    <property name="visible">True</property>
+                                                    <property name="spacing">4</property>
+                                                    <child>
+                                                      <widget class="GtkImage" id="image_encoder_analyze_stats">
+                                                        <property name="visible">True</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label94">
+                                                        <property name="visible">True</property>
+                                                        <property name="label" translatable="yes">Analyze</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                  </widget>
+                                                </child>
                                               </widget>
                                               <packing>
                                                 <property name="expand">False</property>
@@ -25268,12 +25357,46 @@ Evaluator can use real name or nickname.</property>
                                                 <property name="visible">True</property>
                                                 <property name="spacing">6</property>
                                                 <child>
-                                                  <widget class="GtkProgressBar" id="encoder_pulsebar_analyze">
-                                                    <property name="width_request">150</property>
+                                                  <widget class="GtkHBox" id="hbox72">
                                                     <property name="visible">True</property>
-                                                    <property name="activity_mode">True</property>
-                                                    <property name="show_text">True</property>
-                                                    <property name="pulse_step">0.10000000149</property>
+                                                    <property name="spacing">4</property>
+                                                    <child>
+                                                      <widget class="GtkProgressBar" id="encoder_pulsebar_analyze">
+                                                        <property name="width_request">150</property>
+                                                        <property name="visible">True</property>
+                                                        <property name="activity_mode">True</property>
+                                                        <property name="show_text">True</property>
+                                                        <property name="pulse_step">0.10000000149</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkButton" id="button_encoder_analyze_cancel">
+                                                        <property name="visible">True</property>
+                                                        <property name="sensitive">False</property>
+                                                        <property name="can_focus">True</property>
+                                                        <property name="can_default">True</property>
+                                                        <property name="receives_default">True</property>
+                                                        <property name="tooltip" translatable="yes">Cancel process</property>
+                                                        <property name="use_underline">True</property>
+                                                        <signal name="clicked" handler="on_button_encoder_cancel_clicked"/>
+                                                        <child>
+                                                          <widget class="GtkImage" id="image26">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-cancel</property>
+                                                          </widget>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
                                                   </widget>
                                                   <packing>
                                                     <property name="expand">False</property>
@@ -25281,23 +25404,6 @@ Evaluator can use real name or nickname.</property>
                                                     <property name="position">0</property>
                                                   </packing>
                                                 </child>
-                                                <child>
-                                                  <widget class="GtkButton" id="button_encoder_analyze_cancel">
-                                                    <property name="label" translatable="yes">Cancel</property>
-                                                    <property name="visible">True</property>
-                                                    <property name="sensitive">False</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="can_default">True</property>
-                                                    <property name="receives_default">True</property>
-                                                    <property name="use_underline">True</property>
-                                                    <signal name="clicked" handler="on_button_encoder_cancel_clicked"/>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">1</property>
-                                                  </packing>
-                                                </child>
                                               </widget>
                                               <packing>
                                                 <property name="expand">False</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 057ee38..0a8b561 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -240,6 +240,8 @@ public partial class ChronoJumpWindow
 	//encoder
 	[Widget] Gtk.Image image_encoder_capture_zoom;
 	[Widget] Gtk.Image image_encoder_analyze_zoom;
+	[Widget] Gtk.Image image_encoder_analyze_stats;
+	[Widget] Gtk.Image image_encoder_signal_delete;
 
 	Random rand;
 	bool volumeOn;
@@ -724,6 +726,10 @@ public partial class ChronoJumpWindow
 		//encoder
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInIcon);
 		image_encoder_analyze_zoom.Pixbuf = pixbuf;
+		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "gpm-statistics.png");
+		image_encoder_analyze_stats.Pixbuf = pixbuf;
+		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_delete.png");
+		image_encoder_signal_delete.Pixbuf = pixbuf;
 	}
 
 	private void loadPreferences () 
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 8de7044..eebc600 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -140,6 +140,8 @@ public partial class ChronoJumpWindow
 	//TODO: on session load, show encoder stuff
 	//
 	//TODO: capture also with webcam an attach it to signal or curve
+	//
+	//TODO: peak power in eccentric in absolute values
 
 	
 	private void encoderInitializeStuff() {



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