[chronojump] RunEncoder graph uses segmentMeters
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RunEncoder graph uses segmentMeters
- Date: Sun, 4 Oct 2020 21:03:38 +0000 (UTC)
commit d64eb139bbceceeeda034249a2487923882214cc
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Oct 4 22:59:56 2020 +0200
RunEncoder graph uses segmentMeters
r-scripts/sprintEncoder.R | 29 ++++++++++++++++-------------
src/runEncoder.cs | 4 ++++
2 files changed, 20 insertions(+), 13 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index c840d9e4..9b052c69 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -46,17 +46,18 @@ assignOptions <- function(options) {
graphWidth = as.numeric(options[8]),
graphHeight = as.numeric(options[9]),
device = options[10],
- title = options[11],
- datetime = options[12],
- startAccel = options[13],
- plotRawAccel = as.logical(options[14]),
- plotFittedAccel = as.logical(options[15]),
- plotRawForce = as.logical(options[16]),
- plotFittedForce = as.logical(options[17]),
- plotRawPower = as.logical(options[18]),
- plotFittedPower = as.logical(options[19]),
- triggersOnList = as.numeric(unlist(strsplit(options[20], "\\;"))),
- triggersOffList = as.numeric(unlist(strsplit(options[21], "\\;")))
+ segmentMeters = as.numeric(options[11]),
+ title = options[12],
+ datetime = options[13],
+ startAccel = options[14],
+ plotRawAccel = as.logical(options[15]),
+ plotFittedAccel = as.logical(options[16]),
+ plotRawForce = as.logical(options[17]),
+ plotFittedForce = as.logical(options[18]),
+ plotRawPower = as.logical(options[19]),
+ plotFittedPower = as.logical(options[20]),
+ triggersOnList = as.numeric(unlist(strsplit(options[21], "\\;"))),
+ triggersOffList = as.numeric(unlist(strsplit(options[22], "\\;")))
))
}
@@ -234,6 +235,7 @@ getSprintFromEncoder <- function(filename, testLength, Mass, Temperature = 25, H
}
plotSprintFromEncoder <- function(sprintRawDynamics, sprintFittedDynamics,
+ segmentMeters,
title = "Test graph",
subtitle = "",
triggersOn = "",
@@ -313,8 +315,8 @@ plotSprintFromEncoder <- function(sprintRawDynamics, sprintFittedDynamics,
#Plotting rawSpeed
ylimits = c(0, sprintRawDynamics$rawVmax*1.05)
xlimits =c(0, sprintRawDynamics$time[sprintRawDynamics$endSample])
- #Calculing 5m lap times, this will be configurable as an exercise
- segmentMeters = 5
+
+ #Calculing 5m lap times, this ca be configured as an exercise
splitPosition = min(sprintRawDynamics$testLength, segmentMeters)
splitTime =
interpolateXAtY(sprintRawDynamics$time[sprintRawDynamics$startSample:sprintRawDynamics$endSample],
sprintRawDynamics$rawPosition[sprintRawDynamics$startSample:sprintRawDynamics$endSample],
@@ -685,6 +687,7 @@ testEncoderCJ <- function(filename, testLength, mass, personHeight, tempC, start
sprintFittedDynamics = getDynamicsFromSprint(K = sprintRawDynamics$K, Vmax =
sprintRawDynamics$Vmax, mass, tempC, personHeight)
print(paste("K =",sprintFittedDynamics$K.fitted, "Vmax =", sprintFittedDynamics$Vmax.fitted))
plotSprintFromEncoder(sprintRawDynamic = sprintRawDynamics, sprintFittedDynamics =
sprintFittedDynamics,
+ segmentMeters = op$segmentMeters,
title = op$title,
subtitle = op$datetime,
triggersOn = op$triggersOnList,
diff --git a/src/runEncoder.cs b/src/runEncoder.cs
index 0dfb838c..6954c7b1 100644
--- a/src/runEncoder.cs
+++ b/src/runEncoder.cs
@@ -299,6 +299,7 @@ public class RunEncoderGraph
private double personHeight;
private double tempC;
private RunEncoder.Devices device;
+ private RunEncoderExercise rex;
private string title;
private string datetime;
private double startAccel;
@@ -311,6 +312,7 @@ public class RunEncoderGraph
private TriggerList triggerList;
public RunEncoderGraph(int testLength, double mass, double personHeight, double tempC,
RunEncoder.Devices device,
+ RunEncoderExercise rex,
string title, string datetime, double startAccel,
bool plotRawAccel, bool plotFittedAccel,
bool plotRawForce, bool plotFittedForce,
@@ -322,6 +324,7 @@ public class RunEncoderGraph
this.personHeight = personHeight;
this.tempC = tempC;
this.device = device;
+ this.rex = rex;
this.title = title;
this.datetime = datetime;
this.startAccel = startAccel;
@@ -361,6 +364,7 @@ public class RunEncoderGraph
"#graphWidth\n" + graphWidth.ToString() + "\n" +
"#graphHeight\n" + graphHeight.ToString() + "\n" +
"#device\n" + device.ToString() + "\n" +
+ "#segmentMeters\n" + rex.SegmentMeters + "\n" +
"#title\n" + title + "\n" +
"#datetime\n" + datetime + "\n" +
"#startAccel\n" + Util.ConvertToPoint(startAccel) + "\n" +
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]