[chronojump] RaceAnalyzer prefs show label on max speed for selected pps



commit 2b4ff732ae1efa018da19ec4155b7cb59ba3782b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 11 18:11:16 2021 +0100

    RaceAnalyzer prefs show label on max speed for selected pps

 glade/preferences_win.glade | 28 ++++++++++++++++++++++++++--
 src/gui/preferences.cs      | 10 +++++++---
 2 files changed, 33 insertions(+), 5 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 2c12a3aa..024c8226 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -5087,10 +5087,34 @@ It starts before and arrives there with some speed.</property>
                                         <property name="can_focus">False</property>
                                         <property name="left_padding">30</property>
                                         <child>
-                                          <widget class="GtkLabel" id="label_pps_equivalent">
+                                          <widget class="GtkVBox" id="vbox1">
                                             <property name="visible">True</property>
                                             <property name="can_focus">False</property>
-                                            <property name="xalign">0</property>
+                                            <property name="spacing">6</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_pps_equivalent">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="xalign">0</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label_pps_maximum">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="xalign">0</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
                                           </widget>
                                         </child>
                                       </widget>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 70bf18e6..c4d31389 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -194,6 +194,7 @@ public class PreferencesWindow
        [Widget] Gtk.SpinButton spin_run_encoder_acceleration;
        [Widget] Gtk.SpinButton spin_run_encoder_pps;
        [Widget] Gtk.Label label_pps_equivalent;
+       [Widget] Gtk.Label label_pps_maximum;
 
        //multimedia tab
        [Widget] Gtk.CheckButton checkbutton_volume;
@@ -745,7 +746,7 @@ public class PreferencesWindow
                //runEncoder -->
                PreferencesWindowBox.spin_run_encoder_acceleration.Value = preferences.runEncoderMinAccel;
                PreferencesWindowBox.spin_run_encoder_pps.Value = preferences.runEncoderPPS;
-               PreferencesWindowBox.update_run_encoder_pps_equivalence ();
+               PreferencesWindowBox.update_run_encoder_pps_equivalence_and_max ();
 
                //language -->
                if(preferences.language == "")
@@ -994,12 +995,15 @@ public class PreferencesWindow
 
        private void on_spin_run_encoder_pps_value_changed (object o, EventArgs args)
        {
-               update_run_encoder_pps_equivalence ();
+               update_run_encoder_pps_equivalence_and_max ();
        }
-       private void update_run_encoder_pps_equivalence ()
+       private void update_run_encoder_pps_equivalence_and_max ()
        {
                label_pps_equivalent.Text = string.Format(Catalog.GetString("{0} pps is equivalent to a 
resolution of {1} cm."),
                                spin_run_encoder_pps.Value, 0.3003 * spin_run_encoder_pps.Value);
+
+               label_pps_maximum.Text = string.Format(Catalog.GetString("{0} pps allow to record up to {1} 
m/s."),
+                               spin_run_encoder_pps.Value, spin_run_encoder_pps.Value * 4);
        }
 
        // <---- end of race analyzer ----


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