[chronojump] sprintPhotocells shows person as title



commit b3c65a9cf044d70193219f2232a8eb6f4adc77a1
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jun 6 23:20:21 2018 +0200

    sprintPhotocells shows person as title

 r-scripts/sprintPhotocells.R | 9 +++++----
 src/gui/sprint.cs            | 3 ++-
 src/sprint.cs                | 9 +++++----
 3 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/r-scripts/sprintPhotocells.R b/r-scripts/sprintPhotocells.R
index cb64280d..1f50bee7 100644
--- a/r-scripts/sprintPhotocells.R
+++ b/r-scripts/sprintPhotocells.R
@@ -45,7 +45,8 @@ assignOptions <- function(options) {
                 tempC  = as.numeric(options[6]),
                 os             = options[7],
                 graphWidth     = as.numeric(options[8]),
-                graphHeight    = as.numeric(options[9])
+                graphHeight    = as.numeric(options[9]),
+                personName     = options[10]
         ))
 }
 
@@ -193,19 +194,19 @@ drawSprintFromPhotocells <- function(sprintDynamics, splitTimes, positions, titl
         exportSprintDynamics(sprintDynamics)
 }
 
-testPhotocellsCJ <- function(positions, splitTimes, mass, personHeight, tempC)
+testPhotocellsCJ <- function(positions, splitTimes, mass, personHeight, tempC, personName)
 {
        sprint = getSprintFromPhotocell(position = positions, splitTimes = splitTimes)
        sprintDynamics = getDynamicsFromSprint(K = sprint$K, Vmax = sprint$Vmax, mass, tempC, personHeight, 
maxTime = max(splitTimes))
        print(paste("K =",sprintDynamics$K.fitted, "Vmax =", sprintDynamics$Vmax.fitted))
 
-       drawSprintFromPhotocells(sprintDynamics = sprintDynamics, splitTimes, positions, title = "Testing 
graph")
+       drawSprintFromPhotocells(sprintDynamics = sprintDynamics, splitTimes, positions, title = personName)
 }
 
 #----- execute code
 
 prepareGraph(op$os, pngFile, op$graphWidth, op$graphHeight)
-testPhotocellsCJ(op$positions, op$splitTimes, op$mass, op$personHeight, op$tempC)
+testPhotocellsCJ(op$positions, op$splitTimes, op$mass, op$personHeight, op$tempC, op$personName)
 endGraph()
 
 
diff --git a/src/gui/sprint.cs b/src/gui/sprint.cs
index a1f369bd..70e89ca8 100644
--- a/src/gui/sprint.cs
+++ b/src/gui/sprint.cs
@@ -262,7 +262,8 @@ public partial class ChronoJumpWindow
 
                bool success = sprint.CallR(
                                viewport_sprint.Allocation.Width -5,
-                               viewport_sprint.Allocation.Height -5);
+                               viewport_sprint.Allocation.Height -5,
+                               currentPerson.Name);
 
                if(! success)
                {
diff --git a/src/sprint.cs b/src/sprint.cs
index 55597603..ddce0df5 100644
--- a/src/sprint.cs
+++ b/src/sprint.cs
@@ -58,7 +58,7 @@ public class Sprint
        }
        */
 
-       public bool CallR(int graphWidth, int graphHeight)
+       public bool CallR(int graphWidth, int graphHeight, string personName)
        {
                string executable = UtilEncoder.RProcessBinURL();
                List<string> parameters = new List<string>();
@@ -78,7 +78,7 @@ public class Sprint
                parameters.Insert(1, "\"" + tempPath + "\"");
 
                //C) writeOptions
-               writeOptionsFile(graphWidth, graphHeight);
+               writeOptionsFile(graphWidth, graphHeight, personName);
 
                LogB.Information("\nCalling sprint.R ----->");
 
@@ -91,7 +91,7 @@ public class Sprint
                return execute_result.success;
        }
 
-       private void writeOptionsFile(int graphWidth, int graphHeight)
+       private void writeOptionsFile(int graphWidth, int graphHeight, string personName)
        {
                /*
                string scriptOptions =
@@ -114,7 +114,8 @@ public class Sprint
                        "#tempC\n" +            tempC + "\n" +
                        "#os\n" +               UtilEncoder.OperatingSystemForRGraphs() + "\n" +
                        "#graphWidth\n" +       graphWidth.ToString() + "\n" +
-                       "#graphHeight\n" +      graphHeight.ToString() + "\n";
+                       "#graphHeight\n" +      graphHeight.ToString() + "\n" +
+                       "#personName\n" +       personName + "\n";
 
                TextWriter writer = File.CreateText(Path.GetTempPath() + "Roptions.txt");
                writer.Write(scriptOptions);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]