[chronojump] Fix to race analyzer distance on capture
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fix to race analyzer distance on capture
- Date: Mon, 4 Jan 2021 15:57:00 +0000 (UTC)
commit e93811d52a76cdc6a49c81b22b3605b6bbf536e3
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jan 4 16:56:28 2021 +0100
Fix to race analyzer distance on capture
src/gui/app1/runEncoder.cs | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index 294a09888..5a2d8b0d7 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -544,11 +544,16 @@ public partial class ChronoJumpWindow
{
if(timePre > 0)
{
- runEncoderCaptureDistance = Math.Abs(encoderDisplacement) * 1000000 *
0.003003; //hardcoded: same as sprintEncoder.R
- runEncoderCaptureSpeed =
UtilAll.DivideSafe(runEncoderCaptureDistance, (time - timePre));
+ double runEncoderCaptureDistanceAtThisSample =
Math.Abs(encoderDisplacement) * 1000000 * 0.003003; //hardcoded: same as sprintEncoder.R
+ runEncoderCaptureSpeed =
UtilAll.DivideSafe(runEncoderCaptureDistanceAtThisSample, (time - timePre));
- LogB.Information(string.Format("encoderDisplacement: {0};
runEncoderCaptureSpeed: {1}; time: {2}; timePre: {3}",
- encoderDisplacement, runEncoderCaptureSpeed,
time, timePre));
+ runEncoderCaptureDistance += runEncoderCaptureDistanceAtThisSample;
+
+ LogB.Information(string.Format("encoderDisplacement: {0};
runEncoderCaptureDistanceAtThisSample: {1}, runEncoderDistance: {2}, runEncoderCaptureSpeed: {3}; time: {4};
timePre: {5}",
+ encoderDisplacement,
+ runEncoderCaptureDistanceAtThisSample,
+ runEncoderCaptureDistance,
+ runEncoderCaptureSpeed, time, timePre));
}
timePre = time;
sw.Restart();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]