[chronojump] Encoder analyze single instant (added displacement)



commit a009f950c333ba6630e863c06f252db29b2a7bb4
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Feb 5 12:55:15 2016 +0100

    Encoder analyze single instant (added displacement)

 encoder/graph.R        |   11 ++-
 encoder/util.R         |   14 +++
 glade/chronojump.glade |  224 ++++++++++++++++++++++++++++++++++++++----------
 src/encoder.cs         |   22 +++--
 src/gui/encoder.cs     |   11 +++
 5 files changed, 229 insertions(+), 53 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 1525187..46c5179 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -2699,8 +2699,15 @@ doProcess <- function(options)
                                          FALSE         #show all the repetition, not only ground phase on ecc
                                          ) 
 
-                       df=data.frame(cbind(kn$speedy, kn$accely, kn$force, kn$power))
-                       colnames(df)=c("speed","acceleration","force","power")
+                       #smoothing for displamenet
+                       smoothingTemp = 0
+                       if(repOp$eccon == "c" || repOp$eccon == "e")
+                               smoothingTemp = op$SmoothingOneC
+                       else
+                               smoothingTemp = SmoothingsEC[smoothingPos]
+
+                       df=data.frame(cbind(getPositionSmoothed(kn$displ,smoothingTemp), kn$speedy, 
kn$accely, kn$force, kn$power))
+                       colnames(df)=c("displacement","speed","acceleration","force","power")
 
                        write("going to write it to file", stderr())
                        #write(paste("length", curves[op$Jump,2] - curves[op$Jump,1] ), stderr())
diff --git a/encoder/util.R b/encoder/util.R
index ba85dc6..f362fd4 100644
--- a/encoder/util.R
+++ b/encoder/util.R
@@ -261,6 +261,19 @@ getSpeed <- function(displacement, smoothing) {
        return (speedSpline)
 }
 
+#same smoothing than getSped
+getPositionSmoothed <- function(displacement, smoothing) {
+       #no change affected by encoderConfiguration
+       
+       #use position because this does not make erronously change the initial and end of the curve
+       #do spline with displacement is buggy because data is too similar -2, -1, 0, 1, 2, ...
+       position <- cumsum(displacement)
+       positionSpline <- smooth.spline( 1:length(position), position, spar=smoothing)
+       
+       return (positionSpline$y)
+}
+
+
 getAccelerationSafe <- function(speed) {
        #x vector should contain at least 4 different values
        if(length(speed) >= 4)
@@ -589,6 +602,7 @@ kinematicsF <- function(displacement, repOp, smoothingOneEC, smoothingOneC, g, i
        #write(mean(speed$y[start:end]), stderr())
 
        return(list(
+                   displ = displacement[start:end], 
                    speedy = speed$y[start:end], 
                    accely = accel$y[start:end], 
                    force = force[start:end], 
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 27f4658..b27eeb7 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7949,6 +7949,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -9432,6 +9435,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -10556,6 +10562,9 @@ after time</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -17973,7 +17982,7 @@ on current Chronojump version.</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="n_rows">5</property>
-                                                            <property name="n_columns">6</property>
+                                                            <property name="n_columns">7</property>
                                                             <property name="column_spacing">8</property>
                                                             <property name="row_spacing">4</property>
                                                             <child>
@@ -17983,8 +17992,8 @@ on current Chronojump version.</property>
                                                             <property name="label" 
translatable="yes">Speed</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
                                                             <property name="x_options"/>
                                                             <property name="y_options"/>
                                                             </packing>
@@ -17996,8 +18005,8 @@ on current Chronojump version.</property>
                                                             <property name="label" 
translatable="yes">Acceleration</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">3</property>
-                                                            <property name="right_attach">4</property>
+                                                            <property name="left_attach">4</property>
+                                                            <property name="right_attach">5</property>
                                                             <property name="x_options"/>
                                                             <property name="y_options"/>
                                                             </packing>
@@ -18009,8 +18018,8 @@ on current Chronojump version.</property>
                                                             <property name="label" 
translatable="yes">Force</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">4</property>
-                                                            <property name="right_attach">5</property>
+                                                            <property name="left_attach">5</property>
+                                                            <property name="right_attach">6</property>
                                                             <property name="x_options"/>
                                                             <property name="y_options"/>
                                                             </packing>
@@ -18022,8 +18031,8 @@ on current Chronojump version.</property>
                                                             <property name="label" 
translatable="yes">Power</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">5</property>
-                                                            <property name="right_attach">6</property>
+                                                            <property name="left_attach">6</property>
+                                                            <property name="right_attach">7</property>
                                                             <property name="x_options"/>
                                                             <property name="y_options"/>
                                                             </packing>
@@ -18035,8 +18044,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
                                                             <property name="top_attach">1</property>
                                                             <property name="bottom_attach">2</property>
                                                             <property name="x_options"/>
@@ -18050,8 +18059,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">3</property>
-                                                            <property name="right_attach">4</property>
+                                                            <property name="left_attach">4</property>
+                                                            <property name="right_attach">5</property>
                                                             <property name="top_attach">1</property>
                                                             <property name="bottom_attach">2</property>
                                                             <property name="x_options"/>
@@ -18065,8 +18074,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">4</property>
-                                                            <property name="right_attach">5</property>
+                                                            <property name="left_attach">5</property>
+                                                            <property name="right_attach">6</property>
                                                             <property name="top_attach">1</property>
                                                             <property name="bottom_attach">2</property>
                                                             <property name="x_options"/>
@@ -18079,8 +18088,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">5</property>
-                                                            <property name="right_attach">6</property>
+                                                            <property name="left_attach">6</property>
+                                                            <property name="right_attach">7</property>
                                                             <property name="top_attach">1</property>
                                                             <property name="bottom_attach">2</property>
                                                             <property name="x_options"/>
@@ -18094,8 +18103,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
                                                             <property name="top_attach">2</property>
                                                             <property name="bottom_attach">3</property>
                                                             <property name="x_options"/>
@@ -18109,8 +18118,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">3</property>
-                                                            <property name="right_attach">4</property>
+                                                            <property name="left_attach">4</property>
+                                                            <property name="right_attach">5</property>
                                                             <property name="top_attach">2</property>
                                                             <property name="bottom_attach">3</property>
                                                             <property name="x_options"/>
@@ -18124,8 +18133,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">4</property>
-                                                            <property name="right_attach">5</property>
+                                                            <property name="left_attach">5</property>
+                                                            <property name="right_attach">6</property>
                                                             <property name="top_attach">2</property>
                                                             <property name="bottom_attach">3</property>
                                                             <property name="x_options"/>
@@ -18139,8 +18148,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">5</property>
-                                                            <property name="right_attach">6</property>
+                                                            <property name="left_attach">6</property>
+                                                            <property name="right_attach">7</property>
                                                             <property name="top_attach">2</property>
                                                             <property name="bottom_attach">3</property>
                                                             <property name="x_options"/>
@@ -18437,8 +18446,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
                                                             <property name="top_attach">3</property>
                                                             <property name="bottom_attach">4</property>
                                                             <property name="x_options"/>
@@ -18452,8 +18461,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">3</property>
-                                                            <property name="right_attach">4</property>
+                                                            <property name="left_attach">4</property>
+                                                            <property name="right_attach">5</property>
                                                             <property name="top_attach">3</property>
                                                             <property name="bottom_attach">4</property>
                                                             <property name="x_options"/>
@@ -18467,8 +18476,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">4</property>
-                                                            <property name="right_attach">5</property>
+                                                            <property name="left_attach">5</property>
+                                                            <property name="right_attach">6</property>
                                                             <property name="top_attach">3</property>
                                                             <property name="bottom_attach">4</property>
                                                             <property name="x_options"/>
@@ -18482,8 +18491,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">5</property>
-                                                            <property name="right_attach">6</property>
+                                                            <property name="left_attach">6</property>
+                                                            <property name="right_attach">7</property>
                                                             <property name="top_attach">3</property>
                                                             <property name="bottom_attach">4</property>
                                                             <property name="x_options"/>
@@ -18497,8 +18506,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">2</property>
-                                                            <property name="right_attach">3</property>
+                                                            <property name="left_attach">3</property>
+                                                            <property name="right_attach">4</property>
                                                             <property name="top_attach">4</property>
                                                             <property name="bottom_attach">5</property>
                                                             <property name="x_options"/>
@@ -18512,8 +18521,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">3</property>
-                                                            <property name="right_attach">4</property>
+                                                            <property name="left_attach">4</property>
+                                                            <property name="right_attach">5</property>
                                                             <property name="top_attach">4</property>
                                                             <property name="bottom_attach">5</property>
                                                             <property name="x_options"/>
@@ -18527,8 +18536,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">4</property>
-                                                            <property name="right_attach">5</property>
+                                                            <property name="left_attach">5</property>
+                                                            <property name="right_attach">6</property>
                                                             <property name="top_attach">4</property>
                                                             <property name="bottom_attach">5</property>
                                                             <property name="x_options"/>
@@ -18542,8 +18551,8 @@ on current Chronojump version.</property>
                                                             <property name="width_chars">8</property>
                                                             </widget>
                                                             <packing>
-                                                            <property name="left_attach">5</property>
-                                                            <property name="right_attach">6</property>
+                                                            <property name="left_attach">6</property>
+                                                            <property name="right_attach">7</property>
                                                             <property name="top_attach">4</property>
                                                             <property name="bottom_attach">5</property>
                                                             <property name="x_options"/>
@@ -18577,6 +18586,82 @@ on current Chronojump version.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label150">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Displacement</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">2</property>
+                                                            <property name="right_attach">3</property>
+                                                            <property name="x_options"/>
+                                                            <property name="y_options"/>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_encoder_analyze_displ_a">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="width_chars">8</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">2</property>
+                                                            <property name="right_attach">3</property>
+                                                            <property name="top_attach">1</property>
+                                                            <property name="bottom_attach">2</property>
+                                                            <property name="x_options"/>
+                                                            <property name="y_options"/>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_encoder_analyze_displ_b">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="width_chars">8</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">2</property>
+                                                            <property name="right_attach">3</property>
+                                                            <property name="top_attach">2</property>
+                                                            <property name="bottom_attach">3</property>
+                                                            <property name="x_options"/>
+                                                            <property name="y_options"/>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_encoder_analyze_displ_average">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="width_chars">8</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">2</property>
+                                                            <property name="right_attach">3</property>
+                                                            <property name="top_attach">3</property>
+                                                            <property name="bottom_attach">4</property>
+                                                            <property name="x_options"/>
+                                                            <property name="y_options"/>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_encoder_analyze_displ_max">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="width_chars">8</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">2</property>
+                                                            <property name="right_attach">3</property>
+                                                            <property name="top_attach">4</property>
+                                                            <property name="bottom_attach">5</property>
+                                                            <property name="x_options"/>
+                                                            <property name="y_options"/>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23016,6 +23101,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -24039,6 +24127,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -25554,6 +25645,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>
@@ -26126,6 +26220,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -38166,6 +38263,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>
@@ -40221,6 +40336,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>
@@ -41498,9 +41625,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>
@@ -42523,6 +42647,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>
@@ -46318,6 +46445,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>
@@ -47005,6 +47135,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -47707,6 +47840,9 @@ It starts before and arrives there with some speed.</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/encoder.cs b/src/encoder.cs
index a3c9fc1..40c4cb0 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -1435,6 +1435,7 @@ public class EncoderConfiguration {
 
 public class EncoderAnalyzeInstant 
 {
+       public List<double> displ;
        public List<double> speed;
        public List<double> accel;
        public List<double> force;
@@ -1449,6 +1450,8 @@ public class EncoderAnalyzeInstant
        private double msPlotArea;
        
        //last calculated values on last range of msa and msb
+       public double displAverageLast;
+       public double displMaxLast;
        public double speedAverageLast;
        public double speedMaxLast;
        public double accelAverageLast;
@@ -1459,6 +1462,7 @@ public class EncoderAnalyzeInstant
        public double powerMaxLast;
 
        public EncoderAnalyzeInstant() {
+               displ = new List<double>(); 
                speed = new List<double>(); 
                accel = new List<double>(); 
                force = new List<double>(); 
@@ -1487,10 +1491,11 @@ public class EncoderAnalyzeInstant
                                }
 
                        string [] lsplit = l.Split(new char[] {','});
-                       speed.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[1])));
-                       accel.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[2])));
-                       force.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[3])));
-                       power.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[4])));
+                       displ.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[1])));
+                       speed.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[2])));
+                       accel.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[3])));
+                       force.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[4])));
+                       power.Add(Convert.ToDouble(Util.ChangeDecimalSeparator(lsplit[5])));
                }
        }
        
@@ -1518,11 +1523,13 @@ public class EncoderAnalyzeInstant
        {
                ms --; //converts from starting at 1 (graph) to starting at 0 (data)
 
-               if(ms > speed.Count)
+               if(ms > displ.Count)
                        return -1;
 
                else {
-                       if(param == "speed")
+                       if(param == "displ")
+                               return displ[ms];
+                       else if(param == "speed")
                                return speed[ms];
                        else if(param == "accel")
                                return accel[ms];
@@ -1548,9 +1555,10 @@ public class EncoderAnalyzeInstant
                        msb = temp;
                }
 
-               if(msa > speed.Count || msb > speed.Count)
+               if(msa > displ.Count || msb > displ.Count)
                        return false;
 
+               getAverageAndMax(displ, msa, msb, out displAverageLast, out displMaxLast);
                getAverageAndMax(speed, msa, msb, out speedAverageLast, out speedMaxLast);
                getAverageAndMax(accel, msa, msb, out accelAverageLast, out accelMaxLast);
                getAverageAndMax(force, msa, msb, out forceAverageLast, out forceMaxLast);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 955caa0..c080a12 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -141,19 +141,23 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.HScale hscale_encoder_analyze_b;
        [Widget] Gtk.HBox hbox_buttons_scale_encoder_analyze_b;
        [Widget] Gtk.Label label_encoder_analyze_time_a;
+       [Widget] Gtk.Label label_encoder_analyze_displ_a;
        [Widget] Gtk.Label label_encoder_analyze_speed_a;
        [Widget] Gtk.Label label_encoder_analyze_accel_a;
        [Widget] Gtk.Label label_encoder_analyze_force_a;
        [Widget] Gtk.Label label_encoder_analyze_power_a;
        [Widget] Gtk.Label label_encoder_analyze_time_b;
+       [Widget] Gtk.Label label_encoder_analyze_displ_b;
        [Widget] Gtk.Label label_encoder_analyze_speed_b;
        [Widget] Gtk.Label label_encoder_analyze_accel_b;
        [Widget] Gtk.Label label_encoder_analyze_force_b;
        [Widget] Gtk.Label label_encoder_analyze_power_b;
+       [Widget] Gtk.Label label_encoder_analyze_displ_average;
        [Widget] Gtk.Label label_encoder_analyze_speed_average;
        [Widget] Gtk.Label label_encoder_analyze_accel_average;
        [Widget] Gtk.Label label_encoder_analyze_force_average;
        [Widget] Gtk.Label label_encoder_analyze_power_average;
+       [Widget] Gtk.Label label_encoder_analyze_displ_max;
        [Widget] Gtk.Label label_encoder_analyze_speed_max;
        [Widget] Gtk.Label label_encoder_analyze_accel_max;
        [Widget] Gtk.Label label_encoder_analyze_force_max;
@@ -5389,6 +5393,7 @@ public partial class ChronoJumpWindow
                if(eai != null) {
                        int ms = Convert.ToInt32(hscale_encoder_analyze_a.Value);
                        label_encoder_analyze_time_a.Text = ms.ToString();
+                       label_encoder_analyze_displ_a.Text = Util.TrimDecimals(eai.GetParam("displ",ms), 1); 
//mm
                        label_encoder_analyze_speed_a.Text = Util.TrimDecimals(eai.GetParam("speed",ms), 2);
                        label_encoder_analyze_accel_a.Text = Util.TrimDecimals(eai.GetParam("accel",ms), 2);
                        label_encoder_analyze_force_a.Text = Util.TrimDecimals(eai.GetParam("force",ms), 1);
@@ -5405,6 +5410,7 @@ public partial class ChronoJumpWindow
                if(eai != null) {
                        int msb = Convert.ToInt32(hscale_encoder_analyze_b.Value);
                        label_encoder_analyze_time_b.Text = msb.ToString();
+                       label_encoder_analyze_displ_b.Text = Util.TrimDecimals(eai.GetParam("displ",msb), 1); 
//mm
                        label_encoder_analyze_speed_b.Text = Util.TrimDecimals(eai.GetParam("speed",msb), 2);
                        label_encoder_analyze_accel_b.Text = Util.TrimDecimals(eai.GetParam("accel",msb), 2);
                        label_encoder_analyze_force_b.Text = Util.TrimDecimals(eai.GetParam("force",msb), 1);
@@ -5434,11 +5440,13 @@ public partial class ChronoJumpWindow
                int msb = Convert.ToInt32(hscale_encoder_analyze_b.Value);
                bool success = eai.CalculateRangeParams(msa, msb);
                if(success) {
+                       label_encoder_analyze_displ_average.Text = Util.TrimDecimals(eai.displAverageLast, 1);
                        label_encoder_analyze_speed_average.Text = Util.TrimDecimals(eai.speedAverageLast, 2);
                        label_encoder_analyze_accel_average.Text = Util.TrimDecimals(eai.accelAverageLast, 2);
                        label_encoder_analyze_force_average.Text = Util.TrimDecimals(eai.forceAverageLast, 1);
                        label_encoder_analyze_power_average.Text = Util.TrimDecimals(eai.powerAverageLast, 1);
 
+                       label_encoder_analyze_displ_max.Text = Util.TrimDecimals(eai.displMaxLast, 1);
                        label_encoder_analyze_speed_max.Text = Util.TrimDecimals(eai.speedMaxLast, 2);
                        label_encoder_analyze_accel_max.Text = Util.TrimDecimals(eai.accelMaxLast, 2);
                        label_encoder_analyze_force_max.Text = Util.TrimDecimals(eai.forceMaxLast, 1);
@@ -5452,14 +5460,17 @@ public partial class ChronoJumpWindow
                hscale_encoder_analyze_b.Visible = visible;
                hbox_buttons_scale_encoder_analyze_b.Visible = visible;
                label_encoder_analyze_time_b.Visible = visible;
+               label_encoder_analyze_displ_b.Visible = visible;
                label_encoder_analyze_speed_b.Visible = visible;
                label_encoder_analyze_accel_b.Visible = visible;
                label_encoder_analyze_force_b.Visible = visible;
                label_encoder_analyze_power_b.Visible = visible;
+               label_encoder_analyze_displ_average.Visible = visible;
                label_encoder_analyze_speed_average.Visible = visible;
                label_encoder_analyze_accel_average.Visible = visible;
                label_encoder_analyze_force_average.Visible = visible;
                label_encoder_analyze_power_average.Visible = visible;
+               label_encoder_analyze_displ_max.Visible = visible;
                label_encoder_analyze_speed_max.Visible = visible;
                label_encoder_analyze_accel_max.Visible = visible;
                label_encoder_analyze_force_max.Visible = visible;



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