[chronojump] Countdown on inertialCalibrated



commit c463f11cf95f2132e80b9536b5aba32a537f5d1b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 15 13:52:40 2017 +0100

    Countdown on inertialCalibrated

 glade/app1.glade   |    6 +++++-
 src/gui/encoder.cs |   15 +++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 540447e..e852459 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -15513,7 +15513,8 @@ Concentric</property>
                                                             <widget class="GtkLabel" id="label136">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label">Start with the rope 
completely unwrapped and then click on Calibrate.</property>
+                                                            <property name="label" translatable="yes">Start 
with the rope completely unwrapped,
+then click this button.</property>
                                                             <property name="use_markup">True</property>
                                                             <property name="justify">center</property>
                                                             </widget>
@@ -18617,6 +18618,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 377f4fe..9a18cd6 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -5062,16 +5062,19 @@ public partial class ChronoJumpWindow
                if(! shownWaitAtInertialCapture)
                {
                        button_encoder_inertial_calibrate_2.Sensitive = false;
-                       label_wait.Text = "Please, wait 3 seconds.";
+                       label_wait.Text = string.Format("Exercise will start in {0} seconds.", 3);
                        shownWaitAtInertialCapture = true;
                }
 
-               if(! calledCaptureInertial && DateTime.Now.Subtract(timeCalibrated).TotalSeconds > 3)
+               if(! calledCaptureInertial)
                {
-                       //capture starts in 3 seconds
-                       //System.Threading.Thread.Sleep(3000);
-                       calledCaptureInertial = true;
-                       on_button_encoder_capture_clicked (new object (), new EventArgs ());
+                       int elapsed = Convert.ToInt32(DateTime.Now.Subtract(timeCalibrated).TotalSeconds);
+                       if(elapsed > 3)
+                       {
+                               calledCaptureInertial = true;
+                               on_button_encoder_capture_clicked (new object (), new EventArgs ());
+                       } else
+                               label_wait.Text = string.Format("Exercise will start in {0} seconds.", 3 - 
elapsed);
                }
 
                //resize hscale if needed


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