Example #1
0
    void setup()
    {
        slider.maxValue = Start_Screen.sliderLength;

        reader = new BasicEmotivReader(device, false);
        Application.runInBackground = true;

        ssvepOn();
        createTestArray();

        //Creates the timeline and timeline checkpoints
        timelineCheckPoints = new long[(ect.Length + 2)][];
        timeline            = new Timeline <IEmotivState>();

        for (int i = 0; i < ect.Length; i++)
        {
            timelineCheckPoints[i] = new long[2];
        }

        //Starts reading from the device
        reader.OnRead += (e) => timeline.Register(e);
        reader.StartReading();
        incrementSlider = true;
        accuracyLogger  = new CsvLogger("Accuracy.csv");
        accuracyLogger.add(Start_Screen.profile);
        accuracyFalsePositiveLogger = new CsvLogger("AccuracyFalsePositiveLogger.csv");

        Activate();
    }
Example #2
0
        /// <summary>
        /// Reader from random device and report states read from EmotivAnalyticReader
        /// </summary>
        static void Main(string[] args)
        {
            IEmotivDevice device = new EPOCEmotivDevice("emotiv123", "Emotivbci123", "KLD_Blink");

            IConnectomeReader <IEmotivState> readerPlug = new BasicEmotivReader(device);

            int waitTimeSecond = 40;
            IConnectomeReader <IEmotivState> reader = new TimedEmotivReader(readerPlug, waitTimeSecond);

            int p = -1;

            reader.OnRead += (state) =>
            {
                if (device.WirelessSignalStrength != p)
                {
                    p = device.WirelessSignalStrength;
                    //Debug.WriteLine(p);
                }
            };

            reader.StartReading();

            while (reader.IsReading)
            {
                //Debug.WriteLine(device.BatteryLevel);
            }

            Console.ReadLine();
            Console.WriteLine("[END]");
        }
Example #3
0
    void setup()
    {
        Application.runInBackground = true;
        slider.maxValue             = Start_Screen.sliderLength;
        streakCounter = 0;
        highscore     = 0;
        intervals     = new ArrayList();
        setButtonText("Starting");
        run    = false;
        reader = new BasicEmotivReader(device, false);
        ssvepOn();

        reader.OnRead += (e) => counter(e);
        activate();
    }
    void setup()
    {
        currentPoint = 0;
        highscore    = 0;
        passedTest   = false;
        started      = false;

        slider.maxValue             = Start_Screen.sliderLength;
        Application.runInBackground = true;
        ssvepOn();

        reader = new BasicEmotivReader(device, false);

        reader.OnRead += (e) => powerChecker(e);

        activate();
    }
Example #5
0
        //fix this pile of disgust
        private void button1_Click(object sender, EventArgs e)
        {
            //connects or starts collecting data
            if (device == null)
            {
                MessageBox.Show("Connect device first.", "Missing device",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                int seconds;

                if (int.TryParse(TimeTextBox.Text, out seconds))
                {
                    IEmotivReader reader = new BasicEmotivReader(device);
                    StartCollecting(reader, seconds);
                }
                else
                {
                    MessageBox.Show("Unable to parse inputted time.", "Input Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }