[chronojump] jumpsAsymmetry implemented mean/max
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] jumpsAsymmetry implemented mean/max
- Date: Tue, 27 Sep 2022 12:42:22 +0000 (UTC)
commit 6b29592f340c37dbbcf7e2bbec44b4b0a2e5053a
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Sep 27 14:41:47 2022 +0200
jumpsAsymmetry implemented mean/max
glade/app1.glade | 80 +++++++++++++++++++++++++++++++------
src/gui/app1/jumpsAsymmetry.cs | 13 +++++-
src/gui/cairo/jumpsRunsEvolution.cs | 3 +-
src/jumpsAsymmetry.cs | 8 +++-
4 files changed, 88 insertions(+), 16 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 6cba60d8f..576e17971 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -21820,6 +21820,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -21827,6 +21830,50 @@ Concentric</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkVBox" id="vbox142">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_jumps_asymmetry_use_means">
+ <property name="label" translatable="yes">Daily
mean values</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_asymmetry_use_means_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_jumps_asymmetry_use_maximums">
+ <property name="label" translatable="yes">Daily
max values</property>
+ <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_asymmetry_use_means</property>
+ <signal name="toggled"
handler="on_radio_jumps_asymmetry_use_maximums_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </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>
@@ -27100,6 +27147,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -33899,18 +33949,6 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Tests
will be filmed</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkHBox"
id="hbox_video_encoder_capturing">
<property name="can_focus">False</property>
<property name="spacing">4</property>
@@ -33947,6 +33985,18 @@ Concentric</property>
</packing>
</child>
<child>
+ <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Tests
will be filmed</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox"
id="hbox_video_encoder_no_capturing">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -43418,6 +43468,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -51521,6 +51574,9 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/gui/app1/jumpsAsymmetry.cs b/src/gui/app1/jumpsAsymmetry.cs
index 73508a88b..600cf8f63 100644
--- a/src/gui/app1/jumpsAsymmetry.cs
+++ b/src/gui/app1/jumpsAsymmetry.cs
@@ -35,6 +35,8 @@ public partial class ChronoJumpWindow
[Widget] Gtk.RadioButton radio_jumps_asymmetry_bilateral;
[Widget] Gtk.RadioButton radio_jumps_asymmetry_asymmetry;
+ [Widget] Gtk.RadioButton radio_jumps_asymmetry_use_means;
+
[Widget] Gtk.HBox hbox_combo_select_jumps_asymmetry_bilateral;
[Widget] Gtk.ComboBox combo_select_jumps_asymmetry_bilateral;
[Widget] Gtk.HBox hbox_combo_select_jumps_asymmetry_1;
@@ -98,6 +100,15 @@ public partial class ChronoJumpWindow
jumpsAsymmetryDo (true);
}
+ private void on_radio_jumps_asymmetry_use_means_toggled (object o, EventArgs args)
+ {
+ jumpsAsymmetryDo (true);
+ }
+ private void on_radio_jumps_asymmetry_use_maximums_toggled (object o, EventArgs args)
+ {
+ jumpsAsymmetryDo (true);
+ }
+
private void on_combo_select_jumps_asymmetry_bilateral_changed (object o, EventArgs args)
{
jumpsAsymmetryDo (true);
@@ -137,7 +148,7 @@ public partial class ChronoJumpWindow
jumpsAsymmetry.Calculate (
currentPerson.UniqueID, currentSession.UniqueID,
radio_jumps_asymmetry_bilateral.Active,
- //TODO: max/avg
+ radio_jumps_asymmetry_use_means.Active,
jumpBilateral,
jumpAsymmetry1,
jumpAsymmetry2
diff --git a/src/gui/cairo/jumpsRunsEvolution.cs b/src/gui/cairo/jumpsRunsEvolution.cs
index 63cae6fd0..c45dd789b 100644
--- a/src/gui/cairo/jumpsRunsEvolution.cs
+++ b/src/gui/cairo/jumpsRunsEvolution.cs
@@ -321,7 +321,8 @@ public class JumpsAsymmetryGraph : EvolutionGraph //to inherit paintGridDatetime
} else
writeTextAtRight(ypos++, formula, false);
- writeTextAtRight(ypos++, date, false);
+ //better do not write the date as this graph is longitudinal
+ //writeTextAtRight(ypos++, date, false);
}
}
diff --git a/src/jumpsAsymmetry.cs b/src/jumpsAsymmetry.cs
index c9f2e6d6f..0f8cef212 100644
--- a/src/jumpsAsymmetry.cs
+++ b/src/jumpsAsymmetry.cs
@@ -32,7 +32,7 @@ public class JumpsAsymmetry
{
}
- public void Calculate (int personID, int sessionID, bool bilateral, //TODO: max,avg
+ public void Calculate (int personID, int sessionID, bool bilateral, bool means,
string jumpBilateralStr, string j1Str, string j2Str)
{
List<string> jumpTypes_l = new List<string> ();
@@ -41,8 +41,12 @@ public class JumpsAsymmetry
jumpTypes_l.Add (j1Str);
jumpTypes_l.Add (j2Str);
+ Sqlite.StatType stat = Sqlite.StatType.AVG;
+ if (! means)
+ stat = Sqlite.StatType.MAX;
+
//1 get data
- List<SqliteStruct.DateTypeResult> sdtr_l = SqliteJump.SelectJumpsStatsByDay (personID,
jumpTypes_l, Sqlite.StatType.MAX);
+ List<SqliteStruct.DateTypeResult> sdtr_l = SqliteJump.SelectJumpsStatsByDay (personID,
jumpTypes_l, stat);
point_l = new List<PointF> ();
dates_l = new List<DateTime> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]