Commit 06d35db8 authored by Xavier de Blas's avatar Xavier de Blas

show all person events done (closes task: 288)

export now exports height and initial speed (closes task: 259)

treeviewjumps shows height in centimeters

fixed bug in stats global and person with multisession and right yaxis
fixed bug in stats/simple/non indexes (showed "all" and "limit" and that's not possible)

clean code in gui/stats.cs
parent 0f309740
CHANGELOG:
31 aug 2005
show all person events done (closes task: 288)
export now exports height and initial speed (closes task: 259)
treeviewjumps shows height in centimeters
fixed bug in stats global and person with multisession and right yaxis
fixed bug in stats/simple/non indexes (showed "all" and "limit" and
that's not possible)
clean code in gui/stats.cs
26 aug 2005
Added index F/V (task: 273) in stats and graphs
new files: /src/stats/fv.cs /src/stats/graphs/fv.cs
......
No preview for this file type
......@@ -76,7 +76,7 @@
<signal name="activate" handler="on_open_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1094">
<widget class="GtkImage" id="image1163">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
......@@ -97,7 +97,7 @@
<signal name="activate" handler="on_edit_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1095">
<widget class="GtkImage" id="image1164">
<property name="visible">True</property>
<property name="stock">gtk-edit</property>
<property name="icon_size">1</property>
......@@ -119,7 +119,7 @@
<signal name="activate" handler="on_delete_session_activate" last_modification_time="Thu, 28 Jul 2005 13:37:42 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1096">
<widget class="GtkImage" id="image1165">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -146,7 +146,7 @@
<signal name="activate" handler="on_export_session_activate" last_modification_time="Sat, 12 Feb 2005 21:57:07 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1097">
<widget class="GtkImage" id="image1166">
<property name="visible">True</property>
<property name="stock">gtk-convert</property>
<property name="icon_size">1</property>
......@@ -217,7 +217,7 @@
<signal name="activate" handler="on_person_add_single_activate" last_modification_time="Thu, 18 Aug 2005 23:07:39 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1098">
<widget class="GtkImage" id="image1167">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
......@@ -238,7 +238,7 @@
<signal name="activate" handler="on_person_add_multiple_activate" last_modification_time="Thu, 18 Aug 2005 23:01:23 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1099">
<widget class="GtkImage" id="image1168">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
......@@ -265,7 +265,7 @@
<signal name="activate" handler="on_recuperate_person_activate" last_modification_time="Sun, 12 Dec 2004 00:40:31 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1100">
<widget class="GtkImage" id="image1169">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
......@@ -286,7 +286,7 @@
<signal name="activate" handler="on_recuperate_persons_from_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1101">
<widget class="GtkImage" id="image1170">
<property name="visible">True</property>
<property name="stock">gtk-open</property>
<property name="icon_size">1</property>
......@@ -313,7 +313,7 @@
<signal name="activate" handler="on_edit_current_person_clicked" last_modification_time="Sun, 17 Oct 2004 11:43:33 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1102">
<widget class="GtkImage" id="image1171">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
......@@ -326,6 +326,27 @@
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="show_all_person_events">
<property name="visible">True</property>
<property name="label" translatable="yes">_Show all events of current person</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 09:51:24 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1172">
<property name="visible">True</property>
<property name="stock">gtk-index</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separador12">
<property name="visible">True</property>
......@@ -340,7 +361,7 @@
<signal name="activate" handler="on_delete_current_person_from_session_activate" last_modification_time="Thu, 28 Jul 2005 15:49:38 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1103">
<widget class="GtkImage" id="image1173">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -428,7 +449,7 @@
<signal name="activate" handler="on_button_more_clicked" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1104">
<widget class="GtkImage" id="image1174">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
......@@ -453,7 +474,7 @@
<signal name="activate" handler="on_edit_selected_jump_clicked" last_modification_time="Sun, 17 Oct 2004 11:47:42 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1105">
<widget class="GtkImage" id="image1175">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
......@@ -474,7 +495,7 @@
<signal name="activate" handler="on_delete_selected_jump_clicked" last_modification_time="Tue, 19 Oct 2004 11:54:17 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1106">
<widget class="GtkImage" id="image1176">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -538,7 +559,7 @@
<signal name="activate" handler="on_button_more_rj_clicked" last_modification_time="Fri, 11 Mar 2005 14:45:23 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1107">
<widget class="GtkImage" id="image1177">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
......@@ -563,7 +584,7 @@
<signal name="activate" handler="on_edit_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1108">
<widget class="GtkImage" id="image1178">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
......@@ -584,7 +605,7 @@
<signal name="activate" handler="on_delete_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1109">
<widget class="GtkImage" id="image1179">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -611,7 +632,7 @@
<signal name="activate" handler="on_jump_type_add_activate" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1110">
<widget class="GtkImage" id="image1180">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
......@@ -717,7 +738,7 @@
<signal name="activate" handler="on_button_run_more_clicked" last_modification_time="Fri, 22 Apr 2005 14:37:06 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1111">
<widget class="GtkImage" id="image1181">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
......@@ -742,7 +763,7 @@
<signal name="activate" handler="on_edit_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1112">
<widget class="GtkImage" id="image1182">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
......@@ -763,7 +784,7 @@
<signal name="activate" handler="on_delete_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1113">
<widget class="GtkImage" id="image1183">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -826,7 +847,7 @@
<signal name="activate" handler="on_button_run_interval_more_clicked" last_modification_time="Tue, 16 Aug 2005 01:18:41 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1114">
<widget class="GtkImage" id="image1184">
<property name="visible">True</property>
<property name="stock">gtk-add</property>
<property name="icon_size">1</property>
......@@ -851,7 +872,7 @@
<signal name="activate" handler="on_edit_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1115">
<widget class="GtkImage" id="image1185">
<property name="visible">True</property>
<property name="stock">gtk-justify-fill</property>
<property name="icon_size">1</property>
......@@ -872,7 +893,7 @@
<signal name="activate" handler="on_delete_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1116">
<widget class="GtkImage" id="image1186">
<property name="visible">True</property>
<property name="stock">gtk-remove</property>
<property name="icon_size">1</property>
......@@ -899,7 +920,7 @@
<signal name="activate" handler="on_run_type_add_activate" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image1117">
<widget class="GtkImage" id="image1187">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
......@@ -951,7 +972,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">Simulated</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<property name="active">True</property>
<signal name="activate" handler="on_radiobutton_simulated_activate" last_modification_time="Sat, 08 Jan 2005 05:09:37 GMT"/>
</widget>
</child>
......@@ -1427,6 +1448,42 @@
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolItem" id="toolitem6">
<property name="visible">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<child>
<widget class="GtkButton" id="button_show_all_person_events">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">show all events of this person</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 12:14:12 GMT"/>
<child>
<widget class="GtkImage" id="image1188">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......@@ -11203,4 +11260,163 @@ If you need more, just repeat the operation later</property>
</child>
</widget>
<widget class="GtkWindow" id="person_show_all_events">
<property name="border_width">10</property>
<property name="width_request">480</property>
<property name="height_request">350</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Show all events of a person</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<signal name="delete_event" handler="on_delete_event" last_modification_time="Sat, 27 Aug 2005 15:30:23 GMT"/>
<child>
<widget class="GtkVBox" id="vbox49">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="checkbutton_only_current_session">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">show only persons in current session</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="on_checkbutton_only_current_session_clicked" last_modification_time="Mon, 29 Aug 2005 11:52:55 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox105">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="label166">
<property name="visible">True</property>
<property name="label" translatable="yes">Person</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox_combo_persons">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow20">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="treeview_person_show_all_events">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox23">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button_close">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_button_close_clicked" last_modification_time="Sat, 02 Oct 2004 22:19:30 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
......@@ -206,6 +206,7 @@ public class ChronoJump
PersonAddWindow personAddWin;
PersonAddMultipleWindow personAddMultipleWin;
PersonModifyWindow personModifyWin;
PersonShowAllEventsWindow personShowAllEventsWin;
JumpsMoreWindow jumpsMoreWin;
JumpsRjMoreWindow jumpsRjMoreWin;
JumpExtraWindow jumpExtraWin; //for normal and repetitive jumps
......@@ -1093,6 +1094,10 @@ public class ChronoJump
}
}
private void on_show_all_person_events_activate (object o, EventArgs args) {
personShowAllEventsWin = PersonShowAllEventsWindow.Show(app1, currentSession.UniqueID, currentPerson);
}
private void on_delete_current_person_from_session_activate (object o, EventArgs args) {
Console.WriteLine("delete current person from this session");
......
......@@ -189,21 +189,26 @@ public class ExportSessionCSV : ExportSession
Catalog.GetString("Jumper name") + ", " +
Catalog.GetString("jump ID") + ", " +
Catalog.GetString("Type") + ", " +
Catalog.GetString("TV") + ", " +
Catalog.GetString("TC") + ", " +
"TV, " +
"TC, " +
Catalog.GetString("Fall") + ", " +
Catalog.GetString("Weight") + ", " +
Catalog.GetString("Height") + ", " +
Catalog.GetString("Initial Speed") + ", " +
Catalog.GetString("Description") );
foreach (string jumpString in myJumps) {
string [] myStr = jumpString.Split(new char[] {':'});
writer.WriteLine ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}",
writer.WriteLine ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}",
myStr[0], myStr[1], //person.name, jump.uniqueID
//myStr[2], myStr[3], //jump.personID, jump.sessionID
myStr[4], myStr[5], //jump.type, jump.tv
myStr[6], myStr[7], //jump.tc, jump.fall
myStr[8], myStr[9] //jump.weight, jump.description
myStr[8], //jump.weight,
Util.GetHeightInCentimeters(myStr[5]),
Util.GetInitialSpeed(myStr[5]),
myStr[9] //jump.description
);
}
}
......@@ -219,22 +224,33 @@ public class ExportSessionCSV : ExportSession
Catalog.GetString("Jumper name") + ", " +
Catalog.GetString("jump ID") + ", " +
Catalog.GetString("jump Type") + ", " +
Catalog.GetString("TV Max") + ", " +
Catalog.GetString("TC Max") + ", " +
Catalog.GetString("TV AVG") + ", " +
Catalog.GetString("TV Max") + ", " +
Catalog.GetString("Max Height") + ", " +
Catalog.GetString("Max Initial Speed") + ", " +
Catalog.GetString("TC AVG") + ", " +
Catalog.GetString("TV AVG") + ", " +
Catalog.GetString("AVG Height") + ", " +
Catalog.GetString("AVG Initial Speed") + ", " +
Catalog.GetString("Fall") + ", " +
Catalog.GetString("Weight") + ", " +
Catalog.GetString("Jumps") + ", " +
Catalog.GetString("Time") + ", " +
Catalog.GetString("Limited") + ", " +
Catalog.GetString("Description" ) );
writer.WriteLine ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}",
writer.WriteLine ("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}, {16}",
myStr[0], myStr[1], //person.name, jumpRj.uniqueID
//myStr[2], myStr[3], //jumpRj.personID, jumpRj.sessionID
myStr[4], myStr[5], //jumpRj.type, jumpRj.tvMax
myStr[6], myStr[10], //jumpRj.tcMax, jumpRj.tvAvg
myStr[11], myStr[7], //jumpRj.tvAvg, jumpRj.Fall
myStr[4], //jumpRj.type
myStr[6], //jumpRj.tcMax
myStr[5], //jumpRj.tvMax
Util.GetHeightInCentimeters(myStr[5]), //Max height
Util.GetInitialSpeed(myStr[5]), //Max initial speed
myStr[11], //jumpRj.tcAvg
myStr[10], //jumpRj.tvAvg
Util.GetHeightInCentimeters(myStr[10]), //Avg height
Util.GetInitialSpeed(myStr[10]), //Avg Initial speed
myStr[7], //jumpRj.Fall
myStr[8], myStr[14], //jumpRj.Weight, jumpRj.Jumps
myStr[15], myStr[16], //jumpRj.Time, jumpRj.Limited
myStr[9] //jumpRj.Description
......
......@@ -945,3 +945,148 @@ public class PersonAddMultipleWindow {
}
}
//show all events (jumps and runs) of a person in different sessions
public class PersonShowAllEventsWindow {
[Widget] Gtk.Window person_show_all_events;
[Widget] Gtk.CheckButton checkbutton_only_current_session;
TreeStore store;
[Widget] Gtk.TreeView treeview_person_show_all_events;
[Widget] Gtk.Box hbox_combo_persons;
[Widget] Gtk.Combo combo_persons;
static PersonShowAllEventsWindow PersonShowAllEventsWindowBox;
protected Gtk.Window parent;
protected int sessionID;
protected Person currentPerson;
PersonShowAllEventsWindow (Gtk.Window parent, int sessionID, Person currentPerson) {
Glade.XML gladeXML = Glade.XML.FromAssembly ("chronojump.glade", "person_show_all_events", null);
gladeXML.Autoconnect(this);
this.parent = parent;
this.sessionID = sessionID;
this.currentPerson = currentPerson;
createComboPersons(sessionID, currentPerson.UniqueID.ToString(), currentPerson.Name);
createTreeView(treeview_person_show_all_events);
store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof (string),
typeof (string), typeof(string), typeof(string) );
treeview_person_show_all_events.Model = store;
fillTreeView(treeview_person_show_all_events,store, currentPerson.UniqueID);
}
static public PersonShowAllEventsWindow Show (Gtk.Window parent, int sessionID, Person currentPerson)
{
if (PersonShowAllEventsWindowBox == null) {
PersonShowAllEventsWindowBox = new PersonShowAllEventsWindow (parent, sessionID, currentPerson);
}
PersonShowAllEventsWindowBox.person_show_all_events.Show ();
return PersonShowAllEventsWindowBox;
}
private void createComboPersons(int sessionID, string personID, string personName) {
combo_persons = new Combo ();
int inSession = -1; //select persons from all sessions
if(checkbutton_only_current_session.Active) {
inSession = sessionID; //select only persons who are on currentSession
}
string [] myPersons = SqlitePerson.SelectAllPersonsRecuperable("name", -1, inSession);
//put only id and name in combo
string [] myPersons2 = new string[myPersons.Length];
int count = 0;
foreach (string person in myPersons) {
string [] myStr = person.Split(new char[] {':'});
myPersons2[count++] = myStr[0] + ":" + myStr[1];
}
combo_persons.PopdownStrings = myPersons2;
//selected is current person
foreach (string person in myPersons2) {
if (person == personID + ":" + personName) {
combo_persons.Entry.Text = person;
}
}
combo_persons.DisableActivate ();
combo_persons.Entry.Changed += new EventHandler (on_combo_persons_changed);
hbox_combo_persons.PackStart(combo_persons, true, true, 0);
hbox_combo_persons.ShowAll();
combo_persons.Sensitive = true;
}
private void on_combo_persons_changed(object o, EventArgs args) {
string myText = combo_persons.Entry.Text;
if(myText != "") {
store = new TreeStore( typeof (string), typeof (string), typeof (string), typeof (string),
typeof (string), typeof(string), typeof(string) );
treeview_person_show_all_events.Model = store;
string [] myStringFull = myText.Split(new char[] {':'});
fillTreeView( treeview_person_show_all_events, store, Convert.ToInt32(myStringFull[0]) );
}
}
protected void on_checkbutton_only_current_session_clicked(object o, EventArgs args) {
string myText = combo_persons.Entry.Text;
if(myText != "") {
string [] myStringFull = myText.Split(new char[] {':'});
combo_persons.Destroy();
createComboPersons(sessionID, myStringFull[0], myStringFull[1] );
on_combo_persons_changed(0, args); //called for updating the treeview ifcombo_persons.Entry changed
}
}
protected void createTreeView (Gtk.TreeView tv) {
tv.HeadersVisible=true;
int count = 0;
tv.AppendColumn ( Catalog.GetString ("Session name"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Place"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Date\n(MM/DD/YYYY)"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Jumps\nsimple"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Jumps\nreactive"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Runs\nsimple"), new CellRendererText(), "text", count++);
tv.AppendColumn ( Catalog.GetString ("Runs\ninterval"), new CellRendererText(), "text", count++);
}
protected void fillTreeView (Gtk.TreeView tv, TreeStore store, int personID) {
ArrayList myEvents;
//myEvents = SqlitePerson.SelectAllPersonEvents(currentPerson.UniqueID);
myEvents = SqlitePerson.SelectAllPersonEvents(personID);
foreach (string myEvent in myEvents) {
string [] myStr = myEvent.Split(new char[] {':'});
store.AppendValues (myStr[0], myStr[1], myStr[2], myStr[3], myStr[4], myStr[5], myStr[6]);
}
}
protected virtual void on_button_close_clicked (object o, EventArgs args)
{
PersonShowAllEventsWindowBox.person_show_all_events.Hide();
PersonShowAllEventsWindowBox = null;
}
protected virtual void on_delete_event (object o, EventArgs args)
{
PersonShowAllEventsWindowBox.person_show_all_events.Hide();
PersonShowAllEventsWindowBox = null;
}
}
......@@ -83,12 +83,13 @@ public class StatsWindow {
Catalog.GetString("Simple"),
Catalog.GetString("With TC"),
Catalog.GetString("Reactive"),
//Catalog.GetString("Indexes")
};
static string djIndexFormula = Catalog.GetString("Dj Index") + " ((tv-tc)/tc *100)";
static string qIndexFormula = Catalog.GetString("Q index") + " (tv/tc)";
private static string [] comboStatsSubTypeWithTCOptions = {
Catalog.GetString("Dj Index") + " ((tv-tc)*100/tc)",
Catalog.GetString("Q index") + " (tv/tc)"
djIndexFormula,
qIndexFormula
};