[chronojump] JumpsRjFatigue can show tv/tc
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] JumpsRjFatigue can show tv/tc
- Date: Thu, 6 Aug 2020 12:55:00 +0000 (UTC)
commit b3b55a0d5b627cb862965916d5f243f962595913
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Aug 6 14:54:44 2020 +0200
JumpsRjFatigue can show tv/tc
glade/app1.glade | 64 +++++++++++++++++++++++++++++++++++++++---
src/gui/app1/jumpsRjFatigue.cs | 16 ++++++++++-
src/jumpsRjFatigue.cs | 9 ++++--
3 files changed, 82 insertions(+), 7 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 89d16a17..d4b67ea8 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -20362,29 +20362,64 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
+ <widget class="GtkLabel" id="label560">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Show</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkRadioButton"
id="radio_jumps_rj_fatigue_heights">
- <property name="label" translatable="yes">Show
height</property>
+ <property name="label"
translatable="yes">Height</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
+ <signal name="toggled"
handler="on_radio_jumps_rj_fatigue_heights_toggled" swapped="no"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton"
id="radio_jumps_rj_fatigue_tv-tc">
- <property name="label" translatable="yes">Show
flight time / contact time</property>
+ <widget class="GtkRadioButton"
id="radio_jumps_rj_fatigue_tv_tc">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="active">True</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_tv_tc_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkHBox" id="hbox48">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkLabel" id="label564">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Flight
time</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="label566">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">/</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -20392,6 +20427,27 @@ Concentric</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label565">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Contact time</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</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="expand">False</property>
diff --git a/src/gui/app1/jumpsRjFatigue.cs b/src/gui/app1/jumpsRjFatigue.cs
index 373e4b3a..ad5db046 100644
--- a/src/gui/app1/jumpsRjFatigue.cs
+++ b/src/gui/app1/jumpsRjFatigue.cs
@@ -34,6 +34,8 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_jumps_rj_fatigue_image_save;
[Widget] Gtk.HBox hbox_combo_select_jumps_rj_fatigue;
[Widget] Gtk.ComboBox combo_select_jumps_rj_fatigue;
+ [Widget] Gtk.RadioButton radio_jumps_rj_fatigue_heights;
+ [Widget] Gtk.RadioButton radio_jumps_rj_fatigue_tv_tc;
JumpsRjFatigue jumpsRjFatigue;
JumpsRjFatigueGraph jumpsRjFatigueGraph;
@@ -77,6 +79,17 @@ public partial class ChronoJumpWindow
}
// combo (end)
+ private void on_radio_jumps_rj_fatigue_heights_toggled (object o, EventArgs args)
+ {
+ if(radio_jumps_rj_fatigue_heights.Active)
+ jumpsRjFatigueDo(true);
+ }
+ private void on_radio_jumps_rj_fatigue_tv_tc_toggled (object o, EventArgs args)
+ {
+ if(radio_jumps_rj_fatigue_tv_tc.Active)
+ jumpsRjFatigueDo(true);
+ }
+
private void jumpsRjFatigueDo (bool calculateData)
{
if(currentPerson == null || currentSession == null ||
@@ -95,7 +108,8 @@ public partial class ChronoJumpWindow
string jumpType = "";
if(calculateData)
- jumpsRjFatigue.Calculate(currentSession.UniqueID, currentPerson.UniqueID, jumpType);
+ jumpsRjFatigue.Calculate(currentSession.UniqueID, currentPerson.UniqueID,
+ jumpType, radio_jumps_rj_fatigue_heights.Active);
if(jumpsRjFatigue.Point_l.Count == 0)
{
diff --git a/src/jumpsRjFatigue.cs b/src/jumpsRjFatigue.cs
index c9bceedc..4d590159 100644
--- a/src/jumpsRjFatigue.cs
+++ b/src/jumpsRjFatigue.cs
@@ -33,7 +33,7 @@ public class JumpsRjFatigue
{
}
- public void Calculate (int sessionID, int personID, string jumpType)
+ public void Calculate (int sessionID, int personID, string jumpType, bool useHeights)
{
//1 get data
List<JumpRj> jrj_l = SqliteJumpRj.SelectJumps (false, sessionID, personID, jumpType);
@@ -43,7 +43,12 @@ public class JumpsRjFatigue
int currentSession = -1;
foreach(JumpRj j in jrj_l)
{
- List<double> y_l = j.HeightList;
+ List<double> y_l;
+ if(useHeights)
+ y_l = j.HeightList;
+ else
+ y_l = j.TvTcList;
+
for(int i = 0; i < y_l.Count ; i ++)
point_l.Add(new PointF(
i+1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]