[chronojump] inertial recalibrate done! Need tests!



commit 116aa9e9cc1091af7f57714262065e1395ba771f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Apr 6 18:18:04 2017 +0200

    inertial recalibrate done! Need tests!

 glade/app1.glade           |  103 +++++++++++++++++++++++++++++++++++++++++++-
 images/md/calibrate.png    |  Bin 0 -> 512 bytes
 src/Makefile.am            |    1 +
 src/gui/chronojumpIcons.cs |    6 +++
 src/gui/encoder.cs         |    4 ++
 5 files changed, 113 insertions(+), 1 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 24ef523..d5196a4 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -16593,11 +16593,41 @@ then click this button.</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_encoder_inertial_calibrate">
-                                                            <property name="label" 
translatable="yes">Calibrate</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
                                                             <signal name="clicked" 
handler="on_button_encoder_inertial_calibrate_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox75">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_encoder_calibrate">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</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="label255">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Calibrate</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -16638,6 +16668,45 @@ then click this button.</property>
                                                             <property name="position">3</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox209">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label_recalibrate">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="xalign">1</property>
+                                                            <property name="label" translatable="yes"> If 
you want to recalibrate, push this button</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_recalibrate1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="xalign">1</property>
+                                                            <property name="label">-&gt;</property>
+                                                            </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="pack_type">end</property>
+                                                            <property name="position">4</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -16790,6 +16859,35 @@ then click this button.</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkAlignment" id="alignment20">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="top_padding">5</property>
+                                                            <property name="bottom_padding">3</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_encoder_inertial_recalibrate">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="tooltip" 
translatable="yes">Calbrate again</property>
+                                                            <signal name="clicked" 
handler="on_button_encoder_inertial_recalibrate_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_encoder_recalibrate">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
                                                           </widget>
                                                           <packing>
                                                             <property name="expand">False</property>
@@ -19919,6 +20017,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/images/md/calibrate.png b/images/md/calibrate.png
new file mode 100644
index 0000000..e641d83
Binary files /dev/null and b/images/md/calibrate.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index 47af6a1..ff30380 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -395,6 +395,7 @@ RESOURCES = \
        ../images/md/inertial_rolled.png,inertial_rolled.png \
        ../images/md/inertial_half_rolled.png,inertial_half_rolled.png \
        ../images/md/inertial_extended.png,inertial_extended.png \
+       ../images/md/calibrate.png,calibrate.png \
        ../images/chronojump_icon.png,chronojump_icon.png \
        ../images/chronojump_icon_graph.png,chronojump_icon_graph.png \
        ../images/stock_right.png,stock_right.png \
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 5f3e0f3..9245b53 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -71,6 +71,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_inertial_rolled;
        [Widget] Gtk.Image image_inertial_half_rolled;
        [Widget] Gtk.Image image_inertial_extended;
+       [Widget] Gtk.Image image_encoder_calibrate;
+       [Widget] Gtk.Image image_encoder_recalibrate;
 
        private void putNonStandardIcons()
        {
@@ -201,6 +203,10 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "inertial_extended.png");
                image_inertial_extended.Pixbuf = pixbuf;
 
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "calibrate.png");
+               image_encoder_calibrate.Pixbuf = pixbuf;
+               image_encoder_recalibrate.Pixbuf = pixbuf;
+
                /*
                 * <------ end of material design icons
                 */
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 9fdca69..0e667df 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -658,6 +658,10 @@ public partial class ChronoJumpWindow
                        encoderThreadStart(encoderActions.CAPTURE_BG);
                }
        }
+       void on_button_encoder_inertial_recalibrate_clicked (object o, EventArgs args)
+       {
+               notebook_encoder_capture_or_exercise_or_instructions.Page = 2;
+       }
 
        double maxPowerIntersessionOnCapture;
        //called from main GUI


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