[chronojump] Encoder table bigger. new encoder exercise table
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder table bigger. new encoder exercise table
- Date: Sat, 2 Jun 2012 00:31:18 +0000 (UTC)
commit cc9f7a7dd0e7595b08a59fbf16282c28879ff580
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jun 1 17:53:54 2012 +0200
Encoder table bigger. new encoder exercise table
diagrams/sqlite/chronojump_sqlite.dia | Bin 12855 -> 13178 bytes
diagrams/sqlite/chronojump_sqlite.png | Bin 157806 -> 170838 bytes
glade/chronojump.glade | 1 -
src/constants.cs | 1 +
src/gui/encoder.cs | 25 ++++++++---
src/sqlite/encoder.cs | 71 +++++++++++++++++++++++++++++---
src/sqlite/main.cs | 8 +++-
7 files changed, 89 insertions(+), 17 deletions(-)
---
diff --git a/diagrams/sqlite/chronojump_sqlite.dia b/diagrams/sqlite/chronojump_sqlite.dia
index 67fbcc9..4a723dc 100644
Binary files a/diagrams/sqlite/chronojump_sqlite.dia and b/diagrams/sqlite/chronojump_sqlite.dia differ
diff --git a/diagrams/sqlite/chronojump_sqlite.png b/diagrams/sqlite/chronojump_sqlite.png
index dc74e49..f2dc533 100644
Binary files a/diagrams/sqlite/chronojump_sqlite.png and b/diagrams/sqlite/chronojump_sqlite.png differ
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index b4c7887..05668c3 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -24862,7 +24862,6 @@ Evaluator can use real name or nickname.</property>
<child>
<widget class="GtkRadioButton" id="radiobutton_encoder_analyze_superpose">
<property name="label" translatable="yes">Superpose</property>
- <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
diff --git a/src/constants.cs b/src/constants.cs
index c3631c0..d949b1a 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -98,6 +98,7 @@ public class Constants
public const string MultiChronopicTable = "multiChronopic";
public const string TempMultiChronopicTable = "tempMultiChronopic"; //TODO
public const string EncoderTable = "encoder";
+ public const string EncoderExerciseTable = "encoderExercise";
//tests types
public const string JumpTypeTable = "jumpType";
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 8c70559..13254ce 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -47,6 +47,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_encoder_capture;
[Widget] Gtk.TreeView treeview_encoder_curves;
[Widget] Gtk.ProgressBar encoder_pulsebar_capture;
+ [Widget] Gtk.Label label_encoder_capture_comment;
[Widget] Gtk.Entry entry_encoder_capture_comment;
[Widget] Gtk.Button button_encoder_delete_curve;
[Widget] Gtk.Button button_encoder_save_curve;
@@ -89,6 +90,13 @@ public partial class ChronoJumpWindow
//TODO: auto close capturing window
+ //TODO: fixing powerbars problem, [false: sqlite.encoder curves don't store if it's "c" or "ec", then graph.R when doing the curves, don't do a row for the e and another for the c, because don't know in which curves have to differentiate], also don't plot names ok. This affects at multi and do it good in order to compare c and ec contractions of same person. change encoder table, adding "contraction", "exerciseID" (uniqueID of table encoderExercise), "laterality" (Right, Left, Both)
+ //
+ //
+ //TODO: Put person name in graph (at title,with small separation, or inside graph at topright) (if we click on another person on treeview person, we need to know wich person was last generated graph)
+ //TODO: if mode is ecc-con, curves used have to be eccon
+ //TODO: when change person: unsensitive: recalculate, capture graph, treeview capture, buttons caputre on bottom, analyze button
+
//TODO: put chronopic detection in a generic place. Done But:
//TODO: solve the problem of connecting two different chronopics
//
@@ -96,11 +104,8 @@ public partial class ChronoJumpWindow
//TODO:put zoom,unzoom (at side of delete curve) in capture curves (for every curve)
//TODO: treeview on analyze
//TODO: Add exercise. at capture add combobox of exercises or treeview that pop ups (maybe genericWin). squat, benchpress, jump. change weight bar, and jump radiobuttons to this combobox, addoption of others, and add them on sqlite
- //Any exercise should have: name of exercise, %body weight, ressistance (maquina, goma, res, inercial, ...),comment
- //
- //TODO: Add "lateralitat": Right, Left, Both;
+
//to analyze: user has to select: session, athlete, exercise,
- //TODO: an exericise like squat have to count body as 70% and be changeable by user,because some publications use the 100%
//TODO: single curve, and side, checkbox to show1 param, 2 or three
//TODO: powerbars with checkbox to show1 param, 2 or three
//TODO: on capture (quasi-realtime), show powerbars or curves or both
@@ -216,14 +221,14 @@ public partial class ChronoJumpWindow
string contents = Util.ReadFile(Util.GetEncoderCurvesTempFileName());
if (contents == null) {
//TODO: no data: make some of the gui unsensitive ??
- button_encoder_analyze.Sensitive = false;
+ sensitiveEncoderGlobalButtons(false);
} else {
removeColumns();
int curvesNum = createTreeViewEncoder(contents);
if(! radiobutton_encoder_concentric.Active)
curvesNum = curvesNum / 2;
spin_encoder_analyze_curve_num.SetRange(1,curvesNum);
- button_encoder_analyze.Sensitive = true;
+ sensitiveEncoderGlobalButtons(true);
}
}
@@ -994,10 +999,16 @@ public partial class ChronoJumpWindow
}
}
+ private void sensitiveEncoderGlobalButtons(bool sensitive) {
+ label_encoder_capture_comment.Sensitive = sensitive;
+ entry_encoder_capture_comment.Sensitive = sensitive;
+ button_encoder_save_stream.Sensitive = sensitive;
+ button_encoder_analyze.Sensitive = sensitive;
+ }
+
private void sensitiveEncoderRowButtons(bool sensitive) {
button_encoder_delete_curve.Sensitive = sensitive;
button_encoder_save_curve.Sensitive = sensitive;
- button_encoder_save_all_curves.Sensitive = sensitive;
}
/* end of TreeView stuff */
diff --git a/src/sqlite/encoder.cs b/src/sqlite/encoder.cs
index 1b8494c..fb91cfa 100644
--- a/src/sqlite/encoder.cs
+++ b/src/sqlite/encoder.cs
@@ -36,26 +36,30 @@ class SqliteEncoder : Sqlite
* create and initialize tables
*/
- protected internal static void createTable()
+ protected internal static void createTableEncoder()
{
dbcmd.CommandText =
"CREATE TABLE " + Constants.EncoderTable + " ( " +
"uniqueID INTEGER PRIMARY KEY, " +
"personID INT, " +
"sessionID INT, " +
- "name TEXT, " +
- "url TEXT, " +
- "type TEXT, " + //"streamBAR", "streamJUMP", "curveBAR", "curveJUMP"
- "extraWeight TEXT, " + //string because can contain "33%" or "50Kg"
+ "exerciseID INT, " +
"eccon TEXT, " + //"c" or "ec"
+ "laterality TEXT, " + //"left" "right" "both"
+ "extraWeight TEXT, " + //string because can contain "33%" or "50Kg"
+ "streamOrCurve TEXT, " + //"stream" or "curve", old: "streamBAR", "streamJUMP", "curveBAR", "curveJUMP"
+ "filename TEXT, " +
+ "url TEXT, " +
"time INT, " +
"minHeight INT, " +
"smooth FLOAT, " +
- "description TEXT )";
+ "description TEXT, " +
+ "future1 TEXT, " +
+ "future2 TEXT, " +
+ "future3 TEXT )";
dbcmd.ExecuteNonQuery();
}
-
/*
* Encoder class methods
*/
@@ -168,5 +172,58 @@ class SqliteEncoder : Sqlite
return array;
}
+
+ /*
+ * EncoderExercise stuff
+ */
+
+
+ //ressistance (weight bar, machine, goma, none, inertial, ...)
+ protected internal static void createTableEncoderExercise()
+ {
+ dbcmd.CommandText =
+ "CREATE TABLE " + Constants.EncoderExerciseTable + " ( " +
+ "uniqueID INTEGER PRIMARY KEY, " +
+ "name TEXT, " +
+ "percentBodyWeight INT, " +
+ "ressistance TEXT, " +
+ "description TEXT, " +
+ "future1 TEXT, " +
+ "future2 TEXT, " +
+ "future3 TEXT )";
+ dbcmd.ExecuteNonQuery();
+ }
+
+ public static void InsertExercise(bool dbconOpened, string name, int percentBodyWeight,
+ string ressistance, string description)
+ {
+ if(! dbconOpened)
+ dbcon.Open();
+ dbcmd.CommandText = "INSERT INTO " + Constants.EncoderExerciseTable +
+ " (uniqueID, name, percentBodyWeight, ressistance, description, future1, future2, future3)" +
+ " VALUES (NULL, '" + name + "', " + percentBodyWeight + ", '" +
+ ressistance + "', '" + description + "', '','','')";
+ Log.WriteLine(dbcmd.CommandText.ToString());
+ dbcmd.ExecuteNonQuery();
+
+ if(! dbconOpened)
+ dbcon.Close();
+ }
+
+ protected internal static void initializeTableEncoderExercise()
+ {
+ string [] iniEncoderExercises = {
+ //name:percentBodyWeight:ressistance:description
+ "Bench press:0:weight bar:",
+ "Squat:75:weight bar:",
+ "Jump:100:none:"
+ };
+
+ foreach(string line in iniEncoderExercises) {
+ string [] parts = line.Split(new char[] {':'});
+ InsertExercise(false,parts[0],Convert.ToInt32(parts[1]),parts[2],parts[3]);
+ }
+ }
+
}
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 6f5e4ed..abbd06e 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -1124,7 +1124,9 @@ class Sqlite
conversionRateTotal = 2;
conversionRate = 1;
- SqliteEncoder.createTable();
+ SqliteEncoder.createTableEncoder();
+ SqliteEncoder.createTableEncoderExercise();
+ SqliteEncoder.initializeTableEncoderExercise();
conversionRate = 2;
Log.WriteLine("Created encoder tables.");
@@ -1264,7 +1266,9 @@ class Sqlite
//encoder
creationRate ++;
- SqliteEncoder.createTable();
+ SqliteEncoder.createTableEncoder();
+ SqliteEncoder.createTableEncoderExercise();
+ SqliteEncoder.initializeTableEncoderExercise();
//sports
creationRate ++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]