Example #1
0
 private VideoViewer()
 {
     ComboBoxBackgroundColorFix.Initialize();
     InitializeComponent();
     menuBarIcons.IsDetachVideoVisible = false;
     RegisterForEvents();
 }
Example #2
0
        public GazeTrackerUIMainWindow()
        {
            // Little fix for colorschema (must run before initializing)
            ComboBoxBackgroundColorFix.Initialize();

            // Register for special error messages
            ErrorLogger.TrackerError += tracker_OnTrackerError;

            this.ContentRendered += new EventHandler(GazeTrackerUIMainWindow_ContentRendered);

            InitializeComponent();

            #region EyeSpark specific code

            // create a simple tray menu with only one item.
            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("Open", ShowFromTray);
            trayMenu.MenuItems.Add("Exit " + Title, AppClose);

            // Create a tray icon. In this example we usa a
            // standard system icon for simplicity, but you
            // can of course use your own custom icon too.
            trayIcon = new NotifyIcon();

            // TODO: [EyeSpark] Decide if aditional info is needed in system tray
            trayIcon.Text = Title;
            trayIcon.Icon = Properties.Resources.eyespark;

            // Add menu to tray icon and show it.
            trayIcon.ContextMenu  = trayMenu;
            trayIcon.DoubleClick += new EventHandler(ShowFromTray);
            //HideToTray();

            #endregion
        }
Example #3
0
        public GazeTrackerUIMainWindow()
        {
            // Little fix for colorschema (must run before initializing)
            ComboBoxBackgroundColorFix.Initialize();

            // Register for special error messages
            ErrorLogger.TrackerError += tracker_OnTrackerError;

            InitializeComponent();
            Loaded += GazeTrackerUIMainWindow_Loaded;
        }
        // private Tracker tracker;

        #endregion


        #region Constructor / Init methods

        public GTApplicationMainWindow()
        {
            // Little fix for colorschema (must run before initializing)
            ComboBoxBackgroundColorFix.Initialize();

            // Register for special error messages
            ErrorLogger.TrackerError += tracker_OnTrackerError;

            this.ContentRendered += new EventHandler(GTApplicationMainWindow_ContentRendered);

            InitializeComponent();
        }
        public GazeTrackerUIMainWindow()
        {
            // Little fix for colorschema (must run before initializing)
            ComboBoxBackgroundColorFix.Initialize();

            // Register for special error messages
            ErrorLogger.TrackerError += tracker_OnTrackerError;

            this.ContentRendered += new EventHandler(GazeTrackerUIMainWindow_ContentRendered);

            InitializeComponent();
            GazeTrackerUIMainWindow.FontSize = lblTitle.FontSize;
            Form1 test = new Form1();

            test.Show();
        }
Example #6
0
        /// <summary>
        /// The implementation of this method connects the client, so that the
        /// system is ready for calibration.
        /// </summary>
        /// <returns><strong>True</strong> if successful connected to tracker,
        /// otherwise <strong>false</strong>.</returns>
        public virtual bool Connect()
        {
            try
            {
                // Little fix for colorschema (must run before initializing)
                ComboBoxBackgroundColorFix.Initialize();

                // Register for special error messages
                ErrorLogger.TrackerError += this.OnTrackerError;

                // Load GTSettings
                Settings.Instance.LoadLatestConfiguration();

                // Camera initialization and start frame grabbing
                if (GTHardware.Camera.Instance.DeviceType != GTHardware.Camera.DeviceTypeEnum.None)
                {
                    // If DirectShow camera, init using saved settings
                    if (GTHardware.Camera.Instance.DeviceType == GTHardware.Camera.DeviceTypeEnum.DirectShow)
                    {
                        GTHardware.Camera.Instance.SetDirectShowCamera(
                            Settings.Instance.Camera.DeviceNumber,
                            Settings.Instance.Camera.DeviceMode);
                    }
                    else
                    {
                        GTHardware.Camera.Instance.Device.Initialize();
                    }

                    GTHardware.Camera.Instance.Device.Start();
                }
                else
                {
                    // No camera detected, display message
                    const string Error = "The GazeTracker was unable to connect a camera. \n" +
                                         "Make sure that the device is connected and that the device drivers are installed. " +
                                         "Verified configurations can be found in our forum located at http://forum.gazegroup.org";
                    this.OnTrackerError(Error);
                }

                // Set this process to real-time priority
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;

                SettingsWindow.Instance.Title = "SettingsWindow"; // Just touch it..

                // Load settings and apply
                this.InitSettings();

                // Video preview window (tracker visualizes image processing)
                this.eyeVideoControl.Start();

                GTCommands.Instance.Calibration.OnAccepted   += this.OnCalibrationAccepted;
                GTCommands.Instance.Calibration.OnStart      += this.OnCalibrationStart;
                GTCommands.Instance.Calibration.OnRunning    += this.OnCalibrationRunning;
                GTCommands.Instance.Calibration.OnPointStart += this.OnPointStart;
                GTCommands.Instance.Calibration.OnAbort      += this.OnCalibrationAbort;
                GTCommands.Instance.Calibration.OnEnd        += this.OnCalibrationEnd;

                this.IsConnected = true;
            }
            catch (Exception ex)
            {
                this.OnTrackerError(ex.Message);
                return(false);
            }

            return(true);
        }