[chronojump] Encoder test ends at n inactivity seconds, but if no repetitions captured, then will end at double o
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder test ends at n inactivity seconds, but if no repetitions captured, then will end at double o
- Date: Mon, 10 Nov 2014 11:13:54 +0000 (UTC)
commit 40828fac8360e7be5600d59e1fea48259844c78e
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Nov 10 12:11:42 2014 +0100
Encoder test ends at n inactivity seconds, but if no repetitions captured, then will end at double of
this time to have more time to start movement
glade/chronojump.glade | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
src/gui/encoder.cs | 18 +++++++++--
2 files changed, 95 insertions(+), 3 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index f9ce999..4bf252e 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6330,6 +6330,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -7051,6 +7054,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -7906,6 +7912,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -8520,6 +8529,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -18266,6 +18278,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -18788,6 +18803,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -19802,6 +19820,9 @@ by you</property>
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkButton" id="button_video_url">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -19873,6 +19894,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -22102,6 +22126,29 @@ comments</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button_inactivity_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <signal name="clicked" handler="on_button_inactivity_help_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage" id="image31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon-size">2</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -28670,6 +28717,24 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -30572,6 +30637,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -31132,6 +31200,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -33686,6 +33757,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -33872,6 +33946,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -34073,6 +34150,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index e377113..e1fbdd4 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1959,7 +1959,6 @@ public partial class ChronoJumpWindow
int directionCompleted = -1; // +1 or -1
int previousFrameChange = 0;
int lastNonZero = 0;
- bool firstCurve = true;
//this will be used to stop encoder automatically
int consecutiveZeros = -1;
@@ -1998,8 +1997,13 @@ public partial class ChronoJumpWindow
//but it has to be moved a little bit first, just to give time to the people
//if(consecutiveZeros >= consecutiveZerosMax && sum > 0) #Not OK becuase sum
maybe is 0: +1,+1,-1,-1
//if(consecutiveZeros >= consecutiveZerosMax && ecca.ecc.Count > 0) #Not ok
because when ecca is created, ecc.Count == 1
- //lastNonZero > 0 means something different than 0 has been readed
- if(consecutiveZeros >= consecutiveZerosMax && lastNonZero > 0)
+ //
+ //process ends
+ //when a curve has been found and then there are n seconds of inactivity, or
+ //when a curve has not been found and then there are 2*n seconds of inactivity
+ if(
+ (ecca.curvesAccepted > 0 && consecutiveZeros >=
consecutiveZerosMax) ||
+ (ecca.curvesAccepted == 0 && consecutiveZeros >= (2*
consecutiveZerosMax)) )
{
encoderProcessFinish = true;
Log.WriteLine("SHOULD FINISH");
@@ -4986,6 +4990,14 @@ public class EncoderCaptureOptionsWindow {
return -1;
}
+
+ private void on_button_inactivity_help_clicked (object o, EventArgs args)
+ {
+ new DialogMessage(Constants.MessageTypes.INFO,
+ Catalog.GetString("If a repetition has been found, test will end at selected
inactivity seconds.") + "\n" +
+ Catalog.GetString("If a repetition has not been found, test will end at
selected inactivity seconds (x2).")
+ );
+ }
protected virtual void on_button_close_clicked (object o, EventArgs args)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]