[chronojump] forcesensor analyze AB, modelized new gui DONE!



commit efd3dc89debe05a9f2415fcf12561037344601b6
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Nov 10 13:32:44 2020 +0100

    forcesensor analyze AB, modelized new gui DONE!

 glade/app1.glade                   | 39 ++++++++++++++++++++++----------------
 src/gui/app1/forceSensor.cs        | 17 ++++-------------
 src/gui/app1/forceSensorAnalyze.cs | 38 +++++++++++++++++++++++++++++++++----
 3 files changed, 61 insertions(+), 33 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 5c54178d..332a4592 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -20813,6 +20813,9 @@ Concentric</property>
                                                             <property name="column_spacing">16</property>
                                                             <property name="row_spacing">2</property>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkButton" 
id="button_force_sensor_analyze_load">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
@@ -21332,20 +21335,18 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <placeholder/>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" id="hbox182">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkButton" id="button3">
+                                                            <widget class="GtkButton" 
id="button_force_sensor_analyze_back_to_signal">
                                                             <property name="label" 
translatable="yes">Back</property>
                                                             <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_force_sensor_analyze_back_to_signal_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23275,6 +23276,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -28018,6 +28022,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>
@@ -28054,18 +28070,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>
@@ -36190,6 +36194,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/forceSensor.cs b/src/gui/app1/forceSensor.cs
index ebfdc14f..cfa18844 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -134,7 +134,7 @@ public partial class ChronoJumpWindow
 
        private void initForceSensor ()
        {
-               notebook_force_sensor_analyze.CurrentPage = 1;  //start on 1: force_general_analysis
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
                createForceExerciseCombo();
                createComboForceSensorCaptureOptions();
                createForceAnalyzeCombos();
@@ -389,6 +389,7 @@ public partial class ChronoJumpWindow
                }
                else if (o == (object) button_execute_test)
                {
+                       notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
                        forceSensorButtonsSensitive(false);
                        sensitiveLastTestButtons(false);
                        contactsShowCaptureDoingButtons(true);
@@ -1845,6 +1846,7 @@ LogB.Information(" fs R ");
                force_capture_drawingarea.Sensitive = true;
                notebook_force_sensor_analyze.Sensitive = true;
                button_force_sensor_analyze_options.Sensitive = true;
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
        }
 
        protected void on_force_sensor_load_signal_row_play (object o, EventArgs args)
@@ -2024,18 +2026,7 @@ LogB.Information(" fs R ");
                }
 
                currentForceSensor.UpdateSQL(false);
-       }
-
-       private void on_button_force_sensor_analyze_analyze_clicked (object o, EventArgs args)
-       {
-               if(! Util.FileExists(lastForceSensorFullPath))
-               {
-                       new DialogMessage(Constants.MessageTypes.WARNING, Constants.FileNotFoundStr());
-                       return;
-               }
-
-               if(lastForceSensorFullPath != null && lastForceSensorFullPath != "")
-                       forceSensorCopyTempAndDoGraphs(forceSensorGraphsEnum.RFD);
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
        }
 
        private enum forceSensorGraphsEnum { SIGNAL, RFD }
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 237fa1af..7a1ea87a 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -44,6 +44,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_force_sensor_ai_zoom;
        [Widget] Gtk.Button button_force_sensor_ai_zoom_out;
 
+       [Widget] Gtk.Button button_force_sensor_analyze_back_to_signal;
+
        [Widget] Gtk.SpinButton spin_force_duration_seconds;
        [Widget] Gtk.RadioButton radio_force_duration_seconds;
        [Widget] Gtk.HBox hbox_force_rfd_duration_percent;
@@ -134,6 +136,7 @@ public partial class ChronoJumpWindow
 
        private RepetitionMouseLimits fsAIRepetitionMouseLimits;
 
+       private enum notebook_force_sensor_analyze_pages { AUTOMATIC, MANUAL, AUTOMATICOPTIONS }
        /*
         * analyze options -------------------------->
         */
@@ -158,14 +161,21 @@ public partial class ChronoJumpWindow
                hbox_top_person.Sensitive = s;
        }
 
+       private int notebook_force_sensor_analyze_LastPage;
        private void on_button_force_sensor_analyze_options_clicked (object o, EventArgs args)
        {
-               notebook_force_sensor_analyze.CurrentPage = 2;
+               //store the notebook to return to same place
+               notebook_force_sensor_analyze_LastPage = notebook_force_sensor_analyze.CurrentPage;
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.AUTOMATICOPTIONS);
+
                forceSensorAnalyzeOptionsSensitivity(false);
        }
 
        private void on_button_force_sensor_analyze_options_close_clicked (object o, EventArgs args)
        {
+               //we can go to manual or to automatic
+               notebook_force_sensor_analyze.CurrentPage = notebook_force_sensor_analyze_LastPage;
+
                // 1 change stuff on Sqlite if needed
 
                Sqlite.Open();
@@ -214,7 +224,6 @@ public partial class ChronoJumpWindow
 
                // 2 change sensitivity of widgets
 
-               notebook_force_sensor_analyze.CurrentPage = 0;
                forceSensorAnalyzeOptionsSensitivity(true);
        }
 
@@ -224,6 +233,27 @@ public partial class ChronoJumpWindow
                on_button_force_sensor_analyze_analyze_clicked (o, args);
        }
 
+       private void on_button_force_sensor_analyze_analyze_clicked (object o, EventArgs args)
+       {
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.AUTOMATIC);
+               button_force_sensor_analyze_back_to_signal.Sensitive = true;
+
+               if(! Util.FileExists(lastForceSensorFullPath))
+               {
+                       new DialogMessage(Constants.MessageTypes.WARNING, Constants.FileNotFoundStr());
+                       return;
+               }
+
+               if(lastForceSensorFullPath != null && lastForceSensorFullPath != "")
+                       forceSensorCopyTempAndDoGraphs(forceSensorGraphsEnum.RFD);
+       }
+
+       private void on_button_force_sensor_analyze_back_to_signal_clicked (object o, EventArgs args)
+       {
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
+               button_force_sensor_analyze_back_to_signal.Sensitive = false;
+       }
+
        private void check_force_visibilities()
        {
                hbox_force_1.Visible = (check_force_1.Active);
@@ -587,7 +617,7 @@ public partial class ChronoJumpWindow
                        return;
 
 //             hbox_force_sensor_analyze_automatic_options.Visible = true;
-               notebook_force_sensor_analyze.CurrentPage = 0;
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.AUTOMATIC);
        }
        bool force_sensor_ai_drawingareaShown = false;
        private void on_radiobutton_force_sensor_analyze_manual_toggled (object o, EventArgs args)
@@ -596,7 +626,7 @@ public partial class ChronoJumpWindow
                        return;
 
 //             hbox_force_sensor_analyze_automatic_options.Visible = false;
-               notebook_force_sensor_analyze.CurrentPage = 1;
+               notebook_force_sensor_analyze.CurrentPage = 
Convert.ToInt32(notebook_force_sensor_analyze_pages.MANUAL);
                force_sensor_ai_drawingareaShown = true;
                forceSensorDoGraphAI(false);
        }


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