Exemplo n.º 1
0
        private void do_training(Centroid c)
        {
            EEG_Logger p = new EEG_Logger(); //Creating a new object of the class and acting upon it

            for (int i = 0; i < 10; i++)
            {
                pBar.PerformStep();
                p.Run();
                Thread.Sleep(1660); //Slow down the process, so the user can see what's happening and also to pull data for a specified amount of time
                //1660 for 15.03 Seconds
            }

            read_CSV().read_training_records(c);


            pBar.Value = 0;
            File.Delete("outfile.csv");
            this.userInfoStringParsed[this.c.position + 1] = this.c.currDistance.ToString();
            this.userInfoString = "";
            foreach (string s in this.userInfoStringParsed)
            {
                this.userInfoString += (s + ",");
            }
            this.userInfoString = this.userInfoString.Substring(0, this.userInfoString.Length - 1);

            MessageBox.Show("Training complete.");
        }
Exemplo n.º 2
0
        //Match button clicked
        private void matchButton_Click(object sender, EventArgs e)
        {
            EEG_Logger p = new EEG_Logger(); //Creating a new object of the class and acting upon it

            for (int i = 0; i < 10; i++)
            {
                pBar.PerformStep();
                p.Run();
                Thread.Sleep(1660); //Slow down the process, so the user can see what's happening and also to pull data for a specified amount of time
                //1660 for 15.03 Seconds
            }

            Centroid temp_centroid = new Centroid("temp", 0);

            temp_centroid = read_CSV().read_matching_records(); //Reading the .csv file

            File.Delete("outfile.csv");
            pBar.Value = 0;
            MessageBox.Show("Matching complete.");

            MatchingData m = new MatchingData();

            this.label4.Text    = m.match_data(collection, temp_centroid);
            this.label4.Visible = true;
            Thread.Sleep(1500);
            //This is to calculate our error rate to make see how accurate we are at predicting the right word
            DialogResult answer = MessageBox.Show("Did we match the right word?", "Speak Your Mind", MessageBoxButtons.YesNo);

            if (answer == DialogResult.Yes)
            {
                int yesCount;
                yesCount = Convert.ToInt32(this.userInfoStringParsed[16]) + 1;
                this.userInfoStringParsed[16] = yesCount.ToString();
                this.userInfoString           = "";
                foreach (string s in this.userInfoStringParsed)
                {
                    this.userInfoString += (s + ",");
                }
                this.userInfoString = this.userInfoString.Substring(0, this.userInfoString.Length - 1);
            }
            else if (answer == DialogResult.No)
            {
                int noCount;
                noCount = Convert.ToInt32(this.userInfoStringParsed[17]) + 1;
                this.userInfoStringParsed[17] = noCount.ToString();
                this.userInfoString           = "";
                foreach (string s in this.userInfoStringParsed)
                {
                    this.userInfoString += (s + ",");
                }
                this.userInfoString = this.userInfoString.Substring(0, this.userInfoString.Length - 1);
            }
        }
Exemplo n.º 3
0
 protected override void Initialize()
 {
     freeCam = false;
     currentCamera = 1;
     lev = 0;
     graphics.PreferredBackBufferWidth = 800;
     graphics.PreferredBackBufferHeight = 480;
     up_color = Color.Black;
     down_color = Color.Black;
     left_color = Color.Black;
     right_color = Color.Black;
     log = new EEG_Logger();
     Task.Factory.StartNew(() => start_timers());
     O1 = new ILArray<double>[2001];
     O1_count = 0;
     base.Initialize();
     nocounts = 0;
 }