public void ReadTestingInfo() { TobiiCSVRead(Name, tobiiList); Dictionary <long, double> avgs = CompactifyTobiiList(tobiiList, SmoothInterval); foreach (var item in avgs) { Ys.Add(item.Value); Xs.Add(item.Key); } }
void addY(int val) { if (Ys.Count > 0) { int lastY = Ys[Ys.Count - 1]; if (val > lastY) { for (int i = lastY; i < val; i++) { Ys.Add(i); Xs.Add(curX += 1); } } else if (val < lastY) { for (int i = lastY; i > val; i--) { Ys.Add(i); Xs.Add(curX += 1); } } else { Xs.Add(curX += 1); Ys.Add(val); } } else { Ys.Add(1); Xs.Add(curX += 1); } if (Xs.Count > pictureBox1.Width) { Xs.RemoveAt(0); Ys.RemoveAt(0); difference++; } }
private void AddBtn_Click(object sender, EventArgs e) { try { if (YTxtB.Text != string.Empty && XTxtB.Text != string.Empty) { Ys.Add(Convert.ToDouble(YTxtB.Text)); Xs.Add(Convert.ToDouble(XTxtB.Text)); } else { MessageBox.Show("In order to save please add cordinate in X textbox also in Y textbox "); } } catch (Exception) { MessageBox.Show("Error adding the cordinates, please insert in correct format. Example 1.2 => 1,2"); } YTxtB.Clear(); XTxtB.Clear(); }