[chronojump] Fixed person,session heights at labels jump simple
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed person,session heights at labels jump simple
- Date: Sun, 10 Nov 2013 21:37:03 +0000 (UTC)
commit 7dffd7d067ddd81125fd4c533fa2909786c19603
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Nov 10 21:56:39 2013 +0100
Fixed person,session heights at labels jump simple
src/gui/eventExecute.cs | 15 ++++++++++-----
src/gui/usefulObjects.cs | 13 +++++++++++++
2 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 4af6661..04cbc66 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -611,6 +611,7 @@ public partial class ChronoJumpWindow
//printLabels
printLabelsJumpSimple (
eventGraph.tv, eventGraph.tvPersonAVGAtSQL, eventGraph.tvSessionAVGAtSQL,
+ eventGraph.heightPersonAVGAtSQL, eventGraph.heightSessionAVGAtSQL,
eventGraph.tc, eventGraph.tcPersonAVGAtSQL, eventGraph.tcSessionAVGAtSQL);
// -- refresh
@@ -998,7 +999,11 @@ Log.WriteLine("Preparing reactive A");
}
- private void printLabelsJumpSimple (double tvNow, double tvPerson, double tvSession, double tcNow,
double tcPerson, double tcSession) {
+ private void printLabelsJumpSimple (
+ double tvNow, double tvPerson, double tvSession,
+ double heightPerson, double heightSession,
+ double tcNow, double tcPerson, double tcSession)
+ {
if(tcNow > 0) {
event_execute_label_jump_simple_tc_now.Text = Util.TrimDecimals(tcNow.ToString(),
prefsDigitsNumber);
event_execute_label_jump_simple_tc_person.Text =
Util.TrimDecimals(tcPerson.ToString(), prefsDigitsNumber);
@@ -1012,12 +1017,12 @@ Log.WriteLine("Preparing reactive A");
event_execute_label_jump_simple_tf_person.Text = Util.TrimDecimals(tvPerson.ToString(),
prefsDigitsNumber);
event_execute_label_jump_simple_tf_session.Text = Util.TrimDecimals(tvSession.ToString(),
prefsDigitsNumber);
+ //current height is calculated from tvNow
+ //heightPerson and heightSession is calculated for every jump, then done the AVG, then send
here
event_execute_label_jump_simple_height_now.Text = Util.TrimDecimals(
Util.GetHeightInCentimeters(tvNow.ToString()) , prefsDigitsNumber);
- event_execute_label_jump_simple_height_person.Text = Util.TrimDecimals(
- Util.GetHeightInCentimeters(tvPerson.ToString()) , prefsDigitsNumber);
- event_execute_label_jump_simple_height_session.Text = Util.TrimDecimals(
- Util.GetHeightInCentimeters(tvSession.ToString()) , prefsDigitsNumber);
+ event_execute_label_jump_simple_height_person.Text =
Util.TrimDecimals(heightPerson.ToString(), prefsDigitsNumber);
+ event_execute_label_jump_simple_height_session.Text =
Util.TrimDecimals(heightSession.ToString(), prefsDigitsNumber);
}
private void printLabelsRunSimple (double timeNow, double timePerson, double timeSession, double
speedNow, double speedPerson, double speedSession) {
diff --git a/src/gui/usefulObjects.cs b/src/gui/usefulObjects.cs
index cc20e0f..d20086b 100644
--- a/src/gui/usefulObjects.cs
+++ b/src/gui/usefulObjects.cs
@@ -57,6 +57,8 @@ public class PrepareEventGraphJumpSimple {
public string [] jumpsAtSQL;
public double tvPersonAVGAtSQL;
public double tvSessionAVGAtSQL;
+ public double heightPersonAVGAtSQL;
+ public double heightSessionAVGAtSQL;
public double tcPersonAVGAtSQL;
public double tcSessionAVGAtSQL;
@@ -79,6 +81,17 @@ public class PrepareEventGraphJumpSimple {
tvSessionAVGAtSQL = SqliteSession.SelectAVGEventsOfAType(
sessionID, -1, table, type, "TV");
+ //need to calculate height also, because:
+ //it's different to have mean of tv and then calculate height of that mean
+ //than have every height and then calculate the mean
+
+ heightPersonAVGAtSQL = SqliteSession.SelectAVGEventsOfAType(
+ sessionID, personID,
+ table, type, "100*4.9*(TV/2)*(TV/2)");
+ heightSessionAVGAtSQL = SqliteSession.SelectAVGEventsOfAType(
+ sessionID, -1, table, type, "100*4.9*(TV/2)*(TV/2)");
+
+
tcPersonAVGAtSQL = 0;
tcSessionAVGAtSQL = 0;
if(tc > 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]