[chronojump] Encoder analyze 1RM separated from cross variables
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder analyze 1RM separated from cross variables
- Date: Fri, 22 Jan 2016 19:38:34 +0000 (UTC)
commit df2ce13c32e988da61374c0dfa6f7efed0e7e269
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jan 22 20:36:18 2016 +0100
Encoder analyze 1RM separated from cross variables
glade/chronojump.glade | 137 +++++++++++++++++++--
images/encoder-analyze-1RM.png | Bin 0 -> 639 bytes
images/svg/icons.svg | 75 +++++++++--
src/Makefile.am | 1 +
src/constants.cs | 1 +
src/gui/chronojump.cs | 2 +
src/gui/encoder.cs | 270 ++++++++++++++++++++++++++--------------
7 files changed, 368 insertions(+), 118 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 631617d..583fcd3 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7928,6 +7928,9 @@ after time</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -9390,6 +9393,9 @@ after time</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -10493,6 +10499,9 @@ after time</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -17136,6 +17145,11 @@ on current Chronojump version.</property>
<property name="can_focus">False</property>
<property name="spacing">8</property>
<child>
+ <widget class="GtkHBox" id="hbox192">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
<widget class="GtkRadioButton"
id="radiobutton_encoder_analyze_powerbars">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -17155,7 +17169,7 @@ on current Chronojump version.</property>
</child>
</widget>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
@@ -17167,6 +17181,7 @@ on current Chronojump version.</property>
<property
name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip"
translatable="yes">Cross variables</property>
+ <property name="active">True</property>
<property name="draw_indicator">False</property>
<property
name="group">radiobutton_encoder_analyze_powerbars</property>
<signal name="toggled"
handler="on_radiobutton_encoder_analyze_cross_toggled" swapped="no"/>
@@ -17186,12 +17201,39 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
+ <widget class="GtkRadioButton"
id="radiobutton_encoder_analyze_1RM">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip"
translatable="yes">Cross variables</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">False</property>
+ <property
name="group">radiobutton_encoder_analyze_powerbars</property>
+ <signal name="toggled"
handler="on_radiobutton_encoder_analyze_1RM_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkImage"
id="image_encoder_analyze_1RM">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property
name="stock">gtk-missing-image</property>
+ <property name="icon-size">2</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkRadioButton"
id="radiobutton_encoder_analyze_side">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property
name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">Side
compare</property>
+ <property name="active">True</property>
<property name="draw_indicator">False</property>
<property
name="group">radiobutton_encoder_analyze_powerbars</property>
<signal name="toggled"
handler="on_radiobutton_encoder_analyze_side_toggled" swapped="no"/>
@@ -17207,7 +17249,7 @@ on current Chronojump version.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -17217,6 +17259,7 @@ on current Chronojump version.</property>
<property
name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip"
translatable="yes">Single repetition</property>
+ <property name="active">True</property>
<property name="draw_indicator">False</property>
<property
name="group">radiobutton_encoder_analyze_powerbars</property>
<signal name="toggled"
handler="on_radiobutton_encoder_analyze_single_toggled" swapped="no"/>
@@ -17232,7 +17275,7 @@ on current Chronojump version.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -17242,6 +17285,7 @@ on current Chronojump version.</property>
<property
name="receives_default">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip"
translatable="yes">Neuromuscular profile</property>
+ <property name="active">True</property>
<property name="draw_indicator">False</property>
<property
name="group">radiobutton_encoder_analyze_powerbars</property>
<signal name="toggled"
handler="on_radiobutton_encoder_analyze_neuromuscular_profile_toggled" swapped="no"/>
@@ -17257,7 +17301,14 @@ on current Chronojump version.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
@@ -17460,6 +17511,19 @@ on current Chronojump version.</property>
</packing>
</child>
<child>
+ <widget class="GtkHBox"
id="hbox_combo_encoder_analyze_1RM">
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkVSeparator" id="vseparator3">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -17467,7 +17531,7 @@ on current Chronojump version.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">7</property>
+ <property name="position">8</property>
</packing>
</child>
<child>
@@ -17642,14 +17706,14 @@ on current Chronojump version.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">8</property>
+ <property name="position">9</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -17762,7 +17826,7 @@ on current Chronojump version.</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
- <property name="position">6</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
@@ -22210,6 +22274,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -23212,6 +23279,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -24706,6 +24776,9 @@ by you</property>
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkButton" id="button_video_url">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -25257,6 +25330,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -37171,6 +37247,24 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -39142,6 +39236,18 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -40440,9 +40546,6 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<placeholder/>
</child>
<child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkLabel" id="label218">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -41444,6 +41547,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -45218,6 +45324,9 @@ It starts before and arrives there with some speed.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -45884,6 +45993,9 @@ It starts before and arrives there with some speed.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -46565,6 +46677,9 @@ It starts before and arrives there with some speed.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/images/encoder-analyze-1RM.png b/images/encoder-analyze-1RM.png
new file mode 100644
index 0000000..eff01bc
Binary files /dev/null and b/images/encoder-analyze-1RM.png differ
diff --git a/images/svg/icons.svg b/images/svg/icons.svg
index 1513f18..28958be 100644
--- a/images/svg/icons.svg
+++ b/images/svg/icons.svg
@@ -14,7 +14,7 @@
height="342.32059"
id="svg2"
version="1.1"
- inkscape:version="0.48.4 r9939"
+ inkscape:version="0.48.5 r10040"
sodipodi:docname="icons.svg"
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/together.png"
inkscape:export-xdpi="90"
@@ -5337,16 +5337,16 @@
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
- inkscape:zoom="5.7830226"
- inkscape:cx="226.85353"
- inkscape:cy="275.5274"
+ inkscape:zoom="1.5102801"
+ inkscape:cx="145.14997"
+ inkscape:cy="173.14667"
inkscape:document-units="px"
inkscape:current-layer="capa1"
showgrid="false"
inkscape:window-width="1366"
- inkscape:window-height="714"
+ inkscape:window-height="702"
inkscape:window-x="0"
- inkscape:window-y="25"
+ inkscape:window-y="27"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
@@ -5408,7 +5408,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -5464,7 +5464,7 @@
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/encoder-analyze-powerbars.png"
inkscape:export-xdpi="89.989998"
inkscape:export-ydpi="89.989998"
- transform="translate(0,-13.226589)">
+ transform="translate(-30,-13.226589)">
<rect
y="1003.4709"
x="-58.672874"
@@ -5559,25 +5559,25 @@
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
- x="-61.635895"
+ x="-97.635895"
y="978.15656"
id="text3938-3-5"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3940-6-4"
- x="-61.635895"
+ x="-97.635895"
y="978.15656"
style="font-size:2px">encoder-analyze-powerbars.png</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
- x="-42.645142"
+ x="-70.645142"
y="981.80341"
id="text3938-3-5-7"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3940-6-4-1"
- x="-42.645142"
+ x="-70.645142"
y="981.80341"
style="font-size:2px">encoder-analyze-cross.png</tspan></text>
<text
@@ -5621,7 +5621,7 @@
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/encoder-analyze-side.png"
inkscape:export-xdpi="89.989998"
inkscape:export-ydpi="89.989998"
- transform="translate(0,-13.72549)">
+ transform="translate(1.663137,-15.738761)">
<rect
y="1003.9698"
x="-10.833775"
@@ -5894,7 +5894,7 @@
inkscape:export-filename="/home/xavier/informatica/progs_meus/chronojump/chronojump/images/encoder-analyze-cross.png"
inkscape:export-xdpi="89.989998"
inkscape:export-ydpi="89.989998"
- transform="translate(6.5575725,-13.143517)">
+ transform="translate(-29.442427,-13.143517)">
<rect
y="1003.9698"
x="-35.875648"
@@ -8427,5 +8427,52 @@
sodipodi:nodetypes="ccc" />
</g>
</g>
+ <g
+ id="g5441"
+ transform="translate(45.514245,23.458884)">
+ <rect
+ y="964.81171"
+ x="-83.72406"
+ height="16"
+ width="16"
+ id="rect2985-7-4"
+ style="fill:none;stroke:none" />
+ <text
+ sodipodi:linespacing="125%"
+ id="text4179-0-0-60-0"
+ y="973.81305"
+ x="-79.852623"
+
style="font-size:7.04184055px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.70263833;stroke-linecap:butt;stroke-miterlimit:100;stroke-opacity:1;stroke-dasharray:none;font-family:Sans"
+ xml:space="preserve"><tspan
+
style="font-size:11.16211224px;font-weight:bold;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.70263833;stroke-linecap:butt;stroke-miterlimit:100;stroke-opacity:1;stroke-dasharray:none;-inkscape-font-specification:Sans
Bold"
+ y="973.81305"
+ x="-79.852623"
+ id="tspan4181-7-7-6-1"
+ sodipodi:role="line">1</tspan></text>
+ <text
+ sodipodi:linespacing="125%"
+ id="text4179-0-0-6-6-2-5"
+ y="980.05963"
+ x="-81.655014"
+
style="font-size:9.29928875px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.33619124;stroke-linecap:butt;stroke-miterlimit:100;stroke-opacity:1;stroke-dasharray:none;font-family:Sans"
+ xml:space="preserve"><tspan
+
style="font-size:6.72382355px;font-weight:bold;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.33619124;stroke-linecap:butt;stroke-miterlimit:100;stroke-opacity:1;stroke-dasharray:none;-inkscape-font-specification:Sans
Bold"
+ y="980.05963"
+ x="-81.655014"
+ id="tspan4181-7-7-4-8-8-7"
+ sodipodi:role="line">RM</tspan></text>
+ </g>
+ <text
+ xml:space="preserve"
+
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+ x="-42.132053"
+ y="981.16022"
+ id="text3938-3-5-7-2"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3940-6-4-1-8"
+ x="-42.132053"
+ y="981.16022"
+ style="font-size:2px">encoder-analyze-1RM.png</tspan></text>
</g>
</svg>
diff --git a/src/Makefile.am b/src/Makefile.am
index 1a37302..8e0e3d1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -306,6 +306,7 @@ RESOURCES = \
../images/encoder-analyze-saved-curves.png,encoder-analyze-saved-curves.png \
../images/encoder-analyze-powerbars.png,encoder-analyze-powerbars.png \
../images/encoder-analyze-cross.png,encoder-analyze-cross.png \
+ ../images/encoder-analyze-1RM.png,encoder-analyze-1RM.png \
../images/encoder-analyze-side.png,encoder-analyze-side.png \
../images/encoder-analyze-single.png,encoder-analyze-single.png \
../images/encoder-analyze-nmp.png,encoder-analyze-nmp.png \
diff --git a/src/constants.cs b/src/constants.cs
index 9b75183..771f092 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -413,6 +413,7 @@ public class Constants
public static string FileNameEncoderAnalyzePowerbarsIcon = "encoder-analyze-powerbars.png";
public static string FileNameEncoderAnalyzeCrossIcon = "encoder-analyze-cross.png";
+ public static string FileNameEncoderAnalyze1RMIcon = "encoder-analyze-1RM.png";
public static string FileNameEncoderAnalyzeSideIcon = "encoder-analyze-side.png";
public static string FileNameEncoderAnalyzeSingleIcon = "encoder-analyze-single.png";
public static string FileNameEncoderAnalyzeNmpIcon = "encoder-analyze-nmp.png";
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 6261729..7d7cccb 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -788,6 +788,8 @@ public partial class ChronoJumpWindow
image_encoder_analyze_powerbars.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderAnalyzeCrossIcon);
image_encoder_analyze_cross.Pixbuf = pixbuf;
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderAnalyze1RMIcon);
+ image_encoder_analyze_1RM.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderAnalyzeSideIcon);
image_encoder_analyze_side.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderAnalyzeSingleIcon);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index f23de02..20c72b9 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -112,6 +112,9 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Box hbox_combo_encoder_analyze_cross;
[Widget] Gtk.ComboBox combo_encoder_analyze_cross;
+ [Widget] Gtk.Box hbox_combo_encoder_analyze_1RM;
+ [Widget] Gtk.ComboBox combo_encoder_analyze_1RM;
+
[Widget] Gtk.Box hbox_encoder_analyze_show_powerbars;
[Widget] Gtk.CheckButton check_encoder_analyze_show_time_to_peak_power;
[Widget] Gtk.CheckButton check_encoder_analyze_show_range;
@@ -144,11 +147,13 @@ public partial class ChronoJumpWindow
[Widget] Gtk.RadioButton radiobutton_encoder_analyze_powerbars;
[Widget] Gtk.RadioButton radiobutton_encoder_analyze_cross;
+ [Widget] Gtk.RadioButton radiobutton_encoder_analyze_1RM;
[Widget] Gtk.RadioButton radiobutton_encoder_analyze_single;
[Widget] Gtk.RadioButton radiobutton_encoder_analyze_side;
[Widget] Gtk.RadioButton radiobutton_encoder_analyze_neuromuscular_profile;
[Widget] Gtk.Image image_encoder_analyze_powerbars;
[Widget] Gtk.Image image_encoder_analyze_cross;
+ [Widget] Gtk.Image image_encoder_analyze_1RM;
[Widget] Gtk.Image image_encoder_analyze_side;
[Widget] Gtk.Image image_encoder_analyze_single;
[Widget] Gtk.Image image_encoder_analyze_nmp;
@@ -2121,65 +2126,81 @@ public partial class ChronoJumpWindow
return;
}
- //check on unsupported graph
- string crossNameTemp =
- Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
+ //cannot do inter/intra person with some cross graphs
+ if(encoderAnalysis == "cross")
+ {
+ string nameTemp =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
encoderAnalyzeCrossTranslation);
- //cannot do inter/intra person with some cross graphs
-
if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_data_compare),
- encoderDataCompareTranslation) != "No compare" &&
- encoderAnalysis == "cross" &&
- (
- crossNameTemp == "Speed,Power / Load" ||
- crossNameTemp == Catalog.GetString("Speed,Power / Load") ||
- crossNameTemp == "1RM Any exercise" ||
- crossNameTemp == Catalog.GetString("1RM Any exercise") ||
- crossNameTemp == "1RM Bench Press" ||
- crossNameTemp == Catalog.GetString("1RM Bench Press")
- //no 1RM Indirect because cannot be done with saved curves
- )) {
- new DialogMessage(Constants.MessageTypes.WARNING,
- Catalog.GetString("Sorry, this graph is not supported yet.") +
- "\n\nSaved repetitions - compare - cross variables" +
- "\n- Speed,Power / Load" +
- "\n- 1RM Any exercise" +
- "\n- 1RM Bench Press"
- //no 1RM Indirect because cannot be done with saved curves
- );
+
if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_data_compare),
+ encoderDataCompareTranslation) != "No compare" &&
+ (
+ nameTemp == "Speed,Power / Load" ||
+ nameTemp == Catalog.GetString("Speed,Power / Load")
+ )) {
+ new DialogMessage(Constants.MessageTypes.WARNING,
+ Catalog.GetString("Sorry, this graph is not supported
yet.") +
+ "\n\nSaved repetitions - compare - cross variables" +
+ "\n- Speed,Power / Load"
+ );
- return;
+ return;
+ }
}
-
- //cannot do 1RM with different exercises
- if(encoderAnalysis == "cross" && (
- crossNameTemp == "1RM Any exercise" ||
- crossNameTemp == Catalog.GetString("1RM Any exercise") ||
- crossNameTemp == "1RM Bench Press" ||
- crossNameTemp == Catalog.GetString("1RM Bench Press")
- //no 1RM Indirect because cannot be done with saved curves
- ))
+
+ //cannot do inter/intra person with some 1RM graphs
+ if(encoderAnalysis == "1RM")
{
- bool differentExercises = false;
- string oldExName = "";
- foreach(EncoderSQL eSQL in data)
- {
- if(eSQL.status == "inactive")
- continue;
+ string nameTemp =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation);
- string exName = eSQL.exerciseName;
- if(oldExName != "" && exName != oldExName)
- differentExercises = true;
- oldExName = exName;
- }
- if(differentExercises) {
+
if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_data_compare),
+ encoderDataCompareTranslation) != "No compare" &&
+ (
+ nameTemp == "1RM Any exercise" ||
+ nameTemp == Catalog.GetString("1RM Any exercise") ||
+ nameTemp == "1RM Bench Press" ||
+ nameTemp == Catalog.GetString("1RM Bench Press")
+ //no 1RM Indirect because cannot be done with saved curves
+ )) {
new DialogMessage(Constants.MessageTypes.WARNING,
- Catalog.GetString("Sorry, cannot calculate 1RM of
different exercises.") + "\n" +
- Catalog.GetString("Please select repetitions of only
one exercise type."));
+ Catalog.GetString("Sorry, this graph is not supported
yet.") +
+ "\n- 1RM Any exercise" +
+ "\n- 1RM Bench Press"
+ //no 1RM Indirect because cannot be done with saved
curves
+ );
+
return;
}
- }
+
+ //cannot do 1RM with different exercises
+ if(
+ nameTemp == "1RM Any exercise" ||
+ nameTemp == Catalog.GetString("1RM Any exercise") ||
+ nameTemp == "1RM Bench Press" ||
+ nameTemp == Catalog.GetString("1RM Bench Press")
+ //no 1RM Indirect because cannot be done with saved curves
+ ) {
+ bool differentExercises = false;
+ string oldExName = "";
+ foreach(EncoderSQL eSQL in data)
+ {
+ if(eSQL.status == "inactive")
+ continue;
+ string exName = eSQL.exerciseName;
+ if(oldExName != "" && exName != oldExName)
+ differentExercises = true;
+ oldExName = exName;
+ }
+ if(differentExercises) {
+ new DialogMessage(Constants.MessageTypes.WARNING,
+ Catalog.GetString("Sorry, cannot calculate
1RM of different exercises.") + "\n" +
+ Catalog.GetString("Please select repetitions
of only one exercise type."));
+ return;
+ }
+ }
+ }
}
button_encoder_analyze.Visible = false;
@@ -2673,8 +2694,9 @@ public partial class ChronoJumpWindow
string analysisOptions = getEncoderAnalysisOptions();
//use this send because we change it to send it to R
- //but we don't want to change encoderAnalysis because we want to know again if == "cross"
- //encoderAnalysis can be "cross" and sendAnalysis be "1RMBadillo1010"
+ //but we don't want to change encoderAnalysis because we want to know again if == "cross" (or
"1RM")
+ //encoderAnalysis can be "cross" and sendAnalysis be "Speed / Load"
+ //encoderAnalysis can be "1RM" and sendAnalysis be "1RMBadillo1010"
string sendAnalysis = encoderAnalysis;
//see doProcess at encoder/graph.R
@@ -2685,11 +2707,7 @@ public partial class ChronoJumpWindow
crossName =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
encoderAnalyzeCrossTranslation);
- //(crossName == "1RM Any exercise") done below different for curve and signal
- if(crossName == "1RM Bench Press") {
- sendAnalysis = "1RMBadillo2010";
- analysisOptions = "p";
- } else if(
+ if(
crossName == "Speed / Load" || crossName == "Force / Load" ||
crossName == "Power / Load" || crossName == "Speed,Power / Load" ||
crossName == "Force / Speed" || crossName == "Power / Speed")
@@ -2704,6 +2722,18 @@ public partial class ChronoJumpWindow
}
}
+ string my1RMName = "";
+ if(sendAnalysis == "1RM") {
+ my1RMName =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation);
+
+ //(my1RMName == "1RM Any exercise") done below different for curve and signal
+ if(my1RMName == "1RM Bench Press") {
+ sendAnalysis = "1RMBadillo2010";
+ analysisOptions = "p";
+ }
+ }
+
if(sendAnalysis == "powerBars" || sendAnalysis == "single" || sendAnalysis == "side")
analysisVariables = getAnalysisVariables(sendAnalysis);
@@ -2780,8 +2810,8 @@ public partial class ChronoJumpWindow
//cannot be curves of different exercises
//because is 1RM of a person on an exercise
//this is checked at: "on_button_encoder_analyze_clicked()"
- if(encoderAnalysis == "cross" &&
- (crossName == "1RM Bench Press" || crossName == "1RM Any exercise") )
+ if(encoderAnalysis == "1RM" &&
+ (my1RMName == "1RM Bench Press" || my1RMName == "1RM Any exercise") )
{
//get exercise ID
int exID = -1;
@@ -2792,7 +2822,7 @@ public partial class ChronoJumpWindow
}
}
- if(crossName == "1RM Any exercise") {
+ if(my1RMName == "1RM Any exercise") {
//get speed1RM (from exercise of curve on SQL, not from combo)
EncoderExercise exTemp = (EncoderExercise)
SqliteEncoder.SelectEncoderExercises(
false , exID, false)[0];
@@ -2915,8 +2945,8 @@ public partial class ChronoJumpWindow
Sqlite.Close();
} else { //current signal
- if(encoderAnalysis == "cross") {
- if(crossName == "1RM Any exercise") {
+ if(encoderAnalysis == "1RM") {
+ if(my1RMName == "1RM Any exercise") {
//get speed1RM (from combo)
EncoderExercise ex = (EncoderExercise)
SqliteEncoder.SelectEncoderExercises(
false, getExerciseIDFromCombo(), false)[0];
@@ -2926,7 +2956,7 @@ public partial class ChronoJumpWindow
SqlitePreferences.Select("encoder1RMMethod");
analysisOptions = "p";
}
- else if(crossName == "1RM Indirect") {
+ else if(my1RMName == "1RM Indirect") {
sendAnalysis = "1RMIndirect";
}
}
@@ -3090,6 +3120,7 @@ public partial class ChronoJumpWindow
hbox_encoder_analyze_curve_num.Visible=true;
hbox_combo_encoder_analyze_curve_num_combo.Visible = true;
hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=false;
hbox_encoder_analyze_show_powerbars.Visible=false;
hbox_encoder_analyze_show_SAFE.Visible=true;
@@ -3114,6 +3145,7 @@ public partial class ChronoJumpWindow
hbox_encoder_analyze_curve_num.Visible=true;
hbox_combo_encoder_analyze_curve_num_combo.Visible = true;
hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=false;
hbox_encoder_analyze_show_powerbars.Visible=false;
hbox_encoder_analyze_show_SAFE.Visible=true;
@@ -3135,6 +3167,7 @@ public partial class ChronoJumpWindow
hbox_encoder_analyze_curve_num.Visible=false;
hbox_combo_encoder_analyze_curve_num_combo.Visible = false;
hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=false;
hbox_encoder_analyze_show_powerbars.Visible=false;
hbox_encoder_analyze_show_SAFE.Visible=true;
@@ -3156,6 +3189,7 @@ public partial class ChronoJumpWindow
hbox_encoder_analyze_curve_num.Visible=false;
hbox_combo_encoder_analyze_curve_num_combo.Visible = false;
hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=false;
hbox_encoder_analyze_show_powerbars.Visible=true;
hbox_encoder_analyze_show_SAFE.Visible=false;
@@ -3178,6 +3212,7 @@ public partial class ChronoJumpWindow
hbox_encoder_analyze_curve_num.Visible=false;
hbox_combo_encoder_analyze_curve_num_combo.Visible = false;
hbox_combo_encoder_analyze_cross.Visible=true;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=true;
hbox_encoder_analyze_show_powerbars.Visible=false;
hbox_encoder_analyze_show_SAFE.Visible=false;
@@ -3196,10 +3231,34 @@ public partial class ChronoJumpWindow
button_encoder_analyze_sensitiveness();
}
+ private void on_radiobutton_encoder_analyze_1RM_toggled (object obj, EventArgs args) {
+ hbox_encoder_analyze_curve_num.Visible=false;
+ hbox_combo_encoder_analyze_curve_num_combo.Visible = false;
+ hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=true;
+ check_encoder_analyze_mean_or_max.Visible=true;
+ hbox_encoder_analyze_show_powerbars.Visible=false;
+ hbox_encoder_analyze_show_SAFE.Visible=false;
+ encoderAnalysis="1RM";
+
+ check_encoder_analyze_eccon_together.Sensitive=true;
+
+ //block_check_encoder_analyze_eccon_together_if_needed();
+ //done here:
+ on_combo_encoder_analyze_1RM_changed (obj, args);
+
+ button_encoder_analyze_help.Visible = false;
+ label_encoder_analyze_side_max.Visible = false;
+
+ encoderButtonsSensitive(encoderSensEnumStored);
+ button_encoder_analyze_sensitiveness();
+ }
+
private void on_radiobutton_encoder_analyze_neuromuscular_profile_toggled (object obj, EventArgs
args) {
hbox_encoder_analyze_curve_num.Visible=false;
hbox_combo_encoder_analyze_curve_num_combo.Visible = false;
hbox_combo_encoder_analyze_cross.Visible=false;
+ hbox_combo_encoder_analyze_1RM.Visible=false;
check_encoder_analyze_mean_or_max.Visible=false;
hbox_encoder_analyze_show_powerbars.Visible=false;
hbox_encoder_analyze_show_SAFE.Visible=false;
@@ -3330,8 +3389,10 @@ public partial class ChronoJumpWindow
string [] encoderLateralityTranslation;
string [] encoderDataCompareTranslation;
string [] encoderAnalyzeCrossTranslation;
+ string [] encoderAnalyze1RMTranslation;
protected void createEncoderCombos() {
+LogB.Information("1");
//create combo exercises
combo_encoder_exercise = ComboBox.NewText ();
createEncoderComboExercise();
@@ -3401,19 +3462,18 @@ public partial class ChronoJumpWindow
new EventHandler(on_combo_encoder_analyze_data_compare_changed );
+LogB.Information("2");
//create combo analyze cross (variables)
string [] comboAnalyzeCrossOptions = {
- "Power / Load", "Speed / Load", "Force / Load", "Speed,Power / Load", "Force /
Speed", "Power / Speed",
- "1RM Any exercise", "1RM Bench Press", "1RM Indirect"};
+ "Power / Load", "Speed / Load", "Force / Load", "Speed,Power / Load", "Force /
Speed", "Power / Speed"
+ };
string [] comboAnalyzeCrossOptionsTranslated = {
Catalog.GetString("Power / Load"), Catalog.GetString("Speed / Load"),
Catalog.GetString("Force / Load"), Catalog.GetString("Speed,Power / Load"),
- Catalog.GetString("Force / Speed"), Catalog.GetString("Power / Speed"),
- Catalog.GetString("1RM Any exercise"), Catalog.GetString("1RM Bench Press"),
- Catalog.GetString("1RM Indirect")
+ Catalog.GetString("Force / Speed"), Catalog.GetString("Power / Speed")
}; //if added more, change the int in the 'for' below
encoderAnalyzeCrossTranslation = new String [comboAnalyzeCrossOptions.Length];
- for(int j=0; j < 9 ; j++)
+ for(int j=0; j < 6 ; j++)
encoderAnalyzeCrossTranslation[j] =
comboAnalyzeCrossOptions[j] + ":" + comboAnalyzeCrossOptionsTranslated[j];
combo_encoder_analyze_cross = ComboBox.NewText ();
@@ -3422,6 +3482,26 @@ public partial class ChronoJumpWindow
Catalog.GetString(comboAnalyzeCrossOptions[0]));
combo_encoder_analyze_cross.Changed += new EventHandler
(on_combo_encoder_analyze_cross_changed);
+
+LogB.Information("3");
+ //create combo analyze 1RM
+ string [] comboAnalyze1RMOptions = { "1RM Any exercise", "1RM Bench Press", "1RM Indirect" };
+ string [] comboAnalyze1RMOptionsTranslated = {
+ Catalog.GetString("1RM Any exercise"), Catalog.GetString("1RM Bench Press"),
+ Catalog.GetString("1RM Indirect")
+ }; //if added more, change the int in the 'for' below
+ encoderAnalyze1RMTranslation = new String [comboAnalyze1RMOptions.Length];
+ for(int j=0; j < 3 ; j++)
+ encoderAnalyze1RMTranslation[j] =
+ comboAnalyze1RMOptions[j] + ":" + comboAnalyze1RMOptionsTranslated[j];
+ combo_encoder_analyze_1RM = ComboBox.NewText ();
+ UtilGtk.ComboUpdate(combo_encoder_analyze_1RM, comboAnalyze1RMOptionsTranslated, "");
+ combo_encoder_analyze_1RM.Active = UtilGtk.ComboMakeActive(combo_encoder_analyze_1RM,
+ Catalog.GetString(comboAnalyze1RMOptions[0]));
+ combo_encoder_analyze_1RM.Changed += new EventHandler (on_combo_encoder_analyze_1RM_changed);
+
+
+LogB.Information("4");
//create combo analyze curve num combo
//is not an spinbutton because values can be separated: "3,4,7,21"
combo_encoder_analyze_curve_num_combo = ComboBox.NewText ();
@@ -3455,10 +3535,16 @@ public partial class ChronoJumpWindow
combo_encoder_analyze_cross.Sensitive = true;
hbox_combo_encoder_analyze_cross.Visible = false; //do not show hbox at start
+ hbox_combo_encoder_analyze_1RM.PackStart(combo_encoder_analyze_1RM, true, true, 0);
+ hbox_combo_encoder_analyze_1RM.ShowAll();
+ combo_encoder_analyze_1RM.Sensitive = true;
+ hbox_combo_encoder_analyze_1RM.Visible = false; //do not show hbox at start
+
hbox_combo_encoder_analyze_curve_num_combo.PackStart(combo_encoder_analyze_curve_num_combo,
true, true, 0);
hbox_combo_encoder_analyze_curve_num_combo.ShowAll();
combo_encoder_analyze_curve_num_combo.Sensitive = true;
hbox_combo_encoder_analyze_curve_num_combo.Visible = false; //do not show hbox at start
+LogB.Information("5");
}
//this is called also when an exercise is deleted to update the combo and the string []
@@ -3512,6 +3598,7 @@ public partial class ChronoJumpWindow
radiobutton_encoder_analyze_single.Sensitive = false;
radiobutton_encoder_analyze_side.Sensitive = false;
radiobutton_encoder_analyze_cross.Active = true;
+ radiobutton_encoder_analyze_1RM.Active = true;
button_encoder_analyze_data_compare.Visible = true;
//put some data just in case user doesn't click on compare button
@@ -3529,26 +3616,23 @@ public partial class ChronoJumpWindow
void on_combo_encoder_analyze_cross_changed (object o, EventArgs args)
{
- if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation) == "1RM Bench Press" ||
- Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation) == "1RM Any exercise" ||
- Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation) == "1RM Indirect" )
- {
- check_encoder_analyze_mean_or_max.Active = true;
- check_encoder_analyze_mean_or_max.Sensitive = false;
- check_encoder_analyze_eccon_together.Active = false;
- check_encoder_analyze_eccon_together.Sensitive = false;
- } else {
- check_encoder_analyze_mean_or_max.Sensitive = true;
- check_encoder_analyze_eccon_together.Sensitive = true;
- block_check_encoder_analyze_eccon_together_if_needed();
- }
+ check_encoder_analyze_mean_or_max.Sensitive = true;
+ check_encoder_analyze_eccon_together.Sensitive = true;
+ block_check_encoder_analyze_eccon_together_if_needed();
+
+ button_encoder_analyze_sensitiveness();
+ }
+
+ void on_combo_encoder_analyze_1RM_changed (object o, EventArgs args)
+ {
+ check_encoder_analyze_mean_or_max.Active = true;
+ check_encoder_analyze_mean_or_max.Sensitive = false;
+ check_encoder_analyze_eccon_together.Active = false;
+ check_encoder_analyze_eccon_together.Sensitive = false;
//1RM Indirect can only be used with current signal
- if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation) == "1RM Indirect" &&
+ if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation) == "1RM Indirect" &&
! check_encoder_analyze_signal_or_curves.Active) { //saved curves
button_encoder_analyze.Sensitive = false;
new DialogMessage(Constants.MessageTypes.WARNING,
@@ -4135,9 +4219,9 @@ public partial class ChronoJumpWindow
//1RM Indirect only works on current set
if(
- radiobutton_encoder_analyze_cross.Active &&
-
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation) == "1RM Indirect")
+ radiobutton_encoder_analyze_1RM.Active &&
+
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation) == "1RM Indirect")
analyze_sensitive = false;
}
button_encoder_analyze.Sensitive = analyze_sensitive;
@@ -5528,12 +5612,12 @@ public partial class ChronoJumpWindow
button_encoder_analyze_image_save.Sensitive = true;
button_encoder_analyze_table_save.Sensitive = true;
- string crossName =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
- encoderAnalyzeCrossTranslation);
+ string my1RMName =
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_cross),
+ encoderAnalyze1RMTranslation);
button_encoder_analyze_1RM_save.Sensitive =
(radiobutton_encoder_analyze_cross.Active &&
- (crossName == "1RM Bench Press" || crossName == "1RM Any exercise") );
- // || crossName == "1RM Indirect") );
+ (my1RMName == "1RM Bench Press" || my1RMName == "1RM Any exercise") );
+ // || my1RMName == "1RM Indirect") );
/*
* TODO: currently disabled because
* on_button_encoder_analyze_1RM_save_clicked () reads getExerciseNameFromTable()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]