[chronojump] Minimal height different for inertial and not inertial



commit 837e4830cbc6ce611f165fff15ce42c334525ab9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Mar 4 01:14:26 2016 +0100

    Minimal height different for inertial and not inertial

 glade/chronojump.glade |  262 +++++++++++++++++++++++++++++++++++++-----------
 src/gui/encoder.cs     |   32 +++++--
 2 files changed, 230 insertions(+), 64 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index a1002c0..334f634 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7891,6 +7891,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -9416,6 +9419,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -10582,6 +10588,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -18981,6 +18990,9 @@ on current Chronojump version.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23565,6 +23577,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -24630,6 +24645,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -26187,6 +26205,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -26801,6 +26822,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -28696,15 +28720,15 @@ comments</property>
       <widget class="GtkVBox" id="vbox27">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">8</property>
+        <property name="spacing">12</property>
         <child>
           <widget class="GtkTable" id="table7">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="n_rows">5</property>
             <property name="n_columns">2</property>
-            <property name="column_spacing">12</property>
-            <property name="row_spacing">8</property>
+            <property name="column_spacing">16</property>
+            <property name="row_spacing">12</property>
             <child>
               <widget class="GtkLabel" id="label1">
                 <property name="can_focus">False</property>
@@ -28832,57 +28856,6 @@ comments</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkHBox" id="hbox115">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">4</property>
-                <child>
-                  <widget class="GtkSpinButton" id="spin_encoder_capture_min_height">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="has_tooltip">True</property>
-                    <property name="tooltip" translatable="yes">Minimal height</property>
-                    <property name="invisible_char">●</property>
-                    <property name="width_chars">3</property>
-                    <property name="invisible_char_set">True</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">20 1 300 1 10 0</property>
-                    <property name="climb_rate">1</property>
-                    <property name="snap_to_ticks">True</property>
-                    <property name="numeric">True</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="label81">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="xalign">1</property>
-                    <property name="label" translatable="yes">cm</property>
-                    <property name="use_markup">True</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-              </packing>
-            </child>
-            <child>
               <widget class="GtkLabel" id="label7">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
@@ -28996,6 +28969,142 @@ comments</property>
                 <property name="bottom_attach">3</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkTable" id="table1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="n_rows">2</property>
+                <property name="n_columns">2</property>
+                <property name="column_spacing">16</property>
+                <property name="row_spacing">8</property>
+                <child>
+                  <widget class="GtkHBox" id="hbox115">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <widget class="GtkSpinButton" id="spin_encoder_capture_min_height_not_inertial">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Minimal height</property>
+                        <property name="invisible_char">●</property>
+                        <property name="width_chars">3</property>
+                        <property name="invisible_char_set">True</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">20 1 300 1 10 0</property>
+                        <property name="climb_rate">1</property>
+                        <property name="snap_to_ticks">True</property>
+                        <property name="numeric">True</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="label81">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">1</property>
+                        <property name="label" translatable="yes">cm</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <widget class="GtkSpinButton" id="spin_encoder_capture_min_height_inertial">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Minimal height</property>
+                        <property name="invisible_char">●</property>
+                        <property name="width_chars">3</property>
+                        <property name="invisible_char_set">True</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">5 1 300 1 10 0</property>
+                        <property name="climb_rate">1</property>
+                        <property name="snap_to_ticks">True</property>
+                        <property name="numeric">True</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="label4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">1</property>
+                        <property name="label" translatable="yes">cm</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label5">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Not inertial</property>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label6">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Inertial</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="expand">False</property>
@@ -39131,6 +39240,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -41354,6 +41481,18 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -42714,9 +42853,6 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                       <placeholder/>
                                     </child>
                                     <child>
-                                      <placeholder/>
-                                    </child>
-                                    <child>
                                       <widget class="GtkLabel" id="label218">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
@@ -43781,6 +43917,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                     <child>
                                       <placeholder/>
                                     </child>
+                                    <child>
+                                      <placeholder/>
+                                    </child>
                                   </widget>
                                 </child>
                               </widget>
@@ -47587,6 +47726,9 @@ It starts before and arrives there with some speed.</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -48316,6 +48458,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -49060,6 +49205,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index c9bcb1c..81ddafd 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -904,7 +904,7 @@ public partial class ChronoJumpWindow
                                "",     //fileSaved,    //to know date do: select substr(name,-23,19) from 
encoder;
                                "",     //path,                 //url
                                (int) encoderCaptureOptionsWin.spin_encoder_capture_time.Value, 
-                               (int) encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value, 
+                               
encoderCaptureOptionsWin.GetMinHeight(encoderConfigurationCurrent.has_inertia), 
                                Util.RemoveTildeAndColonAndDot(textview_encoder_signal_comment.Buffer.Text), 
//desc,
                                "", videoURL,           //status, videoURL
                                encoderConfigurationCurrent,
@@ -915,7 +915,7 @@ public partial class ChronoJumpWindow
 
 
                EncoderParams ep = new EncoderParams(
-                               (int) encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value, 
+                               
encoderCaptureOptionsWin.GetMinHeight(encoderConfigurationCurrent.has_inertia), 
                                getExercisePercentBodyWeightFromCombo (),
                                Util.ConvertToPoint(findMass(Constants.MassType.BODY)),
                                Util.ConvertToPoint(findMass(Constants.MassType.EXTRA)),
@@ -1492,7 +1492,9 @@ public partial class ChronoJumpWindow
                                combo_encoder_laterality.Active = 
UtilGtk.ComboMakeActive(combo_encoder_laterality, eSQL.laterality);
                                spin_encoder_extra_weight.Value = Convert.ToInt32(eSQL.extraWeight);
 
-                               encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value = 
eSQL.minHeight;
+                               encoderCaptureOptionsWin.SetMinHeight(
+                                               eSQL.encoderConfiguration.has_inertia, eSQL.minHeight);
+
                                textview_encoder_signal_comment.Buffer.Text = eSQL.description;
                                encoderTimeStamp = eSQL.GetDate(false); 
                                encoderSignalUniqueID = eSQL.uniqueID;
@@ -3034,7 +3036,7 @@ public partial class ChronoJumpWindow
                        }
 
                        ep = new EncoderParams(
-                                       (int) encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value, 
+                                       
encoderCaptureOptionsWin.GetMinHeight(encoderConfigurationCurrent.has_inertia),
                                        getExercisePercentBodyWeightFromCombo (),
                                        Util.ConvertToPoint(findMass(Constants.MassType.BODY)),
                                        Util.ConvertToPoint(findMass(Constants.MassType.EXTRA)),
@@ -4871,7 +4873,9 @@ public partial class ChronoJumpWindow
                                        captureCurvesBarsData = new ArrayList();
 
                                        needToRefreshTreeviewCapture = false;
-                                       encoderSelectedMinimumHeight =(int) 
encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value;
+
+                                       encoderSelectedMinimumHeight = encoderCaptureOptionsWin.GetMinHeight(
+                                                       encoderConfigurationCurrent.has_inertia);
        
                                        encoderThread = new Thread(new ThreadStart(encoderDoCaptureCsharp));
                                        GLib.Idle.Add (new GLib.IdleHandler 
(pulseGTKEncoderCaptureAndCurves));
@@ -5048,7 +5052,7 @@ public partial class ChronoJumpWindow
        private void runEncoderCaptureNoRDotNetInitialize() 
        {
                EncoderParams ep = new EncoderParams(
-                               (int) encoderCaptureOptionsWin.spin_encoder_capture_min_height.Value, 
+                               
encoderCaptureOptionsWin.GetMinHeight(encoderConfigurationCurrent.has_inertia),
                                getExercisePercentBodyWeightFromCombo (),
                                Util.ConvertToPoint(findMass(Constants.MassType.BODY)),
                                Util.ConvertToPoint(findMass(Constants.MassType.EXTRA)),
@@ -6083,7 +6087,8 @@ public class EncoderCaptureOptionsWindow {
        [Widget] public Gtk.RadioButton radiobutton_encoder_capture_external;
        [Widget] public Gtk.SpinButton spin_encoder_capture_time;
        [Widget] public Gtk.SpinButton spin_encoder_capture_inactivity_end_time;
-       [Widget] public Gtk.SpinButton spin_encoder_capture_min_height;
+       [Widget] private Gtk.SpinButton spin_encoder_capture_min_height_inertial;
+       [Widget] private Gtk.SpinButton spin_encoder_capture_min_height_not_inertial;
        [Widget] Gtk.Box hbox_combo_main_variable;
        [Widget] Gtk.ComboBox combo_main_variable;
        [Widget] public Gtk.CheckButton check_show_start_and_duration;
@@ -6186,6 +6191,19 @@ public class EncoderCaptureOptionsWindow {
                        
                return -1;
        }
+
+       public int GetMinHeight (bool inertial) {
+               if(inertial)
+                       return (int) spin_encoder_capture_min_height_inertial.Value;
+               else
+                       return (int) spin_encoder_capture_min_height_not_inertial.Value;
+       }
+       public void SetMinHeight (bool inertial, int height) {
+               if(inertial)
+                       spin_encoder_capture_min_height_inertial.Value = height;
+               else
+                       spin_encoder_capture_min_height_not_inertial.Value = height;
+       }
        
        private void on_button_inactivity_help_clicked (object o, EventArgs args)
        {


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