[chronojump] DB:1.53 improvements on encoder rhythm
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] DB:1.53 improvements on encoder rhythm
- Date: Wed, 24 Jan 2018 14:51:34 +0000 (UTC)
commit 6c4e4cf63e2d9c493af88f54b24c07bc31093d10
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Jan 24 15:29:42 2018 +0100
DB:1.53 improvements on encoder rhythm
glade/repetitive_conditions.glade | 569 ++++++++++++++++++++-----------------
src/encoderRhythm.cs | 12 +-
src/gui/chronojump.cs | 1 +
src/gui/encoder.cs | 13 +-
src/gui/repetitiveConditions.cs | 10 +
src/preferences.cs | 18 +-
src/sqlite/main.cs | 14 +-
src/sqlite/preferences.cs | 6 +-
8 files changed, 359 insertions(+), 284 deletions(-)
---
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index 3c23fcd..0c7aa29 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -3583,36 +3583,92 @@
</packing>
</child>
<child>
- <widget class="GtkFrame" id="frame_rhythm">
+ <widget class="GtkVBox" id="vbox8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.69999998807907104</property>
- <property name="shadow_type">out</property>
+ <property name="spacing">20</property>
<child>
- <widget class="GtkAlignment" id="alignment21">
+ <widget class="GtkCheckButton" id="check_rhythm_active">
+ <property name="label" translatable="yes">Show rhythm while capturing</property>
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_rhythm_active_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame_rhythm">
<property name="can_focus">False</property>
- <property name="top_padding">10</property>
- <property name="bottom_padding">10</property>
- <property name="left_padding">10</property>
- <property name="right_padding">10</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.69999998807907104</property>
+ <property name="shadow_type">out</property>
<child>
- <widget class="GtkVBox" id="vbox10">
+ <widget class="GtkAlignment" id="alignment21">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">10</property>
+ <property name="top_padding">10</property>
+ <property name="bottom_padding">10</property>
+ <property name="left_padding">10</property>
+ <property name="right_padding">10</property>
<child>
- <widget class="GtkHBox" id="hbox38">
+ <widget class="GtkVBox" id="vbox10">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">10</property>
<child>
- <widget class="GtkLabel" id="label29">
+ <widget class="GtkHBox" id="hbox38">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Duration of eccentric
phase</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label29">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Duration of eccentric
phase</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_ecc">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</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.10000000000000001 1 0</property>
+ <property name="digits">2</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="label41">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">seconds</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">False</property>
@@ -3621,70 +3677,52 @@
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="spin_rhythm_ecc">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</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.10000000000000001 1 0</property>
- <property name="digits">2</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="label41">
+ <widget class="GtkHBox" id="hbox39">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</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">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox39">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label39">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Duration of concentric
phase</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_con">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</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.5 0.10000000000000001 10 0.10000000000000001 1
0</property>
- <property name="digits">2</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label39">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Duration of concentric
phase</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_con">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</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.5 0.10000000000000001 10
0.10000000000000001 1 0</property>
+ <property name="digits">2</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" translatable="yes">seconds</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">False</property>
@@ -3693,10 +3731,52 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label42">
+ <widget class="GtkHBox" id="hbox42">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label48">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Rest between
repetitions</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_rest_reps">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</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">1 0 99 0.10000000000000001 1 0</property>
+ <property name="digits">2</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="label49">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">seconds</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">False</property>
@@ -3704,110 +3784,74 @@
<property name="position">2</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="hbox42">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label48">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Rest between repetitions</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_rest_reps">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</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">1 0 99 0.10000000000000001 1 0</property>
- <property name="digits">2</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="label49">
+ <widget class="GtkAlignment" id="alignment23">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
+ <property name="top_padding">10</property>
+ <child>
+ <widget class="GtkCheckButton" id="check_rhythm_use_clusters">
+ <property name="label" translatable="yes">Use clusters</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_rhythm_use_clusters_toggled"
swapped="no"/>
+ </widget>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</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="GtkAlignment" id="alignment23">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">10</property>
<child>
- <widget class="GtkCheckButton" id="check_rhythm_use_clusters">
- <property name="label" translatable="yes">Use clusters</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_check_rhythm_use_clusters_toggled"
swapped="no"/>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</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="vbox_rhythm_cluster">
+ <widget class="GtkAlignment" id="alignment22">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">8</property>
+ <property name="left_padding">30</property>
<child>
- <widget class="GtkHBox" id="hbox40">
+ <widget class="GtkVBox" id="vbox_rhythm_cluster">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">8</property>
<child>
- <widget class="GtkLabel" id="label43">
+ <widget class="GtkHBox" id="hbox40">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Repetitions in
cluster</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label43">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Repetitions in
cluster</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_reps_cluster">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">5 2 30 1 10 0</property>
+ <property name="digits">2</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>
@@ -3816,60 +3860,54 @@
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="spin_rhythm_reps_cluster">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">5 2 30 1 10 0</property>
- <property name="digits">2</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="GtkHBox" id="hbox41">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label44">
+ <widget class="GtkHBox" id="hbox41">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Rest between
clusters</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spin_rhythm_rest_clusters">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</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">6 0.10000000000000001 99 0 0 0</property>
- <property name="climb_rate">1</property>
- <property name="digits">2</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Rest between
clusters</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_rhythm_rest_clusters">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</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">6 0.10000000000000001 99 0 0
0</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">2</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="label45">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">seconds</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">False</property>
@@ -3878,80 +3916,79 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label45">
+ <widget class="GtkTextView" id="textview1">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">seconds</property>
+ <property name="can_focus">True</property>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">2</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">4</property>
+ </packing>
</child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment24">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="top_padding">20</property>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <widget class="GtkAlignment" id="alignment24">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="layout_style">end</property>
+ <property name="top_padding">10</property>
<child>
- <widget class="GtkButton" id="button_rhythm_default">
- <property name="label" translatable="yes">Back to default
values</property>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <signal name="clicked" handler="on_button_rhythm_default_clicked"
swapped="no"/>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="button_rhythm_default">
+ <property name="label" translatable="yes">Back to default
values</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <signal name="clicked" handler="on_button_rhythm_default_clicked"
swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</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="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
</child>
</widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
</child>
</widget>
</child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label27">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label">Configure adaptative rhythm</property>
- <property name="use_markup">True</property>
+ <child>
+ <widget class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Configure adaptative rhythm</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="type">label_item</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
diff --git a/src/encoderRhythm.cs b/src/encoderRhythm.cs
index 0f7c712..54a58da 100644
--- a/src/encoderRhythm.cs
+++ b/src/encoderRhythm.cs
@@ -23,6 +23,7 @@ using System.Data;
public class EncoderRhythm
{
+ public bool Active;
public double EccSeconds;
public double ConSeconds;
public double RestRepsSeconds; //rest between repetitions
@@ -33,18 +34,21 @@ public class EncoderRhythm
public EncoderRhythm()
{
+ Active = false;
+
//default values
- EccSeconds = .5;
+ EccSeconds = 0.5;
ConSeconds = 0.5;
- RestRepsSeconds = 1;
+ RestRepsSeconds = 0;
- RepsCluster = 5; //1 is minimum value and means "no use clusters"
+ RepsCluster = 1; //1 is default, minimum value and means "no use clusters"
RestClustersSeconds = 6;
}
- public EncoderRhythm(double eccSeconds, double conSeconds, double restRepsSeconds,
+ public EncoderRhythm(bool active, double eccSeconds, double conSeconds, double restRepsSeconds,
int repsCluster, double restClustersSeconds)
{
+ Active = active;
EccSeconds = eccSeconds;
ConSeconds = conSeconds;
RestRepsSeconds = restRepsSeconds;
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index b3fc52f..a0904c9 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -803,6 +803,7 @@ public partial class ChronoJumpWindow
configInitFromPreferences();
encoderRhythm = new EncoderRhythm(
+ preferences.encoderRhythmActive,
preferences.encoderRhythmEccSeconds, preferences.encoderRhythmConSeconds,
preferences.encoderRhythmRestRepsSeconds,
preferences.encoderRhythmRepsCluster,
preferences.encoderRhythmRestClustersSeconds);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 5b1b07d..63eb88f 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -5298,6 +5298,10 @@ public partial class ChronoJumpWindow
eCaptureInertialBG.SimulatedReset();
}
+ //initialize DateTime for rhythm
+ encoderRhythmExecute = new EncoderRhythmExecute(encoderRhythm);
+ image_encoder_rhythm_alert.Visible = false;
+
//triggers only work on gravitatory, concentric
Preferences.TriggerTypes reallyCutByTriggers =
Preferences.TriggerTypes.NO_TRIGGERS;
@@ -5306,15 +5310,11 @@ public partial class ChronoJumpWindow
{
reallyCutByTriggers = preferences.encoderCaptureCutByTriggers;
notebook_encoder_signal_comment_rhythm_and_triggers.Page = 2;
- } else
+ } else if(encoderRhythm.Active)
notebook_encoder_signal_comment_rhythm_and_triggers.Page = 1;
encoderRProcCapture.CutByTriggers = reallyCutByTriggers;
- //initialize DateTime for rhythm
- encoderRhythmExecute = new EncoderRhythmExecute(encoderRhythm);
- image_encoder_rhythm_alert.Visible = false;
-
encoderThread = new Thread(new ThreadStart(encoderDoCaptureCsharp));
GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderCaptureAndCurves));
}
@@ -5817,7 +5817,8 @@ public partial class ChronoJumpWindow
needToRefreshTreeviewCapture = false;
}
- updatePulsebarRhythm();
+ if(encoderRhythm.Active)
+ updatePulsebarRhythm();
//changed trying to fix crash of nuell 27/may/2016
//LogB.Debug(" Cap:", encoderThread.ThreadState.ToString());
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index bb63d87..b2a0b70 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -154,7 +154,9 @@ public class RepetitiveConditionsWindow
[Widget] Gtk.Image image_repetitive_test_bad;
//encoder rhythm
+ [Widget] Gtk.CheckButton check_rhythm_active;
[Widget] Gtk.VBox vbox_rhythm_cluster;
+ [Widget] Gtk.Frame frame_rhythm;
[Widget] Gtk.CheckButton check_rhythm_use_clusters;
[Widget] Gtk.SpinButton spin_rhythm_ecc;
[Widget] Gtk.SpinButton spin_rhythm_con;
@@ -574,6 +576,11 @@ public class RepetitiveConditionsWindow
}
//encoder rhythm
+ private void on_check_rhythm_active_toggled (object o, EventArgs args)
+ {
+ frame_rhythm.Visible = check_rhythm_active.Active;
+ }
+
private void on_check_rhythm_use_clusters_toggled (object o, EventArgs args)
{
vbox_rhythm_cluster.Visible = check_rhythm_use_clusters.Active;
@@ -593,6 +600,8 @@ public class RepetitiveConditionsWindow
spin_rhythm_reps_cluster.Value = encoderRhythm.RepsCluster;
spin_rhythm_rest_clusters.Value = encoderRhythm.RestClustersSeconds;
+ frame_rhythm.Visible = check_rhythm_active.Active;
+
if(encoderRhythm.UseClusters()) {
check_rhythm_use_clusters.Active = true;
vbox_rhythm_cluster.Visible = true;
@@ -609,6 +618,7 @@ public class RepetitiveConditionsWindow
reps_cluster = 1;
return new EncoderRhythm(
+ check_rhythm_active.Active,
spin_rhythm_ecc.Value, spin_rhythm_con.Value, spin_rhythm_rest_reps.Value,
reps_cluster, spin_rhythm_rest_clusters.Value);
}
diff --git a/src/preferences.cs b/src/preferences.cs
index 9e0b1fc..6e1cdf2 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -98,6 +98,7 @@ public class Preferences
public string databaseVersion;
//encoder rhythm
+ public bool encoderRhythmActive;
public double encoderRhythmEccSeconds;
public double encoderRhythmConSeconds;
public double encoderRhythmRestRepsSeconds;
@@ -164,39 +165,46 @@ public class Preferences
public void UpdateEncoderRhythm(EncoderRhythm er)
{
+ if(encoderRhythmActive != er.Active)
+ {
+ encoderRhythmActive = er.Active;
+ SqlitePreferences.Update(SqlitePreferences.EncoderRhythmActiveStr,
+ er.Active.ToString(), false); //bool
+ }
+
if(encoderRhythmEccSeconds != er.EccSeconds)
{
encoderRhythmEccSeconds = er.EccSeconds;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmEccSecondsStr,
- Util.ConvertToPoint(er.EccSeconds), false);
+ Util.ConvertToPoint(er.EccSeconds), false); //double to point
}
if(encoderRhythmConSeconds != er.ConSeconds)
{
encoderRhythmConSeconds = er.ConSeconds;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmConSecondsStr,
- Util.ConvertToPoint(er.ConSeconds), false);
+ Util.ConvertToPoint(er.ConSeconds), false); //double to point
}
if(encoderRhythmRestRepsSeconds != er.RestRepsSeconds)
{
encoderRhythmRestRepsSeconds = er.RestRepsSeconds;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmRestRepsSecondsStr,
- Util.ConvertToPoint(er.RestRepsSeconds), false);
+ Util.ConvertToPoint(er.RestRepsSeconds), false); //double to point
}
if(encoderRhythmRepsCluster != er.RepsCluster)
{
encoderRhythmRepsCluster = er.RepsCluster;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmRepsClusterStr,
- Util.ConvertToPoint(er.RepsCluster), false);
+ er.RepsCluster.ToString(), false); //int
}
if(encoderRhythmRestClustersSeconds != er.RestClustersSeconds)
{
encoderRhythmRestClustersSeconds = er.RestClustersSeconds;
SqlitePreferences.Update(SqlitePreferences.EncoderRhythmRestClustersSecondsStr,
- Util.ConvertToPoint(er.RestClustersSeconds), false);
+ Util.ConvertToPoint(er.RestClustersSeconds), false); //double to point
}
}
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 018b07a..421acc3 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.52";
+ static string lastChronojumpDatabaseVersion = "1.53";
public Sqlite() {
}
@@ -2296,12 +2296,21 @@ class Sqlite
SqlitePreferences.Insert (SqlitePreferences.EncoderRhythmRestRepsSecondsStr,
Util.ConvertToPoint(er.RestRepsSeconds));
SqlitePreferences.Insert (SqlitePreferences.EncoderRhythmRepsClusterStr,
- Util.ConvertToPoint(er.RepsCluster));
+ er.RepsCluster.ToString()); //int
SqlitePreferences.Insert
(SqlitePreferences.EncoderRhythmRestClustersSecondsStr,
Util.ConvertToPoint(er.RestClustersSeconds));
currentVersion = updateVersion("1.52");
}
+ if(currentVersion == "1.52")
+ {
+ LogB.SQL("Added encoderRhtyhm active variable");
+
+ SqlitePreferences.Insert (SqlitePreferences.EncoderRhythmActiveStr, "False");
+
+ currentVersion = updateVersion("1.53");
+ }
+
@@ -2485,6 +2494,7 @@ class Sqlite
SqlitePreferences.initializeTable(lastChronojumpDatabaseVersion, creatingBlankDatabase);
//changes [from - to - desc]
+ //1.52 - 1.53 Converted DB to 1.53 Added encoderRhtyhm active variable
//1.51 - 1.52 Converted DB to 1.52 Added encoderRhtyhm stuff
//1.50 - 1.51 Converted DB to 1.51 Updated encoderCaptureCutByTriggers variable
//1.49 - 1.50 Converted DB to 1.50 Updated preferences: added crashLogLanguage
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 9b53fbc..c4ea83f 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -42,6 +42,7 @@ class SqlitePreferences : Sqlite
public const string ForceSensorCalibrationWeightStr = "forceSensorCalibrationWeight";
public const string ForceSensorCalibrationFactorStr = "forceSensorCalibrationFactor";
+ public const string EncoderRhythmActiveStr = "encoderRhythmActive";
public const string EncoderRhythmEccSecondsStr = "encoderRhythmEccSeconds";
public const string EncoderRhythmConSecondsStr = "encoderRhythmConSeconds";
public const string EncoderRhythmRestRepsSecondsStr = "encoderRhythmRestRepsSeconds";
@@ -153,6 +154,7 @@ class SqlitePreferences : Sqlite
//encoderRhythm
EncoderRhythm er = new EncoderRhythm();
+ Insert (EncoderRhythmActiveStr, er.Active.ToString(), dbcmdTr);
Insert (EncoderRhythmEccSecondsStr, Util.ConvertToPoint(er.EccSeconds),
dbcmdTr);
Insert (EncoderRhythmConSecondsStr, Util.ConvertToPoint(er.ConSeconds),
dbcmdTr);
Insert (EncoderRhythmRestRepsSecondsStr,
Util.ConvertToPoint(er.RestRepsSeconds), dbcmdTr);
@@ -328,6 +330,8 @@ class SqlitePreferences : Sqlite
Enum.Parse(typeof(Constants.Encoder1RMMethod), reader[1].ToString());
//encoder rhythm
+ else if(reader[0].ToString() == EncoderRhythmActiveStr)
+ preferences.encoderRhythmActive = reader[1].ToString() == "True"; //bool
else if(reader[0].ToString() == EncoderRhythmEccSecondsStr)
preferences.encoderRhythmEccSeconds = Convert.ToDouble(
Util.ChangeDecimalSeparator(reader[1].ToString()));
@@ -338,7 +342,7 @@ class SqlitePreferences : Sqlite
preferences.encoderRhythmRestRepsSeconds = Convert.ToDouble(
Util.ChangeDecimalSeparator(reader[1].ToString()));
else if(reader[0].ToString() == EncoderRhythmRepsClusterStr)
- preferences.encoderRhythmRepsCluster = Convert.ToInt32(reader[1].ToString());
+ preferences.encoderRhythmRepsCluster = Convert.ToInt32(reader[1].ToString());
//int
else if(reader[0].ToString() == EncoderRhythmRestClustersSecondsStr)
preferences.encoderRhythmRestClustersSeconds = Convert.ToDouble(
Util.ChangeDecimalSeparator(reader[1].ToString()));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]