private void createTreeView_runs_interval_sprint(Gtk.TreeView tv)
{
LogB.Information("SPRINT create START");
UtilGtk.RemoveColumns(tv);
button_sprint.Sensitive = false;
image_sprint.Sensitive = false;
button_sprint_save_image.Sensitive = false;
tv.HeadersVisible = true;
int count = 0;
tv.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), "text", count++);
tv.AppendColumn("ID", new CellRendererText(), "text", count++);
tv.AppendColumn(Catalog.GetString("Distances"), new CellRendererText(), "text", count++);
tv.AppendColumn(Catalog.GetString("Split times"), new CellRendererText(), "text", count++);
tv.AppendColumn(Catalog.GetString("Total time"), new CellRendererText(), "text", count++);
storeSprint = new TreeStore(
typeof(string), typeof(string), typeof(string),
typeof(string), typeof(string));
tv.Model = storeSprint;
if (currentSession == null || currentPerson == null)
{
return;
}
tv.Selection.Changed -= onTreeviewSprintSelectionEntry;
tv.Selection.Changed += onTreeviewSprintSelectionEntry;
List <object> runITypes = SqliteRunIntervalType.SelectRunIntervalTypesNew("", false);
string [] runsArray = SqliteRunInterval.SelectRuns(
false, currentSession.UniqueID, currentPerson.UniqueID, "");
foreach (string line in runsArray)
{
//[] lineSplit has run params
string [] lineSplit = line.Split(new char[] { ':' });
//get intervalTimes
string intervalTimesString = lineSplit[8];
string positions = getSprintPositions(
Convert.ToDouble(lineSplit[7]), //distanceInterval. == -1 means variable distances
intervalTimesString,
runIntervalTypeDistances(lineSplit[4], runITypes) //distancesString
);
if (positions == "")
{
continue;
}
string splitTimes = getSplitTimes(intervalTimesString);
string [] lineParams =
{
lineSplit[4],
lineSplit[1],
positions,
splitTimes,
Util.TrimDecimals(lineSplit[6], preferences.digitsNumber)
};
storeSprint.AppendValues(lineParams);
}
LogB.Information("SPRINT create END");
}