[chronojump] DB:1.80 ForceSensor repetitions min displ/force on preferences



commit 3fce274d9cbaa5a79bc50325598b4c97c6b2abc8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Nov 26 17:54:37 2019 +0100

    DB:1.80 ForceSensor repetitions min displ/force on preferences

 glade/app1.glade              |  51 +++--
 glade/preferences_win.glade   | 419 +++++++++++++++++++++++++++++++++++++++++-
 src/forceSensor.cs            |  12 +-
 src/gui/forceSensorAnalyze.cs |  15 +-
 src/gui/preferences.cs        |  26 +++
 src/preferences.cs            |   8 +-
 src/sqlite/main.cs            |  31 +++-
 src/sqlite/preferences.cs     |  22 ++-
 8 files changed, 555 insertions(+), 29 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 62404c86..5b353adf 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -21447,6 +21447,9 @@ Concentric</property>
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" id="hbox284">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -22071,9 +22074,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <placeholder/>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_force_sensor_ai_speed_diff">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -22116,9 +22116,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <placeholder/>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_force_sensor_ai_speed_average">
                                                             <property name="can_focus">False</property>
                                                             <property name="width_chars">8</property>
@@ -22202,6 +22199,15 @@ Concentric</property>
                                                             <property name="y_options">GTK_SHRINK</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24449,6 +24455,18 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -24485,18 +24503,6 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -31513,6 +31519,15 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 25073f36..cdb8d91e 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -3362,6 +3362,423 @@ Other</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
+                <child>
+                  <widget class="GtkNotebook" id="notebook_encoder_capture_gi1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment23">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">8</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkVBox" id="vbox21">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox19">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">20</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label37">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Minimal range of 
movement</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox334">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">12</property>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox336">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkLabel" id="label414">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Eccentric</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkSpinButton" 
id="spin_force_sensor_elastic_ecc_min_displ">
+                                            <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">0.10000000000000001 
0.10000000000000001 10 0.01 0.10000000000000001 0</property>
+                                            <property name="climb_rate">1</property>
+                                            <property name="digits">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">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label415">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label">m</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox337">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkLabel" id="label416">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Concentric</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkSpinButton" 
id="spin_force_sensor_elastic_con_min_displ">
+                                            <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">0.10000000000000001 
0.10000000000000001 10 0.01 0.10000000000000001 0</property>
+                                            <property name="climb_rate">1</property>
+                                            <property name="digits">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">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label417">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label">m</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox48">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">10</property>
+                        <child>
+                          <widget class="GtkLabel" id="label40">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Elastic</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="tab_fill">False</property>
+                        <property name="type">tab</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment_encoder_gravitatory_inertial1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">8</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox53">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">16</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox55">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">20</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label39">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Minimal range of 
movement</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox56">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">12</property>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox58">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkLabel" id="label41">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Eccentric</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkSpinButton" 
id="spin_force_sensor_not_elastic_ecc_min_force">
+                                            <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">10 1 999 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">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label42">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label">N</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox59">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkLabel" id="label55">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Concentric</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkSpinButton" 
id="spin_force_sensor_not_elastic_con_min_force">
+                                            <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">10 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">1</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label119">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label">N</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkVSeparator" id="vseparator2">
+                                <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>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox57">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">10</property>
+                        <child>
+                          <widget class="GtkLabel" id="label80">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Not elastic</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                        <property name="tab_fill">False</property>
+                        <property name="type">tab</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
                 <child>
                   <widget class="GtkHBox" id="hbox_force_sensor_width_in_seconds1">
                     <property name="visible">True</property>
@@ -3416,7 +3833,7 @@ Other</property>
                   <packing>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
-                    <property name="position">1</property>
+                    <property name="position">2</property>
                   </packing>
                 </child>
               </widget>
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 2bfa2231..6d0c46ae 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -1321,12 +1321,13 @@ public class ForceSensorAnalyzeInstant
        private int graphHeight;
 
        public ForceSensorAnalyzeInstant(string file, int graphWidth, int graphHeight, double start, double 
end,
-                       ForceSensorExercise fse, double personWeight, ForceSensor.CaptureOptions fsco, double 
stiffness)
+                       ForceSensorExercise fse, double personWeight, ForceSensor.CaptureOptions fsco, double 
stiffness,
+                       double eccMinDisplacement, double conMinDisplacement)
        {
                this.graphWidth = graphWidth;
                this.graphHeight = graphHeight;
 
-               readFile(file, start, end, fse, personWeight, fsco, stiffness);
+               readFile(file, start, end, fse, personWeight, fsco, stiffness, eccMinDisplacement, 
conMinDisplacement);
 
                //on zoom adjust width
                if(start >= 0 || end >= 0)
@@ -1341,7 +1342,8 @@ public class ForceSensorAnalyzeInstant
        }
 
        private void readFile(string file, double start, double end, ForceSensorExercise fse,
-                       double personWeight, ForceSensor.CaptureOptions fsco, double stiffness)
+                       double personWeight, ForceSensor.CaptureOptions fsco, double stiffness,
+                       double eccMinDisplacement, double conMinDisplacement)
        {
                fscAIPoints = new ForceSensorCapturePoints(graphWidth, graphHeight, -1);
 
@@ -1394,10 +1396,10 @@ public class ForceSensorAnalyzeInstant
                ForceSensorDynamics forceSensorDynamics;
                if(fse.Elastic)
                        forceSensorDynamics = new ForceSensorDynamicsElastic(
-                                       times, forces, fsco, fse, personWeight, stiffness);
+                                       times, forces, fsco, fse, personWeight, stiffness, 
eccMinDisplacement, conMinDisplacement);
                else
                        forceSensorDynamics = new ForceSensorDynamicsNotElastic(
-                                       times, forces, fsco, fse, personWeight, stiffness);
+                                       times, forces, fsco, fse, personWeight, stiffness, 
eccMinDisplacement, conMinDisplacement);
 
                forces = forceSensorDynamics.GetForces();
 
diff --git a/src/gui/forceSensorAnalyze.cs b/src/gui/forceSensorAnalyze.cs
index efa38c34..de901e6f 100644
--- a/src/gui/forceSensorAnalyze.cs
+++ b/src/gui/forceSensorAnalyze.cs
@@ -581,13 +581,26 @@ public partial class ChronoJumpWindow
                        }
                }
 
+               //pass them as doubles
+               double eccMinDispl;
+               double conMinDispl;
+               if(currentForceSensorExercise.Elastic)
+               {
+                       eccMinDispl = preferences.forceSensorElasticEccMinDispl;
+                       conMinDispl = preferences.forceSensorElasticConMinDispl;
+               } else {
+                       eccMinDispl = preferences.forceSensorNotElasticEccMinForce;
+                       conMinDispl = preferences.forceSensorNotElasticConMinForce;
+               }
+
                fsAI = new ForceSensorAnalyzeInstant(
                                lastForceSensorFullPath,
                                force_sensor_ai_drawingarea.Allocation.Width,
                                force_sensor_ai_drawingarea.Allocation.Height,
                                zoomA, zoomB,
                                currentForceSensorExercise, currentPersonSession.Weight,
-                               getForceSensorCaptureOptions(), currentForceSensor.Stiffness);
+                               getForceSensorCaptureOptions(), currentForceSensor.Stiffness,
+                               eccMinDispl, conMinDispl);
 
                /*
                 * position the hscales on the left to avoid loading a csv
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 66eb20c8..ef651a3b 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -144,6 +144,10 @@ public class PreferencesWindow
        [Widget] Gtk.SpinButton spin_force_sensor_capture_width_graph_seconds;
        [Widget] Gtk.RadioButton radio_force_sensor_capture_zoom_out;
        [Widget] Gtk.RadioButton radio_force_sensor_capture_scroll;
+       [Widget] Gtk.SpinButton spin_force_sensor_elastic_ecc_min_displ;
+       [Widget] Gtk.SpinButton spin_force_sensor_elastic_con_min_displ;
+       [Widget] Gtk.SpinButton spin_force_sensor_not_elastic_ecc_min_force;
+       [Widget] Gtk.SpinButton spin_force_sensor_not_elastic_con_min_force;
        [Widget] Gtk.SpinButton spin_force_sensor_graphs_line_width;
 
        //multimedia tab
@@ -585,6 +589,11 @@ public class PreferencesWindow
                else
                        PreferencesWindowBox.radio_force_sensor_capture_zoom_out.Active = true;
 
+               PreferencesWindowBox.spin_force_sensor_elastic_ecc_min_displ.Value = 
preferences.forceSensorElasticEccMinDispl;
+               PreferencesWindowBox.spin_force_sensor_elastic_con_min_displ.Value = 
preferences.forceSensorElasticConMinDispl;
+               PreferencesWindowBox.spin_force_sensor_not_elastic_ecc_min_force.Value = 
preferences.forceSensorNotElasticEccMinForce;
+               PreferencesWindowBox.spin_force_sensor_not_elastic_con_min_force.Value = 
preferences.forceSensorNotElasticConMinForce;
+
                PreferencesWindowBox.spin_force_sensor_graphs_line_width.Value = 
preferences.forceSensorGraphsLineWidth;
 
                //language -->
@@ -1941,6 +1950,23 @@ public class PreferencesWindow
                                preferences.forceSensorCaptureScroll,
                                radio_force_sensor_capture_scroll.Active);
 
+               preferences.forceSensorElasticEccMinDispl = preferencesChange(
+                               SqlitePreferences.ForceSensorElasticEccMinDispl,
+                               preferences.forceSensorElasticEccMinDispl,
+                               Convert.ToDouble(spin_force_sensor_elastic_ecc_min_displ.Value));
+               preferences.forceSensorElasticConMinDispl = preferencesChange(
+                               SqlitePreferences.ForceSensorElasticConMinDispl,
+                               preferences.forceSensorElasticConMinDispl,
+                               Convert.ToDouble(spin_force_sensor_elastic_con_min_displ.Value));
+               preferences.forceSensorNotElasticEccMinForce = preferencesChange(
+                               SqlitePreferences.ForceSensorNotElasticEccMinForce,
+                               preferences.forceSensorNotElasticEccMinForce,
+                               Convert.ToInt32(spin_force_sensor_not_elastic_ecc_min_force.Value));
+               preferences.forceSensorNotElasticConMinForce = preferencesChange(
+                               SqlitePreferences.ForceSensorNotElasticConMinForce,
+                               preferences.forceSensorNotElasticConMinForce,
+                               Convert.ToInt32(spin_force_sensor_not_elastic_con_min_force.Value));
+
                preferences.forceSensorGraphsLineWidth = preferencesChange(
                                SqlitePreferences.ForceSensorGraphsLineWidth,
                                preferences.forceSensorGraphsLineWidth,
diff --git a/src/preferences.cs b/src/preferences.cs
index 1b9eaa77..29d3e638 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -77,7 +77,8 @@ public class Preferences
        public bool encoderWorkKcal;
        public double encoderSmoothCon;
        public Constants.Encoder1RMMethod encoder1RMMethod;
-       
+
+       //multimedia
        public string videoDevice;
        public string videoDevicePixelFormat;
        public string videoDeviceResolution;
@@ -89,8 +90,13 @@ public class Preferences
        public bool RGraphsTranslate;
        public bool useHeightsOnJumpIndexes;
 
+       //forceSensor
        public int forceSensorCaptureWidthSeconds;
        public bool forceSensorCaptureScroll;
+       public double forceSensorElasticEccMinDispl;
+       public double forceSensorElasticConMinDispl;
+       public int forceSensorNotElasticEccMinForce;
+       public int forceSensorNotElasticConMinForce;
        public int forceSensorGraphsLineWidth;
 
        //advanced tab
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 2a069d31..fc4523b9 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -129,7 +129,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.79";
+       static string lastChronojumpDatabaseVersion = "1.80";
 
        public Sqlite() {
        }
@@ -2555,6 +2555,32 @@ class Sqlite
 
                                currentVersion = updateVersion("1.79");
                        }
+                       if(currentVersion == "1.79")
+                       {
+                               LogB.SQL("Inserted forceSensorElasticEccMinDispl, ...");
+
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorElasticEccMinDispl, 
".1");
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorElasticConMinDispl, 
".1");
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorNotElasticEccMinForce, 
"10");
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorNotElasticConMinForce, 
"10");
+
+                               currentVersion = updateVersion("1.80");
+                       }
+
+
+                       /*
+                       if(currentVersion == "1.79")
+                       {
+                               LogB.SQL("Created table ForceSensorElasticBandGlue and moved stiffnessString 
records there");
+
+                               SqliteForceSensorElasticBandGlue.createTable();
+
+                               //TODO: move everything here
+                               SqliteForceSensor.import_from_1_79_to_1_80();
+
+                               currentVersion = updateVersion("1.80");
+                       }
+                       */
 
 
 
@@ -2750,6 +2776,9 @@ class Sqlite
                SqliteJson.createTableUploadExhibitionTestTemp ();
 
                //changes [from - to - desc]
+//just testing: 1.79 - 1.80 Converted DB to 1.80 Created table ForceSensorElasticBandGlue and moved 
stiffnessString records there
+//
+               //1.79 - 1.80 Converted DB to 1.80 Inserted forceSensorElasticEccMinDispl, ...
                //1.78 - 1.79 Converted DB to 1.79 Inserted into preferences: encoderWorkKcal
                //1.77 - 1.78 Converted DB to 1.78 Inserted into preferences: encoderAutoSaveCurveBestNValue
                //1.76 - 1.77 Converted DB to 1.77 Inserted into preferences: forceSensorGraphsLineWidth
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 0a0d741b..2339b28b 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -56,6 +56,10 @@ class SqlitePreferences : Sqlite
        //forceSensor
        public const string ForceSensorCaptureWidthSeconds = "forceSensorCaptureWidthSeconds";
        public const string ForceSensorCaptureScroll = "forceSensorCaptureScroll";
+       public const string ForceSensorElasticEccMinDispl = "forceSensorElasticEccMinDispl";
+       public const string ForceSensorElasticConMinDispl = "forceSensorElasticConMinDispl";
+       public const string ForceSensorNotElasticEccMinForce = "forceSensorNotElasticEccMinForce";
+       public const string ForceSensorNotElasticConMinForce = "forceSensorNotElasticConMinForce";
        public const string ForceSensorGraphsLineWidth = "forceSensorGraphsLineWidth";
 
        public const string ForceSensorTareDateTimeStr = "forceSensorTareDateTime";
@@ -189,8 +193,12 @@ class SqlitePreferences : Sqlite
 
                                //forceSensor
                                Insert (ForceSensorCaptureWidthSeconds, "10", dbcmdTr);
-                               Insert (ForceSensorCaptureScroll, "True"); //scroll. not zoom out
-                               Insert (ForceSensorGraphsLineWidth, "2");
+                               Insert (ForceSensorCaptureScroll, "True", dbcmdTr); //scroll. not zoom out
+                               Insert (ForceSensorElasticEccMinDispl, ".1", dbcmdTr);
+                               Insert (ForceSensorElasticConMinDispl, ".1", dbcmdTr);
+                               Insert (ForceSensorNotElasticEccMinForce, "10", dbcmdTr);
+                               Insert (ForceSensorNotElasticConMinForce, "10", dbcmdTr);
+                               Insert (ForceSensorGraphsLineWidth, "2", dbcmdTr);
 
                                //multimedia
                                Insert ("videoDevice", "", dbcmdTr); //first
@@ -465,6 +473,16 @@ class SqlitePreferences : Sqlite
                                preferences.forceSensorCaptureWidthSeconds = 
Convert.ToInt32(reader[1].ToString());
                        else if(reader[0].ToString() == ForceSensorCaptureScroll)
                                preferences.forceSensorCaptureScroll = reader[1].ToString() == "True";
+                       else if(reader[0].ToString() == ForceSensorElasticEccMinDispl)
+                               preferences.forceSensorElasticEccMinDispl = Convert.ToDouble(
+                                               Util.ChangeDecimalSeparator(reader[1].ToString()));
+                       else if(reader[0].ToString() == ForceSensorElasticConMinDispl)
+                               preferences.forceSensorElasticConMinDispl = Convert.ToDouble(
+                                               Util.ChangeDecimalSeparator(reader[1].ToString()));
+                       else if(reader[0].ToString() == ForceSensorNotElasticEccMinForce)
+                               preferences.forceSensorNotElasticEccMinForce = 
Convert.ToInt32(reader[1].ToString());
+                       else if(reader[0].ToString() == ForceSensorNotElasticConMinForce)
+                               preferences.forceSensorNotElasticConMinForce = 
Convert.ToInt32(reader[1].ToString());
                        else if(reader[0].ToString() == ForceSensorGraphsLineWidth)
                                preferences.forceSensorGraphsLineWidth = 
Convert.ToInt32(reader[1].ToString());
 


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