private void plot_gaze_point(Point_Obj p) { if (this.chart2.InvokeRequired) { //ChartCallback c = new ChartCallback(plot_point); GazeChartCallback gC = new GazeChartCallback(plot_gaze_point); this.Invoke(gC, new object[] { p }); } else { this.chart2.Series["Series1"].Points.AddXY(p.get_x(), p.get_y()); int L = this.chart2.Series["Series1"].Points.Count; if (p.get_x() < -MONITOR_DIM_X / 2 || p.get_x() > MONITOR_DIM_X / 2) { //Console.WriteLine("POINT RED!"); this.chart2.Series["Series1"].Points[L - 1].Color = Color.Red; } else if (p.get_y() < -MONITOR_DIM_Y / 2 || p.get_y() > MONITOR_DIM_Y / 2) { //Console.WriteLine("POINT RED!"); this.chart2.Series["Series1"].Points[L - 1].Color = Color.Red; } else { //Console.WriteLine("POINT BLUE!"); this.chart2.Series["Series1"].Points[L - 1].Color = Color.Blue; } if(L > POINTS_TO_SHOW) { //DataPoint d = new DataPoint(this.chart2.Series["Series1"].Points[0].XValue, this.chart2.Series["Series1"].Points[0].YValues[0]); //saved_pts.Add(d); this.chart2.Series["Series1"].Points.RemoveAt(0); } } }
private void plot_gaze_point(Point_Obj p, Subj_Data S) { if (this.gaze_plot.InvokeRequired) { //ChartCallback c = new ChartCallback(plot_point); GazeChartCallback gC = new GazeChartCallback(plot_gaze_point); this.Invoke(gC, new object[] { p, S }); } else { this.gaze_plot.Series["Series1"].Points.AddXY(p.get_x(), p.get_y()); int L = this.gaze_plot.Series["Series1"].Points.Count; int MONITOR_DIM_X = S.get_MONITOR_DIM_X(); int MONITOR_DIM_Y = S.get_MONITOR_DIM_Y(); int ID = S.get_ID(); if (p.get_x() < -MONITOR_DIM_X / 2 || p.get_x() > MONITOR_DIM_X / 2) { //Console.WriteLine("POINT RED!"); this.gaze_plot.Series["Series1"].Points[L - 1].Color = Color.Red; } else if (p.get_y() < -MONITOR_DIM_Y / 2 || p.get_y() > MONITOR_DIM_Y / 2) { //Console.WriteLine("POINT RED!"); this.gaze_plot.Series["Series1"].Points[L - 1].Color = Color.Red; } else { //Console.WriteLine("POINT BLUE!"); this.gaze_plot.Series["Series1"].Points[L - 1].Color = color_list[ID]; } if(L > POINTS_TO_SHOW) { this.gaze_plot.Series["Series1"].Points.RemoveAt(0); } } }