Beispiel #1
0
        public void onLoad(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Maximized;
            Application.Current.MainWindow = this;
            State = EState.Setup;

            overview           = new UserControls.OverviewCtrl();
            stimuliDisplayArea = new UserControls.DocumentCtrl();
            selectionCtrl      = new AoiCtrl();
            markupCtrl         = new MarkupCtrl();
            calibrationTest    = new UserControls.TestCalibrationCtrl();
            calibrationCtrl    = new UserControls.CalibrationCtrl();

            aoiSelectionComplete += new selectionCompleteHandler(((AoiCtrl)selectionCtrl).endSelection);
            progStateChanged     += new stateChangedHandler(ctrlwin.stateChanged);
            //this.KeyDown += new System.Windows.Input.KeyEventHandler(MainWindow_KeyDown);
        }
Beispiel #2
0
        //currently unused vars
        //init gaze stream
        //StreamReader fd;
        //Thread eegStream;
        //Session session;
        //public Collection<EncoderDevice> AudioDevices { get; set; }
        //public delegate void testChangedHandler(String path);
        //public event testChangedHandler currentTestChanged;
        ////current test
        //private Test _currentTestInstance = null;
        //public Test currentTestInstance
        //{
        //	get { return _currentTestInstance; }
        //	set
        //	{
        //		if(_currentTestInstance != null) //add previous value to list
        //		{
        //			testList.Add(_currentTestInstance);
        //		}
        //		_currentTestInstance = value;
        //	}
        //}

        public MainWindow()
        {
            stopwatch.Start();

            //set window to start on the second monitor
            this.WindowStartupLocation = WindowStartupLocation.Manual;
            Screen s2 = Screen.AllScreens[0];

            //Screen s2 = Screen.AllScreens.Where(s => !s.Primary).FirstOrDefault();
            System.Drawing.Rectangle r2 = s2.WorkingArea;
            this.Top    = r2.Top;
            this.Left   = r2.Left;
            this.Width  = r2.Width;
            this.Height = r2.Height;

            //set datacontext and init window loading
            this.DataContext = this;
            InitializeComponent();

            //find available video devices for webcam
            VideoDevices = EncoderDevices.FindDevices(EncoderDeviceType.Video);

            //Create child window
            SourceInitialized += (s, a) =>
            {
                ctrlwin       = new ControlWindow();
                ctrlwin.Owner = this;
                ctrlwin.Show();
            };

            //loadTest += new LoadTestHandler(((UserControls.DocumentCtrl)stimuliDisplayArea).onTestLoaded);

            progStateChanged += new stateChangedHandler(stateChanged);


            //readyToRecord += new readyToRecordHandler(ctrlwin.readyToRecord);

            //recordingStarted += new recordingStartHandler(ctrlwin.startRecording);

            //recordingStopped += new recordingEndHandler(ctrlwin.stopRecording);
        }