//Patient History List Box private void lst_tests_SelectedIndexChanged(object sender, EventArgs e) { if (lst_tests.SelectedIndex >= 0) { DataTable grid_data = new DataTable(); DataRow rows; grid_data.Columns.Add("Metric"); grid_data.Columns.Add("Mean"); grid_data.Columns.Add("Std Dev"); grid_data.Columns.Add("Min"); grid_data.Columns.Add("Max"); for (int k = 0; k < history_test_list[lst_tests.SelectedIndex].anal.Length; k++) { rows = grid_data.NewRow(); rows["Metric"] = history_test_list[lst_tests.SelectedIndex].anal[k].metric; rows["Mean"] = history_test_list[lst_tests.SelectedIndex].anal[k].mean; rows["Std Dev"] = history_test_list[lst_tests.SelectedIndex].anal[k].stdDev; rows["Min"] = history_test_list[lst_tests.SelectedIndex].anal[k].min; rows["Max"] = history_test_list[lst_tests.SelectedIndex].anal[k].max; grid_data.Rows.Add(rows); } dataGrid.DataSource = grid_data; hand.Text = history_test_list[lst_tests.SelectedIndex].hand.ToString(); mode.Text = history_test_list[lst_tests.SelectedIndex].mode.ToString(); rotation.Text = history_test_list[lst_tests.SelectedIndex].rotation.ToString(); test_name.Text = history_test_list[lst_tests.SelectedIndex].script.type.ToString(); normal.Text = history_test_list[lst_tests.SelectedIndex].isNormal.ToString(); List <Data> samples = test.RetrieveTestData(history_test_list[lst_tests.SelectedIndex].ID); List <global::Movement.TestEngine.Capture.CalibratedInkSample> testSamples = samples.ConvertAll <global::Movement.TestEngine.Capture.CalibratedInkSample>( new Converter <Data, global::Movement.TestEngine.Capture.CalibratedInkSample>( delegate(Data d) { global::Movement.TestEngine.Capture.CalibratedInkSample sample = new global::Movement.TestEngine.Capture.CalibratedInkSample(); sample.X = d.x; sample.Y = d.y; sample.Time = d.time; sample.Pressure = d.pressure; return(sample); })); analysis_control.ShowAnalysis(global::Movement.Analysis.AnalysisMetric.Pressure, testSamples); ScriptInfo si = new ScriptInfo(); si.scriptID = history_test_list[lst_tests.SelectedIndex].script.scriptID; Script s = test.GetScript(si); global::Movement.TestEngine.Testing.TestScript ts = new global::Movement.TestEngine.Testing.TestScript(si.scriptID, s.scriptData); replay_control.ReplayTest(ts, testSamples); } }
//Patient History List Box private void lst_tests_SelectedIndexChanged(object sender, EventArgs e) { if (lst_tests.SelectedIndex >=0 ) { DataTable grid_data = new DataTable(); DataRow rows; grid_data.Columns.Add("Metric"); grid_data.Columns.Add("Mean"); grid_data.Columns.Add("Std Dev"); grid_data.Columns.Add("Min"); grid_data.Columns.Add("Max"); for (int k = 0; k < history_test_list[lst_tests.SelectedIndex].anal.Length; k++) { rows = grid_data.NewRow(); rows["Metric"] = history_test_list[lst_tests.SelectedIndex].anal[k].metric; rows["Mean"] = history_test_list[lst_tests.SelectedIndex].anal[k].mean; rows["Std Dev"] = history_test_list[lst_tests.SelectedIndex].anal[k].stdDev; rows["Min"] = history_test_list[lst_tests.SelectedIndex].anal[k].min; rows["Max"] = history_test_list[lst_tests.SelectedIndex].anal[k].max; grid_data.Rows.Add(rows); } dataGrid.DataSource = grid_data; hand.Text = history_test_list[lst_tests.SelectedIndex].hand.ToString(); mode.Text = history_test_list[lst_tests.SelectedIndex].mode.ToString(); rotation.Text = history_test_list[lst_tests.SelectedIndex].rotation.ToString(); test_name.Text = history_test_list[lst_tests.SelectedIndex].script.type.ToString(); normal.Text = history_test_list[lst_tests.SelectedIndex].isNormal.ToString(); List<Data> samples = test.RetrieveTestData(history_test_list[lst_tests.SelectedIndex].ID); List<global::Movement.TestEngine.Capture.CalibratedInkSample> testSamples = samples.ConvertAll<global::Movement.TestEngine.Capture.CalibratedInkSample>( new Converter<Data, global::Movement.TestEngine.Capture.CalibratedInkSample>( delegate(Data d) { global::Movement.TestEngine.Capture.CalibratedInkSample sample = new global::Movement.TestEngine.Capture.CalibratedInkSample(); sample.X = d.x; sample.Y = d.y; sample.Time = d.time; sample.Pressure = d.pressure; return sample; })); analysis_control.ShowAnalysis(global::Movement.Analysis.AnalysisMetric.Pressure, testSamples); ScriptInfo si = new ScriptInfo(); si.scriptID = history_test_list[lst_tests.SelectedIndex].script.scriptID; Script s = test.GetScript(si); global::Movement.TestEngine.Testing.TestScript ts = new global::Movement.TestEngine.Testing.TestScript(si.scriptID, s.scriptData); replay_control.ReplayTest(ts, testSamples); } }