예제 #1
0
파일: Program.cs 프로젝트: ATUAV/ATUAV
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);

            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            if (Settings.ProcessorDefinitions.ContainsKey(connector.Info.ProductId))
            {
                foreach (EmdatProcessorSettings settings in Settings.ProcessorDefinitions[connector.Info.ProductId])
                {
                    EmdatProcessor processor = new EmdatProcessor(syncManager);
                    processor.CumulativeData = settings.Cumulative;
                    connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
                    fixations.FixDetector.FixationEnd     += processor.FixationEnd;
                    Processors.Add(settings.ProcessorId, processor);
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: daisys/ATUAV
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            GazeDataFixationHandler fixations = new GazeDataFixationHandler(syncManager);
            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            /*/ print each event to console
            GazeDataConsolePrintHandler printer = new GazeDataConsolePrintHandler(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixationDetector.FixationEnd += printer.FixationEnd;*/

            // windowed print to console
            GazeDataWindowingPrintHandler printer = new GazeDataWindowingPrintHandler(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixationDetector.FixationEnd += printer.FixationEnd;
            printer.StartWindow();

            while (true)
            {
                Thread.Sleep(3000);
                printer.RenewWindow(true);
            }
        }
예제 #3
0
파일: Form1.cs 프로젝트: Faham/emophiz
 private void _browser_EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
 {
     int index = _trackerCombo.Items.IndexOf(e.EyetrackerInfo);
     if(index >= 0)
     {
         _trackerCombo.Items[index] = e.EyetrackerInfo;
     }
 }
예제 #4
0
 // EyetrackerRemoved
 private void _browser_EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
     if (FEyetrackerInfo.Contains(e.EyetrackerInfo))
     {
         FEyetrackerInfo.Remove(e.EyetrackerInfo);
     }
     FUpdate = true;
     FLogger.Log(LogType.Debug, "Eyetracker has been removed");
 }
예제 #5
0
        // EyetrackerUpdated
        private void _browser_EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerInfo Info = e.EyetrackerInfo;

            if (FEyetrackerInfo.Contains(Info))
            {
                int Index = FEyetrackerInfo.IndexOf(Info);
                FEyetrackerInfo.RemoveAt(Index);
                FEyetrackerInfo.Insert(Index, Info);
            }
            FUpdate = true;
            FLogger.Log(LogType.Debug, "Eyetracker has been updated");
        }
예제 #6
0
파일: Program.cs 프로젝트: ATUAV/ATUAV
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);

            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            /*/ 1. print each event to console
             * ConsolePrinter printer = new ConsolePrinter(syncManager);
             * //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
             * fixations.FixDetector.FixationEnd += printer.FixationEnd;//*/

            /*/ 2. windowed print to console
             * WindowingConsolePrinter printer = new WindowingConsolePrinter(syncManager);
             * //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
             * fixations.FixDetector.FixationEnd += printer.FixationEnd;
             *
             * printer.StartWindow();
             * while (true)
             * {
             *  Thread.Sleep(windowDuration);
             *  printer.ProcessWindow(cumulativeWindows);
             * }//*/

            // 3. process windows with EMDAT
            EmdatProcessor processor = new EmdatProcessor(syncManager);

            if (aoiFilePath != null)
            {
                processor.AoiFilePath = aoiFilePath;
            }

            connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
            fixations.FixDetector.FixationEnd     += processor.FixationEnd;

            processor.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                processor.ProcessWindow(cumulativeWindows);
            }//*/
        }
예제 #7
0
파일: Program.cs 프로젝트: ATUAV/ATUAV
        private static int windowDuration = 3000; // ms

        #endregion Fields

        #region Methods

        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);
            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            /*/ 1. print each event to console
            ConsolePrinter printer = new ConsolePrinter(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixDetector.FixationEnd += printer.FixationEnd;//*/

            /*/ 2. windowed print to console
            WindowingConsolePrinter printer = new WindowingConsolePrinter(syncManager);
            //connector.Eyetracker.GazeDataReceived += printer.GazeDataReceived;
            fixations.FixDetector.FixationEnd += printer.FixationEnd;

            printer.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                printer.ProcessWindow(cumulativeWindows);
            }//*/

            // 3. process windows with EMDAT
            EmdatProcessor processor = new EmdatProcessor(syncManager);
            if (aoiFilePath != null)
            {
                processor.AoiFilePath = aoiFilePath;
            }

            connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
            fixations.FixDetector.FixationEnd += processor.FixationEnd;

            processor.StartWindow();
            while (true)
            {
                Thread.Sleep(windowDuration);
                processor.ProcessWindow(cumulativeWindows);
            }//*/
        }
예제 #8
0
파일: Program.cs 프로젝트: ATUAV/ATUAV
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            GazeDataFixationHandler fixations = new GazeDataFixationHandler(syncManager);
            connector.AddGazeDataHandler(fixations.GazeDataReceived);

            // print to console
            GazeDataConsolePrintHandler printer = new GazeDataConsolePrintHandler(syncManager);
            //connector.AddGazeDataHandler(printer.GazeDataReceived);
            fixations.FixationDetector.FixationEnd += printer.FixationEnd;
        }
예제 #9
0
파일: Program.cs 프로젝트: ATUAV/ATUAV
        static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);

            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            GazeDataFixationHandler fixations = new GazeDataFixationHandler(syncManager);

            connector.AddGazeDataHandler(fixations.GazeDataReceived);

            // print to console
            GazeDataConsolePrintHandler printer = new GazeDataConsolePrintHandler(syncManager);

            //connector.AddGazeDataHandler(printer.GazeDataReceived);
            fixations.FixationDetector.FixationEnd += printer.FixationEnd;
        }
예제 #10
0
 private void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is found on the network
     trackerInfo = e.EyetrackerInfo;
     StatusText.Text = string.Format("Found {0}.", trackerInfo.Model);
 }
예제 #11
0
 /// <summary>
 /// The eyetracker found.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is found on the network we add it to the listview
     availableEyetracker.Add(e.EyetrackerInfo);
 }
예제 #12
0
 /// <summary>
 /// The static event handler method that is called whenever an eyetracker
 ///   has been removed.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="EyetrackerInfoEventArgs"/> with the event data.
 /// </param>
 private static void EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
   // When an eyetracker disappears from the network we remove it from the listview
   availableEyetracker.Remove(e.EyetrackerInfo);
 }
예제 #13
0
 /// <summary>
 /// The static event handler method that is called whenever an eyetracker
 ///   has been updated.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="EyetrackerInfoEventArgs"/> with the event data.
 /// </param>
 private static void EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
 {
 }
예제 #14
0
 void _browser_EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
     _trackerCombo.Items.Remove(e.EyetrackerInfo);
 }
예제 #15
0
 /// <summary>
 /// The eyetracker found.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
   // When an eyetracker is found on the network we add it to the listview
   availableEyetracker.Add(e.EyetrackerInfo);
 }
예제 #16
0
 /// <summary>
 /// The static event handler method that is called whenever an eyetracker
 ///   has been removed.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="EyetrackerInfoEventArgs"/> with the event data.
 /// </param>
 private static void EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker disappears from the network we remove it from the listview
     availableEyetracker.Remove(e.EyetrackerInfo);
 }
예제 #17
0
 private void _browser_EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     _trackerCombo.Items.Add(e.EyetrackerInfo);
 }
예제 #18
0
 /// <summary>
 /// The static event handler method that is called whenever an eyetracker
 ///   has been updated.
 /// </summary>
 /// <param name="sender">
 /// Source of the event
 /// </param>
 /// <param name="e">
 /// A <see cref="EyetrackerInfoEventArgs"/> with the event data.
 /// </param>
 private static void EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
 {
 }
예제 #19
0
 private void EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is updated we simply create a new
     // listviewitem and replace the old one
 }
예제 #20
0
파일: Program.cs 프로젝트: oschmid/ATUAV
        /// <summary>
        /// Connects to found eyetrackers, synchronizes CPU and eyetracker clocks, and attaches event handlers.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Contains found EyetrackerInfo</param>
        private static void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
        {
            EyetrackerConnector connector = new EyetrackerConnector(e.EyetrackerInfo);
            connector.Connect();

            // sync CPU and Eyetracker clocks
            SyncManager syncManager = new SyncManager(clock, e.EyetrackerInfo, EventThreadingOptions.BackgroundThread);

            // detect fixations
            FixationDetector fixations = new FixationDetector(syncManager);
            connector.Eyetracker.GazeDataReceived += fixations.GazeDataReceived;

            if (Settings.ProcessorDefinitions.ContainsKey(connector.Info.ProductId))
            {
                foreach (EmdatProcessorSettings settings in Settings.ProcessorDefinitions[connector.Info.ProductId])
                {
                    EmdatProcessor processor = new EmdatProcessor(syncManager);
                    processor.CumulativeData = settings.Cumulative;
                    connector.Eyetracker.GazeDataReceived += processor.GazeDataReceived;
                    fixations.FixDetector.FixationEnd += processor.FixationEnd;
                    Processors.Add(settings.ProcessorId, processor);
                }
            }
        }
예제 #21
0
파일: MainForm.cs 프로젝트: Faham/emophiz
 private void EyetrackerUpdated(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is updated we simply create a new
     // listviewitem and replace the old one
     int index = _trackerList.Items.IndexOfKey(e.EyetrackerInfo.ProductId);
     if(index >= 0)
     {
         _trackerList.Items[index] = CreateTrackerListViewItem(e.EyetrackerInfo);
     }
 }
예제 #22
0
파일: MainForm.cs 프로젝트: Faham/emophiz
 private void EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker disappears from the network we remove it from the listview
     _trackerList.Items.RemoveByKey(e.EyetrackerInfo.ProductId);
     UpdateUIElements();
 }
예제 #23
0
파일: MainForm.cs 프로젝트: Faham/emophiz
 private void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is found on the network we add it to the listview
     var trackerItem = CreateTrackerListViewItem(e.EyetrackerInfo);
     _trackerList.Items.Add(trackerItem);
     UpdateUIElements();
 }
예제 #24
0
 private void EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker is found on the network
     trackerInfo = e.EyetrackerInfo;
     LogEvent.Engine.Write(string.Format("Found {0}.", trackerInfo.Model));
 }
예제 #25
0
 private void EyetrackerRemoved(object sender, EyetrackerInfoEventArgs e)
 {
     // When an eyetracker disappears from the network we remove it from the listview
     if (tracker != null)
         DisconnectTracker();
 }
예제 #26
0
 // Eyetracker found
 private void _browser_EyetrackerFound(object sender, EyetrackerInfoEventArgs e)
 {
     FEyetrackerInfo.Add(e.EyetrackerInfo);
     FUpdate = true;
     FLogger.Log(LogType.Debug, "Eyetracker has been detected");
 }