[chronojump] ForceSensor Export can configure width and height



commit 704cc716fa4b06edaf64816ca593a6cc45de866a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 4 17:58:34 2021 +0100

    ForceSensor Export can configure width and height

 glade/app1.glade                   | 139 +++++++++++++++++++++++++++++++++----
 src/forceSensor.cs                 |   9 ++-
 src/gui/app1/forceSensorAnalyze.cs |  10 +++
 3 files changed, 143 insertions(+), 15 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 1d7fa32f..3ee6846a 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -23830,6 +23830,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24448,6 +24451,11 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkHBox" id="hbox199">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">24</property>
+                                                            <child>
                                                             <widget class="GtkCheckButton" 
id="check_force_sensor_export_images">
                                                             <property name="label" 
translatable="yes">Include images</property>
                                                             <property name="visible">True</property>
@@ -24455,6 +24463,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_force_sensor_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_force_sensor_export_width_height">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">12</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox478">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label602">
+                                                            <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_force_sensor_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 200 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="hbox480">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label605">
+                                                            <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_force_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 200 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>
@@ -29681,18 +29793,6 @@ 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>
@@ -29729,6 +29829,18 @@ 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>
@@ -38094,6 +38206,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 90e662fd..a0678a10 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -2567,6 +2567,8 @@ public class ForceSensorExport
        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
@@ -2595,14 +2597,13 @@ public class ForceSensorExport
        ArrayList fsEx_l;
        private static int totalRepsToExport;
        List<string> exportedRFDs;
-       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 ForceSensorExport (
                        Gtk.Notebook notebook,
                        Gtk.ProgressBar progressbar,
                        Gtk.Label labelResult,
+                       int imageWidth, int imageHeight,
                        bool includeImages,
                        bool isWindows, int personID, int sessionID,
                        List<ForceSensorRFD> rfdList, ForceSensorImpulse impulse,
@@ -2619,6 +2620,8 @@ public class ForceSensorExport
                this.notebook = notebook;
                this.progressbar = progressbar;
                this.labelResult = labelResult;
+               this.imageWidth = imageWidth;
+               this.imageHeight = imageHeight;
                this.includeImages = includeImages;
                this.isWindows = isWindows;
                this.personID = personID;
@@ -3002,7 +3005,7 @@ public class ForceSensorExport
                                        includeImages
                                        );
 
-                       bool success = fsg.CallR(imageWidth -5, imageHeight -5, false);
+                       bool success = fsg.CallR(imageWidth, imageHeight, false);
                }
 
                LogB.Information("Waiting creation of file... ");
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 7a1f5b13..c0e17317 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -153,6 +153,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Notebook notebook_force_sensor_export;
        [Widget] Gtk.Label label_force_sensor_export_data;
        [Widget] Gtk.CheckButton check_force_sensor_export_images;
+       [Widget] Gtk.HBox hbox_force_sensor_export_width_height;
+       [Widget] Gtk.SpinButton spinbutton_force_sensor_export_image_width;
+       [Widget] Gtk.SpinButton spinbutton_force_sensor_export_image_height;
        [Widget] Gtk.ProgressBar progressbar_force_sensor_export;
        [Widget] Gtk.Label label_force_sensor_export_result;
 
@@ -688,6 +691,11 @@ public partial class ChronoJumpWindow
 
        //move to export gui file
 
+       private void on_check_force_sensor_export_images_toggled (object o, EventArgs args)
+       {
+               hbox_force_sensor_export_width_height.Visible = check_force_sensor_export_images.Active;
+       }
+
        private void on_radio_force_sensor_analyze_individual_current_set_toggled (object o, EventArgs args)
        {
                button_force_sensor_analyze_load.Visible = true;
@@ -750,6 +758,8 @@ public partial class ChronoJumpWindow
                                notebook_force_sensor_export,
                                progressbar_force_sensor_export,
                                label_force_sensor_export_result,
+                               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(),


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