[chronojump] Done: RaceAnalyzer analyze export currentPerson allSessions



commit 0570d5fa327796a00d3546a587bbb5bb4b9b7d61
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Oct 6 17:14:52 2021 +0200

    Done: RaceAnalyzer analyze export currentPerson allSessions

 glade/app1.glade                  | 50 +++++++++++++++++++++++++++++++++++++--
 src/constants.cs                  |  8 +++++--
 src/gui/app1/encoder.cs           | 15 ++++++++++--
 src/gui/app1/icons.cs             |  1 +
 src/gui/app1/runEncoderAnalyze.cs | 30 +++++++++++++++++------
 5 files changed, 91 insertions(+), 13 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index df4e2abe7..8c4e8c86f 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -27704,7 +27704,7 @@ Concentric</property>
                                                             <property 
name="receives_default">False</property>
                                                             <property name="draw_indicator">False</property>
                                                             <property 
name="group">radio_run_encoder_analyze_individual_current_set</property>
-                                                            <signal name="toggled" 
handler="on_radio_run_encoder_analyze_individual_current_session_toggled" swapped="no"/>
+                                                            <signal name="toggled" 
handler="on_radio_run_encoder_analyze_individual_session_current_or_all_toggled" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox469">
                                                             <property name="visible">True</property>
@@ -27743,6 +27743,52 @@ Concentric</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_run_encoder_analyze_individual_all_sessions">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_run_encoder_analyze_individual_current_set</property>
+                                                            <signal name="toggled" 
handler="on_radio_run_encoder_analyze_individual_session_current_or_all_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox8">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_run_encoder_analyze_individual_all_sessions">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</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="label118">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">All 
sessions</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="position">2</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             </widget>
@@ -28552,7 +28598,7 @@ Concentric</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_run_encoder_export_current_session_clicked" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_button_run_encoder_export_not_set_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox182">
                                                             <property name="visible">True</property>
diff --git a/src/constants.cs b/src/constants.cs
index 5d9f678b8..38866bebe 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1131,8 +1131,12 @@ public class Constants
                FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES,
                FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES,
                RUNENCODER_SAVE_IMAGE, RUNENCODER_SAVE_TABLE,
-               RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES, 
RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES,
-               RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES, 
RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES,
+               RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES,
+               RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES,
+               RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES,
+               RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES,
+               RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES,
+               RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES,
        }
 
        public static double EncoderErrorCode = -1;
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 400294ad8..fbdc4cefb 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -2162,6 +2162,7 @@ public partial class ChronoJumpWindow
                                checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+                               checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES)
                        exportString = Catalog.GetString ("Export repetition in CSV format");
                else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
@@ -2180,7 +2181,8 @@ public partial class ChronoJumpWindow
 
                //on intersession do not show session in nameString
                else if(
-                               checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES)
+                               checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
+                               checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES)
                        nameString = currentPerson.Name;
 
                //on encoder analyze save image, show analysis on filename
@@ -2277,6 +2279,7 @@ public partial class ChronoJumpWindow
                        nameString += "_forcesensor_export.csv";
                else if(
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+                               checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES)
                        nameString += "_raceAnalyzer_export.csv";
                else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE)
@@ -2309,6 +2312,7 @@ public partial class ChronoJumpWindow
                                        checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                        checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+                                       checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
                                        checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
                                        checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
@@ -2401,6 +2405,7 @@ public partial class ChronoJumpWindow
                                                        new 
EventHandler(on_overwrite_file_forcesensor_export_accepted);
                                        else if(
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES )
                                                confirmWin.Button_accept.Clicked +=
                                                        new 
EventHandler(on_overwrite_file_runencoder_export_accepted);
@@ -2459,6 +2464,7 @@ public partial class ChronoJumpWindow
                                                on_button_force_sensor_export_file_selected (exportFileName);
                                        else if(
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES ||
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES )
                                                on_button_run_encoder_export_file_selected (exportFileName);
                                        else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_IMAGE)
@@ -2474,6 +2480,7 @@ public partial class ChronoJumpWindow
                                                        checkFileOp != 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES &&
                                                        checkFileOp != 
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES &&
                                                        checkFileOp != 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES &&
+                                                       checkFileOp != 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES &&
                                                        checkFileOp != 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES )
                                        {
                                                string myString = string.Format(Catalog.GetString("Saved to 
{0}"), 
@@ -2520,7 +2527,8 @@ public partial class ChronoJumpWindow
                                checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
                        nameString = currentSession.Name + "_" + currentSession.DateShortAsSQL;
-               else if(checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES)
+               else if(checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES ||
+                               checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES)
                        nameString = currentPerson.Name;
 
                if(
@@ -2534,6 +2542,7 @@ public partial class ChronoJumpWindow
                        nameString += "_forcesensor_export";
                else if(
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+                               checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
                        nameString += "_raceAnalyzer_export";
 
@@ -2590,6 +2599,7 @@ public partial class ChronoJumpWindow
                                                        new 
EventHandler(on_overwrite_file_forcesensor_export_cancelled);
                                        } else if(
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES ||
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES )
                                        {
                                                confirmWin.Button_accept.Clicked +=
@@ -2610,6 +2620,7 @@ public partial class ChronoJumpWindow
                                                on_button_force_sensor_export_file_selected (exportFileName);
                                        else if(
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES ||
                                                        checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES )
                                                on_button_run_encoder_export_file_selected (exportFileName);
                                }
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 020e9db90..80aa70105 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -925,6 +925,7 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + 
Constants.FileNameEncoderAnalyzeIndividualAllSessionsIcon);
                image_encoder_analyze_individual_all_sessions.Pixbuf = pixbuf;
                image_force_sensor_analyze_individual_all_sessions.Pixbuf = pixbuf;
+               image_run_encoder_analyze_individual_all_sessions.Pixbuf = pixbuf;
                image_tab_jumps_evolution.Pixbuf = pixbuf;
                image_tab_runs_evolution.Pixbuf = pixbuf;
 
diff --git a/src/gui/app1/runEncoderAnalyze.cs b/src/gui/app1/runEncoderAnalyze.cs
index 502db00ed..2d79d4975 100644
--- a/src/gui/app1/runEncoderAnalyze.cs
+++ b/src/gui/app1/runEncoderAnalyze.cs
@@ -41,9 +41,11 @@ public partial class ChronoJumpWindow
 
        [Widget] Gtk.RadioButton radio_run_encoder_analyze_individual_current_set;
        [Widget] Gtk.RadioButton radio_run_encoder_analyze_individual_current_session;
+       [Widget] Gtk.RadioButton radio_run_encoder_analyze_individual_all_sessions;
        [Widget] Gtk.RadioButton radio_run_encoder_analyze_groupal_current_session;
        [Widget] Gtk.Image image_run_encoder_analyze_individual_current_set;
        [Widget] Gtk.Image image_run_encoder_analyze_individual_current_session;
+       [Widget] Gtk.Image image_run_encoder_analyze_individual_all_sessions;
        [Widget] Gtk.Image image_run_encoder_analyze_groupal_current_session;
 
        [Widget] Gtk.HBox hbox_run_encoder_top;
@@ -288,7 +290,7 @@ public partial class ChronoJumpWindow
                label_run_encoder_export_result.Text = "";
                button_run_encoder_export_result_open.Visible = false;
        }
-       private void on_radio_run_encoder_analyze_individual_current_session_toggled (object o, EventArgs 
args)
+       private void on_radio_run_encoder_analyze_individual_session_current_or_all_toggled (object o, 
EventArgs args)
        {
                button_run_encoder_analyze_load.Visible = false;
                button_run_encoder_analyze_analyze.Visible = false;
@@ -314,8 +316,19 @@ public partial class ChronoJumpWindow
                button_run_encoder_export_result_open.Visible = false;
        }
 
-       private void on_button_run_encoder_export_current_session_clicked (object o, EventArgs args)
+       private void on_button_run_encoder_export_not_set_clicked (object o, EventArgs args)
        {
+               // 1) check if all sessions
+               if(radio_run_encoder_analyze_individual_all_sessions.Active)
+               {
+                       if(currentPerson == null)
+                               return;
+
+                       button_run_encoder_export_session (currentPerson.UniqueID, -1);
+                       return;
+               }
+
+               // 2) current session (individual or groupal)
                if(currentSession == null)
                        return;
 
@@ -324,16 +337,16 @@ public partial class ChronoJumpWindow
                        if(currentPerson == null)
                                return;
 
-                       button_run_encoder_export_session (currentPerson.UniqueID);
+                       button_run_encoder_export_session (currentPerson.UniqueID, currentSession.UniqueID);
                }
                else if (radio_run_encoder_analyze_groupal_current_session.Active)
                {
-                       button_run_encoder_export_session (-1);
+                       button_run_encoder_export_session (-1, currentSession.UniqueID);
                }
        }
 
        RunEncoderExport runEncoderExport;
-       private void button_run_encoder_export_session (int personID)
+       private void button_run_encoder_export_session (int personID, int sessionID)
        {
                label_run_encoder_export_result.Text = "";
                button_run_encoder_export_result_open.Visible = false;
@@ -367,8 +380,7 @@ public partial class ChronoJumpWindow
                                Convert.ToInt32(spinbutton_run_encoder_export_image_height.Value),
                                check_run_encoder_export_instantaneous.Active,
                                UtilAll.IsWindows(),
-                               personID,
-                               currentSession.UniqueID,
+                               personID, sessionID,
                                preferences.runEncoderMinAccel,
                                
Preferences.RunEncoderShouldPlotVariable(Preferences.RunEncoderPlotVariables.RAWACCEL),
                                
Preferences.RunEncoderShouldPlotVariable(Preferences.RunEncoderPlotVariables.FITTEDACCEL),
@@ -387,11 +399,15 @@ public partial class ChronoJumpWindow
                {
                        if(personID == -1)
                                selectedFile = checkFolder 
(Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES);
+                       else if (sessionID == -1)
+                               selectedFile = checkFolder 
(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES);
                        else
                                selectedFile = checkFolder 
(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES);
                } else {                                                                                      
  //export file
                        if(personID == -1)
                                selectedFile = checkFile 
(Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES);
+                       else if (sessionID == -1)
+                               selectedFile = checkFile 
(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_ALL_SESSIONS_NO_IMAGES);
                        else
                                selectedFile = checkFile 
(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES);
                }


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