private void write_pt_to_hist(Point_Obj p, Screen_Prob_Map p_m, Subj_Data S, int frame_num) { int ID = S.get_ID(); if (((Chart)this.hist_chart_list[ID]).InvokeRequired) { ChartHistCallback cH = new ChartHistCallback(write_pt_to_hist); this.Invoke(cH, new object[] { p, p_m, S, frame_num }); } else { Chart chart = (Chart)this.hist_chart_list[ID]; chart.ChartAreas[0].AxisX.Maximum = frame_num; // display points up to current frame Chart chart_f2 = (Chart)F2.hist_chart_list[ID]; int MONITOR_DIM_X = S.get_MONITOR_DIM_X(); int MONITOR_DIM_Y = S.get_MONITOR_DIM_Y(); // convert gaze point (world coordinates) => monitor coordinates p.set_coord(-p.get_x(), p.get_y() + MONITOR_DIM_Y / 2, p.get_z()); if (p.get_x() < -MONITOR_DIM_X / 2 || p.get_x() > MONITOR_DIM_X / 2) { chart.Series["Series1"].Points.AddXY(frame_num, 0.0F); Console.WriteLine("{0} - Confid Score: {1}", ID, 0.0F); chart_f2.Series[0].Points.AddXY(DateTime.Now.ToLongTimeString(), 0.0F); } else if (p.get_y() < -MONITOR_DIM_Y / 2 || p.get_y() > MONITOR_DIM_Y / 2) { chart.Series["Series1"].Points.AddXY(frame_num, 0.0F); Console.WriteLine("{0} - Confid Score: {1}", ID, 0.0F); chart_f2.Series[0].Points.AddXY(DateTime.Now.ToLongTimeString(), 0.0F); } else { //chart.Series["Series1"].Points.AddXY(frame_num, 0); //double D = p_m.look_up_value(Convert.ToInt32(-p.get_x()), Convert.ToInt32(p.get_y()) + MONITOR_DIM_Y / 2); double D = p_m.look_up_value(Convert.ToInt32(p.get_x()), Convert.ToInt32(p.get_y())); Console.WriteLine("{0} - Confid Score: {1}", ID, D); //Console.WriteLine("Adding Point "+D.ToString()); chart.Series["Series1"].Points.AddXY(frame_num, Convert.ToSingle(D)); //write_to_msg_box(frame_num.ToString() + " " + D.ToString()); chart_f2.Series[0].Points.AddXY(DateTime.Now.ToLongTimeString(), Convert.ToSingle(D)); } if (frame_num > 100) { chart.ChartAreas[0].AxisX.Minimum = chart.ChartAreas[0].AxisX.Maximum - 100; } } }
private void write_pt_to_hist(Subj_Data S) { int frame_num = S.get_pt_list().Last().frame_num; int ID = S.get_ID(); if (((Chart)this.hist_chart_list[ID]).InvokeRequired) { ChartHistCallback cH = new ChartHistCallback(write_pt_to_hist); this.Invoke(cH, new object[] { S }); } else { Exp_Data_Pt exp_pt = S.get_pt_list().Last(); Chart chart = (Chart)this.hist_chart_list[ID]; chart.ChartAreas[0].AxisX.Maximum = frame_num; // display points up to current frame float SUM = (exp_pt.neu_score + exp_pt.neg_score + exp_pt.pos_score + exp_pt.surp_score); chart.Series[0].Points.AddXY(frame_num, exp_pt.neu_score/SUM); chart.Series[1].Points.AddXY(frame_num, exp_pt.neg_score/SUM); chart.Series[2].Points.AddXY(frame_num, exp_pt.pos_score/SUM); chart.Series[3].Points.AddXY(frame_num, exp_pt.surp_score/SUM); if (frame_num > 50) { chart.ChartAreas[0].AxisX.Minimum = chart.ChartAreas[0].AxisX.Maximum - 50; } } }
private void write_pt_to_hist(Point_Obj p, Screen_Prob_Map p_m, int ID, int frame_num) { if (((Chart)this.hist_chart_list[ID]).InvokeRequired) { ChartHistCallback cH = new ChartHistCallback(write_pt_to_hist); this.Invoke(cH, new object[] { p, p_m, ID, frame_num }); } else { Chart chart = (Chart)this.hist_chart_list[ID]; chart.ChartAreas[0].AxisX.Maximum = frame_num; // display points up to current frame if (p.get_x() < -MONITOR_DIM_X / 2 || p.get_x() > MONITOR_DIM_X / 2) { chart.Series["Series1"].Points.AddXY(frame_num, 0.0F); } else if (p.get_y() < -MONITOR_DIM_Y / 2 || p.get_y() > MONITOR_DIM_Y / 2) { chart.Series["Series1"].Points.AddXY(frame_num, 0.0F); } else { //chart.Series["Series1"].Points.AddXY(frame_num, 0); double D = p_m.look_up_value(Convert.ToInt32(p.get_x()) + MONITOR_DIM_X / 2, Convert.ToInt32(p.get_y()) + MONITOR_DIM_Y / 2); //Console.WriteLine(D); //Console.WriteLine("Adding Point "+D.ToString()); chart.Series["Series1"].Points.AddXY(frame_num, Convert.ToSingle(D)); //write_to_msg_box(frame_num.ToString() + " " + D.ToString()); } if (frame_num > 100) { chart.ChartAreas[0].AxisX.Minimum = chart.ChartAreas[0].AxisX.Maximum - 100; } } }