private void comboBoxMetric_SelectedIndexChanged(object sender, EventArgs e) { if (0 <= comboBoxMetric.SelectedIndex && comboBoxMetric.SelectedIndex < PerformanceMetrics.PerformanceMetricStrings.Length) { metric = (PerformanceMetricType)comboBoxMetric.SelectedIndex; updateChart(); } }
private void comboBoxTask_SelectedIndexChanged(object sender, EventArgs e) { task = (string)comboBoxTask.SelectedItem; metric = profile.GetPrimaryMetric(therapy, task); comboBoxMetric.SelectedIndex = -1; comboBoxMetric.SelectedIndex = (int)metric; }
public DataPoints GetMetricPoints(string therapy, string task, PerformanceMetricType metric) { List<DateTime> dates = new List<DateTime>(); List<float> points = new List<float>(); foreach (Session s in Sessions) { if (s.therapy == therapy) { float sum = 0; float count = 0; foreach (TaskData t in s.TaskDatas) { if (t.TaskName == task) { sum += t.Metrics.metrics[(int)metric]; count++; } } if (count > 0) { dates.Add(s.createDate); points.Add(sum / count); } } } return new DataPoints(dates.ToArray(), points.ToArray()); }