[chronojump] RunEncoder analyze not automatic, button shown again and better sensitivity



commit 6bb9da1e86470a2bc3327ae3b986be2cc1bfb7f8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 29 12:26:29 2021 +0200

    RunEncoder analyze not automatic, button shown again and better sensitivity

 glade/app1.glade                  | 31 +++++++++++++---------
 src/gui/app1/runEncoder.cs        | 54 ++++++++++++++++++++-------------------
 src/gui/app1/runEncoderAnalyze.cs | 15 +++++++----
 3 files changed, 57 insertions(+), 43 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 3b7c8be9..c4ebe077 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -24528,6 +24528,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27660,6 +27663,7 @@ Concentric</property>
                                                             </child>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_run_encoder_analyze_analyze">
+                                                            <property name="visible">True</property>
                                                             <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
@@ -30611,6 +30615,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>
@@ -30647,18 +30663,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>
@@ -39069,6 +39073,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/runEncoder.cs b/src/gui/app1/runEncoder.cs
index c4a8820b..8fcd4701 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -291,6 +291,10 @@ public partial class ChronoJumpWindow
                raceEncoderReadWidgets();
                button_contacts_exercise_close_and_recalculate.Sensitive = false;
 
+               //remove stuff on analyze tab
+               image_run_encoder_graph.Visible = false;
+               treeview_raceAnalyzer = UtilGtk.RemoveColumns(treeview_raceAnalyzer);
+
                bool connected = runEncoderCapturePre4_GTK();
                if(! connected)
                        runEncoderButtonsSensitive(true);
@@ -306,13 +310,16 @@ public partial class ChronoJumpWindow
 
                button_contacts_exercise_close_and_recalculate.Sensitive = false;
                textview_contacts_signal_comment.Buffer.Text = "";
-               image_run_encoder_graph.Sensitive = false;
+
+               //image_run_encoder_graph.Sensitive = false; //this is not useful at all
+               image_run_encoder_graph.Visible = false;
+
                treeview_raceAnalyzer = UtilGtk.RemoveColumns(treeview_raceAnalyzer);
                button_raceAnalyzer_table_save.Sensitive = false;
                clearRaceAnalyzerTriggers();
 
                button_run_encoder_analyze_options_close_and_analyze.Sensitive = false;
-               //button_run_encoder_analyze_analyze.Sensitive = false;
+               button_run_encoder_analyze_analyze.Sensitive = false;
                button_delete_last_test.Sensitive = false;
                button_run_encoder_image_save.Sensitive = false;
 
@@ -410,7 +417,7 @@ public partial class ChronoJumpWindow
                contactsShowCaptureDoingButtons(true);
 
                //runEncoderCaptureSimulated = menuitem_check_race_encoder_capture_simulate.Active; //TODO: 
show this in some way on 2.0
-               runEncoderCaptureSimulated = false; //note that on simulated we need to click finish not so 
late
+               runEncoderCaptureSimulated = true; //note that on simulated we need to click finish not so 
late
 
                /*
                //initialize
@@ -648,7 +655,7 @@ public partial class ChronoJumpWindow
                        File.Copy(fileName, RunEncoder.GetCSVFileName(), true); //can be overwritten
                        lastRunEncoderFullPath = fileName;
 
-                       //raceEncoderCaptureGraphDo(); moved to pulseGTKRunEncoderCapture () where 
currentRunEncoder is created
+                       //raceEncoderCaptureRGraphDo(); moved to pulseGTKRunEncoderCapture () where 
currentRunEncoder is created
 
                        capturingRunEncoder = arduinoCaptureStatus.COPIED_TO_TMP;
                }
@@ -865,7 +872,8 @@ public partial class ChronoJumpWindow
                                );
                showRaceAnalyzerTriggers ();
 
-               raceEncoderCopyTempAndDoGraphs();
+               //on load do the R graph, but not on capture, to show on capture the label related to lack of 
person height
+               raceEncoderCopyToTempAndDoRGraph();
 
                button_contacts_exercise_close_and_recalculate.Sensitive = true;
 
@@ -1016,7 +1024,7 @@ public partial class ChronoJumpWindow
 
                raceEncoderReadWidgets();
                if(lastRunEncoderFullPath != null && lastRunEncoderFullPath != "")
-                       raceEncoderCopyTempAndDoGraphs();
+                       raceEncoderCopyToTempAndDoRGraph();
 
                event_execute_label_message.Text = "Recalculated.";
                radio_mode_contacts_analyze.Active = true;
@@ -1034,7 +1042,7 @@ public partial class ChronoJumpWindow
                currentRunEncoder.UpdateSQL(false);
        }
 
-       private void raceEncoderCopyTempAndDoGraphs()
+       private void raceEncoderCopyToTempAndDoRGraph()
        {
                // 0) delete results file
                Util.FileDelete(RunEncoder.GetCSVResultsFileName());
@@ -1043,14 +1051,14 @@ public partial class ChronoJumpWindow
                File.Copy(lastRunEncoderFullPath, RunEncoder.GetCSVFileName(), true); //can be overwritten
 
                // 2) create and open graph
-               raceEncoderCaptureGraphDo();
+               raceEncoderCaptureRGraphDo();
 
                Thread.Sleep (250); //Wait a bit to ensure is copied
 
                runEncoderAnalyzeOpenImage();
                notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.RACEENCODER);
                radio_mode_contacts_analyze.Active = true;
-               //button_run_encoder_analyze_analyze.Sensitive = true;
+               button_run_encoder_analyze_analyze.Sensitive = true;
 
                // 3) display table
                treeview_raceAnalyzer = UtilGtk.RemoveColumns(treeview_raceAnalyzer);
@@ -1068,7 +1076,7 @@ public partial class ChronoJumpWindow
                }
        }
 
-       private void raceEncoderCaptureGraphDo()
+       private void raceEncoderCaptureRGraphDo()
        {
                if(File.Exists(UtilEncoder.GetSprintEncoderImage()))
                        Util.FileDelete(UtilEncoder.GetSprintEncoderImage());
@@ -1308,14 +1316,18 @@ public partial class ChronoJumpWindow
                                        sensitiveLastTestButtons(true);
                                        contactsShowCaptureDoingButtons(false);
 
-                                       raceEncoderCaptureGraphDo();
+                                       //do not analyze after capture, to be able to show the message: no 
person height
+                                       /*
+                                       raceEncoderCaptureRGraphDo();
 
                                        runEncoderAnalyzeOpenImage();
                                        notebook_analyze.CurrentPage = 
Convert.ToInt32(notebook_analyze_pages.RACEENCODER);
                                        radio_mode_contacts_analyze.Active = true;
+                                       */
+
                                        button_contacts_exercise_close_and_recalculate.Sensitive = true;
                                        button_run_encoder_analyze_options_close_and_analyze.Sensitive = true;
-                                       //button_run_encoder_analyze_analyze.Sensitive = true;
+                                       button_run_encoder_analyze_analyze.Sensitive = true;
                                        button_run_encoder_image_save.Sensitive = true;
                                        button_delete_last_test.Sensitive = true;
 
@@ -1338,7 +1350,7 @@ public partial class ChronoJumpWindow
                                sensitiveLastTestButtons(false);
                                contactsShowCaptureDoingButtons(false);
                                button_run_encoder_analyze_options_close_and_analyze.Sensitive = false;
-                               //button_run_encoder_analyze_analyze.Sensitive = false;
+                               button_run_encoder_analyze_analyze.Sensitive = false;
                                button_run_encoder_image_save.Sensitive = false;
                                button_delete_last_test.Sensitive = false;
 
@@ -1440,8 +1452,6 @@ public partial class ChronoJumpWindow
                return true;
        }
 
-       //private bool button_run_encoder_analyze_analyze_was_sensitive; //needed this temp variable
-
        void runEncoderButtonsSensitive(bool sensitive)
        {
                //runEncoder related buttons
@@ -1449,16 +1459,6 @@ public partial class ChronoJumpWindow
                vbox_run_encoder_capture_options.Sensitive = sensitive;
                button_contacts_exercise.Sensitive = sensitive;
                button_execute_test.Sensitive = sensitive;
-
-               /*
-               if(sensitive)
-                       button_run_encoder_analyze_analyze.Sensitive = 
button_run_encoder_analyze_analyze_was_sensitive;
-               else {
-                       button_run_encoder_analyze_analyze_was_sensitive = 
button_run_encoder_analyze_analyze.Sensitive;
-                       button_run_encoder_analyze_analyze.Sensitive = false;
-               }
-               */
-
                hbox_contacts_camera.Sensitive = sensitive;
 
                //other gui buttons
@@ -1477,7 +1477,9 @@ public partial class ChronoJumpWindow
                image_run_encoder_graph = UtilGtk.OpenImageSafe(
                                imagePath,
                                image_run_encoder_graph);
-               image_run_encoder_graph.Sensitive = true;
+
+               //image_run_encoder_graph.Sensitive = true; //not useful
+               image_run_encoder_graph.Visible = true;
        }
 
        /*
diff --git a/src/gui/app1/runEncoderAnalyze.cs b/src/gui/app1/runEncoderAnalyze.cs
index 72df29d1..61353107 100644
--- a/src/gui/app1/runEncoderAnalyze.cs
+++ b/src/gui/app1/runEncoderAnalyze.cs
@@ -36,7 +36,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.ComboBox combo_run_encoder_analyze_force;
        [Widget] Gtk.ComboBox combo_run_encoder_analyze_power;
        [Widget] Gtk.Button button_run_encoder_analyze_options_close_and_analyze;
-       //[Widget] Gtk.Button button_run_encoder_analyze_analyze; //unneeded at the moment
+       [Widget] Gtk.Button button_run_encoder_analyze_analyze;
        [Widget] Gtk.Button button_run_encoder_image_save;
 
        [Widget] Gtk.RadioButton radio_run_encoder_analyze_individual_current_set;
@@ -120,11 +120,15 @@ public partial class ChronoJumpWindow
                combo_run_encoder_analyze_power.Visible = (check_run_encoder_analyze_power.Active);
        }
 
+       private bool button_run_encoder_analyze_analyze_was_sensitive; //needed this temp variable
        private void on_button_run_encoder_analyze_options_clicked (object o, EventArgs args)
        {
                notebook_run_encoder_analyze.CurrentPage = 
Convert.ToInt32(notebook_run_encoder_analyze_pages.OPTIONS);
                hbox_run_encoder_analyze_top_modes.Sensitive = false;
                runEncoderButtonsSensitive(false);
+
+               button_run_encoder_analyze_analyze_was_sensitive = 
button_run_encoder_analyze_analyze.Sensitive;
+               button_run_encoder_analyze_analyze.Sensitive = false;
        }
        private void on_button_run_encoder_analyze_options_close_clicked (object o, EventArgs args)
        {
@@ -167,6 +171,7 @@ public partial class ChronoJumpWindow
 
                notebook_run_encoder_analyze.CurrentPage = 
Convert.ToInt32(notebook_run_encoder_analyze_pages.CURRENTSET);
                runEncoderButtonsSensitive(true);
+               button_run_encoder_analyze_analyze.Sensitive = 
button_run_encoder_analyze_analyze_was_sensitive;
        }
 
        private void on_button_run_encoder_analyze_options_close_and_analyze_clicked (object o, EventArgs 
args)
@@ -184,7 +189,7 @@ public partial class ChronoJumpWindow
                }
 
                if(lastRunEncoderFullPath != null && lastRunEncoderFullPath != "")
-                       raceEncoderCopyTempAndDoGraphs();
+                       raceEncoderCopyToTempAndDoRGraph();
        }
 
        private void on_button_run_encoder_image_save_clicked (object o, EventArgs args)
@@ -271,7 +276,7 @@ public partial class ChronoJumpWindow
        private void on_radio_run_encoder_analyze_individual_current_set_toggled (object o, EventArgs args)
        {
                button_run_encoder_analyze_load.Visible = true;
-               //button_run_encoder_analyze_analyze.Visible = true;
+               button_run_encoder_analyze_analyze.Visible = true;
 
                notebook_run_encoder_analyze.CurrentPage = 
Convert.ToInt32(notebook_run_encoder_analyze_pages.CURRENTSET);
                label_run_encoder_export_result.Text = "";
@@ -279,7 +284,7 @@ public partial class ChronoJumpWindow
        private void on_radio_run_encoder_analyze_individual_current_session_toggled (object o, EventArgs 
args)
        {
                button_run_encoder_analyze_load.Visible = false;
-               //button_run_encoder_analyze_analyze.Visible = false;
+               button_run_encoder_analyze_analyze.Visible = false;
 
                if(currentPerson != null)
                        label_run_encoder_export_data.Text = currentPerson.Name;
@@ -292,7 +297,7 @@ public partial class ChronoJumpWindow
        private void on_radio_run_encoder_analyze_groupal_current_session_toggled (object o, EventArgs args)
        {
                button_run_encoder_analyze_load.Visible = false;
-               //button_run_encoder_analyze_analyze.Visible = false;
+               button_run_encoder_analyze_analyze.Visible = false;
 
                label_run_encoder_export_data.Text = currentSession.Name;
 


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