[chronojump] RunEncoder Export can configure width and height



commit c1c0fc4bd2c7c86fe1b81bbd406ca0a74b716a0f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 4 19:02:51 2021 +0100

    RunEncoder Export can configure width and height

 glade/app1.glade                   | 127 ++++++++++++++++++++++++++++++++++++-
 src/forceSensor.cs                 |   4 +-
 src/gui/app1/forceSensorAnalyze.cs |   2 +-
 src/gui/app1/runEncoderAnalyze.cs  |  10 +++
 src/runEncoder.cs                  |   9 ++-
 5 files changed, 144 insertions(+), 8 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 3ee6846a..654d9c0c 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -24502,7 +24502,7 @@ Concentric</property>
                                                             <property 
name="secondary_icon_activatable">False</property>
                                                             <property 
name="primary_icon_sensitive">True</property>
                                                             <property 
name="secondary_icon_sensitive">True</property>
-                                                            <property name="adjustment">900 200 8000 1 10 
0</property>
+                                                            <property name="adjustment">900 400 8000 1 10 
0</property>
                                                             <property name="numeric">True</property>
                                                             </widget>
                                                             <packing>
@@ -24544,7 +24544,7 @@ Concentric</property>
                                                             <property 
name="secondary_icon_activatable">False</property>
                                                             <property 
name="primary_icon_sensitive">True</property>
                                                             <property 
name="secondary_icon_sensitive">True</property>
-                                                            <property name="adjustment">600 200 8000 1 10 
0</property>
+                                                            <property name="adjustment">600 400 8000 1 10 
0</property>
                                                             <property name="numeric">True</property>
                                                             </widget>
                                                             <packing>
@@ -24575,6 +24575,11 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkAlignment" id="alignment70">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="top_padding">12</property>
+                                                            <child>
                                                             <widget class="GtkHBox" id="hbox454">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -24733,6 +24738,8 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
+                                                            </child>
+                                                            </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
@@ -27422,6 +27429,11 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox253">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">24</property>
+                                                            <child>
                                                             <widget class="GtkCheckButton" 
id="check_run_encoder_export_images">
                                                             <property name="label" 
translatable="yes">Include images</property>
                                                             <property name="visible">True</property>
@@ -27429,6 +27441,110 @@ Concentric</property>
                                                             <property 
name="receives_default">False</property>
                                                             <property name="active">True</property>
                                                             <property name="draw_indicator">True</property>
+                                                            <signal name="toggled" 
handler="on_check_run_encoder_export_images_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" 
id="hbox_run_encoder_export_width_height">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">12</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox481">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label606">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Width</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkSpinButton" 
id="spinbutton_run_encoder_export_image_width">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">•</property>
+                                                            <property 
name="primary_icon_activatable">False</property>
+                                                            <property 
name="secondary_icon_activatable">False</property>
+                                                            <property 
name="primary_icon_sensitive">True</property>
+                                                            <property 
name="secondary_icon_sensitive">True</property>
+                                                            <property name="adjustment">900 400 8000 1 10 
0</property>
+                                                            <property name="numeric">True</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox482">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label607">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Height</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkSpinButton" 
id="spinbutton_run_encoder_sensor_export_image_height">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">•</property>
+                                                            <property 
name="primary_icon_activatable">False</property>
+                                                            <property 
name="secondary_icon_activatable">False</property>
+                                                            <property 
name="primary_icon_sensitive">True</property>
+                                                            <property 
name="secondary_icon_sensitive">True</property>
+                                                            <property name="adjustment">600 400 8000 1 10 
0</property>
+                                                            <property name="numeric">True</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27437,6 +27553,11 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkAlignment" id="alignment71">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="top_padding">12</property>
+                                                            <child>
                                                             <widget class="GtkHBox" id="hbox476">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -27595,6 +27716,8 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
+                                                            </child>
+                                                            </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index a0678a10..542e189e 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -2603,8 +2603,8 @@ public class ForceSensorExport
                        Gtk.Notebook notebook,
                        Gtk.ProgressBar progressbar,
                        Gtk.Label labelResult,
-                       int imageWidth, int imageHeight,
                        bool includeImages,
+                       int imageWidth, int imageHeight,
                        bool isWindows, int personID, int sessionID,
                        List<ForceSensorRFD> rfdList, ForceSensorImpulse impulse,
                        double duration, int durationPercent,
@@ -2620,9 +2620,9 @@ public class ForceSensorExport
                this.notebook = notebook;
                this.progressbar = progressbar;
                this.labelResult = labelResult;
+               this.includeImages = includeImages;
                this.imageWidth = imageWidth;
                this.imageHeight = imageHeight;
-               this.includeImages = includeImages;
                this.isWindows = isWindows;
                this.personID = personID;
                this.sessionID = sessionID;
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index c0e17317..9e8f07b8 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -758,9 +758,9 @@ public partial class ChronoJumpWindow
                                notebook_force_sensor_export,
                                progressbar_force_sensor_export,
                                label_force_sensor_export_result,
+                               check_force_sensor_export_images.Active,
                                Convert.ToInt32(spinbutton_force_sensor_export_image_width.Value),
                                Convert.ToInt32(spinbutton_force_sensor_export_image_height.Value),
-                               check_force_sensor_export_images.Active,
                                UtilAll.IsWindows(), personID, currentSession.UniqueID,
                                rfdList, impulse,//getImpulseValue(),
                                duration, Convert.ToInt32(spin_force_rfd_duration_percent.Value),
diff --git a/src/gui/app1/runEncoderAnalyze.cs b/src/gui/app1/runEncoderAnalyze.cs
index c62371bd..18cdd537 100644
--- a/src/gui/app1/runEncoderAnalyze.cs
+++ b/src/gui/app1/runEncoderAnalyze.cs
@@ -53,6 +53,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Notebook notebook_run_encoder_export;
        [Widget] Gtk.Label label_run_encoder_export_data;
        [Widget] Gtk.CheckButton check_run_encoder_export_images;
+       [Widget] Gtk.HBox hbox_run_encoder_export_width_height;
+       [Widget] Gtk.SpinButton spinbutton_run_encoder_export_image_width;
+       [Widget] Gtk.SpinButton spinbutton_run_encoder_export_image_height;
        [Widget] Gtk.ProgressBar progressbar_run_encoder_export;
        [Widget] Gtk.Label label_run_encoder_export_result;
 
@@ -260,6 +263,11 @@ public partial class ChronoJumpWindow
 
        //move to export gui file
 
+       private void on_check_run_encoder_export_images_toggled (object o, EventArgs args)
+       {
+               hbox_run_encoder_export_width_height.Visible = check_run_encoder_export_images.Active;
+       }
+
        private void on_radio_run_encoder_analyze_individual_current_set_toggled (object o, EventArgs args)
        {
                button_run_encoder_analyze_load.Visible = true;
@@ -321,6 +329,8 @@ public partial class ChronoJumpWindow
                                progressbar_run_encoder_export,
                                label_run_encoder_export_result,
                                check_run_encoder_export_images.Active,
+                               Convert.ToInt32(spinbutton_run_encoder_export_image_width.Value),
+                               Convert.ToInt32(spinbutton_run_encoder_export_image_height.Value),
                                UtilAll.IsWindows(),
                                personID,
                                currentSession.UniqueID,
diff --git a/src/runEncoder.cs b/src/runEncoder.cs
index e9a68857..543dc743 100644
--- a/src/runEncoder.cs
+++ b/src/runEncoder.cs
@@ -419,6 +419,8 @@ public class RunEncoderExport
        private Gtk.ProgressBar progressbar;
        private Gtk.Label labelResult;
        private bool includeImages;
+       private int imageWidth;
+       private int imageHeight;
        private string exportURL; //folder or .csv depending on includeImages
        private bool isWindows;
        private int personID; // -1: all
@@ -441,8 +443,6 @@ public class RunEncoderExport
        private List<RunEncoder> re_l;
        ArrayList personSession_l;
        private ArrayList reEx_l;
-       private int imageWidth = 900; //nothing is displayed, remove when R script has been adapted
-       private int imageHeight = 600; //nothing is displayed, remove when R script has been adapted
 
        //constructor
        public RunEncoderExport (
@@ -450,6 +450,7 @@ public class RunEncoderExport
                        Gtk.ProgressBar progressbar,
                        Gtk.Label labelResult,
                        bool includeImages,
+                       int imageWidth, int imageHeight,
                        bool isWindows,
                        int personID,
                        int sessionID,
@@ -464,6 +465,8 @@ public class RunEncoderExport
                this.progressbar = progressbar;
                this.labelResult = labelResult;
                this.includeImages = includeImages;
+               this.imageWidth = imageWidth;
+               this.imageHeight = imageHeight;
                this.isWindows = isWindows;
                this.personID = personID;
                this.sessionID = sessionID;
@@ -667,7 +670,7 @@ public class RunEncoderExport
                                        includeImages
                                        );
 
-                       bool success = reg.CallR(imageWidth -5, imageHeight -5, false);
+                       bool success = reg.CallR(imageWidth, imageHeight, false);
                }
 
                LogB.Information("Waiting creation of file... ");


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