[chronojump] Inertia moment improvements
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Inertia moment improvements
- Date: Wed, 19 Feb 2014 17:54:07 +0000 (UTC)
commit 749eaf8cb5e0303d68cf3d1999aadc0e1aa21a39
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Feb 19 18:53:37 2014 +0100
Inertia moment improvements
glade/chronojump.glade | 1 -
src/gui/encoder.cs | 19 +++++++++++++------
src/gui/encoderConfiguration.cs | 7 +++++--
3 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 1e90449..b4d12df 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -21949,7 +21949,6 @@ comments</property>
</child>
<child>
<widget class="GtkHBox" id="hbox_im_duration">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index ee8e7d5..e05314f 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -1906,8 +1906,10 @@ public partial class ChronoJumpWindow
//stop if n seconds of inactivity
//but it has to be moved a little bit first, just to give time to the people
- //if(consecutiveZeros >= consecutiveZerosMax && sum > 0) #sum maybe is 0:
+1,+1,-1,-1
- if(consecutiveZeros >= consecutiveZerosMax && ecca.ecc.Count > 0)
+ //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)
{
encoderProcessFinish = true;
Log.WriteLine("SHOULD FINISH");
@@ -4419,16 +4421,18 @@ Log.WriteLine(str);
}
prepareEncoderGraphs();
+ eccaCreated = false;
if(action == encoderActions.CAPTURE) {
encoderStartVideoRecord();
//remove treeview columns
treeviewEncoderCaptureRemoveColumns();
- encoderCaptureStringR =
",series,exercise,mass,start,width,height,meanSpeed,maxSpeed,maxSpeedT,meanPower,peakPower,peakPowerT,pp_ppt,NA,NA,NA";
+ encoderCaptureStringR =
+ ",series,exercise,mass,start,width,height," +
+
"meanSpeed,maxSpeed,maxSpeedT,meanPower,peakPower,peakPowerT,pp_ppt,NA,NA,NA";
capturingCsharp = encoderCaptureProcess.CAPTURING;
- eccaCreated = false;
//TODO: add demult and angle
massDisplacedEncoder =
UtilEncoder.GetMassByEncoderConfiguration(encoderConfigurationCurrent,
@@ -4554,7 +4558,7 @@ Log.WriteLine(str);
Log.Write("dying");
return false;
}
- updatePulsebar(encoderActions.CAPTURE); //activity on pulsebar
+ updatePulsebar(encoderActions.CAPTURE_IM); //activity on pulsebar
updateEncoderCaptureGraph(true, false, false); //graphSignal, not calcCurves, not
plotCurvesBars
Thread.Sleep (25);
@@ -4615,8 +4619,11 @@ Log.WriteLine(str);
}
private void updatePulsebar (encoderActions action) {
- if(action == encoderActions.CAPTURE) {
+ if(action == encoderActions.CAPTURE || action == encoderActions.CAPTURE_IM) {
int selectedTime = (int) encoderCaptureOptionsWin.spin_encoder_capture_time.Value;
+ if(action == encoderActions.CAPTURE_IM)
+ selectedTime = encoder_configuration_win.Spin_im_duration;
+
encoder_pulsebar_capture.Fraction = Util.DivideSafeFraction(
(selectedTime - encoderCaptureCountdown), selectedTime);
encoder_pulsebar_capture.Text = encoderCaptureCountdown + " s";
diff --git a/src/gui/encoderConfiguration.cs b/src/gui/encoderConfiguration.cs
index 444559b..315dad9 100644
--- a/src/gui/encoderConfiguration.cs
+++ b/src/gui/encoderConfiguration.cs
@@ -54,7 +54,7 @@ public class EncoderConfigurationWindow {
[Widget] Gtk.Box vbox_calcule_im;
[Widget] Gtk.SpinButton spin_im_weight;
[Widget] Gtk.SpinButton spin_im_length;
- [Widget] Gtk.SpinButton spin_im_duration;
+ //[Widget] Gtk.SpinButton spin_im_duration;
[Widget] Gtk.Label label_im_progress;
[Widget] Gtk.Button button_encoder_capture_inertial_do;
[Widget] Gtk.Button button_encoder_capture_inertial_cancel;
@@ -310,7 +310,10 @@ public class EncoderConfigurationWindow {
}
public int Spin_im_duration {
- get { return (int) spin_im_duration.Value; }
+ //get { return (int) spin_im_duration.Value; }
+ //
+ //do 60 seconds and it will end automatically when ended
+ get { return 60; }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]