[chronojump] encoder analyze session save image/table filename start whith session name, not person name



commit 58ca914e2d91b9a3dcd74066347458958bb668d1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jan 9 11:07:44 2022 +0100

    encoder analyze session save image/table filename start whith session name, not person name

 src/constants.cs        | 10 ++++++----
 src/gui/app1/encoder.cs | 35 ++++++++++++++++++++++++++---------
 2 files changed, 32 insertions(+), 13 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index 8ab49e7e2..084cd8858 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Copyright (C) 2004-2021   Xavier de Blas <xaviblas gmail com>
+ *  Copyright (C) 2004-2022   Xavier de Blas <xaviblas gmail com>
  */
 
 using System;
@@ -1113,7 +1113,8 @@ public class Constants
        public enum CheckFileOp
        {
                JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE,
-               JUMPS_PROFILE_SAVE_IMAGE, JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE, 
JUMPS_WEIGHT_FV_PROFILE_SAVE_IMAGE, JUMPS_EVOLUTION_SAVE_IMAGE,
+               JUMPS_PROFILE_SAVE_IMAGE, JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE,
+               JUMPS_WEIGHT_FV_PROFILE_SAVE_IMAGE, JUMPS_EVOLUTION_SAVE_IMAGE,
                JUMPS_RJ_FATIGUE_SAVE_IMAGE,
                RUNS_SIMPLE_CAPTURE_SAVE_IMAGE,
                RUNS_EVOLUTION_SAVE_IMAGE,
@@ -1124,9 +1125,10 @@ public class Constants
                RUNS_SPRINT_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES,
                RUNS_SPRINT_EXPORT_INDIVIDUAL_ALL_SESSIONS_YES_IMAGES,
                RUNS_SPRINT_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES,
-               ENCODER_CAPTURE_EXPORT_ALL, ENCODER_CAPTURE_SAVE_IMAGE, ENCODER_ANALYZE_SAVE_IMAGE,
+               ENCODER_CAPTURE_EXPORT_ALL, ENCODER_CAPTURE_SAVE_IMAGE,
+               ENCODER_ANALYZE_SAVE_IMAGE, ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION,
                ENCODER_ANALYZE_SEND_IMAGE, //like save image but just defines the name exportFileName to be 
sended
-               ENCODER_ANALYZE_SAVE_AB, ENCODER_ANALYZE_SAVE_TABLE,
+               ENCODER_ANALYZE_SAVE_AB, ENCODER_ANALYZE_SAVE_TABLE, 
ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION,
                FORCESENSOR_SAVE_IMAGE_SIGNAL, FORCESENSOR_SAVE_IMAGE_RFD_AUTO,
                FORCESENSOR_SAVE_IMAGE_RFD_MANUAL, FORCESENSOR_ANALYZE_SAVE_AB,
                FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES,
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 889977a3d..cab26e073 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -2150,6 +2150,7 @@ public partial class ChronoJumpWindow
                                checkFileOp == Constants.CheckFileOp.RUNS_EVOLUTION_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION ||
                                checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL ||
                                checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_RFD_AUTO ||
                                checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_RFD_MANUAL ||
@@ -2168,6 +2169,7 @@ public partial class ChronoJumpWindow
                                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 ||
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION ||
                                checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
                        exportString = Catalog.GetString ("Save table");
 
@@ -2176,6 +2178,8 @@ public partial class ChronoJumpWindow
                string nameString = currentPerson.Name + "_" + currentSession.DateShortAsSQL;
 
                if(
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION ||
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION ||
                                checkFileOp == 
Constants.CheckFileOp.RUNS_SPRINT_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
                                checkFileOp == 
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES )
@@ -2257,7 +2261,8 @@ public partial class ChronoJumpWindow
                        nameString += "_runs_by_time.png";
                else if(checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE)
                        nameString += "_runs_sprint.png";
-               else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE)
+               else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION)
                        nameString += "_encoder.png";
                else if(checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL)
                        nameString += "_force_sensor_set.png";
@@ -2286,7 +2291,8 @@ public partial class ChronoJumpWindow
                                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)
+               else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
+                               checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION)
                        nameString += "_encoder_curves_table.csv";
                else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
                        nameString += "_raceAnalyzer_table.csv";
@@ -2320,10 +2326,11 @@ public partial class ChronoJumpWindow
                                        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.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION ||
                                        checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
                                exportFileName = Util.AddCsvIfNeeded(exportFileName);
                        else {
-                               //ENCODER_ANALYZE_SAVE_IMAGE, FORCESENSOR_SAVE_IMAGE_SIGNAL,
+                               //ENCODER_ANALYZE_SAVE_IMAGE, ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION, 
FORCESENSOR_SAVE_IMAGE_SIGNAL,
                                //FORCESENSOR_SAVE_IMAGE_RFD_AUTO, FORCESENSOR_SAVE_IMAGE_RFD_MANUAL
                                //… and sure other modes
                                exportFileName = Util.AddPngIfNeeded(exportFileName);
@@ -2376,13 +2383,15 @@ public partial class ChronoJumpWindow
                                        else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_CAPTURE_EXPORT_ALL)
                                                confirmWin.Button_accept.Clicked += 
                                                        new 
EventHandler(on_overwrite_file_export_all_curves_accepted);
-                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE)
+                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION)
                                                confirmWin.Button_accept.Clicked += 
                                                        new 
EventHandler(on_overwrite_file_encoder_analyze_save_image_accepted);
                                        else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_AB)
                                                confirmWin.Button_accept.Clicked += 
                                                        new 
EventHandler(on_overwrite_file_encoder_save_AB_accepted);
-                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE)
+                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION)
                                                confirmWin.Button_accept.Clicked += 
                                                        new 
EventHandler(on_overwrite_file_encoder_save_table_accepted);
                                        else if(checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL)
@@ -2445,11 +2454,13 @@ public partial class ChronoJumpWindow
                                                on_button_encoder_capture_save_image_file_selected 
(exportFileName);
                                        else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_CAPTURE_EXPORT_ALL)
                                                on_button_encoder_export_all_curves_file_selected 
(exportFileName);
-                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE)
+                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION)
                                                on_button_encoder_analyze_save_image_file_selected 
(exportFileName);
                                        else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_AB)
                                                on_button_encoder_save_AB_file_selected (exportFileName);
-                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE)
+                                       else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION)
                                                on_button_encoder_save_table_file_selected (exportFileName, 
true);
                                        else if(checkFileOp == 
Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL)
                                                on_button_forcesensor_save_image_signal_file_selected 
(exportFileName);
@@ -4915,7 +4926,10 @@ public partial class ChronoJumpWindow
                 * or changing person, loading session, …
                 */
 
-               checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE);
+               if(radio_encoder_analyze_groupal_current_session.Active)
+                       checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE_CURRENT_SESSION);
+               else
+                       checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE);
        }
        void on_button_encoder_analyze_save_image_file_selected (string destination)
        {
@@ -4955,7 +4969,10 @@ public partial class ChronoJumpWindow
                 * No problem. Is nice to play with seinsitiveness, but the reading will be from treeview and 
not from file
                 */
 
-               checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE);
+               if(radio_encoder_analyze_groupal_current_session.Active)
+                       checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE_CURRENT_SESSION);
+               else
+                       checkFile(Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE);
        }
 
        /*


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