[chronojump/77] Fixed: 604325 UI suggested changes. Bugfixes
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/77] Fixed: 604325 UI suggested changes. Bugfixes
- Date: Wed, 3 Mar 2010 09:42:11 +0000 (UTC)
commit 1c125470e615af5985cc7c41f7f1c5b9e2891507
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Mar 3 17:40:12 2010 +0800
Fixed: 604325 UI suggested changes. Bugfixes
glade/chronojump.glade | 205 ++++++++++++++++++------
src/constants.cs | 2 +
src/execute/jump.cs | 10 +-
src/gui/chronojump.cs | 365 ++++++++++++++++++++++++------------------
src/gui/person.cs | 19 +--
src/gui/preferences.cs | 30 ++--
src/sqlite/jump.cs | 17 ++-
src/sqlite/jumpRj.cs | 17 ++-
src/sqlite/multiChronopic.cs | 12 +-
src/sqlite/personSession.cs | 19 +--
src/sqlite/pulse.cs | 25 +--
src/sqlite/reactionTime.cs | 25 +--
src/sqlite/run.cs | 14 +-
src/sqlite/runInterval.cs | 12 +-
src/sqlite/stat.cs | 122 ++++++++------
src/treeViewJump.cs | 1 -
16 files changed, 540 insertions(+), 355 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 84a74e4..acb371c 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -95,7 +95,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
- <widget class="GtkTextView" id="textview_desc">
+ <widget class="GtkTextView" id="textview_description">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
@@ -1844,54 +1844,167 @@
</child>
</widget>
<packing>
+ <property name="expand">False</property>
<property name="position">5</property>
</packing>
</child>
<child>
- <widget class="GtkCheckButton" id="checkbutton_height_preferred">
- <property name="label" translatable="yes">Prefer height over TF</property>
+ <widget class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">On statistics
+show elevation as:</property>
+ </widget>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Speed units:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Weight units:</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_elevation_height">
+ <property name="label" translatable="yes">Height (cm)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_elevation_tf">
+ <property name="label">TF (s)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_elevation_height</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_speed_ms">
+ <property name="label">m/s</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_speed_km">
+ <property name="label">Km/h</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_speed_ms</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_weight_percent">
+ <property name="label">%</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_weight_kg">
+ <property name="label">Kg</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_weight_percent</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="padding">2</property>
<property name="position">6</property>
</packing>
</child>
- <child>
- <widget class="GtkCheckButton" id="checkbutton_meters_seconds_preferred">
- <property name="label" translatable="yes">Prefer m/s over Km/h</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">7</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="checkbutton_percent_kg_preferred">
- <property name="label" translatable="yes">Prefer weight in % over Kg</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">8</property>
- </packing>
- </child>
</widget>
<packing>
<property name="position">1</property>
@@ -16842,7 +16955,7 @@ by you</property>
</widget>
</child>
<child>
- <widget class="GtkImageMenuItem" id="show_all_person_events">
+ <widget class="GtkImageMenuItem" id="menuitem_show_all_person_events">
<property name="label">_Show all tests of current person</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
@@ -16888,7 +17001,7 @@ by you</property>
<child>
<widget class="GtkMenu" id="menu_jumps_menu">
<child>
- <widget class="GtkMenuItem" id="execute_simple_jumps1">
+ <widget class="GtkMenuItem" id="menu_execute_simple_jumps1">
<property name="visible">True</property>
<property name="label" translatable="yes">Execute simple jump</property>
<property name="use_underline">True</property>
@@ -17024,7 +17137,7 @@ by you</property>
</widget>
</child>
<child>
- <widget class="GtkMenuItem" id="execute_repetitive_jumps1">
+ <widget class="GtkMenuItem" id="menu_execute_repetitive_jumps1">
<property name="visible">True</property>
<property name="label" translatable="yes">Execute reactive jump</property>
<property name="use_underline">True</property>
@@ -17093,12 +17206,12 @@ by you</property>
</widget>
</child>
<child>
- <widget class="GtkImageMenuItem" id="menuitem_repair_selected_reactive_jump">
+ <widget class="GtkImageMenuItem" id="menuitem_repair_selected_jump_rj">
<property name="label">Repair selected RJ jump</property>
<property name="visible">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
- <signal name="activate" handler="on_repair_selected_reactive_jump_clicked"/>
+ <signal name="activate" handler="on_repair_selected_jump_rj_clicked"/>
</widget>
</child>
<child>
@@ -17174,7 +17287,7 @@ by you</property>
<child>
<widget class="GtkMenu" id="menu_runs_menu">
<child>
- <widget class="GtkMenuItem" id="execute_simple_runs1">
+ <widget class="GtkMenuItem" id="menu_execute_simple_runs1">
<property name="visible">True</property>
<property name="label" translatable="yes">Execute simple run</property>
<property name="use_underline">True</property>
@@ -17323,7 +17436,7 @@ by you</property>
</widget>
</child>
<child>
- <widget class="GtkMenuItem" id="execute_intervalic_runs1">
+ <widget class="GtkMenuItem" id="menu_execute_intervallic_runs1">
<property name="visible">True</property>
<property name="label" translatable="yes">Execute intervallic runs</property>
<property name="use_underline">True</property>
@@ -18733,12 +18846,12 @@ by you</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="button_repair_selected_reactive_jump">
+ <widget class="GtkButton" id="button_repair_selected_jump_rj">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="tooltip" translatable="yes">Repair selected (r)</property>
- <signal name="clicked" handler="on_repair_selected_reactive_jump_clicked"/>
+ <signal name="clicked" handler="on_repair_selected_jump_rj_clicked"/>
<accelerator key="r" signal="clicked"/>
<child>
<widget class="GtkImage" id="image_jump_reactive_repair">
diff --git a/src/constants.cs b/src/constants.cs
index d1eaa32..0ee952a 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -384,6 +384,8 @@ public class Constants
};
public static int Simulated = -1;
+ public static string SimulatedMessage = Catalog.GetString("Tests are SIMULATED until Chronopic is connected at menu 'Tools / Chronopic'.");
+
//levels of sport practice
//int will go into person database
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index 87cf66f..1a9a540 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -373,7 +373,10 @@ Log.Write("wb ");
if(weight > 0) {
myStringPush = myStringPush + "(" + weight.ToString() + "%)";
}
- appbar.Push( 1,myStringPush );
+ if(simulated)
+ appbar.Push(1, Constants.SimulatedMessage);
+ else
+ appbar.Push( 1,myStringPush );
uniqueID = SqliteJump.Insert(false, Constants.JumpTable, "NULL", personID, sessionID,
type, tv, tc, fall, //type, tv, tc, fall
@@ -958,7 +961,10 @@ public class JumpRjExecute : JumpExecute
type + " (" + limitString + ") " +
" " + Catalog.GetString("AVG TF") + ": " + Util.TrimDecimals( Util.GetAverage (tvString).ToString(), pDN ) +
" " + Catalog.GetString("AVG TC") + ": " + Util.TrimDecimals( Util.GetAverage (tcString).ToString(), pDN ) ;
- appbar.Push( 1,myStringPush );
+ if(simulated)
+ appbar.Push(1, Constants.SimulatedMessage);
+ else
+ appbar.Push(1, myStringPush );
//event will be raised, and managed in chronojump.cs
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 326da71..06bcc62 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -57,42 +57,132 @@ public class ChronoJumpWindow
[Widget] Gtk.ComboBox combo_runs_interval;
[Widget] Gtk.ComboBox combo_pulses;
- [Widget] Gtk.MenuItem menuitem_server_upload_session;
+ //menus
+ [Widget] Gtk.MenuItem menu_persons;
+ [Widget] Gtk.MenuItem menu_jumps;
+ [Widget] Gtk.MenuItem menu_runs;
+ [Widget] Gtk.MenuItem menu_other;
+ [Widget] Gtk.MenuItem menu_tools;
+ //menu session
+ [Widget] Gtk.MenuItem menuitem_edit_session;
+ [Widget] Gtk.MenuItem menuitem_delete_session;
+ [Widget] Gtk.MenuItem menuitem_export_csv;
+ [Widget] Gtk.MenuItem menuitem_export_xml;
+
+ //menu person
+ [Widget] Gtk.MenuItem menuitem_person_add_single;
+ [Widget] Gtk.MenuItem menuitem_person_add_multiple;
+ [Widget] Gtk.MenuItem menuitem_recuperate_person;
+ [Widget] Gtk.MenuItem menuitem_recuperate_persons_from_session;
+ [Widget] Gtk.MenuItem menuitem_edit_current_person;
+ [Widget] Gtk.MenuItem menuitem_show_all_person_events;
+ [Widget] Gtk.MenuItem menuitem_delete_current_person_from_session;
+ [Widget] Gtk.Button button_edit_current_person;
+ [Widget] Gtk.Button button_show_all_person_events;
+
+ //tests
+ //jumps
+ [Widget] Gtk.MenuItem menu_execute_simple_jumps1;
[Widget] Gtk.MenuItem menuitem_edit_selected_jump;
[Widget] Gtk.MenuItem menuitem_delete_selected_jump;
- [Widget] Gtk.Button button_edit_selected_jump;
- [Widget] Gtk.Button button_delete_selected_jump;
+ [Widget] Gtk.MenuItem menu_execute_repetitive_jumps1;
[Widget] Gtk.MenuItem menuitem_edit_selected_jump_rj;
+ [Widget] Gtk.MenuItem menuitem_repair_selected_jump_rj;
[Widget] Gtk.MenuItem menuitem_delete_selected_jump_rj;
+ [Widget] Gtk.Button button_edit_selected_jump;
+ [Widget] Gtk.Button button_delete_selected_jump;
[Widget] Gtk.Button button_edit_selected_jump_rj;
[Widget] Gtk.Button button_delete_selected_jump_rj;
- [Widget] Gtk.Button button_repair_selected_reactive_jump;
- [Widget] Gtk.MenuItem menuitem_repair_selected_reactive_jump;
+ [Widget] Gtk.Button button_repair_selected_jump_rj;
+ [Widget] Gtk.MenuItem menuitem_jump_type_add;
+ [Widget] Gtk.MenuItem menuitem_jump_type_delete_simple;
+ [Widget] Gtk.MenuItem menuitem_jump_type_delete_reactive;
+ [Widget] Gtk.MenuItem menuitem_jump_free;
+ [Widget] Gtk.MenuItem sj;
+ [Widget] Gtk.MenuItem sj_l;
+ [Widget] Gtk.MenuItem cmj;
+ [Widget] Gtk.MenuItem cmj_l;
+ [Widget] Gtk.MenuItem abk;
+ [Widget] Gtk.MenuItem dj;
+ [Widget] Gtk.MenuItem menuitem_jump_rocket;
+ [Widget] Gtk.MenuItem menuitem_take_off;
+ [Widget] Gtk.MenuItem more_simple_jumps;
+ [Widget] Gtk.MenuItem more_rj;
+ [Widget] Gtk.MenuItem rj_j;
+ [Widget] Gtk.MenuItem rj_t;
+ [Widget] Gtk.MenuItem rj_unlimited;
+ [Widget] Gtk.MenuItem rj_hexagon;
+
+ //runs
+ [Widget] Gtk.MenuItem menu_execute_simple_runs1;
[Widget] Gtk.MenuItem menuitem_edit_selected_run;
[Widget] Gtk.MenuItem menuitem_delete_selected_run;
- [Widget] Gtk.Button button_edit_selected_run;
- [Widget] Gtk.Button button_delete_selected_run;
+ [Widget] Gtk.MenuItem menu_execute_intervallic_runs1;
[Widget] Gtk.MenuItem menuitem_edit_selected_run_interval;
+ [Widget] Gtk.MenuItem menuitem_repair_selected_run_interval;
[Widget] Gtk.MenuItem menuitem_delete_selected_run_interval;
+ [Widget] Gtk.MenuItem menuitem_run_type_add;
+ [Widget] Gtk.MenuItem menuitem_run_type_delete_simple;
+ [Widget] Gtk.MenuItem menuitem_run_type_delete_intervallic;
+ [Widget] Gtk.Button button_edit_selected_run;
+ [Widget] Gtk.Button button_delete_selected_run;
[Widget] Gtk.Button button_edit_selected_run_interval;
[Widget] Gtk.Button button_delete_selected_run_interval;
[Widget] Gtk.Button button_repair_selected_run_interval;
- [Widget] Gtk.MenuItem menuitem_repair_selected_run_interval;
+ [Widget] Gtk.MenuItem menuitem_run_custom;
+ [Widget] Gtk.MenuItem menuitem_20m;
+ [Widget] Gtk.MenuItem menuitem_100m;
+ [Widget] Gtk.MenuItem menuitem_200m;
+ [Widget] Gtk.MenuItem menuitem_400m;
+ [Widget] Gtk.MenuItem menuitem_run_gesell;
+ [Widget] Gtk.MenuItem menuitem_run_20yard;
+ [Widget] Gtk.MenuItem menuitem_run_505;
+ [Widget] Gtk.MenuItem menuitem_run_illinois;
+ [Widget] Gtk.MenuItem menuitem_run_margaria;
+ [Widget] Gtk.MenuItem menuitem_run_shuttle;
+ [Widget] Gtk.MenuItem menuitem_run_zigzag;
+ [Widget] Gtk.MenuItem menuitem_run_interval_by_laps;
+ [Widget] Gtk.MenuItem menuitem_run_interval_by_time;
+ [Widget] Gtk.MenuItem menuitem_run_interval_unlimited;
+ [Widget] Gtk.MenuItem menuitem_run_interval_mtgug;
+
+ //other
+ //reaction time
+ [Widget] Gtk.MenuItem menuitem_reaction_time;
[Widget] Gtk.Button button_edit_selected_reaction_time;
[Widget] Gtk.Button button_delete_selected_reaction_time;
-
- //[Widget] Gtk.MenuItem menuitem_edit_selected_pulse;
- //[Widget] Gtk.MenuItem menuitem_delete_selected_pulse;
+ //pulse
+ [Widget] Gtk.MenuItem menuitem_pulse_free;
+ [Widget] Gtk.MenuItem menuitem_pulse_custom;
[Widget] Gtk.Button button_edit_selected_pulse;
[Widget] Gtk.Button button_delete_selected_pulse;
[Widget] Gtk.Button button_repair_selected_pulse;
-
+ //multiChronopic
+ [Widget] Gtk.MenuItem menuitem_multi_chronopic_start;
+ [Widget] Gtk.MenuItem menuitem_run_analysis;
[Widget] Gtk.Button button_edit_selected_multi_chronopic;
[Widget] Gtk.Button button_delete_selected_multi_chronopic;
-
+ [Widget] Gtk.Table table_multi_chronopic_buttons;
+ [Widget] Gtk.Button button_multi_chronopic_start;
+ [Widget] Gtk.Button button_run_analysis;
+ [Widget] Gtk.Entry entry_run_analysis_distance;
+ [Widget] Gtk.CheckButton check_multi_sync;
+ [Widget] Gtk.CheckButton check_multi_delete_first;
+ [Widget] Gtk.Entry entry_multi_chronopic_cp2;
+
+ //tools
+ //from SportsTracker code
+ [Glade.WidgetAttribute]
+ private ImageMenuItem
+ menuitem_view_stats = null, menuitem_report_window = null, menuitem_chronopic = null;
+ [Widget] Gtk.MenuItem menuitem_server_evaluator_data;
+ [Widget] Gtk.MenuItem menuitem_server_upload_session;
+ [Widget] Gtk.MenuItem menuitem_preferences;
+
+
//widgets for enable or disable
[Widget] Gtk.Button button_new;
[Widget] Gtk.Button button_open;
@@ -136,78 +226,12 @@ public class ChronoJumpWindow
[Widget] Gtk.Button button_reaction_time;
//[Widget] Gtk.Button button_pulse_more;
- //multiChronopic
- [Widget] Gtk.Table table_multi_chronopic_buttons;
- [Widget] Gtk.MenuItem menuitem_multi_chronopic_start;
- [Widget] Gtk.Button button_multi_chronopic_start;
- [Widget] Gtk.MenuItem menuitem_run_analysis;
- [Widget] Gtk.Button button_run_analysis;
- [Widget] Gtk.Entry entry_run_analysis_distance;
-
-
- [Widget] Gtk.CheckButton check_multi_sync;
- [Widget] Gtk.CheckButton check_multi_delete_first;
[Widget] Gtk.Button button_last;
[Widget] Gtk.Button button_rj_last;
[Widget] Gtk.Button button_run_last;
[Widget] Gtk.Button button_run_interval_last;
- [Widget] Gtk.MenuItem menuitem_preferences;
- [Widget] Gtk.MenuItem menuitem_export_csv;
- [Widget] Gtk.MenuItem menuitem_export_xml;
- [Widget] Gtk.MenuItem menuitem_recuperate_person;
- [Widget] Gtk.MenuItem menuitem_person_add_single;
- [Widget] Gtk.MenuItem menuitem_person_add_multiple;
- [Widget] Gtk.MenuItem menuitem_edit_session;
- [Widget] Gtk.MenuItem menuitem_delete_session;
- [Widget] Gtk.MenuItem menuitem_recuperate_persons_from_session;
- [Widget] Gtk.MenuItem menu_persons;
- [Widget] Gtk.MenuItem menu_jumps;
- [Widget] Gtk.MenuItem menu_runs;
- [Widget] Gtk.MenuItem menu_other;
- [Widget] Gtk.MenuItem menu_tools;
-
- [Widget] Gtk.MenuItem menuitem_jump_free;
- [Widget] Gtk.MenuItem sj;
- [Widget] Gtk.MenuItem sj_l;
- [Widget] Gtk.MenuItem cmj;
- [Widget] Gtk.MenuItem cmj_l;
- [Widget] Gtk.MenuItem abk;
- [Widget] Gtk.MenuItem dj;
- [Widget] Gtk.MenuItem menuitem_jump_rocket;
- [Widget] Gtk.MenuItem menuitem_take_off;
- [Widget] Gtk.MenuItem more_simple_jumps;
- [Widget] Gtk.MenuItem more_rj;
- [Widget] Gtk.MenuItem menuitem_jump_type_add;
- [Widget] Gtk.MenuItem rj_j;
- [Widget] Gtk.MenuItem rj_t;
- [Widget] Gtk.MenuItem rj_unlimited;
- [Widget] Gtk.MenuItem rj_hexagon;
- [Widget] Gtk.MenuItem menuitem_run_custom;
- [Widget] Gtk.MenuItem menuitem_20m;
- [Widget] Gtk.MenuItem menuitem_100m;
- [Widget] Gtk.MenuItem menuitem_200m;
- [Widget] Gtk.MenuItem menuitem_400m;
- [Widget] Gtk.MenuItem menuitem_run_gesell;
- [Widget] Gtk.MenuItem menuitem_run_20yard;
- [Widget] Gtk.MenuItem menuitem_run_505;
- [Widget] Gtk.MenuItem menuitem_run_illinois;
- [Widget] Gtk.MenuItem menuitem_run_margaria;
- [Widget] Gtk.MenuItem menuitem_run_shuttle;
- [Widget] Gtk.MenuItem menuitem_run_zigzag;
- [Widget] Gtk.MenuItem menuitem_run_interval_by_laps;
- [Widget] Gtk.MenuItem menuitem_run_interval_by_time;
- [Widget] Gtk.MenuItem menuitem_run_interval_unlimited;
- [Widget] Gtk.MenuItem menuitem_run_interval_mtgug;
-
- [Widget] Gtk.Entry entry_multi_chronopic_cp2;
- [Widget] Gtk.Button button_edit_current_person;
- [Widget] Gtk.MenuItem menuitem_edit_current_person;
- [Widget] Gtk.MenuItem menuitem_delete_current_person_from_session;
- [Widget] Gtk.Button button_show_all_person_events;
- [Widget] Gtk.MenuItem show_all_person_events;
-
[Widget] Gtk.Notebook notebook;
[Widget] Gtk.Box vbox_image_test;
@@ -352,6 +376,7 @@ public class ChronoJumpWindow
static EventExecuteWindow eventExecuteWin;
+ private bool firstTestInSession = true; //since we started chronojump
private bool firstRjValue;
private double rjTcCount;
private double rjTvCount;
@@ -473,10 +498,6 @@ public class ChronoJumpWindow
}
*/
- //from SportsTracker code
- [Glade.WidgetAttribute]
- private ImageMenuItem
- menuitem_view_stats = null, menuitem_report_window = null, menuitem_chronopic = null;
private void putNonStandardIcons() {
Pixbuf pixbuf;
@@ -1209,7 +1230,7 @@ public class ChronoJumpWindow
myMenu.Attach( myItem, 0, 1, 0, 1 );
myItem = new MenuItem ( Catalog.GetString("Repair selected") + " " + myJump.Type + " (" + myJump.PersonName + ")");
- myItem.Activated += on_repair_selected_reactive_jump_clicked;
+ myItem.Activated += on_repair_selected_jump_rj_clicked;
myMenu.Attach( myItem, 0, 1, 1, 2 );
Gtk.SeparatorMenuItem mySep = new SeparatorMenuItem();
@@ -1869,7 +1890,7 @@ public class ChronoJumpWindow
menuitem_edit_current_person.Sensitive = false;
menuitem_delete_current_person_from_session.Sensitive = false;
button_show_all_person_events.Sensitive = false;
- show_all_person_events.Sensitive = false;
+ menuitem_show_all_person_events.Sensitive = false;
//update report
report.SessionID = currentSession.UniqueID;
@@ -1934,7 +1955,7 @@ public class ChronoJumpWindow
menuitem_edit_current_person.Sensitive = false;
menuitem_delete_current_person_from_session.Sensitive = false;
button_show_all_person_events.Sensitive = false;
- show_all_person_events.Sensitive = false;
+ menuitem_show_all_person_events.Sensitive = false;
//if there are persons
if(foundPersons) {
@@ -4677,7 +4698,7 @@ Console.WriteLine("X");
* --------------------------------------------------------
*/
- private void on_repair_selected_reactive_jump_clicked (object o, EventArgs args) {
+ private void on_repair_selected_jump_rj_clicked (object o, EventArgs args) {
notebook_change(1);
Log.WriteLine("Repair selected subjump");
//1.- check that there's a line selected
@@ -4688,11 +4709,11 @@ Console.WriteLine("X");
//4.- edit this jump
repairJumpRjWin = RepairJumpRjWindow.Show(app1, myJump, prefsDigitsNumber);
- repairJumpRjWin.Button_accept.Clicked += new EventHandler(on_repair_selected_reactive_jump_accepted);
+ repairJumpRjWin.Button_accept.Clicked += new EventHandler(on_repair_selected_jump_rj_accepted);
}
}
- private void on_repair_selected_reactive_jump_accepted (object o, EventArgs args) {
+ private void on_repair_selected_jump_rj_accepted (object o, EventArgs args) {
Log.WriteLine("Repair selected reactive jump accepted");
treeview_jumps_rj_storeReset();
@@ -4846,35 +4867,96 @@ Console.WriteLine("X");
* ---------------- SENSITIVE GUI METHODS-------------------
* --------------------------------------------------------
*/
+
+ private void menuSessionSensitive(bool option)
+ {
+ menuitem_edit_session.Sensitive = option;
+ menuitem_delete_session.Sensitive = option;
+ menuitem_export_csv.Sensitive = option;
+ //menuitem_export_xml.Sensitive = option; not implemented yet
+ }
+
+ private void menuPersonSensitive(bool option)
+ {
+ menuitem_person_add_single.Sensitive = option;
+ menuitem_person_add_multiple.Sensitive = option;
+ menuitem_recuperate_person.Sensitive = option;
+ menuitem_recuperate_persons_from_session.Sensitive = option;
+ }
+
+ private void menuPersonSelectedSensitive(bool option)
+ {
+ menuitem_edit_current_person.Sensitive = option;
+ menuitem_show_all_person_events.Sensitive = option;
+ menuitem_delete_current_person_from_session.Sensitive = option;
+ button_edit_current_person.Sensitive = option;
+ button_show_all_person_events.Sensitive = option;
+ }
+
+ private void menuJumpsSensitive(bool option)
+ {
+ menu_execute_simple_jumps1.Sensitive = option;
+ menuitem_edit_selected_jump.Sensitive = option;
+ menuitem_delete_selected_jump.Sensitive = option;
+ menu_execute_repetitive_jumps1.Sensitive = option;
+ menuitem_edit_selected_jump_rj.Sensitive = option;
+ menuitem_repair_selected_jump_rj.Sensitive = option;
+ menuitem_delete_selected_jump_rj.Sensitive = option;
+ menuitem_jump_type_add.Sensitive = option;
+ menuitem_jump_type_delete_simple.Sensitive = option;
+ menuitem_jump_type_delete_reactive.Sensitive = option;
+ }
+
+ private void menuRunsSensitive(bool option)
+ {
+ menu_execute_simple_runs1.Sensitive = option;
+ menuitem_edit_selected_run.Sensitive = option;
+ menuitem_delete_selected_run.Sensitive = option;
+ menu_execute_intervallic_runs1.Sensitive = option;
+ menuitem_edit_selected_run_interval.Sensitive = option;
+ menuitem_repair_selected_run_interval.Sensitive = option;
+ menuitem_delete_selected_run_interval.Sensitive = option;
+ menuitem_run_type_add.Sensitive = option;
+ menuitem_run_type_delete_simple.Sensitive = option;
+ menuitem_run_type_delete_intervallic.Sensitive = option;
+ }
+
+ private void menuOtherSensitive(bool option)
+ {
+ menuitem_reaction_time.Sensitive = option;
+ menuitem_pulse_free.Sensitive = option;
+ menuitem_pulse_custom.Sensitive = option;
+ menuitem_multi_chronopic_start.Sensitive = option;
+ menuitem_run_analysis.Sensitive = option;
+ }
+ private void menuToolsSensitive(bool option)
+ {
+ menuitem_view_stats.Sensitive = option;
+ menuitem_report_window.Sensitive = option;
+ menuitem_server_evaluator_data.Sensitive = option;
+ menuitem_server_upload_session.Sensitive = option;
+ }
+
private void sensitiveGuiNoSession ()
{
- //menuitems
menuitem_preferences.Sensitive = true;
- menuitem_export_csv.Sensitive = false;
- menuitem_export_xml.Sensitive = false;
- menuitem_recuperate_person.Sensitive = false;
- menuitem_recuperate_persons_from_session.Sensitive = false;
- menuitem_person_add_single.Sensitive = false;
- menuitem_person_add_multiple.Sensitive = false;
treeview_persons.Sensitive = false;
- menuitem_edit_session.Sensitive = false;
- menuitem_delete_session.Sensitive = false;
- menu_persons.Sensitive = false;
- menu_jumps.Sensitive = false;
- menu_runs.Sensitive = false;
- menu_other.Sensitive = false;
- menu_tools.Sensitive = false;
+ //menuitems
+ menuSessionSensitive(false);
+ menuPersonSensitive(false);
+ menuPersonSelectedSensitive(false);
+ menuJumpsSensitive(false);
+ menuRunsSensitive(false);
+ menuOtherSensitive(false);
+ menuToolsSensitive(false);
vbox_image_test.Sensitive = false;
frame_persons.Sensitive = false;
button_recup_per.Sensitive = false;
button_create_per.Sensitive = false;
button_edit_current_person.Sensitive = false;
- menuitem_delete_current_person_from_session.Sensitive = false;
- button_show_all_person_events.Sensitive = false;
- show_all_person_events.Sensitive = false;
//notebook
notebook.Sensitive = false;
@@ -4883,11 +4965,6 @@ Console.WriteLine("X");
button_rj_last.Sensitive=false;
button_run_last.Sensitive=false;
button_run_interval_last.Sensitive=false;
- //button_pulse_last.Sensitive=false;
-
-// button_last_delete.Sensitive = false;
-
- menuitem_server_upload_session.Sensitive = false;
}
private void sensitiveGuiYesSession () {
@@ -4896,17 +4973,9 @@ Console.WriteLine("X");
button_recup_per.Sensitive = true;
button_create_per.Sensitive = true;
- menuitem_export_csv.Sensitive = true;
- menuitem_export_xml.Sensitive = false; //it's not coded yet
- menuitem_recuperate_person.Sensitive = true;
- menuitem_recuperate_persons_from_session.Sensitive = true;
- menuitem_person_add_single.Sensitive = true;
- menuitem_person_add_multiple.Sensitive = true;
- menuitem_edit_session.Sensitive = true;
- menuitem_delete_session.Sensitive = true;
- menu_persons.Sensitive = true;
-
- menuitem_server_upload_session.Sensitive = true;
+ menuSessionSensitive(true);
+ menuPersonSensitive(true);
+ menuToolsSensitive(true);
}
//only called by delete person functions (if we run out of persons)
@@ -4914,34 +4983,22 @@ Console.WriteLine("X");
notebook.Sensitive = false;
treeview_persons.Sensitive = false;
- button_edit_current_person.Sensitive = false;
- menuitem_edit_current_person.Sensitive = false;
- menuitem_delete_current_person_from_session.Sensitive = false;
- button_show_all_person_events.Sensitive = false;
- show_all_person_events.Sensitive = false;
-
- menu_jumps.Sensitive = false;
- menu_runs.Sensitive = false;
- menu_other.Sensitive = false;
- menu_tools.Sensitive = false;
-
- //menuitem_jump_type_add.Sensitive = false;
-// button_last_delete.Sensitive = false;
+ menuPersonSelectedSensitive(false);
+ menuJumpsSensitive(false);
+ menuRunsSensitive(false);
+ menuOtherSensitive(false);
+ menuToolsSensitive(false);
}
private void sensitiveGuiYesPerson () {
notebook.Sensitive = true;
treeview_persons.Sensitive = true;
- button_edit_current_person.Sensitive = true;
- menuitem_edit_current_person.Sensitive = true;
- menuitem_delete_current_person_from_session.Sensitive = true;
- button_show_all_person_events.Sensitive = true;
- show_all_person_events.Sensitive = true;
- menu_jumps.Sensitive = true;
- menu_runs.Sensitive = true;
- menu_other.Sensitive = true;
- menu_tools.Sensitive = true;
+ menuPersonSelectedSensitive(true);
+ menuJumpsSensitive(true);
+ menuRunsSensitive(true);
+ menuOtherSensitive(true);
+ menuToolsSensitive(true);
//unsensitive edit, delete, repair events because no event is initially selected
showHideActionEventButtons(false, "ALL");
@@ -4954,7 +5011,6 @@ Console.WriteLine("X");
}
private void sensitiveGuiYesEvent () {
-// button_last_delete.Sensitive = true;
}
private void sensitiveGuiEventDoing () {
@@ -4966,12 +5022,9 @@ Console.WriteLine("X");
hbox_pulses.Sensitive = false;
//menu
- menu_jumps.Sensitive = false;
- menu_runs.Sensitive = false;
- menu_other.Sensitive = false;
-
- //cancel, delete last, finish
-// button_last_delete.Sensitive = false;
+ menuJumpsSensitive(false);
+ menuRunsSensitive(false);
+ menuOtherSensitive(false);
}
private void sensitiveGuiEventDone () {
@@ -5019,9 +5072,9 @@ Console.WriteLine("X");
}
//menu
- menu_jumps.Sensitive = true;
- menu_runs.Sensitive = true;
- menu_other.Sensitive = true;
+ menuJumpsSensitive(true);
+ menuRunsSensitive(true);
+ menuOtherSensitive(true);
}
private void showHideActionEventButtons(bool show, string type) {
@@ -5038,8 +5091,8 @@ Console.WriteLine("X");
menuitem_delete_selected_jump_rj.Sensitive = show;
button_edit_selected_jump_rj.Sensitive = show;
button_delete_selected_jump_rj.Sensitive = show;
- button_repair_selected_reactive_jump.Sensitive = show;
- menuitem_repair_selected_reactive_jump.Sensitive = show;
+ button_repair_selected_jump_rj.Sensitive = show;
+ menuitem_repair_selected_jump_rj.Sensitive = show;
success = true;
}
if (type == "ALL" || type == "Run") {
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 1dd22b7..6d89c26 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -840,7 +840,6 @@ public class PersonAddModifyWindow
private Person currentPerson;
private Session currentSession;
private PersonSession currentPersonSession;
- private int personID;
private string sex = Constants.M;
private double weightIni;
int pDN;
@@ -850,8 +849,8 @@ public class PersonAddModifyWindow
private bool comesFromRecuperateWin;
//
- //if we are adding a person, personID it's -1
- //if we are modifying a person, personID is obviously it's ID
+ //if we are adding a person, currentPerson.UniqueID it's -1
+ //if we are modifying a person, currentPerson.UniqueID is obviously it's ID
PersonAddModifyWindow (Gtk.Window parent, Session currentSession, Person currentPerson) {
Glade.XML gladeXML;
gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "person_win", null);
@@ -1374,7 +1373,7 @@ public class PersonAddModifyWindow
if(adding)
personExists = Sqlite.Exists (Constants.PersonTable, Util.RemoveTilde(entry1.Text));
else
- personExists = SqlitePerson.ExistsAndItsNotMe (personID, Util.RemoveTilde(entry1.Text));
+ personExists = SqlitePerson.ExistsAndItsNotMe (currentPerson.UniqueID, Util.RemoveTilde(entry1.Text));
string errorMessage = "";
@@ -1396,13 +1395,13 @@ public class PersonAddModifyWindow
//if weight has changed
if(!adding && (double) spinbutton_weight.Value != weightIni) {
//see if this person has done jumps with weight
- string [] myJumpsNormal = SqliteJump.SelectJumps(currentSession.UniqueID, personID, "withWeight", "");
- string [] myJumpsReactive = SqliteJumpRj.SelectJumps(currentSession.UniqueID, personID, "withWeight", "");
+ string [] myJumpsNormal = SqliteJump.SelectJumps(currentSession.UniqueID, currentPerson.UniqueID, "withWeight", "");
+ string [] myJumpsReactive = SqliteJumpRj.SelectJumps(currentSession.UniqueID, currentPerson.UniqueID, "withWeight", "");
if(myJumpsNormal.Length > 0 || myJumpsReactive.Length > 0) {
//create the convertWeight Window
convertWeightWin = ConvertWeightWindow.Show(
- currentSession.UniqueID, personID,
+ currentSession.UniqueID, currentPerson.UniqueID,
weightIni, (double) spinbutton_weight.Value,
myJumpsNormal, myJumpsReactive);
convertWeightWin.Button_accept.Clicked += new EventHandler(on_convertWeightWin_accepted);
@@ -1435,7 +1434,7 @@ public class PersonAddModifyWindow
double weight = (double) spinbutton_weight.Value;
//convert margarias (it's power is calculated using weight and it's written on description)
- string [] myMargarias = SqliteRun.SelectRuns(currentSession.UniqueID, personID, "Margaria");
+ string [] myMargarias = SqliteRun.SelectRuns(currentSession.UniqueID, currentPerson.UniqueID, "Margaria");
foreach(string myStr in myMargarias) {
string [] margaria = myStr.Split(new char[] {':'});
Run mRun = SqliteRun.SelectRunData(Convert.ToInt32(margaria[1]));
@@ -1463,7 +1462,7 @@ public class PersonAddModifyWindow
textview_ps_comments.Buffer.Text);
} else {
//here we update rows in the database
- currentPerson = new Person (personID, entry1.Text, sex, dateTime,
+ currentPerson = new Person (currentPerson.UniqueID, entry1.Text, sex, dateTime,
Constants.RaceUndefinedID,
Convert.ToInt32(Util.FindOnArray(':', 2, 0, UtilGtk.ComboGetActive(combo_countries), countries)),
textview_description.Buffer.Text,
@@ -1487,7 +1486,7 @@ public class PersonAddModifyWindow
//don't come from recuperate
//we only need to update personSession
//1.- search uniqueID
- PersonSession ps = SqlitePersonSession.Select(personID, currentSession.UniqueID);
+ PersonSession ps = SqlitePersonSession.Select(currentPerson.UniqueID, currentSession.UniqueID);
//2.- create new instance
currentPersonSession = new PersonSession (
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 0d5b706..b413dab 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -49,9 +49,15 @@ public class PreferencesWindow {
[Widget] Gtk.RadioButton radiobutton_show_dj_index;
[Widget] Gtk.CheckButton checkbutton_ask_deletion;
- [Widget] Gtk.CheckButton checkbutton_height_preferred;
- [Widget] Gtk.CheckButton checkbutton_meters_seconds_preferred;
- [Widget] Gtk.CheckButton checkbutton_percent_kg_preferred;
+
+ [Widget] Gtk.RadioButton radio_elevation_height;
+ [Widget] Gtk.RadioButton radio_elevation_tf;
+ [Widget] Gtk.RadioButton radio_speed_ms;
+ [Widget] Gtk.RadioButton radio_speed_km;
+ [Widget] Gtk.RadioButton radio_weight_percent;
+ [Widget] Gtk.RadioButton radio_weight_kg;
+
+
// [Widget] Gtk.Box hbox_language_row;
// [Widget] Gtk.Box hbox_combo_language;
// [Widget] Gtk.ComboBox combo_language;
@@ -150,21 +156,21 @@ public class PreferencesWindow {
if(weightStatsPercent)
- PreferencesWindowBox.checkbutton_percent_kg_preferred.Active = true;
+ PreferencesWindowBox.radio_weight_percent.Active = true;
else
- PreferencesWindowBox.checkbutton_percent_kg_preferred.Active = false;
+ PreferencesWindowBox.radio_weight_kg.Active = true;
if(heightPreferred)
- PreferencesWindowBox.checkbutton_height_preferred.Active = true;
+ PreferencesWindowBox.radio_elevation_height.Active = true;
else
- PreferencesWindowBox.checkbutton_height_preferred.Active = false;
+ PreferencesWindowBox.radio_elevation_tf.Active = true;
if(metersSecondsPreferred)
- PreferencesWindowBox.checkbutton_meters_seconds_preferred.Active = true;
+ PreferencesWindowBox.radio_speed_ms.Active = true;
else
- PreferencesWindowBox.checkbutton_meters_seconds_preferred.Active = false;
+ PreferencesWindowBox.radio_speed_km.Active = true;
PreferencesWindowBox.preferences.Show ();
@@ -334,9 +340,9 @@ public class PreferencesWindow {
SqlitePreferences.Update("askDeletion", PreferencesWindowBox.checkbutton_ask_deletion.Active.ToString(), false);
- SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.checkbutton_percent_kg_preferred.Active.ToString(), false);
- SqlitePreferences.Update("heightPreferred", PreferencesWindowBox.checkbutton_height_preferred.Active.ToString(), false);
- SqlitePreferences.Update("metersSecondsPreferred", PreferencesWindowBox.checkbutton_meters_seconds_preferred.Active.ToString(), false);
+ SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.radio_weight_percent.Active.ToString(), false);
+ SqlitePreferences.Update("heightPreferred", PreferencesWindowBox.radio_elevation_height.Active.ToString(), false);
+ SqlitePreferences.Update("metersSecondsPreferred", PreferencesWindowBox.radio_speed_ms.Active.ToString(), false);
/*
if(Util.IsWindows()) {
diff --git a/src/sqlite/jump.cs b/src/sqlite/jump.cs
index 2f88a7d..8e67b24 100644
--- a/src/sqlite/jump.cs
+++ b/src/sqlite/jump.cs
@@ -93,13 +93,16 @@ class SqliteJump : Sqlite
//if all types put, "" in filterType
public static string[] SelectJumps(int sessionID, int personID, string filterWeight, string filterType)
{
+ string tp = Constants.PersonTable;
+ string tps = Constants.PersonSessionTable;
+
string filterSessionString = "";
if(sessionID != -1)
filterSessionString = " AND jump.sessionID == " + sessionID;
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
string filterWeightString = "";
if(filterWeight == "withWeight")
@@ -110,16 +113,16 @@ class SqliteJump : Sqlite
filterTypeString = " AND jump.type == '" + filterType + "' ";
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, jump.*, personSessionWeight.weight " +
- " FROM person, jump, personSessionWeight " +
- " WHERE person.uniqueID == jump.personID " +
+ dbcmd.CommandText = "SELECT " + tp + ".name, jump.*, " + tps + ".weight " +
+ " FROM " + tp + ", jump, " + tps +
+ " WHERE " + tp + ".uniqueID == jump.personID " +
filterSessionString +
filterPersonString +
filterWeightString +
filterTypeString +
- " AND personSessionWeight.personID == person.uniqueID " +
- " AND personSessionWeight.sessionID == jump.sessionID " +
- " ORDER BY upper(person.name), jump.uniqueID";
+ " AND " + tps + ".personID == " + tp + ".uniqueID " +
+ " AND " + tps + ".sessionID == jump.sessionID " +
+ " ORDER BY upper(" + tp + ".name), jump.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
diff --git a/src/sqlite/jumpRj.cs b/src/sqlite/jumpRj.cs
index 087cf69..7707c04 100644
--- a/src/sqlite/jumpRj.cs
+++ b/src/sqlite/jumpRj.cs
@@ -88,13 +88,16 @@ class SqliteJumpRj : SqliteJump
public new static string[] SelectJumps(int sessionID, int personID, string filterWeight, string filterType)
{
+ string tp = Constants.PersonTable;
+ string tps = Constants.PersonSessionTable;
+
string filterSessionString = "";
if(sessionID != -1)
filterSessionString = " AND jumpRj.sessionID == " + sessionID;
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
string filterWeightString = "";
if(filterWeight == "withWeight")
@@ -105,16 +108,16 @@ class SqliteJumpRj : SqliteJump
filterTypeString = " AND jumpRj.type == '" + filterType + "' ";
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, jumpRj.*, personSessionWeight.weight " +
- " FROM person, jumpRj, personSessionWeight " +
- " WHERE person.uniqueID == jumpRj.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, jumpRj.*, " + tps + ".weight " +
+ " FROM " + tp + ", jumpRj, " + tps + " " +
+ " WHERE " + tp + ".uniqueID == jumpRj.personID" +
filterSessionString +
filterPersonString +
filterWeightString +
filterTypeString +
- " AND personSessionWeight.personID == person.uniqueID " +
- " AND personSessionWeight.sessionID == jumpRj.sessionID " +
- " ORDER BY upper(person.name), jumpRj.uniqueID";
+ " AND " + tps + ".personID == " + tp + ".uniqueID " +
+ " AND " + tps + ".sessionID == jumpRj.sessionID " +
+ " ORDER BY upper(" + tp + ".name), jumpRj.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
diff --git a/src/sqlite/multiChronopic.cs b/src/sqlite/multiChronopic.cs
index e65a004..cd0698b 100644
--- a/src/sqlite/multiChronopic.cs
+++ b/src/sqlite/multiChronopic.cs
@@ -110,17 +110,19 @@ class SqliteMultiChronopic : Sqlite
//if all persons, put -1 in personID
public static string[] SelectTests(int sessionID, int personID)
{
+ string tp = Constants.PersonTable;
+
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, multiChronopic.* " +
- " FROM person, multiChronopic " +
- " WHERE person.uniqueID == multiChronopic.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, multiChronopic.* " +
+ " FROM " + tp + ", multiChronopic " +
+ " WHERE " + tp + ".uniqueID == multiChronopic.personID" +
" AND multiChronopic.sessionID == " + sessionID +
filterPersonString +
- " ORDER BY upper(person.name), multiChronopic.uniqueID";
+ " ORDER BY upper(" + tp + ".name), multiChronopic.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
diff --git a/src/sqlite/personSession.cs b/src/sqlite/personSession.cs
index f4924ed..1bc8921 100644
--- a/src/sqlite/personSession.cs
+++ b/src/sqlite/personSession.cs
@@ -131,13 +131,13 @@ class SqlitePersonSession : Sqlite
dbcon.Open();
dbcmd.CommandText = "UPDATE " + Constants.PersonSessionTable +
" SET personID = " + ps.PersonID +
- " SET sessionID = " + ps.SessionID +
- " SET height = " + Util.ConvertToPoint(ps.Height) +
- " SET weight = " + Util.ConvertToPoint(ps.Weight) +
- " SET sportID = " + ps.SportID +
- " SET speciallityID = " + ps.SpeciallityID +
- " SET practice = " + ps.Practice +
- " SET comments = '" + ps.Comments +
+ ", sessionID = " + ps.SessionID +
+ ", height = " + Util.ConvertToPoint(ps.Height) +
+ ", weight = " + Util.ConvertToPoint(ps.Weight) +
+ ", sportID = " + ps.SportID +
+ ", speciallityID = " + ps.SpeciallityID +
+ ", practice = " + ps.Practice +
+ ", comments = '" + ps.Comments +
"' WHERE uniqueID == " + ps.UniqueID;
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -190,10 +190,9 @@ class SqlitePersonSession : Sqlite
{
string tps = Constants.PersonSessionTable;
- string sessionIDString = "";
+ string sessionIDString = " AND sessionID == " + sessionID;
if(sessionID == -1)
- sessionIDString = " AND sessionID == " + sessionID +
- " ORDER BY sessionID DESC limit 1";
+ sessionIDString = " ORDER BY sessionID DESC limit 1";
dbcon.Open();
dbcmd.CommandText = "SELECT * FROM " + tps +
diff --git a/src/sqlite/pulse.cs b/src/sqlite/pulse.cs
index 7800005..dbf5a84 100644
--- a/src/sqlite/pulse.cs
+++ b/src/sqlite/pulse.cs
@@ -84,17 +84,19 @@ class SqlitePulse : Sqlite
//if all persons, put -1 in personID
public static string[] SelectPulses(int sessionID, int personID)
{
+ string tp = Constants.PersonTable;
+
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, pulse.* " +
- " FROM person, pulse " +
- " WHERE person.uniqueID == pulse.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, pulse.* " +
+ " FROM " + tp + ", pulse " +
+ " WHERE " + tp + ".uniqueID == pulse.personID" +
" AND pulse.sessionID == " + sessionID +
filterPersonString +
- " ORDER BY upper(person.name), pulse.uniqueID";
+ " ORDER BY upper(" + tp + ".name), pulse.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -148,19 +150,6 @@ class SqlitePulse : Sqlite
reader.Read();
Pulse myPulse = new Pulse(DataReaderToStringArray(reader, 9));
- /*
- Pulse myPulse = new Pulse(
- Convert.ToInt32(reader[0]), //uniqueID
- Convert.ToInt32(reader[1]), //personID
- Convert.ToInt32(reader[2]), //sessionID
- reader[3].ToString(), //type
- Convert.ToDouble(Util.ChangeDecimalSeparator(reader[4].ToString())), //fixedPulsel
- Convert.ToInt32(reader[5]), //totalPulsesNum
- reader[6].ToString(), //timesString
- reader[7].ToString(), //description
- reader[8].ToString() //simulated
- );
- */
dbcon.Close();
return myPulse;
diff --git a/src/sqlite/reactionTime.cs b/src/sqlite/reactionTime.cs
index f39d54c..2592f26 100644
--- a/src/sqlite/reactionTime.cs
+++ b/src/sqlite/reactionTime.cs
@@ -81,17 +81,19 @@ class SqliteReactionTime : Sqlite
//if all persons, put -1 in personID
public static string[] SelectReactionTimes(int sessionID, int personID)
{
+ string tp = Constants.PersonTable;
+
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, reactionTime.* " +
- " FROM person, reactionTime " +
- " WHERE person.uniqueID == reactionTime.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, reactionTime.* " +
+ " FROM " + tp + ", reactionTime " +
+ " WHERE " + tp + ".uniqueID == reactionTime.personID" +
" AND reactionTime.sessionID == " + sessionID +
filterPersonString +
- " ORDER BY upper(person.name), reactionTime.uniqueID";
+ " ORDER BY upper(" + tp + ".name), reactionTime.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -104,9 +106,7 @@ class SqliteReactionTime : Sqlite
int count = new int();
count = 0;
-
while(reader.Read()) {
-
myArray.Add (reader[0].ToString() + ":" + //person.name
reader[1].ToString() + ":" + //jump.uniqueID
reader[2].ToString() + ":" + //jump.personID
@@ -146,17 +146,6 @@ class SqliteReactionTime : Sqlite
reader.Read();
ReactionTime myRT = new ReactionTime(DataReaderToStringArray(reader, 7));
- /*
- ReactionTime myRT = new ReactionTime(
- Convert.ToInt32(reader[0]), //uniqueID
- Convert.ToInt32(reader[1]), //personID
- Convert.ToInt32(reader[2]), //sessionID
- //reader[3].ToString(), //type
- Convert.ToDouble( Util.ChangeDecimalSeparator(reader[4].ToString()) ),
- reader[5].ToString(), //description
- Convert.ToInt32(reader[6]) //simulated
- );
- */
dbcon.Close();
return myRT;
diff --git a/src/sqlite/run.cs b/src/sqlite/run.cs
index dacef33..0dc1897 100644
--- a/src/sqlite/run.cs
+++ b/src/sqlite/run.cs
@@ -85,26 +85,28 @@ class SqliteRun : Sqlite
//if all types, put "" in filterType
public static string[] SelectRuns(int sessionID, int personID, string filterType)
{
+ string tp = Constants.PersonTable;
+
string filterSessionString = "";
if(sessionID != -1)
filterSessionString = " AND run.sessionID == " + sessionID;
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
string filterTypeString = "";
if(filterType != "")
filterTypeString = " AND run.type == '" + filterType + "' " ;
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, run.* " +
- " FROM person, run " +
- " WHERE person.uniqueID == run.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, run.* " +
+ " FROM " + tp + ", run " +
+ " WHERE " + tp + ".uniqueID == run.personID" +
filterSessionString +
filterPersonString +
filterTypeString +
- " ORDER BY upper(person.name), run.uniqueID";
+ " ORDER BY upper(" + tp + ".name), run.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -117,9 +119,7 @@ class SqliteRun : Sqlite
int count = new int();
count = 0;
-
while(reader.Read()) {
-
myArray.Add (reader[0].ToString() + ":" + //person.name
reader[1].ToString() + ":" + //run.uniqueID
reader[2].ToString() + ":" + //run.personID
diff --git a/src/sqlite/runInterval.cs b/src/sqlite/runInterval.cs
index 2656346..354884f 100644
--- a/src/sqlite/runInterval.cs
+++ b/src/sqlite/runInterval.cs
@@ -83,26 +83,28 @@ class SqliteRunInterval : SqliteRun
public new static string[] SelectRuns(int sessionID, int personID, string filterType)
{
+ string tp = Constants.PersonTable;
+
string filterSessionString = "";
if(sessionID != -1)
filterSessionString = " AND runInterval.sessionID == " + sessionID;
string filterPersonString = "";
if(personID != -1)
- filterPersonString = " AND person.uniqueID == " + personID;
+ filterPersonString = " AND " + tp + ".uniqueID == " + personID;
string filterTypeString = "";
if(filterType != "")
filterTypeString = " AND runInterval.type == '" + filterType + "' " ;
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, runInterval.* " +
- " FROM person, runInterval " +
- " WHERE person.uniqueID == runInterval.personID" +
+ dbcmd.CommandText = "SELECT " + tp + ".name, runInterval.* " +
+ " FROM " + tp + ", runInterval " +
+ " WHERE " + tp + ".uniqueID == runInterval.personID" +
filterSessionString +
filterPersonString +
filterTypeString +
- " ORDER BY upper(person.name), runInterval.uniqueID";
+ " ORDER BY upper(" + tp + ".name), runInterval.uniqueID";
Log.WriteLine(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
diff --git a/src/sqlite/stat.cs b/src/sqlite/stat.cs
index 0ab4eb1..d1ad2f8 100644
--- a/src/sqlite/stat.cs
+++ b/src/sqlite/stat.cs
@@ -32,6 +32,8 @@ class SqliteStat : Sqlite
//AllJumpsName (simple) is not managed here, is done in SjCmjAbkPlus
public static ArrayList SjCmjAbk (string sessionString, bool multisession, string operationString, string jumpType, bool showSex, bool heightPreferred)
{
+ string tp = Constants.PersonTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -46,7 +48,7 @@ class SqliteStat : Sqlite
string moreSelect = "";
moreSelect = ini + "jump.tv" + end;
- string fromString = " FROM jump, person ";
+ string fromString = " FROM jump, " + tp + " ";
string jumpTypeString = " AND jump.type == '" + jumpType + "' ";
//if we use AVG or MAX, then we have to group by the results
@@ -57,15 +59,15 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, sessionID, ";
+ orderByString = orderByString + tp + ".name, sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
- " AND jump.personID == person.uniqueID " +
+ " AND jump.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + ini + "jump.tv" + end + " DESC ";
@@ -113,6 +115,9 @@ class SqliteStat : Sqlite
//and AllJumpsName (simple)
public static ArrayList SjCmjAbkPlus (string sessionString, bool multisession, string operationString, string jumpType, bool showSex, bool heightPreferred, bool weightPercentPreferred)
{
+ string tp = Constants.PersonTable;
+ string tps = Constants.PersonSessionTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -125,14 +130,14 @@ class SqliteStat : Sqlite
string orderByString = "ORDER BY ";
string moreSelect = "";
- moreSelect = ini + "jump.tv" + end + ", " + ini + "jump.weight" + end + ", personSessionWeight.weight";
+ moreSelect = ini + "jump.tv" + end + ", " + ini + "jump.weight" + end + ", " + tps + ".weight";
//manage allJumps
- string fromString = " FROM jump, person, personSessionWeight ";
+ string fromString = " FROM jump, " + tp + ", " + tps + " ";
string jumpTypeString = " AND jump.type == '" + jumpType + "' ";
if(jumpType == Constants.AllJumpsName) {
moreSelect = moreSelect + ", jump.type ";
- fromString = " FROM jump, person, personSessionWeight, jumpType ";
+ fromString = " FROM jump, " + tp + ", " + tps + ", jumpType ";
jumpTypeString = " AND jumpType.startIn == 1 AND jump.Type == jumpType.name ";
}
@@ -145,18 +150,18 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, jump.sessionID, ";
+ orderByString = orderByString + "" + tp + ".name, jump.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, jump.sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, jump.sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
" AND jump.personID == person.uniqueID " +
- // personSessionWeight stuff
- " AND person.uniqueID == personSessionWeight.personID " +
- " AND jump.sessionID == personSessionWeight.sessionID " + //should work for simple and multi session
+ // personSession stuff
+ " AND " + tp + ".uniqueID == " + tps + ".personID " +
+ " AND jump.sessionID == " + tps + ".sessionID " + //should work for simple and multi session
groupByString +
orderByString + ini + "jump.tv" + end + " DESC ";
@@ -252,6 +257,8 @@ class SqliteStat : Sqlite
//dj index, Q index, ... (indexType)
public static ArrayList DjIndexes (string indexType, string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
+ string tp = Constants.PersonTable;
+
string formula = "";
if(indexType == "djIndex") {
formula = Constants.DjIndexFormulaOnly;
@@ -273,11 +280,11 @@ class SqliteStat : Sqlite
moreSelect = ini + formula + end + " AS myIndex, jump.tv, jump.tc, jump.fall";
//manage allJumps
- string fromString = " FROM jump, person ";
+ string fromString = " FROM jump, " + tp + " ";
string jumpTypeString = " AND jump.type == '" + jumpType + "' ";
if(jumpType == Constants.AllJumpsName) {
moreSelect = moreSelect + ", jump.type ";
- fromString = " FROM jump, person, jumpType ";
+ fromString = " FROM jump, " + tp + ", jumpType ";
jumpTypeString = " AND jumpType.startIn == 0 AND jump.Type == jumpType.name ";
}
@@ -290,15 +297,15 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, sessionID, ";
+ orderByString = orderByString + tp + ".name, sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
- " AND jump.personID == person.uniqueID " +
+ " AND jump.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " myIndex DESC, " + ini + "jump.tv" + end + " DESC ";
@@ -355,6 +362,8 @@ class SqliteStat : Sqlite
public static ArrayList RjIndex (string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
+ string tp = Constants.PersonTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -370,11 +379,11 @@ class SqliteStat : Sqlite
moreSelect = ini + Constants.RjIndexFormulaOnly + end + " AS rj_index, tvavg, tcavg, fall"; //*1.0 for having double division
//manage allJumps
- string fromString = " FROM jumpRj, person ";
+ string fromString = " FROM jumpRj, " + tp + " ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Constants.AllJumpsName) {
moreSelect = moreSelect + ", jumpRj.type ";
- fromString = " FROM jumpRj, person, jumpRjType ";
+ fromString = " FROM jumpRj, " + tp + ", jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
@@ -386,16 +395,16 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, jumpRj.sessionID, ";
+ orderByString = orderByString + tp + ".name, jumpRj.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, sessionID, " + moreSelect +
//" FROM jumpRj, person " +
fromString +
sessionString +
jumpTypeString +
- " AND jumpRj.personID == person.uniqueID " +
+ " AND jumpRj.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " rj_index DESC, tvavg DESC ";
@@ -448,6 +457,8 @@ class SqliteStat : Sqlite
public static ArrayList RjPotencyBosco (string sessionString, bool multisession, string operationString, string jumpType, bool showSex)
{
+ string tp = Constants.PersonTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -465,11 +476,11 @@ class SqliteStat : Sqlite
" tvavg, tcavg, jumps, time, fall";
//manage allJumps
- string fromString = " FROM jumpRj, person ";
+ string fromString = " FROM jumpRj, " + tp + " ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Constants.AllJumpsName) {
moreSelect = moreSelect + ", jumpRj.type ";
- fromString = " FROM jumpRj, person, jumpRjType ";
+ fromString = " FROM jumpRj, " + tp + ", jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
@@ -481,15 +492,15 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, jumpRj.sessionID, ";
+ orderByString = orderByString + tp + ".name, jumpRj.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
- " AND jumpRj.personID == person.uniqueID " +
+ " AND jumpRj.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " potency DESC, tvavg DESC ";
@@ -603,6 +614,8 @@ class SqliteStat : Sqlite
//but both of them are simple session
public static ArrayList RjEvolution (string sessionString, bool multisession, string operationString, string jumpType, bool showSex, int maxJumps)
{
+ string tp = Constants.PersonTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -618,11 +631,11 @@ class SqliteStat : Sqlite
moreSelect = ini + "((tvavg-tcavg)*100/(tcavg*1.0))" + end + " AS rj_index, tcString, tvString, fall"; //*1.0 for having double division
//manage allJumps
- string fromString = " FROM jumpRj, person ";
+ string fromString = " FROM jumpRj, " + tp + " ";
string jumpTypeString = " AND jumpRj.type == '" + jumpType + "' ";
if(jumpType == Constants.AllJumpsName) {
moreSelect = moreSelect + ", jumpRj.type ";
- fromString = " FROM jumpRj, person, jumpRjType ";
+ fromString = " FROM jumpRj, " + tp + ", jumpRjType ";
jumpTypeString = " AND jumpRj.Type == jumpRjType.name ";
}
@@ -634,15 +647,15 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + "person.name, jumpRj.sessionID, ";
+ orderByString = orderByString + tp + ".name, jumpRj.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
- " AND jumpRj.personID == person.uniqueID " +
+ " AND jumpRj.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " rj_index DESC, tvavg DESC ";
@@ -705,6 +718,8 @@ class SqliteStat : Sqlite
public static ArrayList IeIub (string sessionString, bool multisession, string ini, string end, string jump1, string jump2, bool showSex)
{
+ string tp = Constants.PersonTable;
+
//What's this? TODO: check old versions of this file
/*
string ini2 = "";
@@ -736,17 +751,17 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + " person.name, j1.sessionID, ";
+ orderByString = orderByString + tp + ".name, j1.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, j1.sessionID, " + moreSelect +
- " FROM jump AS j1, jump AS j2, person " +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, j1.sessionID, " + moreSelect +
+ " FROM jump AS j1, jump AS j2, " + tp + " " +
sessionString +
" AND j1.type == '" + jump1 + "' " +
" AND j2.type == '" + jump2 + "' " +
- " AND j1.personID == person.uniqueID " +
- " AND j2.personID == person.uniqueID " +
+ " AND j1.personID == " + tp + ".uniqueID " +
+ " AND j2.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " myIndex DESC ";
@@ -788,6 +803,8 @@ class SqliteStat : Sqlite
public static ArrayList Fv (string sessionString, bool multisession, string ini, string end, string jump1, string jump2, bool showSex)
{
+ string tp = Constants.PersonTable;
+
string heightJump1 = " 100*4.9* (j1.tv/2.0) * (j1.tv/2.0) "; //jump1 tv converted to height
string heightJump2 = " 100*4.9* (j2.tv/2.0) * (j2.tv/2.0) "; //jump2 tv converted to height
@@ -810,12 +827,12 @@ class SqliteStat : Sqlite
}
//if multisession, order by person.name, sessionID for being able to present results later
if(multisession) {
- orderByString = orderByString + " person.name, j1.sessionID, ";
+ orderByString = orderByString + tp + ".name, j1.sessionID, ";
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, j1.sessionID, " + moreSelect +
- " FROM jump AS j1, jump AS j2, person " +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, j1.sessionID, " + moreSelect +
+ " FROM jump AS j1, jump AS j2, " + tp + " " +
sessionString +
" AND j1.type == '" + jump1 + "' " +
" AND j2.type == '" + jump2 + "' " +
@@ -827,8 +844,8 @@ class SqliteStat : Sqlite
" AND (j1.weight == \"100%\" OR j1.weight == person.weight||'" + "Kg' ) " +
*/
" AND j1.weight == \"100\" " +
- " AND j1.personID == person.uniqueID " +
- " AND j2.personID == person.uniqueID " +
+ " AND j1.personID == " + tp + ".uniqueID " +
+ " AND j2.personID == " + tp + ".uniqueID " +
groupByString +
orderByString + " myIndex DESC ";
@@ -869,6 +886,9 @@ class SqliteStat : Sqlite
public static ArrayList Potency (string indexType, string sessionString, bool multisession, string operationString, string jumpType, bool showSex, bool heightPreferred)
{
+ string tp = Constants.PersonTable;
+ string tps = Constants.PersonSessionTable;
+
string ini = "";
string end = "";
if(operationString == "MAX") {
@@ -876,13 +896,13 @@ class SqliteStat : Sqlite
end = ")";
}
- string orderByString = "ORDER BY person.name, ";
+ string orderByString = "ORDER BY " + tp + ".name, ";
string moreSelect = "";
string jumpHeightInM = "4.9 * jump.tv/2.0 * jump.tv/2.0";
- string personWeight = "personSessionWeight.weight";
- string extraWeight = "jump.weight*personSessionWeight.weight/100.0";
+ string personWeight = tps + ".weight";
+ string extraWeight = "jump.weight*" + tps + ".weight/100.0";
string totalWeight = personWeight + " + " + extraWeight;
if(indexType == Constants.PotencyLewisFormula) {
@@ -949,7 +969,7 @@ class SqliteStat : Sqlite
//divisor has to be .0 if not, double is bad calculated. Bug 478168
//TODO: check if ini,end is needed here
- string fromString = " FROM jump, person, personSessionWeight ";
+ string fromString = " FROM jump, " + tp + ", " + tps + " ";
string jumpTypeString = " AND jump.type == '" + jumpType + "' ";
@@ -966,14 +986,14 @@ class SqliteStat : Sqlite
}
dbcon.Open();
- dbcmd.CommandText = "SELECT person.name, person.sex, jump.sessionID, " + moreSelect +
+ dbcmd.CommandText = "SELECT " + tp + ".name, " + tp + ".sex, jump.sessionID, " + moreSelect +
fromString +
sessionString +
jumpTypeString +
- " AND jump.personID == person.uniqueID " +
- // personSessionWeight stuff
- " AND person.uniqueID == personSessionWeight.personID " +
- " AND jump.sessionID == personSessionWeight.sessionID " + //should work for simple and multi session
+ " AND jump.personID == " + tp + ".uniqueID " +
+ // personSession stuff
+ " AND " + tp + ".uniqueID == " + tps + ".personID " +
+ " AND jump.sessionID == " + tps + ".sessionID " + //should work for simple and multi session
groupByString +
//orderByString + ini + "indexPart1 * indexPart2WithoutSqrt" + end + " DESC ";
diff --git a/src/treeViewJump.cs b/src/treeViewJump.cs
index 391f69e..e02cbe2 100644
--- a/src/treeViewJump.cs
+++ b/src/treeViewJump.cs
@@ -176,7 +176,6 @@ public class TreeViewJumps : TreeViewEvent
Convert.ToDouble(myStringOfData[8]),
Convert.ToDouble(myStringOfData[12]));
-
return myJump;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]