[chronojump] ForceSensor analyze general AB with first/last buttons



commit 640db4132a26cea8497b775fc0a691efea4a5361
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Oct 28 13:12:37 2019 +0100

    ForceSensor analyze general AB with first/last buttons

 glade/app1.glade              | 164 ++++++++++++++++++++++++++++++++++++++----
 src/gui/forceSensorAnalyze.cs |  27 +++++++
 2 files changed, 178 insertions(+), 13 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index a7666c01..0ef9c0d2 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -18899,7 +18899,7 @@ Concentric</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkVBox" id="vbox108">
+                                                  <widget class="GtkVBox" id="vbox108_force_sensor">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <property name="border_width">2</property>
@@ -21102,8 +21102,34 @@ Concentric</property>
                                                             <widget class="GtkHBox" id="hbox277">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox233">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
                                                             <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_a_first">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_hscale_force_sensor_ai_a_first_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image7">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-goto-first</property>
+                                                            <property name="icon-size">1</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_a_pre">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -21121,10 +21147,22 @@ Concentric</property>
                                                             <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">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox234">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
                                                             <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_a_post">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -21142,6 +21180,34 @@ Concentric</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_a_last">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_hscale_force_sensor_ai_a_last_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image8">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-goto-last</property>
+                                                            <property name="icon-size">1</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">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -21183,8 +21249,34 @@ Concentric</property>
                                                             <child>
                                                             <widget class="GtkHBox" 
id="hbox_buttons_scale_force_sensor_ai_b">
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox235">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
                                                             <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_first">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_hscale_force_sensor_ai_b_first_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image9">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-goto-first</property>
+                                                            <property name="icon-size">1</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_pre">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -21200,12 +21292,24 @@ Concentric</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox286">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
                                                             <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_post">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -21221,6 +21325,34 @@ Concentric</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_last">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_hscale_force_sensor_ai_b_last_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image10">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-goto-last</property>
+                                                            <property name="icon-size">1</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>
@@ -22012,6 +22144,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23960,18 +24095,6 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -24008,6 +24131,18 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -30978,6 +31113,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index 39fcf71c..2320c0b3 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -106,10 +106,15 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.SpinButton spinbutton_force_4_to;
        [Widget] Gtk.SpinButton spinbutton_force_impulse_to;
 
+       [Widget] Gtk.Button button_hscale_force_sensor_ai_a_first;
        [Widget] Gtk.Button button_hscale_force_sensor_ai_a_pre;
        [Widget] Gtk.Button button_hscale_force_sensor_ai_a_post;
+       [Widget] Gtk.Button button_hscale_force_sensor_ai_a_last;
+
+       [Widget] Gtk.Button button_hscale_force_sensor_ai_b_first;
        [Widget] Gtk.Button button_hscale_force_sensor_ai_b_pre;
        [Widget] Gtk.Button button_hscale_force_sensor_ai_b_post;
+       [Widget] Gtk.Button button_hscale_force_sensor_ai_b_last;
 
        /*
         * analyze options -------------------------->
@@ -1157,15 +1162,23 @@ public partial class ChronoJumpWindow
        {
                //note ai_a can be working with ai_b or alone (depending on checkbutton_force_sensor_ai_b)
 
+               button_hscale_force_sensor_ai_a_first.Sensitive = hscale_force_sensor_ai_a.Value > 1;
                button_hscale_force_sensor_ai_a_pre.Sensitive = hscale_force_sensor_ai_a.Value > 1;
+               button_hscale_force_sensor_ai_b_first.Sensitive = hscale_force_sensor_ai_b.Value > 1;
                button_hscale_force_sensor_ai_b_pre.Sensitive = hscale_force_sensor_ai_b.Value > 1;
 
+               button_hscale_force_sensor_ai_a_last.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -2;
                button_hscale_force_sensor_ai_a_post.Sensitive = hscale_force_sensor_ai_a.Value < 
fsAI.GetLength() -2;
+               button_hscale_force_sensor_ai_b_last.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -2;
                button_hscale_force_sensor_ai_b_post.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -2;
 
                button_force_sensor_ai_zoom.Sensitive = forceSensorZoomApplied || 
hscale_force_sensor_ai_a.Value != hscale_force_sensor_ai_b.Value;
        }
 
+       private void on_button_hscale_force_sensor_ai_a_first_clicked (object o, EventArgs args)
+       {
+               hscale_force_sensor_ai_a.Value = 1;
+       }
        private void on_button_hscale_force_sensor_ai_a_pre_clicked (object o, EventArgs args)
        {
                hscale_force_sensor_ai_a.Value -= 1;
@@ -1174,6 +1187,15 @@ public partial class ChronoJumpWindow
        {
                hscale_force_sensor_ai_a.Value += 1;
        }
+       private void on_button_hscale_force_sensor_ai_a_last_clicked (object o, EventArgs args)
+       {
+               hscale_force_sensor_ai_a.Value = fsAI.GetLength() -2;
+       }
+
+       private void on_button_hscale_force_sensor_ai_b_first_clicked (object o, EventArgs args)
+       {
+               hscale_force_sensor_ai_b.Value = 1;
+       }
        private void on_button_hscale_force_sensor_ai_b_pre_clicked (object o, EventArgs args)
        {
                hscale_force_sensor_ai_b.Value -= 1;
@@ -1182,6 +1204,11 @@ public partial class ChronoJumpWindow
        {
                hscale_force_sensor_ai_b.Value += 1;
        }
+       private void on_button_hscale_force_sensor_ai_b_last_clicked (object o, EventArgs args)
+       {
+               hscale_force_sensor_ai_b.Value = fsAI.GetLength() -2;
+       }
+
        private void on_checkbutton_force_sensor_ai_b_toggled (object o, EventArgs args)
        {
                int count = Convert.ToInt32(hscale_force_sensor_ai_b.Value);


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