private void on_button_graph_clicked(object o, EventArgs args) { if (selected) { TreeModel model; TreeIter iter1; if (treeview1.Selection.GetSelected(out model, out iter1)) { string str = getRow(iter1); string [] statRow = str.ToString().Split(new char[] { '\t' }); string subType; int rj_evolution_mark_consecutives = report.GetRjEvolutionMarkConsecutives(statRow[1], out subType); ArrayList sendSelectedSessions = report.GetSelectedSessions(statRow[3]); Gtk.TreeView treeviewFake = new Gtk.TreeView(); //not needed for graph bool showSex = Util.StringToBool(statRow[5]); int limit = -1; int statsJumpsType = report.GetStatsJumpTypeAndLimit(statRow[4], out limit); ArrayList arrayListMarkedRows = Util.StringToArrayList(statRow[6], ':'); GraphROptions graphROptions = new GraphROptions(statRow[7]); StatType myStatType = new StatType( statRow[0], //statisticType subType, statRow[2], //statisticApplyTo, treeviewFake, sendSelectedSessions, showSex, statsJumpsType, limit, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, true, //graph false, //always false in this class report.preferences ); myStatType.ChooseStat(); } } }
protected void printStats() { if (StatisticsData.Count > 0) { writer.WriteLine("<h2>Statistics</h2>"); } //obtain every report stats one by one for (int statCount = 0; statCount < StatisticsData.Count; statCount++) { string [] strFull = StatisticsData[statCount].ToString().Split(new char[] { '\t' }); string myHeaderStat = ""; //separate in sessions ArrayList sendSelectedSessions = GetSelectedSessions(strFull[3]); //separate in markedRows ArrayList arrayListMarkedRows = Util.StringToArrayList(strFull[6], ':'); string applyTo = strFull[2]; myHeaderStat += "<h3> " + strFull[0] + " : " + strFull[1] + " : " + applyTo + "</h3> "; bool showSex = Util.StringToBool(strFull[5]); int limit; int statsJumpsType = GetStatsJumpTypeAndLimit(strFull[4], out limit); //obtain marked jumps of rj evolution if needed string subType; int rj_evolution_mark_consecutives = GetRjEvolutionMarkConsecutives(strFull[1], out subType); myHeaderStat += "\n<p><TABLE cellpadding=2 cellspacing=2><tr><td>\n"; writer.WriteLine(myHeaderStat); StatType myStatType; //bool allFine; //report of stat GraphROptions graphROptions = new GraphROptions(strFull[7]); myStatType = new StatType( strFull[0], //statisticType subType, //statisticSubType strFull[2], //statisticApplyTo sendSelectedSessions, showSex, statsJumpsType, limit, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, false, //graph toReport, preferences, writer, "", statCount ); //allFine = myStatType.ChooseStat(); myStatType.ChooseStat(); string myEnunciate = "<tr><td>" + myStatType.Enunciate + "</td></tr>"; writer.WriteLine("<br>"); //report of graph myStatType = new StatType( strFull[0], //statisticType subType, //statisticSubType strFull[2], //statisticApplyTo sendSelectedSessions, showSex, statsJumpsType, limit, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, true, //graph toReport, preferences, writer, fileName, //fileName for exporting there statCount ); myStatType.ChooseStat(); //enunciate is prented here and not before //because myStatType of a graph doesn't know the numContinuous value //needed for enunciate in rj evolution statistic writer.WriteLine(myEnunciate); writer.WriteLine("<tr><td>" + strFull[8] + "</td></tr>"); //comment writer.WriteLine("</table>"); } }
private bool fillTreeView_stats(bool graph) { if(blockFillingTreeview) return false; Log.WriteLine("----------FILLING treeview stats---------------"); string statisticType = UtilGtk.ComboGetActive(combo_stats_stat_type); string statisticSubType = UtilGtk.ComboGetActive(combo_stats_stat_subtype); string statisticApplyTo = ""; if (UtilGtk.ComboGetActive(combo_stats_stat_subtype) == Catalog.GetString(Constants.SubtractionBetweenTests)) statisticApplyTo = UtilGtk.ComboGetActive(combo_subtraction_between_1) + "," + UtilGtk.ComboGetActive(combo_subtraction_between_2); else statisticApplyTo = UtilGtk.ComboGetActive(combo_stats_stat_apply_to); if(statsColumnsToRemove && !graph) { statsRemoveColumns(); } statsColumnsToRemove = true; bool toReport = false; //all graphs are done for be shown on window (not to file like report.cs) int statsJumpsType = 0; int limit = -1; if (radiobutton_stats_jumps_all.Active) { statsJumpsType = 0; limit = -1; } else if (radiobutton_stats_jumps_limit.Active) { statsJumpsType = 1; limit = Convert.ToInt32 ( spin_stats_jumps_limit.Value ); } else if (radiobutton_stats_jumps_person_bests.Active) { statsJumpsType = 2; limit = Convert.ToInt32 ( spin_stats_jumps_person_bests.Value ); } else { statsJumpsType = 3; limit = -1; } //we use sendSelectedSessions for not losing selectedSessions ArrayList //everytime user cicles the sessions select radiobuttons sendSelectedSessions = new ArrayList(2); if (radiobutton_current_session.Active) { sendSelectedSessions.Add (currentSession.UniqueID + ":" + currentSession.Name + ":" + currentSession.Date); } else if (radiobutton_selected_sessions.Active) { sendSelectedSessions = selectedSessions; } //the mark best jumps or runs is only on rjEvolution and runInterval //runInterval has only one stat subtype and is like rjEvolution int evolution_mark_consecutives = -1; if ( ( UtilGtk.ComboGetActive(combo_stats_stat_subtype) == Catalog.GetString("Evolution") || UtilGtk.ComboGetActive(combo_stats_stat_type) == Constants.TypeRunsIntervallic ) && checkbutton_mark_consecutives.Active ) { evolution_mark_consecutives = Convert.ToInt32 ( spinbutton_mark_consecutives.Value ); } ArrayList markedRows = new ArrayList(); if(graph) { markedRows = myStatType.MarkedRows; } //if we change combo_type, subtype, or others, always, show button_graph & add_to_report, //if there's no data, they will be hided, later button_graph.Sensitive = true; button_add_to_report.Sensitive = true; GraphROptions graphROptions = fillGraphROptions(); myStatType = new StatType( statisticType, statisticSubType, statisticApplyTo, treeview_stats, sendSelectedSessions, prefsDigitsNumber, checkbutton_stats_sex.Active, statsJumpsType, limit, heightPreferred, weightPercentPreferred, markedRows, evolution_mark_consecutives, graphROptions, graph, toReport //always false in this class ); //if we just made a graph, store is not made, //and we cannot change the Male/female visualizations in the combo //with this we can assign a store to the graph (we assign the store of the last stat (not graph) //define lastStore before Choosing Stat if(! toReport) if (graph) myStatType.LastStore = lastStore; bool allFine = myStatType.ChooseStat(); //if we just made a graph, store is not made, //and we cannot change the Male/female visualizations in the combo //with this we can assign a store to the graph (we assign the store of the last stat (not graph) //assign lastStore here if(! toReport) if(! graph) lastStore = myStatType.LastStore; myStatType.FakeButtonRowCheckedUnchecked.Clicked += new EventHandler(on_fake_button_row_checked_clicked); myStatType.FakeButtonRowsSelected.Clicked += new EventHandler(on_fake_button_rows_selected_clicked); myStatType.FakeButtonNoRowsSelected.Clicked += new EventHandler(on_fake_button_no_rows_selected_clicked); //useful for not showing button_graph & add_to_report when there are no rows try { if(myStatType.MarkedRows.Count == 0) { button_graph.Sensitive = false; button_add_to_report.Sensitive = false; } } catch { Log.WriteLine("Do markedRows stuff later"); } //show enunciate of the stat in textview_enunciate TextBuffer tb = new TextBuffer (new TextTagTable()); tb.Text = myStatType.Enunciate; textview_enunciate.Buffer = tb; tb.Text = myStatType.Enunciate; //show/hide persons selector on comboCheckboxesOptions if(! graph) { if(UtilGtk.ComboGetActive(combo_stats_stat_type) != Constants.TypeSessionSummary && UtilGtk.ComboGetActive(combo_stats_stat_type) != Constants.TypeJumperSummary) comboCheckboxesOptions = addPersonsToComboCheckBoxesOptions(); else comboCheckboxesOptions = comboCheckboxesOptionsWithoutPersons; UtilGtk.ComboUpdate(combo_select_checkboxes, comboCheckboxesOptions, ""); UtilGtk.ComboUpdate(combo_graph_var_x, UtilGtk.GetCols(treeview_stats, 2), ""); UtilGtk.ComboUpdate(combo_graph_var_y, UtilGtk.GetCols(treeview_stats, 2), ""); } //every time a stat is created, all rows should be checked (except AVG & SD) //but not if we clicked graph if(! graph) { combo_select_checkboxes.Active = UtilGtk.ComboMakeActive(comboCheckboxesOptions, Catalog.GetString("All")); try { combo_graph_var_x.Active=0; combo_graph_var_y.Active=0; } catch {} //maybe there's no data } showUpdateStatsAndHideData(false); if(allFine) { return true; } else { return false; } }
private void on_button_graph_clicked(object o, EventArgs args) { if(selected) { TreeModel model; TreeIter iter1; if (treeview1.Selection.GetSelected (out model, out iter1)) { string str=getRow(iter1); string [] statRow = str.ToString().Split(new char[] {'\t'}); string subType; int rj_evolution_mark_consecutives = report.GetRjEvolutionMarkConsecutives(statRow[1], out subType); ArrayList sendSelectedSessions = report.GetSelectedSessions(statRow[3]); Gtk.TreeView treeviewFake = new Gtk.TreeView(); //not needed for graph bool showSex = Util.StringToBool(statRow[5]); int limit = -1; int statsJumpsType = report.GetStatsJumpTypeAndLimit(statRow[4], out limit); ArrayList arrayListMarkedRows = Util.StringToArrayList(statRow[6], ':'); GraphROptions graphROptions = new GraphROptions(statRow[7]); StatType myStatType = new StatType( statRow[0], //statisticType subType, statRow[2], //statisticApplyTo, treeviewFake, sendSelectedSessions, showSex, statsJumpsType, limit, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, true, //graph false, //always false in this class report.preferences ); myStatType.ChooseStat(); } } }
protected void printStats() { if(StatisticsData.Count > 0) writer.WriteLine("<h2>Statistics</h2>"); //obtain every report stats one by one for(int statCount=0; statCount < StatisticsData.Count ; statCount++) { string [] strFull = StatisticsData[statCount].ToString().Split(new char[] {'\t'}); string myHeaderStat = ""; //separate in sessions ArrayList sendSelectedSessions = GetSelectedSessions(strFull[3]); //separate in markedRows ArrayList arrayListMarkedRows = Util.StringToArrayList(strFull[6], ':'); string applyTo = strFull[2]; myHeaderStat += "<h3> " + strFull[0] + " : " + strFull[1] + " : " + applyTo + "</h3> "; bool showSex = Util.StringToBool(strFull[5]); int limit; int statsJumpsType = GetStatsJumpTypeAndLimit(strFull[4], out limit); //obtain marked jumps of rj evolution if needed string subType; int rj_evolution_mark_consecutives = GetRjEvolutionMarkConsecutives(strFull[1], out subType); myHeaderStat += "\n<p><TABLE cellpadding=2 cellspacing=2><tr><td>\n"; writer.WriteLine(myHeaderStat); StatType myStatType; //bool allFine; //report of stat GraphROptions graphROptions = new GraphROptions(strFull[7]); myStatType = new StatType( strFull[0], //statisticType subType, //statisticSubType strFull[2], //statisticApplyTo sendSelectedSessions, prefsDigitsNumber, showSex, statsJumpsType, limit, heightPreferred, weightStatsPercent, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, false, //graph toReport, writer, "", statCount ); //allFine = myStatType.ChooseStat(); myStatType.ChooseStat(); string myEnunciate ="<tr><td>" + myStatType.Enunciate + "</td></tr>"; writer.WriteLine("<br>"); //report of graph myStatType = new StatType( strFull[0], //statisticType subType, //statisticSubType strFull[2], //statisticApplyTo sendSelectedSessions, prefsDigitsNumber, showSex, statsJumpsType, limit, heightPreferred, weightStatsPercent, arrayListMarkedRows, rj_evolution_mark_consecutives, graphROptions, true, //graph toReport, writer, fileName, //fileName for exporting there statCount ); myStatType.ChooseStat(); //enunciate is prented here and not before //because myStatType of a graph doesn't know the numContinuous value //needed for enunciate in rj evolution statistic writer.WriteLine(myEnunciate); writer.WriteLine("<tr><td>" + strFull[8] + "</td></tr>"); //comment writer.WriteLine("</table>"); } }