private void button_stop_Click(object sender, EventArgs e) { String selectedItem = listBox_Type.SelectedItem.ToString(); if (selectedItem == "SSVEP") { ssvep.Hide(); ssvep.SSVEP_11Hz.Enabled = false; ssvep.SSVEP_13Hz.Enabled = false; // ssvep.SSVEP_timer2.Enabled = true; //SSVEP_Timer.Enabled = true; } else if (selectedItem == "Mental Task") { EmoUpdate.Enabled = false; dataReader.WriteAffectiv(); } button_submit.Enabled = true; listBox_Type.Enabled = true; OPStart = false; /*may delete*/ if (EEGStorer.Count != 0) { WritePowerFile(); WriteFile(); } }
//Experiment Timer- Keep Track of time for experiment private void experimentTimer_Tick(object sender, EventArgs e) { numOfTick++; label_TimerCount.Text = numOfTick.ToString(); String selectedItem = listBox_Type.SelectedItem.ToString(); /* * * if (selectedItem == "Geometric figure rotation" && numOfTick == 10) * { * richTextBox_Direction.Text = "Visualized the object being rotated about the axis for 10s. "; * pictureBox1.Image = pictureBox1.InitialImage; * * } */ // else if (numOfTick >=10) int openEyeTime = 30; if (numOfTick < openEyeTime && selectedItem == "Open-Close") { if (numOfTick % 5 == 0) { Console.Beep(800, 100); isEyeOpen = !isEyeOpen; } } if ((numOfTick >= 10 && (selectedItem != "Open-Close")) || (numOfTick >= openEyeTime && selectedItem == "Open-Close")) { richTextBox_Direction.Text = "Tasks Over"; // Direction_presubmit(selectedItem); button_submit.Enabled = true; listBox_Type.Enabled = true; numOfTick = 0; experimentTimer.Enabled = false; if (selectedItem == "SSVEP-9HZ" || selectedItem == "SSVEP-11HZ" || selectedItem == "SSVEP-13HZ" || selectedItem == "SSVEP-15HZ") { ssvep.SSVEP_timer1.Enabled = false; //ssvep.SSVEP_timer2.Enabled = false; ssvep.Hide(); } //SSVEP_Timer.Enabled = false; //SSVEP_light.Visible = false; if (dataReader.CQCollector.Count != 0) { WriteCQFile(); } if (EEGStorer.Count != 0) { WriteFile(); computePowerStorer(); WriteOpenCloseFile(); WritePowerFile(); } else { label3.Text = "No Data Readed"; } } }