[chronojump] ForceSensor analyze with zoom_in.png, zoom_out.png



commit 236369e6958f9101c0f6c7fc7604aa7129e6aadf
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 12 16:20:08 2021 +0100

    ForceSensor analyze with zoom_in.png, zoom_out.png

 glade/app1.glade                   | 161 ++++++++++++++++++++++---------------
 src/gui/app1/forceSensorAnalyze.cs |  62 ++++++--------
 src/gui/app1/icons.cs              |   4 +
 3 files changed, 127 insertions(+), 100 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 8b30f60c..da33dbd2 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -21039,7 +21039,7 @@ Concentric</property>
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
                                                         <property name="border_width">2</property>
-                                                        <property name="spacing">8</property>
+                                                        <property name="spacing">12</property>
                                                         <child>
                                                           <widget class="GtkHBox" id="hbox457">
                                                             <property name="visible">True</property>
@@ -21397,13 +21397,18 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">8</property>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox182">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
                                                             <widget class="GtkTable" id="table19">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="n_rows">2</property>
-                                                            <property name="n_columns">3</property>
+                                                            <property name="n_columns">4</property>
                                                             <property name="column_spacing">16</property>
-                                                            <property name="row_spacing">4</property>
+                                                            <property name="row_spacing">2</property>
                                                             <child>
                                                             <widget class="GtkHBox" 
id="hbox_force_sensor_ai_a">
                                                             <property name="visible">True</property>
@@ -21899,10 +21904,13 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_force_sensor_ai_ab">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">8</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
                                                             <widget class="GtkCheckButton" 
id="check_force_sensor_ai_chained">
                                                             <property name="visible">True</property>
@@ -21947,17 +21955,26 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox448">
+                                                            <widget class="GtkCheckButton" 
id="check_force_sensor_ai_zoom">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <signal name="clicked" 
handler="on_check_force_sensor_ai_zoom_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox472">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_force_sensor_ai_zoom">
-                                                            <property name="label">Zoom [A-B]</property>
+                                                            <widget class="GtkHBox" id="hbox473">
                                                             <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_force_sensor_ai_zoom_clicked" swapped="no"/>
-                                                            <accelerator key="z" signal="clicked"/>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_force_sensor_ai_zoom">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -21966,12 +21983,9 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_force_sensor_ai_zoom_out">
-                                                            <property name="label">Zoom out</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_force_sensor_ai_zoom_out_clicked" swapped="no"/>
-                                                            <accelerator key="z" signal="clicked"/>
+                                                            <widget class="GtkImage" 
id="image_force_sensor_ai_zoom_out">
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -21981,9 +21995,29 @@ 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="GtkLabel" id="label596">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">[A-B]</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>
                                                             <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
@@ -21991,15 +22025,12 @@ Concentric</property>
                                                             <packing>
                                                             <property name="left_attach">2</property>
                                                             <property name="right_attach">3</property>
-                                                            <property name="x_options">GTK_FILL</property>
-                                                            <property name="y_options"/>
+                                                            <property name="x_options"/>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox182">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
+                                                            <placeholder/>
+                                                            </child>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_force_sensor_analyze_back_to_signal">
                                                             <property name="label" 
translatable="yes">Back</property>
@@ -22011,17 +22042,21 @@ Concentric</property>
                                                             <accelerator key="Escape" signal="clicked"/>
                                                             </widget>
                                                             <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
+                                                            <property name="top_attach">1</property>
+                                                            <property name="bottom_attach">2</property>
+                                                            <property name="x_options"/>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" 
id="hbox_force_sensor_analyze_automatic_options">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
                                                             <widget class="GtkButton" 
id="button_force_sensor_analyze_analyze">
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
@@ -22029,7 +22064,11 @@ Concentric</property>
                                                             <property name="receives_default">True</property>
                                                             <signal name="clicked" 
handler="on_button_force_sensor_analyze_analyze_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox253">
+                                                            <widget class="GtkVBox" id="vbox248">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox470">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
@@ -22041,15 +22080,22 @@ Concentric</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
                                                             <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label368">
+                                                            <widget class="GtkLabel" id="label380">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">RFD 
model Analyze</property>
+                                                            <property name="label" translatable="yes">RFD 
Model</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -22063,28 +22109,11 @@ Concentric</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
-                                                            <property name="top_attach">1</property>
-                                                            <property name="bottom_attach">2</property>
-                                                            <property name="x_options"/>
-                                                            <property name="y_options"/>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">0</property>
@@ -23976,6 +24005,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -29128,18 +29160,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>
@@ -29176,6 +29196,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>
@@ -37479,6 +37511,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 6375c650..386ac577 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -52,8 +52,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.ScrolledWindow scrolledwindow_force_sensor_ai;
        [Widget] Gtk.Button button_force_sensor_analyze_AB_save;
        [Widget] Gtk.CheckButton check_force_sensor_ai_chained;
-       [Widget] Gtk.Button button_force_sensor_ai_zoom;
-       [Widget] Gtk.Button button_force_sensor_ai_zoom_out;
+       [Widget] Gtk.CheckButton check_force_sensor_ai_zoom;
 
        [Widget] Gtk.Button button_force_sensor_analyze_back_to_signal;
 
@@ -1138,7 +1137,7 @@ public partial class ChronoJumpWindow
                //if zoomed: unzoom and return
                if(forceSensorZoomApplied)
                {
-                       button_force_sensor_ai_zoom_out.Click();
+                       check_force_sensor_ai_zoom.Click();
                        return;
                }
 
@@ -1200,8 +1199,7 @@ public partial class ChronoJumpWindow
        private void forceSensorZoomDefaultValues()
        {
                forceSensorZoomApplied = false;
-               button_force_sensor_ai_zoom.Visible = true;
-               button_force_sensor_ai_zoom_out.Visible = false;
+               check_force_sensor_ai_zoom.Active = false;
        }
 
        private int hscale_force_sensor_ai_a_BeforeZoom = 0;
@@ -1209,50 +1207,40 @@ public partial class ChronoJumpWindow
        private int hscale_force_sensor_ai_b_BeforeZoom = 0;
        private int hscale_force_sensor_ai_b_AtZoom = 0;
 
-       private void on_button_force_sensor_ai_zoom_clicked (object o, EventArgs args)
+       private void on_check_force_sensor_ai_zoom_clicked (object o, EventArgs args)
        {
                if(fsAI == null || fsAI.GetLength() == 0)
                        return;
 
-               forceSensorZoomApplied = true;
+               if(check_force_sensor_ai_zoom.Active)
+               {
+                       forceSensorZoomApplied = true;
 
-               //store hscale a to help return to position on unzoom
-               hscale_force_sensor_ai_a_BeforeZoom = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
-               hscale_force_sensor_ai_b_BeforeZoom = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
-               //LogB.Information(string.Format("before zoom set to: {0}, {1}",
-               //                      hscale_force_sensor_ai_a_BeforeZoom,
-               //                      hscale_force_sensor_ai_b_BeforeZoom));
+                       //store hscale a to help return to position on unzoom
+                       hscale_force_sensor_ai_a_BeforeZoom = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
+                       hscale_force_sensor_ai_b_BeforeZoom = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
 
-               forceSensorRepetition_lZoomApplied = fsAI.ForceSensorRepetition_l;
+                       forceSensorRepetition_lZoomApplied = fsAI.ForceSensorRepetition_l;
 
-               forceSensorDoGraphAI(false);
+                       forceSensorDoGraphAI(false);
 
-               button_force_sensor_ai_zoom.Visible = false;
-               button_force_sensor_ai_zoom_out.Visible = true;
-       }
-       private void on_button_force_sensor_ai_zoom_out_clicked (object o, EventArgs args)
-       {
-               if(fsAI == null || fsAI.GetLength() == 0)
-                       return;
+                       image_force_sensor_ai_zoom.Visible = false;
+                       image_force_sensor_ai_zoom_out.Visible = true;
 
-               forceSensorZoomApplied = false;
+               } else {
+                       forceSensorZoomApplied = false;
 
-               hscale_force_sensor_ai_a_AtZoom = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
-               hscale_force_sensor_ai_b_AtZoom = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
-               //LogB.Information(string.Format("at zoom, AtZoom values set to: {0}, {1}",
-               //                      hscale_force_sensor_ai_a_AtZoom,
-               //                      hscale_force_sensor_ai_b_AtZoom));
+                       hscale_force_sensor_ai_a_AtZoom = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
+                       hscale_force_sensor_ai_b_AtZoom = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
 
-               forceSensorDoGraphAI(false);
+                       forceSensorDoGraphAI(false);
 
-               hscale_force_sensor_ai_a.Value = hscale_force_sensor_ai_a_BeforeZoom + 
(hscale_force_sensor_ai_a_AtZoom -1);
-               hscale_force_sensor_ai_b.Value = hscale_force_sensor_ai_a_BeforeZoom + 
(hscale_force_sensor_ai_b_AtZoom -1);
-               //LogB.Information(string.Format("at zoom A,B values set to: {0}, {1}",
-               //                      hscale_force_sensor_ai_a.Value,
-               //                      hscale_force_sensor_ai_b.Value));
+                       hscale_force_sensor_ai_a.Value = hscale_force_sensor_ai_a_BeforeZoom + 
(hscale_force_sensor_ai_a_AtZoom -1);
+                       hscale_force_sensor_ai_b.Value = hscale_force_sensor_ai_a_BeforeZoom + 
(hscale_force_sensor_ai_b_AtZoom -1);
 
-               button_force_sensor_ai_zoom.Visible = true;
-               button_force_sensor_ai_zoom_out.Visible = false;
+                       image_force_sensor_ai_zoom.Visible = true;
+                       image_force_sensor_ai_zoom_out.Visible = false;
+               }
        }
 
        private void forceSensorAnalyzeManualGraphDo(Rectangle allocation)
@@ -1769,7 +1757,7 @@ public partial class ChronoJumpWindow
                button_hscale_force_sensor_ai_b_post.Sensitive = hscale_force_sensor_ai_b.Value < 
fsAI.GetLength() -2;
 
                //diff have to be more than one pixel
-               button_force_sensor_ai_zoom.Sensitive = (Math.Abs(hscale_force_sensor_ai_a.Value - 
hscale_force_sensor_ai_b.Value) > 1);
+               check_force_sensor_ai_zoom.Sensitive = (Math.Abs(hscale_force_sensor_ai_a.Value - 
hscale_force_sensor_ai_b.Value) > 1);
        }
 
        private void on_button_hscale_force_sensor_ai_a_first_clicked (object o, EventArgs args)
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 2ae93850..aff4afd0 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -183,6 +183,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_force_sensor_export_cancel;
        [Widget] Gtk.Image image_force_sensor_ai_chained_link;
        [Widget] Gtk.Image image_force_sensor_ai_chained_link_off;
+       [Widget] Gtk.Image image_force_sensor_ai_zoom;
+       [Widget] Gtk.Image image_force_sensor_ai_zoom_out;
 
        [Widget] Gtk.Image image_hscale_force_sensor_ai_a_first;
        [Widget] Gtk.Image image_hscale_force_sensor_ai_a_last;
@@ -931,5 +933,7 @@ public partial class ChronoJumpWindow
 
                image_force_sensor_ai_chained_link.Pixbuf = new Pixbuf(null, Util.GetImagePath(false) + 
"link.png"); 
                image_force_sensor_ai_chained_link_off.Pixbuf = new Pixbuf(null, Util.GetImagePath(false) + 
"link_off.png"); 
+               image_force_sensor_ai_zoom.Pixbuf = new Pixbuf(null, Util.GetImagePath(false) + 
"zoom_in.png");
+               image_force_sensor_ai_zoom_out.Pixbuf = new Pixbuf(null, Util.GetImagePath(false) + 
"zoom_out.png");
        }
 }


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