private void SetSequenceInfo(SequenceData sd)
        {
            // Keep it simple, no data binding, just dump the data into the new session obj

            sd.Username   = TextBoxUsername.Text;
            sd.DeviceName = TextBoxDevice.Text;

            if (RadioIR0.IsChecked.Value)
            {
                sd.IRSourceCount = 0;
            }
            if (RadioIR1.IsChecked.Value)
            {
                sd.IRSourceCount = 1;
            }
            if (RadioIR2.IsChecked.Value)
            {
                sd.IRSourceCount = 2;
            }
            if (RadioIR3.IsChecked.Value)
            {
                sd.IRSourceCount = 3;
            }
            if (RadioIR4.IsChecked.Value)
            {
                sd.IRSourceCount = 4;
            }
            if (RadioIR5.IsChecked.Value)
            {
                sd.IRSourceCount = 5;
            }

            sd.Lens     = TextBoxLens.Text;
            sd.LensMM   = TextBoxLensMM.Text;
            sd.LensIris = TextBoxLensIris.Text;

            if (RadioCameraViewBinocular.IsChecked.Value)
            {
                sd.CameraView = SequenceData.CameraViewEnum.Binocular;
            }
            if (RadioCameraViewMonocular.IsChecked.Value)
            {
                sd.CameraView = SequenceData.CameraViewEnum.Monocular;
            }
            if (RadioCameraViewHeadmounted.IsChecked.Value)
            {
                sd.CameraView = SequenceData.CameraViewEnum.Headmounted;
            }

            sd.Notes = TextBoxNotes.Text;
        }
        private void SetFormData()
        {
            SequenceData tmp = new SequenceData();

            tmp.LoadLatest();

            TextBoxUsername.Text = tmp.Username;
            TextBoxLens.Text     = tmp.Lens;
            TextBoxLensMM.Text   = tmp.LensMM;
            TextBoxLensIris.Text = tmp.LensIris;

            if (tmp.IRSourceCount == 0)
            {
                RadioIR0.IsChecked = true;
            }
            if (tmp.IRSourceCount == 1)
            {
                RadioIR1.IsChecked = true;
            }
            if (tmp.IRSourceCount == 2)
            {
                RadioIR2.IsChecked = true;
            }
            if (tmp.IRSourceCount == 3)
            {
                RadioIR3.IsChecked = true;
            }
            if (tmp.IRSourceCount == 4)
            {
                RadioIR4.IsChecked = true;
            }
            if (tmp.IRSourceCount == 5)
            {
                RadioIR5.IsChecked = true;
            }

            switch (tmp.CameraView)
            {
            case SequenceData.CameraViewEnum.Binocular:
                RadioCameraViewBinocular.IsChecked = true;
                break;

            case SequenceData.CameraViewEnum.Monocular:
                RadioCameraViewMonocular.IsChecked = true;
                break;

            case SequenceData.CameraViewEnum.Headmounted:
                RadioCameraViewHeadmounted.IsChecked = true;
                break;
            }
        }
        private void RunCapture(object sender, RoutedEventArgs e)
        {
            // "Fake" calibration window that animates points
            calWindow = new DummyCalibrationWindow();

            // Set parameters
            calWindow.SetSize(ScreenParameters.PrimaryResolution);
            calWindow.calibrationControl.PointTransitionDuration = 1000;
            calWindow.calibrationControl.PointDuration           = 1000;
            calWindow.calibrationControl.PointDiameter           = 50;

            // Register for event
            calWindow.calibrationControl.OnPointStart     += new RoutedEventHandler(calibrationControl_OnPointStart);
            calWindow.calibrationControl.OnCalibrationEnd += new RoutedEventHandler(calibrationControl_OnCalibrationEnd);

            // Stor data in SequenceData object
            sequenceData = new SequenceData();

            // Set sequnce info
            SetSequenceInfo(sequenceData);

            // Start animation, when the first point has been display, OnPoint event is occurs and we start storing images
            calWindow.calibrationControl.Start();
        }