Ejemplo n.º 1
0
        private void stop()
        {
            blinkNo = 0;
            WlinkNo = 0;
            mlinkNo = 0;
            frameNo = 0;

            process_last_timestamp = -1.0f;
            process_fps            = -1.0f;

            blink = 0.0F;

            ear = double.NaN;

            saveWebCam = false;

            if (this.vWritter != null)
            {
                this.vWritter.Dispose();
            }

            if (this.outputFile != null)
            {
                this.outputFile.Close();
            }

            this.rwLock.ReleaseLock();


            //this.Close();

            /*
             * if (this.outlet != null)
             * {
             *  this.outlet.close_stream();
             * }
             */
            this.outlet = null;
            this.info   = null;

            this.cmdMultiBlink = null;
            this.cmdWlink      = null;
        }
Ejemplo n.º 2
0
        public void setStart(ExcCommander excWlink, ExcCommander excMultiBlink)
        {
            this.start = !start;

            if (!this.start)
            {
                this.stop();
            }
            else
            {
                this.initBlinkVOG(this.framePerSeconds);

                this.info = new liblsl.StreamInfo("Affectiva-Blinks", "VOG", nChannels, framePerSeconds, liblsl.channel_format_t.cf_double64, "TAIS022-manmermon-AFF-Blinks");
                this.info.desc().append_child_value("channelIDs", "blink, EAR, frame");//, left outer eye, left inner eye, left upper eye, left bottom eye, right outer eye, right inner eye, right upper eye, right bottom eye");
                this.outlet = new liblsl.StreamOutlet(info);

                this.cmdWlink      = excWlink;
                this.cmdMultiBlink = excMultiBlink;
            }
        }
        private void btStart_Click(object sender, EventArgs e)
        {
            ExcCommander excWlink      = new ExcCommander();
            ExcCommander excMultiBlink = new ExcCommander();

            if (btnStart.Checked)
            {
                btnStart.Text = "Parar";
                this.comboWlinkEvents.Enabled      = false;
                this.comboMultiBlinkEvents.Enabled = false;

                if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("intro"))
                {
                    excWlink.addCommand("{ENTER}");
                }
                else if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("espacio"))
                {
                    excWlink.addCommand(" ");
                }
                else if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("click derecho"))
                {
                    excWlink.addCommand("mouseRight");
                }
                else if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("doble click derecho"))
                {
                    excWlink.addCommand("mouseDoubleRight");
                }
                else if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("click izquierdo"))
                {
                    excWlink.addCommand("mouseLeft");
                }
                else if (this.comboWlinkEvents.SelectedItem.ToString().ToLower().Equals("doble click izquierdo"))
                {
                    excWlink.addCommand("mouseDoubleLeft");
                }

                if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("intro"))
                {
                    excMultiBlink.addCommand("{ENTER}");
                }
                else if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("espacio"))
                {
                    excMultiBlink.addCommand(" ");
                }
                else if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("click derecho"))
                {
                    excMultiBlink.addCommand("mouseRight");
                }
                else if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("doble click derecho"))
                {
                    excMultiBlink.addCommand("mouseDoubleRight");
                }
                else if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("click izquierdo"))
                {
                    excMultiBlink.addCommand("mouseLeft");
                }
                else if (this.comboMultiBlinkEvents.SelectedItem.ToString().ToLower().Equals("doble click izquierdo"))
                {
                    excMultiBlink.addCommand("mouseDoubleLeft");
                }
            }
            else
            {
                btnStart.Text = "Empezar";
                this.comboWlinkEvents.Enabled      = true;
                this.comboMultiBlinkEvents.Enabled = true;
            }

            this.panel1.setStart(excWlink, excMultiBlink);
        }