//There is only one CoordinateHolder object per runtime.
        public static coordinateRecorder getInstance(MovementWindow observee)
        {
            if (instance == null)
                instance = new coordinateRecorder();

            return instance;
        }
        private void Sequence_Stop_Click(object sender, RoutedEventArgs e)
        {
            StopFullRecording();
            #region CloseWindows
            if (stimulyWindow != null)
            {
                Action close_stimulyWindow_action = () =>
                {
                    stimulyWindow.Close();
                };
                this.Dispatcher.Invoke(close_stimulyWindow_action);
                stimulyWindow = null;
            }

            if (prompter != null)
            {
                Action close_prompter_action = () =>
                {
                    prompter.Close();
                };
                this.Dispatcher.Invoke(close_prompter_action);
                prompter = null;
            }
            #endregion
        }
示例#3
0
        //There is only one CoordinateHolder object per runtime.
        public static coordinateRecorder getInstance(MovementWindow observee)
        {
            if (instance == null)
            {
                instance = new coordinateRecorder();
            }

            return(instance);
        }
        /*Creates self-paced movement stimuly window */
        private void SelfPacedMovement()
        {
            Action action = () =>
            {
                System.Windows.Media.Color color1 = (System.Windows.Media.Color)Subject1.SelectedColor;
                System.Windows.Media.Color color2 = (System.Windows.Media.Color)Subject2.SelectedColor;
                System.Windows.Media.Color color3 = (System.Windows.Media.Color)CourseColorPicker.SelectedColor;
                stimulyWindow = new MovementWindow(this, color1, color2, color3, (int)LineThicknessPicker.Value);
            };

            this.Dispatcher.Invoke(action);
        }
        /*Creates synchronous movement stimuly window */
        private void SyncMovement()
        {
            Action action = () =>
            {
                System.Windows.Media.Color color1 = (System.Windows.Media.Color)Subject1.SelectedColor;
                System.Windows.Media.Color color2 = (System.Windows.Media.Color)Subject2.SelectedColor;
                System.Windows.Media.Color color3 = (System.Windows.Media.Color)CourseColorPicker.SelectedColor;
                stimulyWindow = new MovementWindow(this, "Synchronous", (int)complexitySlider.Value, (int)SpeedSlider.Value, color1, color2, color3);
            };

            this.Dispatcher.Invoke(action);
        }
        private void Sequence_Timer_TickEvent(object sender, ElapsedEventArgs args)
        {
            #region CloseWindows
            if (stimulyWindow != null)
            {
                Action close_stimulyWindow_action = () =>
                {
                    stimulyWindow.Close();
                };
                this.Dispatcher.Invoke(close_stimulyWindow_action);
                stimulyWindow = null;
            }

            if (prompter != null)
            {
                Action close_prompter_action = () =>
                {
                    prompter.Close();
                };
                this.Dispatcher.Invoke(close_prompter_action);
                prompter = null;
            }
            #endregion
            if (_window == 2)
            {
                _window = 0;
                ((Timer)sender).Dispose();
            }
            else
            {
                var t = (System.Timers.Timer)sender;
                if (t.Interval <= 1000)
                {
                    Action action = () =>
                    {
                        t.Interval = 1000 * 60 * ((int)Sequence_Duration_Slider.Value + 1);
                    };
                    this.Dispatcher.Invoke(action);
                }
                Mode++;
            }
        }
 /*Creates synchronous movement stimuly window */
 private void SyncMovement()
 {
     Action action = () =>
     {
         System.Windows.Media.Color color1 = (System.Windows.Media.Color)Subject1.SelectedColor;
         System.Windows.Media.Color color2 = (System.Windows.Media.Color)Subject2.SelectedColor;
         System.Windows.Media.Color color3 = (System.Windows.Media.Color)CourseColorPicker.SelectedColor;
         stimulyWindow = new MovementWindow(this, "Synchronous", (int)complexitySlider.Value, (int)SpeedSlider.Value, color1, color2, color3);
     };
     this.Dispatcher.Invoke(action);
 }
        private void Sequence_Timer_TickEvent(object sender, ElapsedEventArgs args)
        {
            #region CloseWindows
            if (stimulyWindow != null)
            {
                Action close_stimulyWindow_action = () =>
                {
                    stimulyWindow.Close();
                };
                this.Dispatcher.Invoke(close_stimulyWindow_action);
                stimulyWindow = null;
            }

            if (prompter != null)
            {
                Action close_prompter_action = () =>
                {
                    prompter.Close();
                };
                this.Dispatcher.Invoke(close_prompter_action);
                prompter = null;
            }
            #endregion
            if (_window == 2)
            {
                _window = 0;
                ((Timer)sender).Dispose();
            }
            else
            {
                var t = (System.Timers.Timer)sender;
                if (t.Interval <= 1000)
                {
                    Action action = () =>
                    {
                        t.Interval = 1000 * 60 * ((int)Sequence_Duration_Slider.Value + 1);
                    };
                    this.Dispatcher.Invoke(action);
                }
                Mode++;
            }
        }
        private void Sequence_Stop_Click(object sender, RoutedEventArgs e)
        {
            StopFullRecording();
            #region CloseWindows
            if (stimulyWindow != null)
            {
                Action close_stimulyWindow_action = () =>
                {
                    stimulyWindow.Close();
                };
                this.Dispatcher.Invoke(close_stimulyWindow_action);
                stimulyWindow = null;
            }

            if (prompter != null)
            {
                Action close_prompter_action = () =>
                {
                    prompter.Close();
                };
                this.Dispatcher.Invoke(close_prompter_action);
                prompter = null;
            }
            #endregion
        }
示例#10
0
 /*Creates self-paced movement stimuly window */
 private void SelfPacedMovement()
 {
     Action action = () =>
     {
         System.Windows.Media.Color color1 = (System.Windows.Media.Color)Subject1.SelectedColor;
         System.Windows.Media.Color color2 = (System.Windows.Media.Color)Subject2.SelectedColor;
         System.Windows.Media.Color color3 = (System.Windows.Media.Color)CourseColorPicker.SelectedColor;
         stimulyWindow = new MovementWindow(this, color1, color2, color3, (int)LineThicknessPicker.Value);
     };
     this.Dispatcher.Invoke(action);
 }