[chronojump] Fix on print AVG and SD values on encoder analyze table
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fix on print AVG and SD values on encoder analyze table
- Date: Mon, 2 Nov 2015 15:29:05 +0000 (UTC)
commit 414f192370ae8b79cd2fffaa51de947d32366713
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Nov 2 16:27:51 2015 +0100
Fix on print AVG and SD values on encoder analyze table
src/gui/encoderTreeviews.cs | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/gui/encoderTreeviews.cs b/src/gui/encoderTreeviews.cs
index 0e7ce61..361ad3d 100644
--- a/src/gui/encoderTreeviews.cs
+++ b/src/gui/encoderTreeviews.cs
@@ -577,9 +577,15 @@ public partial class ChronoJumpWindow
//cells[3]: massBody
//cells[4]: massExtra
- totalMass = Convert.ToDouble(Util.ChangeDecimalSeparator(cells[3])) *
- getExercisePercentBodyWeightFromName (exerciseName) / 100.0
- + Convert.ToDouble(Util.ChangeDecimalSeparator(cells[4]));
+
+ //don't show the DisplacedWeight on AVG or SD because there can be
many exercises
+ //(with different exercisePercentBodyWeight) and persons
+ if(cells[0] == "AVG" || cells[0] == "SD")
+ totalMass = -1; //mark to not be shown
+ else
+ totalMass =
Convert.ToDouble(Util.ChangeDecimalSeparator(cells[3])) *
+ getExercisePercentBodyWeightFromName (exerciseName) /
100.0
+ +
Convert.ToDouble(Util.ChangeDecimalSeparator(cells[4]));
LogB.Debug("totalMass:" + totalMass.ToString());
}
@@ -968,8 +974,15 @@ public partial class ChronoJumpWindow
private void RenderDisplacedWeight (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel
model, Gtk.TreeIter iter)
{
EncoderCurve curve = (EncoderCurve) model.GetValue (iter, 0);
+
+ string str = "";
- string str =
String.Format(UtilGtk.TVNumPrint(curve.DisplacedWeight.ToString(),3,0),Convert.ToInt32(curve.DisplacedWeight));
+ //don't show the DisplacedWeight on AVG or SD because there can be many exercises
+ //(with different exercisePercentBodyWeight) and persons
+ if(curve.DisplacedWeight == -1)
+ str = "";
+ else
+ str =
String.Format(UtilGtk.TVNumPrint(curve.DisplacedWeight.ToString(),3,0),Convert.ToInt32(curve.DisplacedWeight));
renderBoldIfNeeded(cell, curve, str);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]