[chronojump] forceSensor: title on RFD graph



commit 5faee72d7e39d0c445076d73f6a40185974dfae5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Dec 19 11:54:44 2017 +0100

    forceSensor: title on RFD graph

 r-scripts/maximumIsometricForce.R |    5 ++++-
 src/forceSensor.cs                |    7 +++++--
 src/gui/forceSensor.cs            |    8 +++++++-
 3 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/r-scripts/maximumIsometricForce.R b/r-scripts/maximumIsometricForce.R
index 6a37577..8d23e6d 100644
--- a/r-scripts/maximumIsometricForce.R
+++ b/r-scripts/maximumIsometricForce.R
@@ -63,7 +63,8 @@ assignOptions <- function(options)
                 hline50fmax.fitted     = options[11],
                 drawRfdOptions          = drawRfdOptions,
                 drawImpulseOptions      = options[16],
-                testLength             = as.numeric(options[17])
+               testLength              = as.numeric(options[17]),
+               title                   = options[18]
         ))
 }
 
@@ -190,6 +191,7 @@ drawDynamicsFromLoadCell <- function(
                      type="l", xlab="Time[s]", ylab="Force[N]",
                      xlim = xlimits, ylim=c(0, yHeight),
                      #main = dynamics$nameOfFile,
+                    main = op$title,
                     yaxs= "i", xaxs = "i")
                 xmin = xlimits[1]
                 xmax = xlimits[2]
@@ -203,6 +205,7 @@ drawDynamicsFromLoadCell <- function(
                      xlim = c(xmin, xmax),
                      ylim=c(0, yHeight),
                      #main = dynamics$nameOfFile,
+                    main = op$title,
                     yaxs= "i", xaxs = "i")
         }
         
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index 889c2fc..d59a785 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -377,12 +377,14 @@ public class ForceSensorGraph
        bool hline50fmax_raw;
        bool hline50fmax_fitted;
        int testLength;
+       string title;
 
-       public ForceSensorGraph(List<ForceSensorRFD> rfdList, ForceSensorImpulse impulse, int testLength)
+       public ForceSensorGraph(List<ForceSensorRFD> rfdList, ForceSensorImpulse impulse, int testLength, 
string title)
        {
                this.rfdList = rfdList;
                this.impulse = impulse;
                this.testLength = testLength;
+               this.title = title;
 
                averageLength = 0.1;
                percentChange = 5;
@@ -461,7 +463,8 @@ public class ForceSensorGraph
                        scriptOptions += "\n-1";
 
                scriptOptions +=
-                       "\n#testLength\n" +             testLength.ToString() + "\n";
+                       "\n#testLength\n" +             testLength.ToString() + "\n" +
+                       "#title\n" +                    title + "\n";
 
                TextWriter writer = File.CreateText(Path.GetTempPath() + "Roptions.txt");
                writer.Write(scriptOptions);
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index c5881e3..d807203 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -970,7 +970,13 @@ LogB.Information(" fc R ");
                if(radio_force_duration_seconds.Active)
                        duration = Convert.ToInt32(spin_force_duration_seconds.Value);
 
-               ForceSensorGraph fsg = new ForceSensorGraph(rfdList, impulse, duration);
+               string title = lastForceSensorFile;
+               if (title == null || title == "")
+                       title = "unnamed";
+               else
+                       title = Util.RemoveChar(title, '_');
+
+               ForceSensorGraph fsg = new ForceSensorGraph(rfdList, impulse, duration, title);
 
                int imageWidth = UtilGtk.WidgetWidth(viewport_force_sensor_graph);
                int imageHeight = UtilGtk.WidgetHeight(viewport_force_sensor_graph);


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