public void write_subj_to_file(Subj_Data S) { Console.WriteLine("WRITING GAZE PT DATA TO FILE"); //String out_path = Path.GetFullPath(System.Environment.GetCommandLineArgs()[1]); //String filename = out_path + "\\OUT_S" + Convert.ToString(S.get_ID()) + ".txt"; String filename = @"C:\Users\pkhorra2\Documents\AvaScholar\Attention_Detector\C#_Proj\Server_Mult_Version\MultiThreadServer_w_log\out.txt"; StreamWriter sW = new StreamWriter(filename); //ArrayList gaze_pts = S.get_gaze_pts(); List<Exp_Data_Pt> gaze_pts = S.get_pt_list(); for (int i = 0; i < gaze_pts.Count; i++) { //Point_Obj g = gaze_pts[i].gaze_pt; //DateTime T = gaze_pts[i].time_stamp; //sW.WriteLine("({0}, {1}) -- TIME: " + T.ToString(), g.get_x(), g.get_y()); //T.ToString()); //sW.WriteLine("TICKS: {0}", T.Ticks); } sW.Flush(); sW.Close(); Console.WriteLine("DONE WRITING"); }
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; } } }