[chronojump] Started JumpsDjOptimalFall gui and JumpsProfile code reorg



commit 2eb7874213a8ad5a4c76ec21b240f5cc07f57936
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Dec 13 12:23:44 2019 +0100

    Started JumpsDjOptimalFall gui and JumpsProfile code reorg

 glade/app1.glade                       | 165 +++++++++++++++++++++++++++++++--
 po/POTFILES.in                         |   1 +
 src/Makefile.am                        |   1 +
 src/gui/app1/chronojump.cs             | 123 +++++++-----------------
 src/gui/app1/chronojumpJumpsProfile.cs | 112 ++++++++++++++++++++++
 src/gui/chronojumpIcons.cs             |   3 +
 6 files changed, 308 insertions(+), 97 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index c8868d74..aa863811 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5116,6 +5116,53 @@ EncoderInertialCapture</property>
                                                     <property name="position">4</property>
                                                   </packing>
                                                 </child>
+                                                <child>
+                                                  <widget class="GtkRadioButton" 
id="radio_mode_contacts_jumps_dj_optimal_fall">
+                                                    <property name="can_focus">True</property>
+                                                    <property name="receives_default">False</property>
+                                                    <property name="relief">none</property>
+                                                    <property name="draw_indicator">False</property>
+                                                    <property 
name="group">radio_mode_contacts_general</property>
+                                                    <signal name="toggled" 
handler="on_radio_mode_contacts_jumps_dj_optimal_fall_toggled" swapped="no"/>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox174">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">10</property>
+                                                        <child>
+                                                          <widget class="GtkImage" 
id="image_tab_jumps_dj_optimal_fall">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkLabel" 
id="label_mode_contacts_jumps_profile2">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">Dja optimal 
fall</property>
+                                                            <property name="justify">center</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</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">5</property>
+                                                  </packing>
+                                                </child>
                                                 <child>
                                                   <widget class="GtkRadioButton" 
id="radio_mode_contacts_sprint">
                                                     <property name="can_focus">True</property>
@@ -5160,7 +5207,7 @@ EncoderInertialCapture</property>
                                                   <packing>
                                                     <property name="expand">False</property>
                                                     <property name="fill">False</property>
-                                                    <property name="position">5</property>
+                                                    <property name="position">6</property>
                                                   </packing>
                                                 </child>
                                               </widget>
@@ -17142,7 +17189,7 @@ on current Chronojump version.</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkVBox" id="vbox82">
+                                                  <widget class="GtkVBox" id="vbox_jumps_profile">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <child>
@@ -18622,7 +18669,107 @@ Concentric</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkAlignment" id="alignment37">
+                                                  <widget class="GtkVBox" id="vbox27">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox323">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">4</property>
+                                                        <child>
+                                                          <widget class="GtkDrawingArea" 
id="drawingarea_jumps_dj_optimal_fall">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkVBox" id="vbox82">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_jumps_dj_optimal_fall_save_image">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="tooltip" translatable="yes">Save 
image</property>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox161">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">4</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_jumps_dj_optimal_fall_save">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_forcesensor_analyze_image_save">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </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>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</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>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">2</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label398">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="label">Jumps optimal fall</property>
+                                                  </widget>
+                                                  <packing>
+                                                    <property name="position">2</property>
+                                                    <property name="tab_fill">False</property>
+                                                    <property name="type">tab</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <widget class="GtkAlignment" id="alignment_sprint">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <property name="top_padding">4</property>
@@ -18813,7 +18960,7 @@ Concentric</property>
                                                     </child>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">2</property>
+                                                    <property name="position">3</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -18823,7 +18970,7 @@ Concentric</property>
                                                     <property name="label">Sprint</property>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">2</property>
+                                                    <property name="position">3</property>
                                                     <property name="tab_fill">False</property>
                                                     <property name="type">tab</property>
                                                   </packing>
@@ -22518,7 +22665,7 @@ Concentric</property>
                                                     </child>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">3</property>
+                                                    <property name="position">4</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -22528,7 +22675,7 @@ Concentric</property>
                                                     <property name="label">force sensor</property>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">3</property>
+                                                    <property name="position">4</property>
                                                     <property name="tab_fill">False</property>
                                                     <property name="type">tab</property>
                                                   </packing>
@@ -22578,7 +22725,7 @@ Concentric</property>
                                                     </child>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">4</property>
+                                                    <property name="position">5</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -22588,7 +22735,7 @@ Concentric</property>
                                                     <property name="label">raceencoder</property>
                                                   </widget>
                                                   <packing>
-                                                    <property name="position">4</property>
+                                                    <property name="position">5</property>
                                                     <property name="tab_fill">False</property>
                                                     <property name="type">tab</property>
                                                   </packing>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index de332b19..cf3fb3ce 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -58,6 +58,7 @@ src/execute/run.cs
 src/exportSession.cs
 src/forceSensor.cs
 src/gui/app1/chronojump.cs
+src/gui/app1/chronojumpJumpsProfile.cs
 src/gui/app1/contactsExercise.cs
 src/gui/app1/forceSensor.cs
 src/gui/app1/jump.cs
diff --git a/src/Makefile.am b/src/Makefile.am
index a0db084b..df47b093 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ LINK = $(REF_DEP_CHRONOJUMP)
 
 SOURCES = \
        gui/app1/chronojump.cs\
+       gui/app1/chronojumpJumpsProfile.cs\
        gui/app1/contactsExercise.cs\
        gui/app1/forceSensor.cs\
        gui/app1/jump.cs\
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index e80345b1..993f8a2e 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -92,6 +92,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Arrow arrow_contacts_sup_capture_analyze;
        [Widget] Gtk.RadioButton radio_mode_contacts_general;
        [Widget] Gtk.RadioButton radio_mode_contacts_jumps_profile;
+       [Widget] Gtk.RadioButton radio_mode_contacts_jumps_dj_optimal_fall;
        [Widget] Gtk.RadioButton radio_mode_contacts_sprint;
 
        [Widget] Gtk.Label label_sprint_person_name;
@@ -250,21 +251,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_jumps_rj_result_help_power;
        [Widget] Gtk.Button button_jumps_rj_result_help_stiffness;
        
-       [Widget] Gtk.DrawingArea drawingarea_jumps_profile;
-       [Widget] Gtk.Image image_tab_jumps_profile;
-       [Widget] Gtk.Image image_jumps_profile_save;
-
-       [Widget] Gtk.HBox hbox_jumps_profile_jumps_done;
-       [Widget] Gtk.Image image_jumps_profile_sj_yes;
-       [Widget] Gtk.Image image_jumps_profile_sj_no;
-       [Widget] Gtk.Image image_jumps_profile_sjl_yes;
-       [Widget] Gtk.Image image_jumps_profile_sjl_no;
-       [Widget] Gtk.Image image_jumps_profile_cmj_yes;
-       [Widget] Gtk.Image image_jumps_profile_cmj_no;
-       [Widget] Gtk.Image image_jumps_profile_abk_yes;
-       [Widget] Gtk.Image image_jumps_profile_abk_no;
-       [Widget] Gtk.Image image_jumps_profile_dja_yes;
-       [Widget] Gtk.Image image_jumps_profile_dja_no;
+       [Widget] Gtk.DrawingArea drawingarea_jumps_dj_optimal_fall;
+       [Widget] Gtk.Image image_tab_jumps_dj_optimal_fall;
+       [Widget] Gtk.Image image_jumps_dj_optimal_fall_save;
 
        //runs
        [Widget] Gtk.Button button_edit_selected_run;
@@ -489,7 +478,7 @@ public partial class ChronoJumpWindow
        
        private string progVersion;
        private string progName;
-       private enum notebook_analyze_pages { STATISTICS, JUMPSPROFILE, SPRINT, FORCESENSOR, RACEENCODER }
+       private enum notebook_analyze_pages { STATISTICS, JUMPSPROFILE, JUMPSDJOPTIMALFALL, SPRINT, 
FORCESENSOR, RACEENCODER }
 
        private string runningFileName; //useful for knowing if there are two chronojump instances
 
@@ -3117,6 +3106,7 @@ public partial class ChronoJumpWindow
                arrow_contacts_sup_capture_analyze.Visible = false;
                radio_mode_contacts_general.Visible = false;
                radio_mode_contacts_jumps_profile.Visible = false;
+               radio_mode_contacts_jumps_dj_optimal_fall.Visible = false;
                radio_mode_contacts_sprint.Visible = false;
                notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.STATISTICS);
                button_inspect_last_test_run_intervallic.Visible = false;
@@ -3161,16 +3151,18 @@ public partial class ChronoJumpWindow
                                        arrow_contacts_sup_capture_analyze.Visible = true;
                                        radio_mode_contacts_general.Visible = true;
                                        radio_mode_contacts_jumps_profile.Visible = true;
+                                       radio_mode_contacts_jumps_dj_optimal_fall.Visible = true;
                                }
-                       } else 
-                       {
+                       } else {
                                notebooks_change(m);
                                button_contacts_bells.Sensitive = true;
                                on_extra_window_jumps_rj_test_changed(new object(), new EventArgs());
                                hbox_results_legend.Visible = false;
 
+                               //used when return from other Menuitem_mode
                                radio_mode_contacts_jumps_profile.Hide();
-                               if(radio_mode_contacts_jumps_profile.Active)
+                               radio_mode_contacts_jumps_dj_optimal_fall.Hide();
+                               if(radio_mode_contacts_jumps_profile.Active || 
radio_mode_contacts_jumps_dj_optimal_fall.Active)
                                        radio_mode_contacts_capture.Active = true;
                        }
                }
@@ -3204,7 +3196,10 @@ public partial class ChronoJumpWindow
                                        radio_mode_contacts_sprint.Visible = true;
                                }
                        }
+
+                       //used when return from other Menuitem_mode
                        radio_mode_contacts_jumps_profile.Hide();
+                       radio_mode_contacts_jumps_dj_optimal_fall.Hide();
                        if(radio_mode_contacts_sprint.Active)
                                radio_mode_contacts_capture.Active = true;
                }
@@ -7032,73 +7027,6 @@ LogB.Debug("mc finished 5");
                        }
                }
        }
-       
-
-       JumpsProfile jumpsProfile;
-
-       private void jumpsProfileDo (bool calculateData)
-       {
-               if(currentPerson == null || currentSession == null)
-                       return;
-               
-               if(jumpsProfile == null) {
-                       jumpsProfile = new JumpsProfile();
-                       calculateData = true;
-               }
-
-               if(calculateData)
-               {
-                       jumpsProfile.Calculate(currentPerson.UniqueID, currentSession.UniqueID);
-
-                       if(jumpsProfile.AllJumpsDone)
-                               hbox_jumps_profile_jumps_done.Visible = false;
-                       else {
-                               hbox_jumps_profile_jumps_done.Visible = true;
-                               JumpsProfileGraph.ShowDoneJumps(jumpsProfile.JumpsDone,
-                                               image_jumps_profile_sj_yes, image_jumps_profile_sj_no,
-                                               image_jumps_profile_sjl_yes, image_jumps_profile_sjl_no,
-                                               image_jumps_profile_cmj_yes, image_jumps_profile_cmj_no,
-                                               image_jumps_profile_abk_yes, image_jumps_profile_abk_no,
-                                               image_jumps_profile_dja_yes, image_jumps_profile_dja_no
-                                               );
-                       }
-               }
-
-               JumpsProfileGraph.Do(jumpsProfile.GetIndexes(), drawingarea_jumps_profile,
-                               currentPerson.Name, currentSession.DateShort);
-       }
-       private void on_drawingarea_jumps_profile_expose_event (object o, ExposeEventArgs args) 
-       {
-               jumpsProfileDo(false); //do not calculate data
-               //data is calculated on switch page (at notebook_capture_analyze) or on change person
-       }
-
-       private void on_button_jumps_profile_save_image_clicked (object o, EventArgs args)
-       {
-               checkFile(Constants.CheckFileOp.JUMPS_PROFILE_SAVE_IMAGE);
-       }
-
-       private void on_button_jumps_profile_save_image_selected (string destination)
-       {
-               if(drawingarea_jumps_profile == null)
-                       return;
-
-               Gdk.Pixbuf pixbuf = Gdk.Pixbuf.FromDrawable(drawingarea_jumps_profile.GdkWindow, 
Gdk.Colormap.System,
-                               0, 0, 0, 0,
-                               UtilGtk.WidgetWidth(drawingarea_jumps_profile),
-                               UtilGtk.WidgetHeight(drawingarea_jumps_profile) );
-
-               LogB.Information("Saving");
-               pixbuf.Save(destination,"png");
-       }
-       private void on_overwrite_file_jumps_profile_save_image_accepted (object o, EventArgs args)
-       {
-               on_button_jumps_profile_save_image_selected (exportFileName);
-
-               string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
-               new DialogMessage(Constants.MessageTypes.INFO, myString);
-       }
-
 
        private void on_radio_mode_contacts_capture_toggled (object o, EventArgs args)
        {
@@ -7108,6 +7036,7 @@ LogB.Debug("mc finished 5");
                arrow_contacts_sup_capture_analyze.Visible = false;
                radio_mode_contacts_general.Visible = false;
                radio_mode_contacts_jumps_profile.Visible = false;
+               radio_mode_contacts_jumps_dj_optimal_fall.Visible = false;
                radio_mode_contacts_sprint.Visible = false;
 
                notebook_capture_analyze.CurrentPage = 0;
@@ -7131,6 +7060,13 @@ LogB.Debug("mc finished 5");
                                        notebook_analyze.CurrentPage = 
Convert.ToInt32(notebook_analyze_pages.JUMPSPROFILE);
                                        jumpsProfileDo(true);
                                }
+
+                               radio_mode_contacts_jumps_dj_optimal_fall.Visible = true;
+                               if(radio_mode_contacts_jumps_dj_optimal_fall.Active)
+                               {
+                                       notebook_analyze.CurrentPage = 
Convert.ToInt32(notebook_analyze_pages.JUMPSDJOPTIMALFALL);
+                                       //jumpsDjOptimalFallDo(true);
+                               }
                        }
                        else if(current_menuitem_mode == Constants.Menuitem_modes.RUNSINTERVALLIC)
                                radio_mode_contacts_sprint.Visible = true;
@@ -7158,6 +7094,14 @@ LogB.Debug("mc finished 5");
                        jumpsProfileDo(true);
                }
        }
+       private void on_radio_mode_contacts_jumps_dj_optimal_fall_toggled (object o, EventArgs args)
+       {
+               if(radio_mode_contacts_jumps_dj_optimal_fall.Active)
+               {
+                       notebook_analyze.CurrentPage = 
Convert.ToInt32(notebook_analyze_pages.JUMPSDJOPTIMALFALL);
+                       //jumpsDjOptimalFallDo(true);
+               }
+       }
        private void on_radio_mode_contacts_sprint_toggled (object o, EventArgs args)
        {
                if(radio_mode_contacts_sprint.Active)
@@ -7340,6 +7284,7 @@ LogB.Debug("mc finished 5");
                if(current_menuitem_mode == Constants.Menuitem_modes.JUMPSSIMPLE)
                {
                        radio_mode_contacts_jumps_profile.Hide();
+                       radio_mode_contacts_jumps_dj_optimal_fall.Hide();
                }
                else if(current_menuitem_mode == Constants.Menuitem_modes.RUNSINTERVALLIC)
                {
@@ -7577,9 +7522,11 @@ LogB.Debug("mc finished 5");
                hbox_jump_auto_controls.Visible  = start;
 
                radio_mode_contacts_analyze.Visible = ! start;
-               if(current_menuitem_mode == Constants.Menuitem_modes.JUMPSREACTIVE)
+               if(current_menuitem_mode == Constants.Menuitem_modes.JUMPSSIMPLE)
+               {
                        radio_mode_contacts_jumps_profile.Visible = ! start;
-               else if(current_menuitem_mode == Constants.Menuitem_modes.RUNSINTERVALLIC)
+                       radio_mode_contacts_jumps_dj_optimal_fall.Visible = ! start;
+               } else if(current_menuitem_mode == Constants.Menuitem_modes.RUNSINTERVALLIC)
                        radio_mode_contacts_sprint.Visible = ! start;
 
                //when start, put button delete_last_test as not sensitive
diff --git a/src/gui/app1/chronojumpJumpsProfile.cs b/src/gui/app1/chronojumpJumpsProfile.cs
new file mode 100644
index 00000000..e677ca5e
--- /dev/null
+++ b/src/gui/app1/chronojumpJumpsProfile.cs
@@ -0,0 +1,112 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * Chronojump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * Chronojump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  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-2019   Xavier de Blas <xaviblas gmail com> 
+ */
+
+
+using System;
+using Gtk;
+//using Gdk;
+using Glade;
+using Mono.Unix;
+
+public partial class ChronoJumpWindow 
+{
+       [Widget] Gtk.DrawingArea drawingarea_jumps_profile;
+       [Widget] Gtk.Image image_tab_jumps_profile;
+       [Widget] Gtk.Image image_jumps_profile_save;
+
+       [Widget] Gtk.HBox hbox_jumps_profile_jumps_done;
+       [Widget] Gtk.Image image_jumps_profile_sj_yes;
+       [Widget] Gtk.Image image_jumps_profile_sj_no;
+       [Widget] Gtk.Image image_jumps_profile_sjl_yes;
+       [Widget] Gtk.Image image_jumps_profile_sjl_no;
+       [Widget] Gtk.Image image_jumps_profile_cmj_yes;
+       [Widget] Gtk.Image image_jumps_profile_cmj_no;
+       [Widget] Gtk.Image image_jumps_profile_abk_yes;
+       [Widget] Gtk.Image image_jumps_profile_abk_no;
+       [Widget] Gtk.Image image_jumps_profile_dja_yes;
+       [Widget] Gtk.Image image_jumps_profile_dja_no;
+
+
+       JumpsProfile jumpsProfile;
+
+       private void jumpsProfileDo (bool calculateData)
+       {
+               if(currentPerson == null || currentSession == null)
+                       return;
+               
+               if(jumpsProfile == null) {
+                       jumpsProfile = new JumpsProfile();
+                       calculateData = true;
+               }
+
+               if(calculateData)
+               {
+                       jumpsProfile.Calculate(currentPerson.UniqueID, currentSession.UniqueID);
+
+                       if(jumpsProfile.AllJumpsDone)
+                               hbox_jumps_profile_jumps_done.Visible = false;
+                       else {
+                               hbox_jumps_profile_jumps_done.Visible = true;
+                               JumpsProfileGraph.ShowDoneJumps(jumpsProfile.JumpsDone,
+                                               image_jumps_profile_sj_yes, image_jumps_profile_sj_no,
+                                               image_jumps_profile_sjl_yes, image_jumps_profile_sjl_no,
+                                               image_jumps_profile_cmj_yes, image_jumps_profile_cmj_no,
+                                               image_jumps_profile_abk_yes, image_jumps_profile_abk_no,
+                                               image_jumps_profile_dja_yes, image_jumps_profile_dja_no
+                                               );
+                       }
+               }
+
+               JumpsProfileGraph.Do(jumpsProfile.GetIndexes(), drawingarea_jumps_profile,
+                               currentPerson.Name, currentSession.DateShort);
+       }
+       private void on_drawingarea_jumps_profile_expose_event (object o, ExposeEventArgs args) 
+       {
+               jumpsProfileDo(false); //do not calculate data
+               //data is calculated on switch page (at notebook_capture_analyze) or on change person
+       }
+
+       private void on_button_jumps_profile_save_image_clicked (object o, EventArgs args)
+       {
+               checkFile(Constants.CheckFileOp.JUMPS_PROFILE_SAVE_IMAGE);
+       }
+
+       private void on_button_jumps_profile_save_image_selected (string destination)
+       {
+               if(drawingarea_jumps_profile == null)
+                       return;
+
+               Gdk.Pixbuf pixbuf = Gdk.Pixbuf.FromDrawable(drawingarea_jumps_profile.GdkWindow, 
Gdk.Colormap.System,
+                               0, 0, 0, 0,
+                               UtilGtk.WidgetWidth(drawingarea_jumps_profile),
+                               UtilGtk.WidgetHeight(drawingarea_jumps_profile) );
+
+               LogB.Information("Saving");
+               pixbuf.Save(destination,"png");
+       }
+       private void on_overwrite_file_jumps_profile_save_image_accepted (object o, EventArgs args)
+       {
+               on_button_jumps_profile_save_image_selected (exportFileName);
+
+               string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
+               new DialogMessage(Constants.MessageTypes.INFO, myString);
+       }
+
+}
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 71176f93..96ab7934 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -210,6 +210,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_encoder_analyze_image_save_1;
        [Widget] Gtk.Image image_encoder_analyze_1RM_save_1;
        [Widget] Gtk.Image image_encoder_analyze_image_save_2;
+       [Widget] Gtk.Image image_forcesensor_analyze_image_save;
        [Widget] Gtk.Image image_forcesensor_analyze_image_save2;
        [Widget] Gtk.Image image_forcesensor_analyze_image_save3;
        [Widget] Gtk.Image image_forcesensor_analyze_image_save5;
@@ -672,6 +673,7 @@ public partial class ChronoJumpWindow
                image_forcesensor_analyze_save_rfd_manual.Pixbuf = pixbuf;
                image_force_sensor_analyze_analyze.Pixbuf = pixbuf;
                image_jumps_profile_save.Pixbuf = pixbuf;
+               image_jumps_dj_optimal_fall_save.Pixbuf = pixbuf;
                image_encoder_analyze_image_compujump_send_email_image.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "save.png");
@@ -680,6 +682,7 @@ public partial class ChronoJumpWindow
                image_encoder_analyze_image_save_1.Pixbuf = pixbuf;
                image_encoder_analyze_1RM_save_1.Pixbuf = pixbuf;
                image_encoder_analyze_image_save_2.Pixbuf = pixbuf;
+               image_forcesensor_analyze_image_save.Pixbuf = pixbuf;
                image_forcesensor_analyze_image_save2.Pixbuf = pixbuf;
                image_forcesensor_analyze_image_save3.Pixbuf = pixbuf;
                image_forcesensor_analyze_image_save5.Pixbuf = pixbuf;


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