[chronojump] RaceAnalyzer load capture graphs shift time to left since runEncoderMinAccel
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RaceAnalyzer load capture graphs shift time to left since runEncoderMinAccel
- Date: Tue, 10 May 2022 11:25:07 +0000 (UTC)
commit 61338849125152deb03afda01ee3eba96310b3ae
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue May 10 13:24:18 2022 +0200
RaceAnalyzer load capture graphs shift time to left since runEncoderMinAccel
src/gui/app1/runEncoder.cs | 5 +++--
src/runEncoder.cs | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index 63ac2dcc4..6a7ec5ec4 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -1094,13 +1094,11 @@ public partial class ChronoJumpWindow
double timePre = -1;
double accel = -1;
bool enoughAccel = false; //accel has been > preferences.runEncoderMinAccel (default 10ms^2)
-
string rowPre = "";
//store data on cairoGraphRaceAnalyzerPoints_dt_l, ...st_l, ...at_l
foreach(string row in contents)
{
- //LogB.Information("row: " + row);
if(count < 3)
{
count ++;
@@ -1129,6 +1127,9 @@ public partial class ChronoJumpWindow
currentPersonSession.Weight, //but note if person
changes (but graph will be hopefully erased), this will change also take care on exports
currentRunEncoder.Angle);
+ //to shift times to the left
+ reCGSD.SetTimeAtEnoughAccel (rowPre);
+
//pass previous row and this one
if(reCGSD.PassLoadedRow (rowPre))
reCGSD.Calcule();
diff --git a/src/runEncoder.cs b/src/runEncoder.cs
index 002bb702e..987192be9 100644
--- a/src/runEncoder.cs
+++ b/src/runEncoder.cs
@@ -290,6 +290,7 @@ public class RunEncoderCaptureGetSpeedAndDisplacement
private int encoderOrRCA;
private int timePre;
+ private int timeAtEnoughAccel;
private double runEncoderCaptureSpeed;
private double runEncoderCaptureSpeedMax;
@@ -303,6 +304,7 @@ public class RunEncoderCaptureGetSpeedAndDisplacement
segmentCalcs = new RunEncoderSegmentCalcs (massKg, angle);
timePre = 0;
+ timeAtEnoughAccel = 0;
}
public void PassCapturedRow (List<int> binaryReaded)
@@ -323,10 +325,28 @@ public class RunEncoderCaptureGetSpeedAndDisplacement
return false;
this.encoderDisplacement = Convert.ToInt32(cells[0]);
+
this.time = Convert.ToInt32(cells[1]);
+ //after enoughAccel, time has to be shifted to left
+ if(timeAtEnoughAccel > 0)
+ time -= timeAtEnoughAccel;
+
return true;
}
+ //to sync time
+ public void SetTimeAtEnoughAccel (string row)
+ {
+ string [] cells = row.Split(new char[] {';'});
+ if(cells.Length != 3)
+ return;
+
+ if(! Util.IsNumber(cells[0], false) || ! Util.IsNumber(cells[1], false))
+ return;
+
+ timeAtEnoughAccel = Convert.ToInt32(cells[1]);
+ }
+
public bool Calcule ()
{
bool hasCalculed = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]