[chronojump] Indirect 1RM can be saved
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Indirect 1RM can be saved
- Date: Mon, 6 Jun 2016 10:58:58 +0000 (UTC)
commit 8e7082e03b9581c67d55b53da5e3a6d5e655553b
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Jun 6 12:49:07 2016 +0200
Indirect 1RM can be saved
encoder/graph.R | 6 +++---
src/gui/encoder.cs | 40 ++++++++++++++++++++++++++--------------
src/gui/encoderTreeviews.cs | 6 ++++++
3 files changed, 35 insertions(+), 17 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 83c33a9..5dabc19 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -3226,10 +3226,10 @@ doProcess <- function(options)
if(op$Eccon != "c")
nrep = abs(nrep/2) #only concentric
- plotRMIndirect( RMIndirect(Q, nrep), Q, nrep )
+ temp <- RMIndirect(Q, nrep)
+ plotRMIndirect(temp, Q, nrep)
- #write this file to allow C# process finish
- write("", op$OutputData1)
+ write.csv(temp, op$OutputData1, quote=FALSE)
}
if(op$Analysis=="exportCSV") {
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index b10b428..4df923b 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -866,16 +866,10 @@ public partial class ChronoJumpWindow
encoderCaptureListStore = new Gtk.ListStore (typeof (EncoderCurve));
}
- private void treeviewEncoderAnalyzeRemoveColumns(bool curveOrNeuromuscular) {
+ private void treeviewEncoderAnalyzeRemoveColumns() {
Gtk.TreeViewColumn [] myColumns = treeview_encoder_analyze_curves.Columns;
foreach (Gtk.TreeViewColumn column in myColumns)
treeview_encoder_analyze_curves.RemoveColumn (column);
-
- //blank the encoderAnalyzeListStore
- if(curveOrNeuromuscular)
- encoderAnalyzeListStore = new Gtk.ListStore (typeof (EncoderCurve));
- else
- encoderAnalyzeListStore = new Gtk.ListStore (typeof (EncoderNeuromuscularData));
}
@@ -3265,12 +3259,23 @@ public partial class ChronoJumpWindow
new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Not enough
data."));
return;
}
-
//save it without the body weight
- double load1RMWithoutPerson = massWithoutPerson(load1RM,getExerciseNameFromTable());
+ string exerciseName = "";
+ int exerciseID = 0;
+ if(Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation) == "1RM Indirect")
+ {
+ exerciseName = UtilGtk.ComboGetActive(combo_encoder_exercise_capture);
+ exerciseID = getExerciseIDFromCombo (exerciseCombos.CAPTURE);
+ }
+ else {
+ exerciseName = getExerciseNameFromTable();
+ exerciseID = getExerciseIDFromTable();
+ }
+ double load1RMWithoutPerson = massWithoutPerson(load1RM, exerciseName);
SqliteEncoder.Insert1RM(false, currentPerson.UniqueID, currentSession.UniqueID,
- getExerciseIDFromTable(), load1RMWithoutPerson);
+ exerciseID, load1RMWithoutPerson);
string myString = Catalog.GetString("Saved.");
if(load1RM != load1RMWithoutPerson)
@@ -5405,10 +5410,18 @@ public partial class ChronoJumpWindow
string contents =
Util.ReadFile(UtilEncoder.GetEncoderAnalyzeTableTempFileName(), false);
if (contents != null && contents != "") {
if(radiobutton_encoder_analyze_neuromuscular_profile.Active) {
- treeviewEncoderAnalyzeRemoveColumns(false);
//neuromuscular
+ treeviewEncoderAnalyzeRemoveColumns();
+ encoderAnalyzeListStore = new Gtk.ListStore (typeof
(EncoderCurve));
createTreeViewEncoderAnalyzeNeuromuscular(contents);
+ } else if(
+ radiobutton_encoder_analyze_1RM.Active &&
+
Util.FindOnArray(':',1,0,UtilGtk.ComboGetActive(combo_encoder_analyze_1RM),
+ encoderAnalyze1RMTranslation) == "1RM
Indirect") {
+ treeviewEncoderAnalyzeRemoveColumns();
+ encoderAnalyzeListStore = new Gtk.ListStore (typeof
(List<double>));
} else {
- treeviewEncoderAnalyzeRemoveColumns(true); //curves
+ treeviewEncoderAnalyzeRemoveColumns();
+ encoderAnalyzeListStore = new Gtk.ListStore (typeof
(EncoderCurve));
createTreeViewEncoderAnalyze(contents);
}
}
@@ -5442,8 +5455,7 @@ public partial class ChronoJumpWindow
encoderAnalyze1RMTranslation);
button_encoder_analyze_1RM_save.Visible =
(radiobutton_encoder_analyze_1RM.Active &&
- (my1RMName == "1RM Bench Press" || my1RMName == "1RM Any exercise") );
- // || my1RMName == "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()
diff --git a/src/gui/encoderTreeviews.cs b/src/gui/encoderTreeviews.cs
index 68dcfed..09479e6 100644
--- a/src/gui/encoderTreeviews.cs
+++ b/src/gui/encoderTreeviews.cs
@@ -805,6 +805,12 @@ public partial class ChronoJumpWindow
return curvesCount;
}
+ private int createTreeViewEncoderAnalyzeEncoder1RM(string contents) {
+ //buscar o fer algun metode generic que serveixi per mes coses
+ //si pot ser d'una classe diferent a la de ChronojumpWindow
+
+ return -1;
+ }
/* start rendering capture and analyze cols */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]