[chronojump] RunEncoder export select manage filename/folder
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RunEncoder export select manage filename/folder
- Date: Wed, 3 Mar 2021 15:46:46 +0000 (UTC)
commit 7a54095fd33c599d94aaeeddd90f4ee908a6c054
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Mar 3 16:46:05 2021 +0100
RunEncoder export select manage filename/folder
src/constants.cs | 4 ++-
src/gui/app1/encoder.cs | 53 ++++++++++++++++++++++++++++++++++-----
src/gui/app1/runEncoderAnalyze.cs | 26 ++++++++++++++++---
3 files changed, 73 insertions(+), 10 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index bc74822e..28a1a03f 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1114,7 +1114,9 @@ public class Constants
FORCESENSOR_SAVE_IMAGE_RFD_MANUAL, FORCESENSOR_ANALYZE_SAVE_AB,
FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES,
FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES,
FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES,
FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES,
- RUNENCODER_SAVE_IMAGE, RUNENCODER_SAVE_TABLE
+ 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,
}
public static double EncoderErrorCode = -1;
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index e1501334..b02f1f34 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -2087,11 +2087,15 @@ public partial class ChronoJumpWindow
else if(
checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_AB ||
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
- checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_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_GROUPAL_CURRENT_SESSION_NO_IMAGES)
exportString = Catalog.GetString ("Export repetition in CSV format");
else if(
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
- checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
exportString = Catalog.GetString ("Export data and graphs");
else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
@@ -2103,7 +2107,9 @@ public partial class ChronoJumpWindow
if(
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
- checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
nameString = currentSession.DateShortAsSQL;
//on encoder analyze save image, show analysis on filename
@@ -2177,6 +2183,14 @@ public partial class ChronoJumpWindow
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
nameString += "_forcesensor_export";
+ else if(
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES)
+ nameString += "_raceAnalyzer_export.csv";
+ else if(
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ nameString += "_raceAnalyzer_export";
else if(checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE)
nameString += "_encoder_curves_table.csv";
else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
@@ -2187,7 +2201,9 @@ public partial class ChronoJumpWindow
FileChooserAction fcAction = FileChooserAction.Save;
if(
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
- checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
fcAction = FileChooserAction.CreateFolder;
Gtk.FileChooserDialog fc=
@@ -2208,11 +2224,15 @@ public partial class ChronoJumpWindow
checkFileOp == Constants.CheckFileOp.FORCESENSOR_ANALYZE_SAVE_AB ||
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_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_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_TABLE ||
checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
exportFileName = Util.AddCsvIfNeeded(exportFileName);
else if(checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
- checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
LogB.Information("");//do nothing
else {
//ENCODER_ANALYZE_SAVE_IMAGE, FORCESENSOR_SAVE_IMAGE_SIGNAL,
@@ -2285,6 +2305,13 @@ public partial class ChronoJumpWindow
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
confirmWin.Button_accept.Clicked +=
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_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ confirmWin.Button_accept.Clicked +=
+ new
EventHandler(on_overwrite_file_runencoder_export_accepted);
else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_IMAGE)
confirmWin.Button_accept.Clicked +=
new
EventHandler(on_overwrite_file_runencoder_image_save_accepted);
@@ -2329,6 +2356,12 @@ public partial class ChronoJumpWindow
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
checkFileOp ==
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
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_GROUPAL_CURRENT_SESSION_NO_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES ||
+ checkFileOp ==
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ on_button_run_encoder_export_file_selected (exportFileName);
else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_IMAGE)
on_button_run_encoder_image_save_selected (exportFileName);
else if(checkFileOp == Constants.CheckFileOp.RUNENCODER_SAVE_TABLE)
@@ -2339,7 +2372,11 @@ public partial class ChronoJumpWindow
checkFileOp !=
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES &&
checkFileOp !=
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES &&
checkFileOp !=
Constants.CheckFileOp.FORCESENSOR_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES &&
- checkFileOp !=
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
+ checkFileOp !=
Constants.CheckFileOp.FORCESENSOR_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES &&
+ checkFileOp !=
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES &&
+ checkFileOp !=
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES &&
+ checkFileOp !=
Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES &&
+ checkFileOp !=
Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES)
{
string myString = string.Format(Catalog.GetString("Saved to
{0}"),
exportFileName);
@@ -2424,6 +2461,10 @@ public partial class ChronoJumpWindow
new DialogMessage(Constants.MessageTypes.INFO, myString);
*/
}
+ private void on_overwrite_file_runencoder_export_accepted(object o, EventArgs args)
+ {
+ on_button_run_encoder_export_file_selected (exportFileName); //file or folder
+ }
void on_button_encoder_delete_signal_clicked (object o, EventArgs args)
{
diff --git a/src/gui/app1/runEncoderAnalyze.cs b/src/gui/app1/runEncoderAnalyze.cs
index 2d02bf33..c62371bd 100644
--- a/src/gui/app1/runEncoderAnalyze.cs
+++ b/src/gui/app1/runEncoderAnalyze.cs
@@ -337,10 +337,30 @@ public partial class ChronoJumpWindow
runEncoderExport.Button_done.Clicked -= new EventHandler(run_encoder_export_done);
runEncoderExport.Button_done.Clicked += new EventHandler(run_encoder_export_done);
- //runEncoderExport.Start(selectedFileName); //file or folder
- runEncoderExport.Start("runEncoderExport.csv"); //file or folder
+ bool selectedFile = false;
+ if(check_run_encoder_export_images.Active)
+ {
+ if(personID == -1)
+ selectedFile =
checkFile(Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_YES_IMAGES);
+ else
+ selectedFile =
checkFile(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_YES_IMAGES);
+ } else {
+ if(personID == -1)
+ selectedFile =
checkFile(Constants.CheckFileOp.RUNENCODER_EXPORT_GROUPAL_CURRENT_SESSION_NO_IMAGES);
+ else
+ selectedFile =
checkFile(Constants.CheckFileOp.RUNENCODER_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES);
+ }
- //TODO: continue with cancel stuff, ...
+ //restore the gui if cancelled
+ if(! selectedFile) {
+ runEncoderButtonsSensitive(true);
+ hbox_run_encoder_top.Sensitive = true;
+ }
+ }
+ private void on_button_run_encoder_export_file_selected (string selectedFileName)
+ {
+ //runEncoderExport.Start("runEncoderExport.csv");
+ runEncoderExport.Start(selectedFileName); //file or folder
}
private void on_button_run_encoder_export_cancel_clicked (object o, EventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]