[chronojump] Shown distance and time on each track at runInterval



commit cf97da63ca86605861cfc09d416cbbdbc533ed81
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jun 14 14:18:48 2016 +0200

    Shown distance and time on each track at runInterval

 src/gui/eventExecute.cs |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index e2e21a4..0407863 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -1369,6 +1369,9 @@ public partial class ChronoJumpWindow
                UtilGtk.ErasePaint(event_execute_drawingarea, event_execute_pixmap);
                
                writeMarginsText(maxValue, minValue, alto);
+                               
+               int lWidth = 1;
+               int lHeight = 1;
                
                //check now here that we will have not division by zero problems
                if(maxValue - minValue > 0) 
@@ -1407,11 +1410,12 @@ public partial class ChronoJumpWindow
                                //blue speed evolution  
                                myPen = pen_azul;
 
-                               //if distances are variable
-                               if(distancesString == "") 
-                                       myValue = distance / myTimeDouble;
-                               else
-                                       myValue = Util.GetRunIVariableDistancesStringRow(distancesString, 
count) / myTimeDouble;
+
+                               double myDistance = distance;
+                               if(distancesString != "") //if distances are variable
+                                       myDistance = Util.GetRunIVariableDistancesStringRow(distancesString, 
count);
+
+                               myValue = myDistance / myTimeDouble;
 
                                int xStart = event_execute_rightMargin;
                                if(myTimeDoubleAccumulated - myTimeDouble > 0)
@@ -1456,6 +1460,14 @@ public partial class ChronoJumpWindow
                                                        xEnd,
                                                        alto-topMargin);
                                }
+                       
+                               layoutSmall.SetMarkup((Math.Round(myDistance,1)).ToString() + "m");
+                               layoutSmall.GetPixelSize(out lWidth, out lHeight);
+                               event_execute_pixmap.DrawLayout (pen_black, ((xStart+ xEnd)/2) -lWidth/2, 
alto -20, layoutSmall);
+                               
+                               layoutSmall.SetMarkup((Math.Round(myTimeDouble,2)).ToString() + "s");
+                               layoutSmall.GetPixelSize(out lWidth, out lHeight);
+                               event_execute_pixmap.DrawLayout (pen_black, ((xStart+ xEnd)/2) -lWidth/2, 
alto -10, layoutSmall);
 
                                oldValue = myValue;
                                count ++;


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