[chronojump] rsi on jumps rj graph
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] rsi on jumps rj graph
- Date: Mon, 7 Dec 2020 12:16:42 +0000 (UTC)
commit 3dd43898fd7775a34b25202b10b9d3e9da8e0ecc
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Dec 7 13:05:50 2020 +0100
rsi on jumps rj graph
glade/app1.glade | 90 +++++++++++++++++++++++++++++++++++++++--
src/gui/app1/jumpsRjFatigue.cs | 16 +++++++-
src/gui/cairo/jumpsRjFatigue.cs | 14 +++++--
src/jump.cs | 21 ++++++++++
src/jumpsRjFatigue.cs | 11 ++---
5 files changed, 139 insertions(+), 13 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 08b3e84b..fed5c04d 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -20318,6 +20318,18 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
+ <widget class="GtkLabel" id="label578">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">Q:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkLabel" id="label564">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -20327,7 +20339,7 @@ Concentric</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -20339,7 +20351,7 @@ Concentric</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -20352,11 +20364,49 @@ Concentric</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_jumps_rj_fatigue_rsi">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <property
name="group">radio_jumps_rj_fatigue_heights</property>
+ <signal name="toggled"
handler="on_radio_jumps_rj_fatigue_rsi_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkHBox" id="hbox342">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkLabel" id="label579">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">RSI:</property>
</widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label494">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip"
translatable="yes">Flight time</property>
+ <property name="label"
translatable="yes">Height</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -20364,6 +20414,40 @@ Concentric</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label576">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">/</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label577">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip"
translatable="yes">Contact time</property>
+ <property name="label"
translatable="yes">TC</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
diff --git a/src/gui/app1/jumpsRjFatigue.cs b/src/gui/app1/jumpsRjFatigue.cs
index 2780df01..5ed3a884 100644
--- a/src/gui/app1/jumpsRjFatigue.cs
+++ b/src/gui/app1/jumpsRjFatigue.cs
@@ -41,6 +41,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.RadioButton radio_jumps_rj_fatigue_heights;
[Widget] Gtk.RadioButton radio_jumps_rj_fatigue_tv_tc;
+ [Widget] Gtk.RadioButton radio_jumps_rj_fatigue_rsi;
[Widget] Gtk.ComboBox combo_jumps_rj_fatigue_divide_in;
@@ -112,6 +113,11 @@ public partial class ChronoJumpWindow
if(radio_jumps_rj_fatigue_tv_tc.Active)
jumpsRjFatigueDo(true);
}
+ private void on_radio_jumps_rj_fatigue_rsi_toggled (object o, EventArgs args)
+ {
+ if(radio_jumps_rj_fatigue_rsi.Active)
+ jumpsRjFatigueDo(true);
+ }
private void on_combo_jumps_rj_fatigue_divide_in_changed (object o, EventArgs args)
{
@@ -159,9 +165,15 @@ public partial class ChronoJumpWindow
string jumpType = comboSelectJumpsRjFatigue.GetSelectedNameEnglish();
+ JumpsRjFatigue.Statistic statistic = JumpsRjFatigue.Statistic.HEIGHTS;
+ if(radio_jumps_rj_fatigue_tv_tc.Active)
+ statistic = JumpsRjFatigue.Statistic.Q;
+ else if(radio_jumps_rj_fatigue_rsi.Active)
+ statistic = JumpsRjFatigue.Statistic.RSI;
+
if(calculateData)
jumpsRjFatigue.Calculate(comboSelectJumpsRjFatigueNum.GetSelectedId(),
- radio_jumps_rj_fatigue_heights.Active);
+ statistic);
if(jumpsRjFatigue.Point_l.Count == 0)
{
@@ -189,7 +201,7 @@ public partial class ChronoJumpWindow
drawingarea_jumps_rj_fatigue,
currentPerson.Name, jumpType,
jumpDateStr,
- radio_jumps_rj_fatigue_heights.Active,
+ statistic,
divideIn);
jumpsRjFatigueGraph.Do(preferences.fontType.ToString());
diff --git a/src/gui/cairo/jumpsRjFatigue.cs b/src/gui/cairo/jumpsRjFatigue.cs
index 4471dab1..0268ee3f 100644
--- a/src/gui/cairo/jumpsRjFatigue.cs
+++ b/src/gui/cairo/jumpsRjFatigue.cs
@@ -27,6 +27,8 @@ using Cairo;
public class JumpsRjFatigueGraph : CairoXY
{
+ private JumpsRjFatigue.Statistic statistic;
+
private int divideIn;
//constructor when there are no points
@@ -45,7 +47,7 @@ public class JumpsRjFatigueGraph : CairoXY
public JumpsRjFatigueGraph (
List<PointF> point_l, double slope, double intercept,
DrawingArea area, string title, string jumpType, string date,
- bool heights, int divideIn)
+ JumpsRjFatigue.Statistic statistic, int divideIn)
{
this.point_l = point_l;
this.slope = slope;
@@ -60,12 +62,18 @@ public class JumpsRjFatigueGraph : CairoXY
xVariable = countStr;
xUnits = "";
- if(heights) {
+ if(statistic == JumpsRjFatigue.Statistic.HEIGHTS)
+ {
yVariable = heightStr;
yUnits = "cm";
- } else {
+ } else if(statistic == JumpsRjFatigue.Statistic.Q)
+ {
yVariable = tfStr + "/" + tcStr;
yUnits = "";
+ } else //if(statistic == JumpsRjFatigue.Statistic.RSI)
+ {
+ yVariable = heightStr + "/" + tcStr;
+ yUnits = "m/s";
}
}
diff --git a/src/jump.cs b/src/jump.cs
index 5ab41274..b0d725c3 100644
--- a/src/jump.cs
+++ b/src/jump.cs
@@ -300,6 +300,27 @@ public class JumpRj : Jump
}
}
+ public List<double> RSIList
+ {
+ get {
+ List<double> l = new List<double>();
+ List<double> heightFull = HeightList;
+ string [] tcFull = TcString.Split(new char[] {'='});
+ if(heightFull.Count != tcFull.Length)
+ return l;
+
+ for(int i = 0; i < heightFull.Count ; i ++)
+ {
+ if(Util.IsNumber(Util.ChangeDecimalSeparator(tcFull[i]), true))
+ l.Add(
+ (heightFull[i] / 100.0) //cm to m
+ /
+
Convert.ToDouble(Util.ChangeDecimalSeparator(tcFull[i])) );
+ }
+ return l;
+ }
+ }
+
public string TcString
{
get { return tcString; }
diff --git a/src/jumpsRjFatigue.cs b/src/jumpsRjFatigue.cs
index e252af5e..d1568ddd 100644
--- a/src/jumpsRjFatigue.cs
+++ b/src/jumpsRjFatigue.cs
@@ -27,23 +27,24 @@ public class JumpsRjFatigue
{
private List<PointF> point_l;
LeastSquaresLine ls;
+ public enum Statistic { HEIGHTS, Q, RSI } //RSI is jump height (m)/ contact time (s)
//constructor
public JumpsRjFatigue()
{
}
- public void Calculate (int uniqueID, bool useHeights)
+ public void Calculate (int uniqueID, Statistic statistic)
{
//1 get data
JumpRj jumpRj = SqliteJumpRj.SelectJumpData (Constants.JumpRjTable, uniqueID, false);
//2 convert to list of PointF
- List<double> y_l;
- if(useHeights)
- y_l = jumpRj.HeightList;
- else
+ List<double> y_l = jumpRj.HeightList; //(statistic == Statistic.HEIGHTS)
+ if(statistic == Statistic.Q)
y_l = jumpRj.TvTcList;
+ else if(statistic == Statistic.RSI)
+ y_l = jumpRj.RSIList;
point_l = new List<PointF>();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]