[chronojump] DB: 1.72 preferences: forceSensorCaptureWidthSeconds, forceSensorCaptureScroll



commit e3993b4d37d1f0d1dd708e73042adb1ece6729a5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 26 10:46:44 2019 +0200

    DB: 1.72 preferences: forceSensorCaptureWidthSeconds, forceSensorCaptureScroll

 glade/app1.glade            | 115 ++++------------------
 glade/preferences_win.glade | 231 ++++++++++++++++++++++++++++++++++++++++++--
 src/gui/chronojump.cs       |   2 -
 src/gui/forceSensor.cs      |  18 ++--
 src/gui/preferences.cs      |  28 ++++++
 src/preferences.cs          |   3 +
 src/sqlite/main.cs          |  12 ++-
 src/sqlite/preferences.cs   |  13 +++
 8 files changed, 305 insertions(+), 117 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 52e2ed62..42caef3f 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -11421,89 +11421,6 @@ Inverted values</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkVBox" 
id="vbox_force_sensor_capture_options">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkCheckButton" 
id="check_force_sensor_scroll">
-                                                            <property name="label">Auto-scroll X on 
capture</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkHBox" 
id="hbox_force_sensor_width_in_seconds">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" 
id="label_force_sensor_capture_width_graph_seconds">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label">Display on 
graph</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkSpinButton" 
id="spin_force_sensor_capture_width_graph_seconds">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="invisible_char">●</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 100 1 10 
0</property>
-                                                            <property name="climb_rate">1</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="label384">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label">s</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">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkVBox" 
id="vbox_last_test_buttons">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -11647,7 +11564,7 @@ Inverted values</property>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="pack_type">end</property>
-                                                            <property name="position">3</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
@@ -21981,6 +21898,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23929,18 +23849,6 @@ 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>
@@ -23977,6 +23885,18 @@ 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>
@@ -30875,6 +30795,9 @@ then click this button.</property>
                                                             <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 290c1f8f..6f74e2c1 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -3247,6 +3247,225 @@ Other</property>
                 <property name="type">tab</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkVBox" id="vbox18">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">8</property>
+                <property name="spacing">10</property>
+                <child>
+                  <widget class="GtkFrame" id="frame10">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="label_yalign">0.69999998807907104</property>
+                    <property name="shadow_type">out</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment21">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkVBox" id="vbox39">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="border_width">8</property>
+                            <property name="spacing">20</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox_force_sensor_width_in_seconds">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <widget class="GtkLabel" 
id="label_force_sensor_capture_width_graph_seconds">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">Width of graph</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkSpinButton" 
id="spin_force_sensor_capture_width_graph_seconds">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</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 100 1 10 0</property>
+                                    <property name="climb_rate">1</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="label384">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">s</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</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="GtkVBox" id="vbox38">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">10</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label102">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label">Behaviour when signal gets to the right of the 
screen</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkAlignment" id="alignment22">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="left_padding">30</property>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox40">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">10</property>
+                                        <child>
+                                          <widget class="GtkHBox" id="hbox48">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">20</property>
+                                            <child>
+                                              <widget class="GtkRadioButton" 
id="radio_force_sensor_capture_zoom_out">
+                                                <property name="label" translatable="yes">Zoom out</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">False</property>
+                                                <property name="active">True</property>
+                                                <property name="draw_indicator">True</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkLabel" id="label119">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" 
translatable="yes">(default)</property>
+                                              </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="GtkRadioButton" 
id="radio_force_sensor_capture_scroll">
+                                            <property name="label" translatable="yes">Scroll</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="active">True</property>
+                                            <property name="draw_indicator">True</property>
+                                            <property 
name="group">radio_force_sensor_capture_zoom_out</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </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>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label118">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Capture graph</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">6</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label19">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Force sensor</property>
+              </widget>
+              <packing>
+                <property name="position">6</property>
+                <property name="tab_fill">False</property>
+                <property name="type">tab</property>
+              </packing>
+            </child>
             <child>
               <widget class="GtkVBox" id="vbox5">
                 <property name="visible">True</property>
@@ -4445,7 +4664,7 @@ Other</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">6</property>
+                <property name="position">7</property>
               </packing>
             </child>
             <child>
@@ -4456,7 +4675,7 @@ Other</property>
                 <property name="label" translatable="yes">Multimedia</property>
               </widget>
               <packing>
-                <property name="position">6</property>
+                <property name="position">7</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
@@ -4838,7 +5057,7 @@ Other</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">7</property>
+                <property name="position">8</property>
               </packing>
             </child>
             <child>
@@ -4849,7 +5068,7 @@ Other</property>
                 <property name="label" translatable="yes">Language</property>
               </widget>
               <packing>
-                <property name="position">7</property>
+                <property name="position">8</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
@@ -5317,7 +5536,7 @@ version:</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">8</property>
+                <property name="position">9</property>
               </packing>
             </child>
             <child>
@@ -5328,7 +5547,7 @@ version:</property>
                 <property name="label" translatable="yes">Advanced</property>
               </widget>
               <packing>
-                <property name="position">8</property>
+                <property name="position">9</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 1ed1ccd7..828465b8 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3209,7 +3209,6 @@ public partial class ChronoJumpWindow
                notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.STATISTICS);
                button_inspect_last_test.Visible = false;
                vbox_force_capture_feedback.Visible = false;
-               vbox_force_sensor_capture_options.Visible = false;
                button_force_sensor_adjust.Visible = false;
                hbox_race_analyzer_device.Visible = false;
 
@@ -3412,7 +3411,6 @@ public partial class ChronoJumpWindow
                        notebook_capture_graph_table.ShowTabs = false;
 
                        vbox_force_capture_feedback.Visible = true;
-                       vbox_force_sensor_capture_options.Visible = true;
                }
                else if(m == Constants.Menuitem_modes.RUNSENCODER)
                {
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index f2d089bd..d2c56ec3 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -93,9 +93,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.VBox vbox_force_capture_feedback;
        [Widget] Gtk.SpinButton spin_force_sensor_capture_feedback_at;
        [Widget] Gtk.SpinButton spin_force_sensor_capture_feedback_range;
-       [Widget] Gtk.CheckButton check_force_sensor_scroll;
-       [Widget] Gtk.VBox vbox_force_sensor_capture_options;
-       [Widget] Gtk.SpinButton spin_force_sensor_capture_width_graph_seconds;
 
        Gdk.Pixmap force_capture_pixmap = null;
 
@@ -118,7 +115,6 @@ public partial class ChronoJumpWindow
        private ForceSensor currentForceSensor;
        private ForceSensorExercise currentForceSensorExercise;
        DateTime forceSensorTimeStartCapture;
-       bool forceSensorScroll;
 
 
        //non GTK on this method
@@ -413,7 +409,6 @@ public partial class ChronoJumpWindow
                button_execute_test.Sensitive = sensitive;
                button_force_sensor_analyze_load.Sensitive = sensitive;
                vbox_force_capture_feedback.Sensitive = sensitive;
-               vbox_force_sensor_capture_options.Sensitive = sensitive;
 
                vbox_contacts_camera.Sensitive = sensitive;
 
@@ -726,7 +721,7 @@ public partial class ChronoJumpWindow
                fscPoints = new ForceSensorCapturePoints(
                                force_capture_drawingarea.Allocation.Width,
                                force_capture_drawingarea.Allocation.Height,
-                               Convert.ToInt32(spin_force_sensor_capture_width_graph_seconds.Value)
+                               preferences.forceSensorCaptureWidthSeconds
                                );
 
                setForceSensorTopAtOperationStart();
@@ -739,7 +734,6 @@ public partial class ChronoJumpWindow
                forcePaintHVLines(ForceSensorGraphs.CAPTURE, fscPoints.RealHeightG, 
ForceSensorCapturePoints.DefaultRealHeightGNeg, 10, false);
                //draw horizontal rectangle of feedback
                forceSensorSignalPlotFeedbackRectangle(fscPoints, force_capture_drawingarea, 
force_capture_pixmap);
-               forceSensorScroll = check_force_sensor_scroll.Active;
 
 
                event_execute_ButtonFinish.Clicked -= new EventHandler(on_finish_clicked);
@@ -934,7 +928,7 @@ public partial class ChronoJumpWindow
 
                        fscPoints.Add(time, forceWithCaptureOptionsAndBW);
                        fscPoints.NumCaptured ++;
-                       if(fscPoints.OutsideGraph(forceSensorScroll))
+                       if(fscPoints.OutsideGraph(preferences.forceSensorCaptureScroll))
                        {
                                redoingPoints = true;
                                fscPoints.Redo();
@@ -942,7 +936,7 @@ public partial class ChronoJumpWindow
                                //mark meaning screen should be erased
                                //but only applies when not in scroll
                                //because scroll already erases screen all the time, paintHVLines and plot 
feedback rectangle
-                               if(! (forceSensorScroll && fscPoints.ScrollStartedAtCount > 0))
+                               if(! (preferences.forceSensorCaptureScroll && fscPoints.ScrollStartedAtCount 
0))
                                        fscPoints.NumPainted = -1;
 
                                redoingPoints = false;
@@ -1042,7 +1036,7 @@ LogB.Information(" fs C ");
                                        Thread.Sleep (250); //Wait a bit to ensure is copied
                                        sensitiveLastTestButtons(true);
 
-                                       
fscPoints.InitRealWidthHeight(Convert.ToInt32(spin_force_sensor_capture_width_graph_seconds.Value));
+                                       
fscPoints.InitRealWidthHeight(preferences.forceSensorCaptureWidthSeconds);
 
                                        forceSensorDoSignalGraphPlot();
                                        forceSensorDoRFDGraph();
@@ -1188,7 +1182,7 @@ LogB.Information(" fs J ");
                                return true;
 
                        //note that scroll mode will call NOScroll method until scroll starts
-                       if(forceSensorScroll && fscPoints.ScrollStartedAtCount > 0)
+                       if(preferences.forceSensorCaptureScroll && fscPoints.ScrollStartedAtCount > 0)
                                forceSensorCaptureDoRealtimeGraphScroll(numCaptured, numPainted, toDraw, 
points);
                        else
                                forceSensorCaptureDoRealtimeGraphNOScroll(numCaptured, numPainted, toDraw, 
points);
@@ -1732,7 +1726,7 @@ LogB.Information(" fs R ");
                fscPoints = new ForceSensorCapturePoints(
                                force_capture_drawingarea.Allocation.Width,
                                force_capture_drawingarea.Allocation.Height,
-                               Convert.ToInt32(spin_force_sensor_capture_width_graph_seconds.Value)
+                               preferences.forceSensorCaptureWidthSeconds
                                );
 
                List<string> contents = Util.ReadFileAsStringList(UtilEncoder.GetmifCSVFileName());
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index b2b3ae7f..180f7dc8 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -141,6 +141,11 @@ public class PreferencesWindow
        [Widget] Gtk.RadioButton radio_encoder_1RM_weighted2;
        [Widget] Gtk.RadioButton radio_encoder_1RM_weighted3;
 
+       //forceSensor tab
+       [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;
+
        //multimedia tab
        [Widget] Gtk.CheckButton checkbutton_volume;
        [Widget] Gtk.Table table_gstreamer;
@@ -234,6 +239,7 @@ public class PreferencesWindow
        const int RUNSPAGE = 3;
        const int ENCODERCAPTUREPAGE = 4;
        const int ENCODEROTHERPAGE = 5;
+       const int FORCESENSORPAGE = 6;
 
        static private WebcamDeviceList wd_list;
        private WebcamFfmpegSupportedModes wfsm;
@@ -285,6 +291,8 @@ public class PreferencesWindow
                        PreferencesWindowBox.notebook.GetNthPage(ENCODERCAPTUREPAGE).Hide();
                        PreferencesWindowBox.notebook.GetNthPage(ENCODEROTHERPAGE).Hide();
                }
+               if(menu_mode != Constants.Menuitem_modes.FORCESENSOR)
+                       PreferencesWindowBox.notebook.GetNthPage(FORCESENSORPAGE).Hide();
 
                PreferencesWindowBox.preferences = preferences;
 
@@ -574,6 +582,15 @@ public class PreferencesWindow
                //done here and not in glade to be shown with the decimal point of user language        
                PreferencesWindowBox.label_encoder_con.Text = (0.7).ToString();
 
+               //forceSensor -->
+
+               PreferencesWindowBox.spin_force_sensor_capture_width_graph_seconds.Value = 
preferences.forceSensorCaptureWidthSeconds;
+
+               if(preferences.forceSensorCaptureScroll)
+                       PreferencesWindowBox.radio_force_sensor_capture_scroll.Active = true;
+               else
+                       PreferencesWindowBox.radio_force_sensor_capture_zoom_out.Active = true;
+
                //language -->
                if(preferences.language == "")
                        PreferencesWindowBox.radio_language_detected.Active = true;
@@ -1902,6 +1919,17 @@ public class PreferencesWindow
 
                //---- end of encoder other
 
+               //forceSensor
+               preferences.forceSensorCaptureWidthSeconds = preferencesChange(
+                               SqlitePreferences.ForceSensorCaptureWidthSeconds,
+                               preferences.forceSensorCaptureWidthSeconds,
+                               Convert.ToInt32(spin_force_sensor_capture_width_graph_seconds.Value));
+
+               preferences.forceSensorCaptureScroll = preferencesChange(
+                               SqlitePreferences.ForceSensorCaptureScroll,
+                               preferences.forceSensorCaptureScroll,
+                               radio_force_sensor_capture_scroll.Active);
+
                //multimedia ----
                if( preferences.volumeOn != PreferencesWindowBox.checkbutton_volume.Active ) {
                        SqlitePreferences.Update("volumeOn", 
PreferencesWindowBox.checkbutton_volume.Active.ToString(), true);
diff --git a/src/preferences.cs b/src/preferences.cs
index 86c8b5de..8266f434 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -88,6 +88,9 @@ public class Preferences
        public bool RGraphsTranslate;
        public bool useHeightsOnJumpIndexes;
 
+       public int forceSensorCaptureWidthSeconds;
+       public bool forceSensorCaptureScroll;
+
        //advanced tab
        public bool askDeletion;
        public int digitsNumber;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index d7ae501a..fb01ed98 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -125,7 +125,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.71";
+       static string lastChronojumpDatabaseVersion = "1.72";
 
        public Sqlite() {
        }
@@ -2471,6 +2471,15 @@ class Sqlite
 
                                currentVersion = updateVersion("1.71");
                        }
+                       if(currentVersion == "1.71")
+                       {
+                               LogB.SQL("Inserted into preferences: forceSensorCaptureWidthSeconds, 
forceSensorCaptureScroll");
+
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorCaptureWidthSeconds, 
"10");
+                               SqlitePreferences.Insert (SqlitePreferences.ForceSensorCaptureScroll, 
"False");
+
+                               currentVersion = updateVersion("1.72");
+                       }
 
 
                        // --- add more updates here
@@ -2664,6 +2673,7 @@ class Sqlite
                SqliteJson.createTableUploadExhibitionTestTemp ();
 
                //changes [from - to - desc]
+               //1.71 - 1.72 Converted DB to 1.72 Inserted into preferences: forceSensorCaptureWidthSeconds, 
forceSensorCaptureScroll
                //1.70 - 1.71 Converted DB to 1.71 Imported run encoder text files into SQL
                //1.69 - 1.70 Converted DB to 1.70 Created tables: RunEncoder, RunEncoderExercise
                //1.68 - 1.69 Converted DB to 1.69 Imported force sensor text files into SQL
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 674364ca..4970e8e2 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -52,6 +52,9 @@ class SqlitePreferences : Sqlite
        public const string EncoderRhythmRepsClusterStr = "encoderRhythmRepsCluster";
        public const string EncoderRhythmRestClustersSecondsStr = "encoderRhythmRestClustersSeconds";
 
+       public const string ForceSensorCaptureWidthSeconds = "forceSensorCaptureWidthSeconds";
+       public const string ForceSensorCaptureScroll = "forceSensorCaptureScroll";
+
        protected internal static new void createTable()
        {
                dbcmd.CommandText = 
@@ -172,7 +175,11 @@ class SqlitePreferences : Sqlite
                                Insert (EncoderRhythmRepsClusterStr, Util.ConvertToPoint(er.RepsCluster), 
dbcmdTr);
                                Insert (EncoderRhythmRestClustersSecondsStr, 
Util.ConvertToPoint(er.RestClustersSeconds), dbcmdTr);
 
+                               //forceSensor
+                               Insert (ForceSensorCaptureWidthSeconds, "10", dbcmdTr);
+                               Insert (ForceSensorCaptureScroll, "False"); //no scroll. zoom out
 
+                               //multimedia
                                Insert ("videoDevice", "", dbcmdTr); //first
                                Insert ("videoDevicePixelFormat", "", dbcmdTr);
                                Insert ("videoDeviceResolution", "", dbcmdTr);
@@ -433,6 +440,12 @@ class SqlitePreferences : Sqlite
                        else if(reader[0].ToString() == "thresholdOther")
                                preferences.thresholdOther = Convert.ToInt32(reader[1].ToString());
 
+                       //force sensor capture
+                       else if(reader[0].ToString() == ForceSensorCaptureWidthSeconds)
+                               preferences.forceSensorCaptureWidthSeconds = 
Convert.ToInt32(reader[1].ToString());
+                       else if(reader[0].ToString() == ForceSensorCaptureScroll)
+                               preferences.forceSensorCaptureScroll = reader[1].ToString() == "True";
+
                        //force sensor tare
                        else if(reader[0].ToString() == ForceSensorTareDateTimeStr)
                                preferences.forceSensorTareDateTime = reader[1].ToString();



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