[chronojump] Fixed saved curves found
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed saved curves found
- Date: Tue, 27 May 2014 16:45:20 +0000 (UTC)
commit 8cf1ba0396887ec5209ed32e274ff27b2902cce8
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue May 27 17:53:04 2014 +0200
Fixed saved curves found
src/gui/encoder.cs | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index c20cc35..af3add3 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4548,26 +4548,36 @@ Log.Write(" AT ANALYZE 2 ");
Log.WriteLine(esc.ToString());
string eccon = findEccon(true);
+
int curveCount = 0;
- EncoderCurve curvePre;
- foreach (EncoderCurve curve in encoderCaptureCurves) {
- curvePre = curve;
- if(eccon == "ecS" && Util.IsEven(curveCount)) {
- curvePre = curve;
+ double curveStart = 0;
+ double curveEnd = 0;
+ foreach (EncoderCurve curve in encoderCaptureCurves)
+ {
+ if(eccon == "c") {
+ curveStart = Convert.ToDouble(curve.Start);
+ curveEnd = Convert.ToDouble(curve.Start) +
Convert.ToDouble(curve.Duration);
+ } else { //eccon == "ecS"
+ if(Util.IsEven(curveCount)) {
+ curveStart = Convert.ToDouble(curve.Start);
curveCount ++;
continue;
+ } else
+ curveEnd = Convert.ToDouble(curve.Start) +
Convert.ToDouble(curve.Duration);
}
+
foreach(EncoderSignalCurve esc in linkedCurves) {
- if(Convert.ToDouble(curvePre.Start) <= esc.msCentral &&
- Convert.ToDouble(curve.Start) +
Convert.ToDouble(curve.Duration) >= esc.msCentral)
+ if(curveStart <= esc.msCentral && curveEnd >= esc.msCentral)
{
Log.WriteLine(curve.Start + " is saved");
encoderCaptureSelectBySavedCurves(esc.msCentral,
true);
break;
}
}
+ curveCount ++;
}
+
}
if(action == encoderActions.CAPTURE_IM && ! encoderProcessCancel && !
encoderProcessProblems)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]