[chronojump] New feature: on forceSensor analyze general can move B -1s +1s



commit 4fcdfef541c3d01380ee02d4a8acebf586111a29
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Oct 6 17:02:17 2020 +0200

    New feature: on forceSensor analyze general can move B -1s +1s

 glade/app1.glade                   | 124 ++++++++++++++++++++++++++++++++-----
 src/gui/app1/forceSensorAnalyze.cs |  35 +++++++++++
 2 files changed, 145 insertions(+), 14 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index ce39b17a..e59e5cd8 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -23246,6 +23246,51 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_pre_1s">
+                                                            <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_pre_1s_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox443">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image6">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-go-back</property>
+                                                            <property name="icon-size">1</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="label33">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">-1s</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">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</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>
@@ -23263,7 +23308,7 @@ Concentric</property>
                                                             <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
-                                                            <property name="position">1</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -23300,6 +23345,51 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkButton" 
id="button_hscale_force_sensor_ai_b_post_1s">
+                                                            <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_post_1s_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox444">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkImage" id="image11">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-go-forward</property>
+                                                            <property name="icon-size">1</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="label104">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">+1s</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">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</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>
@@ -23317,7 +23407,7 @@ Concentric</property>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">1</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -24903,6 +24993,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27759,6 +27852,18 @@ 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>
@@ -27795,18 +27900,6 @@ 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>
@@ -35883,6 +35976,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 8946faf8..009e59c0 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -1561,11 +1561,46 @@ 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_button_hscale_force_sensor_ai_b_pre_1s_clicked (object o, EventArgs args)
+       {
+               if(fsAI == null || fsAI.GetLength() == 0)
+                       return;
+
+               int startB = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
+               double startBMs = fsAI.GetTimeMS(startB);
+               for(int i = startB; i > 0; i --)
+               {
+                       if(startBMs - fsAI.GetTimeMS(i) >= 1000)
+                       {
+                               hscale_force_sensor_ai_b.Value += i - startB;
+                               return;
+                       }
+               }
+       }
+
+       private void on_button_hscale_force_sensor_ai_b_post_1s_clicked (object o, EventArgs args)
+       {
+               if(fsAI == null || fsAI.GetLength() == 0)
+                       return;
+
+               int startB = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
+               double startBMs = fsAI.GetTimeMS(startB);
+               for(int i = startB; i < fsAI.GetLength() -1; i ++)
+               {
+                       if(fsAI.GetTimeMS(i) - startBMs >= 1000)
+                       {
+                               hscale_force_sensor_ai_b.Value += i - startB;
+                               return;
+                       }
+               }
+       }
+
        private void manage_force_sensor_ai_table_visibilities()
        {
                bool visible = true;//checkbutton_force_sensor_ai_b.Active;


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