[chronojump] Added forces on encoder analyze table
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Added forces on encoder analyze table
- Date: Thu, 25 Jun 2015 17:12:57 +0000 (UTC)
commit 6fe9e8568e1c06e43e1e0b95d366bd403e1cd415
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jun 25 19:12:11 2015 +0200
Added forces on encoder analyze table
src/encoder.cs | 9 +++++++--
src/gui/encoderTreeviews.cs | 28 ++++++++++++++++++++--------
2 files changed, 27 insertions(+), 10 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index f7ff8cf..c483ea2 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -270,7 +270,8 @@ public class EncoderCurve
string start, string duration, string height,
string meanSpeed, string maxSpeed, string maxSpeedT,
string meanPower, string peakPower, string peakPowerT,
- string PP_PPT)
+ string PP_PPT,
+ string meanForce, string maxForce, string maxForceT)
{
this.N = n;
this.Series = series;
@@ -288,6 +289,9 @@ public class EncoderCurve
this.PeakPower = peakPower;
this.PeakPowerT = peakPowerT;
this.PP_PPT = PP_PPT; //PeakPower / PeakPowerTime
+ this.MeanForce = meanForce;
+ this.MaxForce = maxForce;
+ this.MaxForceT = maxForceT;
}
public string ToCSV(string decimalSeparator) {
@@ -301,7 +305,8 @@ public class EncoderCurve
Start + sep + Duration + sep + Height + sep +
MeanSpeed + sep + MaxSpeed + sep + MaxSpeedT + sep +
MeanPower + sep + PeakPower + sep + PeakPowerT + sep +
- PP_PPT;
+ PP_PPT + sep +
+ MeanForce + sep + MaxForce + sep + MaxForceT;
if(decimalSeparator == "COMMA")
str = Util.ConvertToComma(str);
diff --git a/src/gui/encoderTreeviews.cs b/src/gui/encoderTreeviews.cs
index 45bf43e..e67691b 100644
--- a/src/gui/encoderTreeviews.cs
+++ b/src/gui/encoderTreeviews.cs
@@ -75,7 +75,7 @@ public partial class ChronoJumpWindow
curvesCount ++;
string [] cells = line.Split(new char[] {','});
- cells = fixDecimals(cells, true); //useForce
+ cells = fixDecimals(cells);
LogB.Error(Util.StringArrayToString(cells, ":"));
encoderCaptureCurves.Add (new EncoderCurve (
@@ -487,7 +487,10 @@ public partial class ChronoJumpWindow
"p" + "\n (W)",
"pmax" + "\n (W)",
"t->pmax" + "\n (s)",
- "pmax/t->pmax" + "\n (W/s)"
+ "pmax/t->pmax" + "\n (W/s)",
+ "F" + "\n (N)",
+ "Fmax" + "\n (N)",
+ "t->Fmax" + "\n (s)"
};
bool lastTreeviewEncoderAnalyzeIsNeuromuscular = false;
@@ -525,7 +528,7 @@ public partial class ChronoJumpWindow
curvesCount ++;
string [] cells = line.Split(new char[] {','});
- cells = fixDecimals(cells, false); //not useForce
+ cells = fixDecimals(cells);
if(! check_encoder_analyze_signal_or_curves.Active) { //user curves
@@ -556,7 +559,8 @@ public partial class ChronoJumpWindow
cells[5], cells[6], cells[7],
cells[8], cells[9], cells[10],
cells[11], cells[12], cells[13],
- cells[14]
+ cells[14],
+ cells[15], cells[16], cells[17] //meanForce,
maxSForce maxForceT
));
} while(true);
@@ -632,6 +636,15 @@ public partial class ChronoJumpWindow
case 15:
aColumn.SetCellDataFunc (aCell, new Gtk.TreeCellDataFunc
(RenderPP_PPT));
break;
+ case 16:
+ aColumn.SetCellDataFunc (aCell, new Gtk.TreeCellDataFunc
(RenderMeanForce));
+ break;
+ case 17:
+ aColumn.SetCellDataFunc (aCell, new Gtk.TreeCellDataFunc
(RenderMaxForce));
+ break;
+ case 18:
+ aColumn.SetCellDataFunc (aCell, new Gtk.TreeCellDataFunc
(RenderMaxForceT));
+ break;
}
treeview_encoder_analyze_curves.AppendColumn (aColumn);
@@ -1187,7 +1200,7 @@ public partial class ChronoJumpWindow
/* end of rendering neuromuscular cols */
- private string [] fixDecimals(string [] cells, bool useForce) {
+ private string [] fixDecimals(string [] cells) {
//start, width, height
for(int i=5; i <= 7; i++)
cells[i] =
Util.TrimDecimals(Convert.ToDouble(Util.ChangeDecimalSeparator(cells[i])),1);
@@ -1200,9 +1213,8 @@ public partial class ChronoJumpWindow
int pp_ppt = 14;
cells[pp_ppt] =
Util.TrimDecimals(Convert.ToDouble(Util.ChangeDecimalSeparator(cells[pp_ppt])),1);
- if(useForce)
- for(int i=15; i <= 17; i++)
- cells[i] =
Util.TrimDecimals(Convert.ToDouble(Util.ChangeDecimalSeparator(cells[i])),3);
+ for(int i=15; i <= 17; i++)
+ cells[i] =
Util.TrimDecimals(Convert.ToDouble(Util.ChangeDecimalSeparator(cells[i])),3);
//18, 19, 20 ara mass, massBody, massExtra. They are unneded because this parameters are also
in cells [3],[4]
//21: laterality
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]