[chronojump] Default new option to discard feedback of first three curves on inertial. Also first ecc feedback is



commit da82ab70ca16caf8e5102fe739aa6798bdb06fea
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Aug 10 21:36:30 2016 +0200

    Default new option to discard feedback of first three curves on inertial. Also first ecc feedback is 
always discarded

 glade/chronojump.glade          |  245 +++++++++++++++++++++++----------------
 po/ca.po                        |    2 +-
 src/gui/chronojump.cs           |    1 +
 src/gui/encoder.cs              |   21 +++-
 src/gui/repetitiveConditions.cs |   16 ++-
 5 files changed, 172 insertions(+), 113 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 2cb996d..e576955 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -18041,6 +18041,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -22832,6 +22835,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -24104,6 +24110,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -25868,6 +25877,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>
@@ -26689,6 +26701,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -40273,6 +40288,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>
@@ -43324,6 +43357,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>
@@ -44477,9 +44522,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>
@@ -45751,6 +45793,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>
@@ -50109,6 +50154,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>
@@ -51045,6 +51093,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -51996,6 +52047,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -52612,18 +52666,6 @@ It starts before and arrives there with some speed.</property>
         <property name="can_focus">False</property>
         <property name="spacing">14</property>
         <child>
-          <widget class="GtkLabel" id="label333">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Select conditions for beep signals</property>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
           <widget class="GtkFrame" id="frame_best_and_worst">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
@@ -52896,7 +52938,7 @@ It starts before and arrives there with some speed.</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="position">1</property>
+            <property name="position">0</property>
           </packing>
         </child>
         <child>
@@ -54222,7 +54264,7 @@ It starts before and arrives there with some speed.</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">2</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
@@ -54499,7 +54541,7 @@ It starts before and arrives there with some speed.</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">3</property>
+            <property name="position">2</property>
           </packing>
         </child>
         <child>
@@ -55962,60 +56004,60 @@ It starts before and arrives there with some speed.</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkCheckButton" id="checkbutton_inertial_discard_first_three">
+            <property name="label" translatable="yes">On inertial discard first three curves.</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
             <property name="position">4</property>
           </packing>
         </child>
         <child>
-          <widget class="GtkFrame" id="frame25">
+          <widget class="GtkHBox" id="hbox16">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="label_yalign">0.69999998807907104</property>
-            <property name="shadow_type">out</property>
+            <property name="spacing">8</property>
             <child>
-              <widget class="GtkAlignment" id="alignment80">
+              <widget class="GtkLabel" id="label20">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="top_padding">10</property>
-                <property name="bottom_padding">10</property>
-                <property name="left_padding">10</property>
-                <property name="right_padding">10</property>
+                <property name="xalign">1</property>
+                <property name="label" translatable="yes">Test bells</property>
+              </widget>
+              <packing>
+                <property name="expand">True</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button_test_good">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip" translatable="yes">Test "Good" bell</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="on_button_test_clicked" swapped="no"/>
                 <child>
                   <widget class="GtkHBox" id="hbox14">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
                     <child>
-                      <widget class="GtkHBox" id="hbox16">
+                      <widget class="GtkImage" id="image1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="radiobutton_test_good">
-                            <property name="label" translatable="yes">"Good" bell</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkImage" id="image_repetitive_test_good">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="stock">gtk-media-play</property>
                       </widget>
                       <packing>
                         <property name="expand">True</property>
@@ -56024,37 +56066,10 @@ It starts before and arrives there with some speed.</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkHBox" id="hbox15">
+                      <widget class="GtkImage" id="image_repetitive_test_good">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="radiobutton_test_bad">
-                            <property name="label" translatable="yes">"Bad" bell</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">radiobutton_test_good</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkImage" id="image_repetitive_test_bad">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="stock">gtk-missing-image</property>
                       </widget>
                       <packing>
                         <property name="expand">True</property>
@@ -56062,34 +56077,59 @@ It starts before and arrives there with some speed.</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">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button_test_bad">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip" translatable="yes">Test "Bad" bell</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="on_button_test_clicked" swapped="no"/>
+                <child>
+                  <widget class="GtkHBox" id="hbox15">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
                     <child>
-                      <widget class="GtkButton" id="button_test">
-                        <property name="label" translatable="yes">test!</property>
+                      <widget class="GtkImage" id="image3">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="on_button_test_clicked" swapped="no"/>
+                        <property name="can_focus">False</property>
+                        <property name="stock">gtk-media-play</property>
                       </widget>
                       <packing>
                         <property name="expand">True</property>
                         <property name="fill">True</property>
-                        <property name="position">2</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkImage" id="image_repetitive_test_bad">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="stock">gtk-missing-image</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
                       </packing>
                     </child>
                   </widget>
                 </child>
               </widget>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label373">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">test bells</property>
-                <property name="use_markup">True</property>
-              </widget>
               <packing>
-                <property name="type">label_item</property>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
               </packing>
             </child>
           </widget>
@@ -56100,7 +56140,7 @@ It starts before and arrives there with some speed.</property>
           </packing>
         </child>
         <child>
-          <widget class="GtkHButtonBox" id="hbuttonbox34">
+          <widget class="GtkHButtonBox" id="hbuttonbox2">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
@@ -56124,6 +56164,7 @@ It starts before and arrives there with some speed.</property>
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
+            <property name="padding">6</property>
             <property name="position">6</property>
           </packing>
         </child>
diff --git a/po/ca.po b/po/ca.po
index 5eb1685..070297d 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -3304,7 +3304,7 @@ msgstr "Mostrar feedback manual"
 
 #: ../glade/chronojump.glade.h:762
 msgid "<b>Height</b> (cm)"
-msgstr "<b>Alçada</b> (kg)"
+msgstr "<b>Alçada</b> (cm)"
 
 #: ../glade/chronojump.glade.h:763
 msgid "<b>Mean speed</b> (m/s)"
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 19af7da..50dbdd1 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -6579,6 +6579,7 @@ LogB.Debug("X");
                                double mainVariableHigher = 
encoderCaptureOptionsWin.GetMainVariableHigher(mainVariable);
                                double mainVariableLower = 
encoderCaptureOptionsWin.GetMainVariableLower(mainVariable);
                                plotCurvesGraphDoPlot(mainVariable, mainVariableHigher, mainVariableLower, 
captureCurvesBarsData,
+                                               
encoderCaptureOptionsWin.GetEncoderInertialDiscardFirstThree(),
                                                false); //not capturing
                        } else
                                UtilGtk.ErasePaint(encoder_capture_curves_bars_drawingarea, 
encoder_capture_curves_bars_pixmap);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index d04b6d3..efb98eb 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4037,7 +4037,7 @@ public partial class ChronoJumpWindow
        
        //if we are capturing, play sounds
        void plotCurvesGraphDoPlot(string mainVariable, double mainVariableHigher, double mainVariableLower, 
-                       ArrayList data6Variables, bool capturing) 
+                       ArrayList data6Variables, bool discardFirstThree, bool capturing) 
        {
                //LogB.Information("at plotCurvesGraphDoPlot");
                UtilGtk.ErasePaint(encoder_capture_curves_bars_drawingarea, 
encoder_capture_curves_bars_pixmap);
@@ -4154,7 +4154,15 @@ public partial class ChronoJumpWindow
                        //select pen color for bars and sounds
                        string myColor = repetitiveConditionsWin.AssignColorAutomatic(d);
 
-                       if( myColor == UtilGtk.ColorGood || (mainVariableHigher != -1 && d >= 
mainVariableHigher) ) 
+                       bool discarded = false;
+                       if( eccon == "c" && discardFirstThree && count < 3)
+                               discarded = true;
+                       else if( eccon != "c" && discardFirstThree && count < 6)
+                               discarded = true;
+                       else if ( (eccon == "ec" || eccon == "ecS") && 
encoderConfigurationCurrent.has_inertia && count == 0)
+                               discarded = true;       //on inertial devices "ec" or "ecS", the first ecc 
cannot have feedback
+
+                       if( ! discarded && ( myColor == UtilGtk.ColorGood || (mainVariableHigher != -1 && d 
= mainVariableHigher) ) )
                        {
                                my_pen_ecc_con_e = pen_green_dark_encoder_capture;
                                my_pen_ecc_con_c = pen_green_light_encoder_capture;
@@ -4163,7 +4171,7 @@ public partial class ChronoJumpWindow
                                if(preferences.volumeOn && count == data.Count -1 && capturing)
                                        Util.PlaySound(Constants.SoundTypes.GOOD, preferences.volumeOn);
                        }
-                       else if( myColor == UtilGtk.ColorBad || (mainVariableLower != -1 && d <= 
mainVariableLower) )
+                       else if( ! discarded && ( myColor == UtilGtk.ColorBad || (mainVariableLower != -1 && 
d <= mainVariableLower) ) )
                        {
                                my_pen_ecc_con_e = pen_red_dark_encoder_capture;
                                my_pen_ecc_con_c = pen_red_light_encoder_capture;
@@ -4317,6 +4325,7 @@ public partial class ChronoJumpWindow
                        double mainVariableHigher = 
encoderCaptureOptionsWin.GetMainVariableHigher(mainVariable);
                        double mainVariableLower = 
encoderCaptureOptionsWin.GetMainVariableLower(mainVariable);
                        plotCurvesGraphDoPlot(mainVariable, mainVariableHigher, mainVariableLower, 
captureCurvesBarsData,
+                                       encoderCaptureOptionsWin.GetEncoderInertialDiscardFirstThree(),
                                        false); //not capturing
                } else
                        UtilGtk.ErasePaint(encoder_capture_curves_bars_drawingarea, 
encoder_capture_curves_bars_pixmap);
@@ -4942,6 +4951,7 @@ public partial class ChronoJumpWindow
                                //captureCurvesBarsData.Add(new EncoderBarsData(20, 39, 10, 40));
 
                                plotCurvesGraphDoPlot(mainVariable, mainVariableHigher, mainVariableLower, 
captureCurvesBarsData, 
+                                               
encoderCaptureOptionsWin.GetEncoderInertialDiscardFirstThree(),
                                                true);  //capturing
                                //}
 
@@ -5376,6 +5386,7 @@ public partial class ChronoJumpWindow
 
 
                                plotCurvesGraphDoPlot(mainVariable, mainVariableHigher, mainVariableLower, 
captureCurvesBarsData,
+                                               
encoderCaptureOptionsWin.GetEncoderInertialDiscardFirstThree(),
                                                false); //not capturing
                
                                button_encoder_signal_save_comment.Label = Catalog.GetString("Save comment");
@@ -5947,6 +5958,10 @@ public class EncoderCaptureOptionsWindow {
                return -1;
        }
 
+       public bool GetEncoderInertialDiscardFirstThree() {
+               return repetitiveConditionsWin.EncoderInertialDiscardFirstThree;
+       }
+
        public int GetMinHeight (bool inertial) {
                if(inertial)
                        return (int) spin_encoder_capture_min_height_inertial.Value;
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index 3d044bd..e5ad153 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -109,13 +109,11 @@ public class RepetitiveConditionsWindow
        [Widget] Gtk.SpinButton spinbutton_encoder_peakpower_higher;
        [Widget] Gtk.SpinButton spinbutton_encoder_power_lower;
        [Widget] Gtk.SpinButton spinbutton_encoder_peakpower_lower;
+       [Widget] Gtk.CheckButton checkbutton_inertial_discard_first_three;
 
 
-       /* bell tests*/ 
-       [Widget] Gtk.RadioButton radiobutton_test_good;
-       [Widget] Gtk.RadioButton radiobutton_test_bad;
-
-       [Widget] Gtk.Button button_test;
+       [Widget] Gtk.Button button_test_good;
+       [Widget] Gtk.Button button_test_bad;
        [Widget] Gtk.Button button_close;
 
        //bells good (green)
@@ -289,9 +287,9 @@ public class RepetitiveConditionsWindow
        void on_button_test_clicked (object o, EventArgs args)
        {
                if(volumeOn) {
-                       if (radiobutton_test_good.Active) 
+                       if (o == button_test_good) 
                                Util.PlaySound(Constants.SoundTypes.GOOD, true);
-                       else
+                       else //button_test_bad
                                Util.PlaySound(Constants.SoundTypes.BAD, true);
                } else
                        new DialogMessage(Constants.MessageTypes.INFO, 
@@ -681,6 +679,10 @@ public class RepetitiveConditionsWindow
        public int EncoderPeakPowerLowerValue {
                get { return Convert.ToInt32(spinbutton_encoder_peakpower_lower.Value); }
        }
+       
+       public bool EncoderInertialDiscardFirstThree {
+               get { return checkbutton_inertial_discard_first_three.Active; }
+       }
 
 }
 


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