Commit 74b67c70 authored by Xavier de Blas's avatar Xavier de Blas

doing individual selectable jumps (checkboxes in treeview) for graphs and report.

TODO:
* now rjEvolution graph is not correct
* now all multisession graphs are broken
* later check reports and graphs in reports

In create persons multiple two persons with same name cannot be added together

minor changes
	fixed bug: button and menuitem show all person events hided when there is no current person
	fixed little bug? in counting report images
	cleaned stats/main.cs
parent abd71456
CHANGELOG:
24 set 2005
doing individual selectable jumps (checkboxes in treeview) for graphs and report.
TODO:
* now rjEvolution graph is not correct
* now all multisession graphs are broken
* later check reports and graphs in reports
In create persons multiple two persons with same name cannot be added together
minor changes
fixed bug: button and menuitem show all person events hided when there is no current person
fixed little bug? in counting report images
cleaned stats/main.cs
22 set 2005
from stats/reactive/evolution it's possible to find the best subjump
or the 'n' best consecutives subjumps. Done for stats and report (currently not possible to implement in
......
No preview for this file type
......@@ -144,6 +144,8 @@ public class ChronoJump
[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.Button button_cancel;
[Widget] Gtk.Button button_finish;
......@@ -690,6 +692,8 @@ public class ChronoJump
combo_person_current.Sensitive = false;
button_edit_current_person.Sensitive = false;
menuitem_edit_current_person.Sensitive = false;
button_show_all_person_events.Sensitive = false;
show_all_person_events.Sensitive = false;
}
private void updateComboJumps() {
......@@ -919,6 +923,8 @@ public class ChronoJump
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;
//update combo sujeto current
updateComboSujetoCurrent();
combo_person_current.Sensitive = false;
......@@ -981,6 +987,8 @@ public class ChronoJump
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;
//update combo sujeto current
bool myBool = updateComboSujetoCurrent();
combo_person_current.Sensitive = false;
......@@ -2284,6 +2292,8 @@ public class ChronoJump
label_current_person.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;
......@@ -2321,6 +2331,8 @@ public class ChronoJump
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;
......@@ -2363,6 +2375,8 @@ public class ChronoJump
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;
......
......@@ -785,6 +785,7 @@ public class PersonAddMultipleWindow {
int personsCreatedCount;
string errorExistsString;
string errorWeightString;
string errorRepeatedEntryString;
PersonAddMultipleWindow (Gtk.Window parent, int sessionID) {
Glade.XML gladeXML = Glade.XML.FromAssembly ("chronojump.glade", "person_add_multiple", null);
......@@ -820,8 +821,9 @@ public class PersonAddMultipleWindow {
{
errorExistsString = "";
errorWeightString = "";
errorRepeatedEntryString = "";
personsCreatedCount = 0;
int count = 1;
checkEntries(count++, entry1.Text.ToString(), (int) spinbutton1.Value);
checkEntries(count++, entry2.Text.ToString(), (int) spinbutton2.Value);
......@@ -833,6 +835,8 @@ public class PersonAddMultipleWindow {
checkEntries(count++, entry8.Text.ToString(), (int) spinbutton8.Value);
checkEntries(count++, entry9.Text.ToString(), (int) spinbutton9.Value);
checkEntries(count++, entry10.Text.ToString(), (int) spinbutton10.Value);
checkAllEntriesAreDifferent();
string combinedErrorString = "";
combinedErrorString = readErrorStrings();
......@@ -858,6 +862,36 @@ public class PersonAddMultipleWindow {
}
}
}
void checkAllEntriesAreDifferent() {
ArrayList newNames= new ArrayList();
newNames.Add(entry1.Text.ToString());
newNames.Add(entry2.Text.ToString());
newNames.Add(entry3.Text.ToString());
newNames.Add(entry4.Text.ToString());
newNames.Add(entry5.Text.ToString());
newNames.Add(entry6.Text.ToString());
newNames.Add(entry7.Text.ToString());
newNames.Add(entry8.Text.ToString());
newNames.Add(entry9.Text.ToString());
newNames.Add(entry10.Text.ToString());
for(int i=0; i<10; i++) {
bool repeated = false;
if(Util.RemoveTilde(newNames[i].ToString()).Length > 0) {
int j;
for(j=i+1; j<10 && !repeated; j++) {
if( Util.RemoveTilde(newNames[i].ToString()) == Util.RemoveTilde(newNames[j].ToString()) ) {
repeated = true;
}
}
if(repeated) {
errorRepeatedEntryString += string.Format("[{0}] {1} - [{2}] {3}\n",
i+1, newNames[i].ToString(), j, newNames[j-1].ToString());
}
}
}
}
string readErrorStrings() {
if (errorExistsString.Length > 0) {
......@@ -866,8 +900,11 @@ public class PersonAddMultipleWindow {
if (errorWeightString.Length > 0) {
errorWeightString = "\nERROR weight of this person(s) cannot be 0:\n" + errorWeightString;
}
if (errorRepeatedEntryString.Length > 0) {
errorRepeatedEntryString = "\nERROR this names are repeated:\n" + errorRepeatedEntryString;
}
return errorExistsString + errorWeightString;
return errorExistsString + errorWeightString + errorRepeatedEntryString;
}
//inserts all the rows where name is not blank
......
......@@ -77,7 +77,8 @@ public class StatsWindow {
ArrayList selectedSessions;
//private Stat myStat;
private StatType myStatType;
private string allJumpsName = Catalog.GetString("All jumps");
private static string [] comboStatsTypeOptions = {
......@@ -136,6 +137,7 @@ public class StatsWindow {
this.reportWin= reportWin;
//myStat = new Stat(); //create and instance of myStat
myStatType = new StatType();
createComboStatsType();
createComboStatsSubType();
......@@ -355,7 +357,12 @@ public class StatsWindow {
rj_evolution_mark_consecutives = Convert.ToInt32 ( spinbutton_mark_consecutives.Value );
}
StatType myStatType = new StatType(
ArrayList markedRows = new ArrayList();
if(graph) {
markedRows = myStatType.MarkedRows;
}
myStatType = new StatType(
statisticType,
statisticSubType,
statisticApplyTo,
......@@ -367,9 +374,10 @@ public class StatsWindow {
limit,
heightPreferred,
weightStatsPercent,
markedRows,
rj_evolution_mark_consecutives,
graph,
toReport
toReport //always false in this class
);
bool allFine = myStatType.ChooseStat();
......@@ -378,7 +386,8 @@ public class StatsWindow {
TextBuffer tb = new TextBuffer (new TextTagTable());
tb.SetText(myStatType.Enunciate);
textview_enunciate.Buffer = tb;
tb.SetText(myStatType.Enunciate);
if(allFine) {
return true;
} else {
......
......@@ -36,11 +36,15 @@ public class StatTypeStruct
public int Limit;
public bool HeightPreferred;
public bool WeightStatsPercent;
public ArrayList MarkedRows;
public bool ToReport;
public StatTypeStruct (string statisticApplyTo,
ArrayList sendSelectedSessions, int prefsDigitsNumber, bool sex_active,
int statsJumpsType, int limit, bool heightPreferred, bool weightStatsPercent,
ArrayList markedRows,
bool toReport)
{
this.StatisticApplyTo = statisticApplyTo;
......@@ -51,6 +55,7 @@ public class StatTypeStruct
this.Limit = limit;
this.HeightPreferred = heightPreferred;
this.WeightStatsPercent = weightStatsPercent;
this.MarkedRows = markedRows;
this.ToReport = toReport;
}
}
......@@ -69,6 +74,9 @@ public class StatType {
bool heightPreferred;
bool weightStatsPercent;
int rj_evolution_mark_consecutives;
ArrayList markedRows;
bool graph;
bool toReport;
TextWriter writer;
......@@ -88,10 +96,15 @@ public class StatType {
StatTypeStruct myStatTypeStruct;
//comes from gui/stats.cs (initialization)
public StatType () {
}
//comes from gui/stats.cs
public StatType (string statisticType, string statisticSubType, string statisticApplyTo, Gtk.TreeView treeview_stats,
ArrayList sendSelectedSessions, int prefsDigitsNumber, bool sex_active,
int statsJumpsType, int limit, bool heightPreferred, bool weightStatsPercent,
int statsJumpsType, int limit, bool heightPreferred, bool weightStatsPercent,
ArrayList markedRows,
int rj_evolution_mark_consecutives, bool graph, bool toReport)
{
//some of this will disappear when we use myStatTypeStruct in all classes:
......@@ -106,15 +119,20 @@ public class StatType {
this.limit = limit;
this.heightPreferred = heightPreferred;
this.weightStatsPercent = weightStatsPercent;
this.markedRows = markedRows;
this.rj_evolution_mark_consecutives = rj_evolution_mark_consecutives;
this.graph = graph;
this.toReport = toReport;
myStatTypeStruct = new StatTypeStruct (
statisticApplyTo,
sendSelectedSessions, prefsDigitsNumber, sex_active,
statsJumpsType, limit, heightPreferred, weightStatsPercent,
toReport);
markedRows,
toReport);
myStat = new Stat(); //create and instance of myStat
}
......@@ -123,6 +141,7 @@ public class StatType {
public StatType (string statisticType, string statisticSubType, string statisticApplyTo,
ArrayList sendSelectedSessions, int prefsDigitsNumber, bool sex_active,
int statsJumpsType, int limit, bool heightPreferred, bool weightStatsPercent,
//ArrayList markedRows,
int rj_evolution_mark_consecutives,
bool graph, bool toReport, TextWriter writer, string fileName)
{
......@@ -136,6 +155,10 @@ public class StatType {
this.limit = limit;
this.heightPreferred = heightPreferred;
this.weightStatsPercent = weightStatsPercent;
//this.markedRows = markedRows;
this.markedRows = new ArrayList();
this.rj_evolution_mark_consecutives = rj_evolution_mark_consecutives;
this.graph = graph;
this.toReport = toReport;
......@@ -146,13 +169,13 @@ public class StatType {
statisticApplyTo,
sendSelectedSessions, prefsDigitsNumber, sex_active,
statsJumpsType, limit, heightPreferred, weightStatsPercent,
toReport);
markedRows,
toReport);
myStat = new Stat(); //create and instance of myStat
}
//TODO: make all this clearer with CASE selections
public bool ChooseStat ()
{
if ( statisticType == Catalog.GetString("Global") ) {
......@@ -315,7 +338,8 @@ public class StatType {
string [] pngs = Directory.GetFiles(directoryName, "*.png");
//if found 3 images, sure will be 1.png, 2.png and 3.png, next will be 4.png
writer.WriteLine("<img src=\"" + directoryName + "/" + pngs.Length.ToString() + ".png\">");
//there will be always a png with chronojump_logo
writer.WriteLine("<img src=\"" + directoryName + "/" + (pngs.Length -1).ToString() + ".png\">");
}
......@@ -324,5 +348,11 @@ public class StatType {
}
public ArrayList MarkedRows {
get {
return myStat.MarkedRows;
}
}
~StatType() {}
}
......@@ -85,11 +85,11 @@ public class StatGlobal : Stat
{
string sessionString = obtainSessionSqlString(sessions);
//it's better (nicer, cleaner, easier) to leave all the AVGSD as 'false'
processDataMultiSession ( SqliteStat.GlobalNormal(sessionString, operation, showSex,
personID, heightPreferred),
true, sessions.Count );
false, sessions.Count );
//TODO: If enable another time, remember to create a GlobalIndexes for IndexQ, FV an others
//session string must be different for indexes
sessionString = obtainSessionSqlStringIndexes(sessions);
......
......@@ -116,6 +116,19 @@ public class GraphGlobal : StatGlobal
foreach (string myValue in statValues)
{
if(i == 0) {
//don't plot AVG and SD rows
if( myValue == Catalog.GetString("AVG") || myValue == Catalog.GetString("SD") ) {
return;
}
//global is nicer and cleaner without the AVG and SD
if(GraphSeries.Count == 0) {
GraphSeries.Add(serieIndex);
GraphSeries.Add(serieTv);
}
/*
//don't plot AVG and SD rows
if( myValue == Catalog.GetString("AVG") || myValue == Catalog.GetString("SD") ) {
//good moment for adding created series to GraphSeries ArrayList
......@@ -126,6 +139,7 @@ public class GraphGlobal : StatGlobal
}
return;
}
*/
if(myValue.StartsWith("IndexQ")) {
CurrentGraphData.XAxisNames.Add(myValue.Replace("IndexQ", "IndexQ *10"));
......
......@@ -66,7 +66,9 @@ public class Stat
protected static int pDN; //prefsDigitsNumber;
//protected static string manName = "M";
//protected static string womanName = "F";
protected ArrayList markedRows;
protected bool toReport = false;
protected string reportString;
......@@ -77,27 +79,11 @@ public class Stat
protected int numContinuous; //for stats rj evolution
//private bool selectedMakeAVGSD;
//if this is not present i have problems like (No overload for method `xxx' takes `0' arguments) with some inherited classes
public Stat ()
{
this.showSex = false;
this.statsJumpsType = 0;
this.limit = 0;
}
public Stat (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType)
{
if(sessions.Count > 1) {
store = getStore(sessions.Count +3); //+3 (for the statName, the AVG horizontal and SD horizontal
} else {
store = getStore(sessions.Count +1);
}
treeview.Model = store;
completeConstruction (treeview, sessions, newPrefsDigitsNumber, showSex, statsJumpsType);
string [] columnsString = { Catalog.GetString("Jumper"), Catalog.GetString("TV") };
prepareHeaders(columnsString);
}
protected void completeConstruction (StatTypeStruct myStatTypeStruct, Gtk.TreeView treeview)
......@@ -110,6 +96,9 @@ public class Stat
this.statsJumpsType = myStatTypeStruct.StatsJumpsType;
this.limit = myStatTypeStruct.Limit;
this.jumpType = myStatTypeStruct.StatisticApplyTo;
this.markedRows = myStatTypeStruct.MarkedRows;
this.toReport = myStatTypeStruct.ToReport;
this.treeview = treeview;
......@@ -120,25 +109,109 @@ public class Stat
iter = new TreeIter();
}
//this method will disappear
protected void completeConstruction (Gtk.TreeView treeview, ArrayList sessions, int newPrefsDigitsNumber, bool showSex, int statsJumpsType)
void createCheckboxes(TreeView tv)
{
this.sessions = sessions;
this.treeview = treeview;
pDN = newPrefsDigitsNumber;
this.showSex = showSex;
this.statsJumpsType = statsJumpsType;
//initialize reportString
reportString = "";
iter = new TreeIter();
CellRendererToggle rendererToggle = new CellRendererToggle ();
rendererToggle.Xalign = 0.0f;
GLib.Object ugly = (GLib.Object) rendererToggle;
ugly.Data ["column"] = 0;
rendererToggle.Toggled += new ToggledHandler (ItemToggled);
rendererToggle.Activatable = true;
rendererToggle.Active = true;
TreeViewColumn column = new TreeViewColumn ("", rendererToggle, "active", 0);
column.Sizing = TreeViewColumnSizing.Fixed;
column.FixedWidth = 50;
column.Clickable = true;
tv.InsertColumn (column, 0);
}
void ItemToggled(object o, ToggledArgs args) {
Console.WriteLine("Toggled");
GLib.Object cellRendererToggle = (GLib.Object) o;
int column = (int) cellRendererToggle.Data["column"];
Gtk.TreeIter iter;
if (store.GetIterFromString (out iter, args.Path))
{
bool val = (bool) store.GetValue (iter, column);
Console.WriteLine ("toggled {0} with value {1}", args.Path, !val);
if(args.Path == "0") {
if (store.GetIterFirst(out iter)) {
val = (bool) store.GetValue (iter, column);
store.SetValue (iter, column, !val);
//delete all from ArrayList markedRows if have to be activated we add the later
//markedRows = new ArrayList();
markedRows.RemoveRange(0,markedRows.Count);
// ALL/NONE should not be in markedRows
/*
if(!val) {
markedRows.Add("0");
}
*/
int count = 1;
while ( store.IterNext(ref iter) ){
//except AVG and SD
string avgOrSD = (string) store.GetValue (iter, 1);
if(avgOrSD != Catalog.GetString("AVG") &&
avgOrSD != Catalog.GetString("SD")) {
store.SetValue (iter, column, !val);
//if (!val) means was false, and now has changed to true.
//all rows have to be activated
if(!val) {
markedRows.Add(count.ToString());
}
}
count ++;
}
}
} else {
//if this row is not AVG or SD
string avgOrSD = (string) store.GetValue (iter, 1);
if(avgOrSD != Catalog.GetString("AVG") && avgOrSD != Catalog.GetString("SD"))
{
//change the checkbox value
store.SetValue (iter, column, !val);
//add or delete from ArrayList markedRows
//if (val) means was true, and now has changed to false. Has been deactivated
if(val) {
int i = 0;
foreach(string myRow in markedRows) {
if(myRow == args.Path) {
markedRows.RemoveAt(i);
Console.WriteLine("deleted from markedRows row:{0}", args.Path);
break;
}
i++;
}
} else {
// ALL/NONE should not be in markedRows
if(args.Path != "0") {
markedRows.Add(args.Path);
Console.WriteLine("Added to markedRows row:{0}", args.Path);
}
}
}
}
}
foreach(string myString in markedRows) {
Console.Write(":" + myString);
}
Console.WriteLine();
}
protected void prepareHeaders(string [] columnsString)
{
createCheckboxes(treeview);
treeview.HeadersVisible=true;
treeview.AppendColumn (Catalog.GetString(columnsString[0]), new CellRendererText(), "text", 0);
treeview.AppendColumn (Catalog.GetString(columnsString[0]), new CellRendererText(), "text", 1);
int i;
if(sessions.Count > 1) {
......@@ -149,16 +222,16 @@ public class Stat
stringFullResults = sessions[i].ToString().Split(new char[] {':'});
myHeaderString = stringFullResults[1] + "\n" +
stringFullResults[2] + "\n" + Catalog.GetString(columnsString[1]); //name, date, col name
treeview.AppendColumn (myHeaderString, new CellRendererText(), "text", i+1);
treeview.AppendColumn (myHeaderString, new CellRendererText(), "text", i+2);
}
//if multisession, add AVG and SD cols
treeview.AppendColumn (Catalog.GetString("AVG"), new CellRendererText(), "text", i+1);
treeview.AppendColumn (Catalog.GetString("SD"), new CellRendererText(), "text", i+2);
treeview.AppendColumn (Catalog.GetString("AVG"), new CellRendererText(), "text", i+2);
treeview.AppendColumn (Catalog.GetString("SD"), new CellRendererText(), "text", i+3);
} else {
treeview.AppendColumn (Catalog.GetString(columnsString[1]), new CellRendererText(), "text", 1);
treeview.AppendColumn (Catalog.GetString(columnsString[1]), new CellRendererText(), "text", 2);
//if there's only one session, add extra data columns if needed
for(i=2 ; i <= dataColumns ; i++) {
treeview.AppendColumn (columnsString[i], new CellRendererText(), "text", i);
treeview.AppendColumn (columnsString[i], new CellRendererText(), "text", i+1);
}
}
}
......@@ -196,8 +269,12 @@ public class Stat
protected TreeStore getStore (int columns)
{
//prepares the TreeStore for required columns
Type [] types = new Type [columns];
for (int i=0; i < columns; i++) {
//columns +1 for the checkbox col (not counted in columns)
Type [] types = new Type [columns+1];
//adding the checkbox col (not counted in columns)
types[0] = typeof (bool);
for (int i=1; i <= columns; i++) {
types[i] = typeof (string);
}
TreeStore myStore = new TreeStore(types);
......@@ -257,6 +334,9 @@ public class Stat
//one column by each dataColumn returned by SQL
protected void processDataSimpleSession (ArrayList arrayFromSql, bool makeAVGSD, int dataColumns)
{
//record makeavgsd for using in checkboxes for not being selected
//selectedMakeAVGSD = makeAVGSD;
string [] rowFromSql = new string [dataColumns +1];
double [] sumValue = new double [dataColumns +1];
double [] sumSquaredValue = new double [dataColumns +1];
......@@ -299,6 +379,9 @@ public class Stat
//one column by each session returned by SQL
protected void processDataMultiSession (ArrayList arrayFromSql, bool makeAVGSD, int sessionsNum)
{
//record makeavgsd for using in checkboxes for not being selected
//selectedMakeAVGSD = makeAVGSD;
string [] rowFromSql = new string [sessionsNum +1];
double [] sumValue = new double [sessionsNum +1];
double [] sumSquaredValue = new double [sessionsNum +1];
......@@ -419,6 +502,24 @@ public class Stat
return rowData;
}
}
//protected void addAllNoneIfNeeded(TreeStore store, TreeIter iter, int cols) {
protected void addAllNoneIfNeeded(int cols) {
//if this is the first row, add the MARK ALL/NONE, and make another row
TreePath myPath = store.GetPath(iter);
if(myPath.ToString() == "0") {
store.SetValue(iter, 0, true); //first col is true
store.SetValue(iter, 1, Catalog.GetString("MARK ALL/NONE")); //second col is MARK ALL/NONE
//the rest columns are ""
for(int i=2; i < cols ; i++) {
store.SetValue(iter, i, "");
}
store.Append (out iter); //add new row and make iter point to it
// ALL/NONE should not be in markedRows
//markedRows.Add("0");
}
}
protected virtual void printData (string [] statValues)
{
......@@ -429,7 +530,26 @@ public class Stat
}
reportString += "</TR>\n";
} else {
iter = store.AppendValues (statValues);
iter = new TreeIter();
//iter = store.Append (iter); //doesn't work
store.Append (out iter); //add new row and make iter point to it
//addAllNoneIfNeeded(store, iter, statValues.Length);
addAllNoneIfNeeded(statValues.Length);
TreePath myPath = store.GetPath(iter);
if(statValues[0] != Catalog.GetString("AVG") && statValues[0] != Catalog.GetString("SD")) {
store.SetValue(iter, 0, true); //first col is true if it's not AVG or SD
markedRows.Add(myPath.ToString());
Console.WriteLine("FROM PRINTDATA Added to markedRows row:{0}", myPath.ToString());
}
for(int i=0; i < statValues.Length; i++) {
store.SetValue(iter, i+1, statValues[i]);
}
}
}
......@@ -498,6 +618,7 @@ public class Stat
public void CreateGraph ()
{
//only graph if there's data
//TODO: check also later if none row is selected
if(CurrentGraphData.XAxisNames.Count == 0) {
return;
}
......@@ -533,6 +654,7 @@ public class Stat
public bool CreateGraph (string fileName)
{
//only graph if there's data
//TODO: check also later if none row is selected
if(CurrentGraphData.XAxisNames.Count == 0) {
return false;
}
......@@ -561,8 +683,10 @@ public class Stat
plot.Draw (g, bounds);
string directoryName = Util.GetReportDirectoryName(fileName);
string [] pngs = Directory.GetFiles(directoryName, "*.png");
//if found 3 images, sure will be 1.png, 2.png and 3.png, next will be 4.png
b.Save (directoryName + "/" + (pngs.Length +1).ToString() + ".png", ImageFormat.Png);
//there will be always a png with chronojump_logo
b.Save (directoryName + "/" + pngs.Length.ToString() + ".png", ImageFormat.Png);
return true;
}
......@@ -610,9 +734,13 @@ public class Stat
protected void plotGraphGraphSeries (IPlotSurface2D plot, int xtics, ArrayList allSeries)
{
foreach(GraphSerie mySerie in allSeries) {
double[] lineData = new double[xtics];
int count = 0;
foreach(GraphSerie mySerie in allSeries)
{
//xtics value is all rows +2 (left & right space)
//lineData should contain xtics but without the rows thar are not in markedRows
Console.WriteLine("{0}:{1}:{2}", xtics, markedRows.Count, xtics-( (xtics-2)-(markedRows.Count) ) );
double[] lineData = new double[ xtics-( (xtics-2)-(markedRows.Count) ) ];
Marker m = mySerie.SerieMarker;
......@@ -628,23 +756,41 @@ public class Stat
//left margin
lineData[0] = double.NaN;
int j=1;
int added=1;
int counter=1;
foreach (string myValue in mySerie.SerieData)
{
//TODO: check this:
//don't graph AVG and SD right cols in multisession
if ( j > xtics -2 ) {
if ( counter > xtics -2 ) {
break;
}
bool allowedRow = false;
foreach(string marked in markedRows) {
// -1 because we should avoid the first row MARK ALL/NONE
if(Convert.ToInt32(marked) == counter) {
allowedRow = true;
break;
}
}
if( ! allowedRow) {
counter ++;
continue;
}
if(myValue == "-") {
lineData[j++] = double.NaN;
lineData[added++] = double.NaN;
} else {