public MovementWindow(MainWindow mainWindow, System.Windows.Media.Color color1, System.Windows.Media.Color color2, System.Windows.Media.Color color3, int StrokeThickness)
        {
            InitializeComponent();
            Pointer1.Stroke      = new SolidColorBrush(color1);
            Pointer1.DataContext = model;
            Pointer2.Stroke      = new SolidColorBrush(color2);
            Pointer2.DataContext = model;
            lineBrush            = new SolidColorBrush(color3);
            this.StrokeThickness = StrokeThickness;

            this.mainWindow = mainWindow;
            recorder        = coordinateRecorder.getInstance(this);
            holder          = CoordinateDataBuffer.GetInstance();
            this.queue1     = new AnimationQueue(StimulyEllipse1, Canvas.LeftProperty, Canvas.TopProperty);
            t           = new System.Timers.Timer();
            t.Elapsed  += new ElapsedEventHandler(SendInfo);
            t.Interval += 100;

            this.SetBinding(Window.WidthProperty, new Binding("RezolutionX")
            {
                Source = model, Mode = BindingMode.OneWayToSource
            });
            this.SetBinding(Window.HeightProperty, new Binding("RezolutionY")
            {
                Source = model, Mode = BindingMode.OneWayToSource
            });

            generate                   = Self_Paced;
            CourseComplexity           = 0;
            StimulyEllipse1.Visibility = Visibility.Visible;
        }
        //There is only one CoordinateHolder object per runtime.
        public static coordinateRecorder getInstance(MovementWindow observee)
        {
            if (instance == null)
                instance = new coordinateRecorder();

            return instance;
        }
        public MovementWindow(MainWindow mainWindow, string mode, int complexity, int Speed, System.Windows.Media.Color color1, System.Windows.Media.Color color2, System.Windows.Media.Color color3)
        {
            InitializeComponent();

            Pointer1.Stroke          = new SolidColorBrush(color1);
            this.color1              = new SolidColorBrush(color1);
            Pointer1.DataContext     = model;
            Pointer2.Stroke          = new SolidColorBrush(color2);
            this.color2              = new SolidColorBrush(color2);
            StimulyEllipse1.Stroke   = this.color1;
            CheckPointEllipse.Stroke = this.color2;
            Pointer2.DataContext     = model;
            lineBrush   = new SolidColorBrush(color3);
            CourseSpeed = Speed;


            this.queue1     = new AnimationQueue(StimulyEllipse1, Canvas.LeftProperty, Canvas.TopProperty);
            this.mainWindow = mainWindow;
            recorder        = coordinateRecorder.getInstance(this);
            holder          = CoordinateDataBuffer.GetInstance();

            t           = new System.Timers.Timer();
            t.Elapsed  += new ElapsedEventHandler(SendInfo);
            t.Interval += 100;


            this.SetBinding(Window.WidthProperty, new Binding("RezolutionX")
            {
                Source = model, Mode = BindingMode.OneWayToSource
            });
            this.SetBinding(Window.HeightProperty, new Binding("RezolutionY")
            {
                Source = model, Mode = BindingMode.OneWayToSource
            });

            if (complexity == 0)
            {
                CourseSpeed += 4; // Lowest complexity trajectory has too many coordinates and the animation moves to slow. For this increment the course speed more .
            }

            if (mode == "Asynchronous")
            {
                generate                     = Asynchronous;
                checkPointTimer              = new System.Timers.Timer();
                checkPointTimer.Interval     = 1000.0 / CourseSpeed * 50;
                checkPointTimer.Elapsed     += new ElapsedEventHandler(ShowNextCheckPoint);
                queue1.checkPointHandler    += new EventHandler(ShowNextCheckPoint);
                StimulyEllipse1.Visibility   = Visibility.Visible;
                CheckPointEllipse.Visibility = Visibility.Visible;
            }

            if (mode == "Synchronous")
            {
                generate = Synchronous;
                StimulyEllipse1.Visibility = Visibility.Visible;
            }
            CourseComplexity = complexity;
        }
Example #4
0
        //There is only one CoordinateHolder object per runtime.
        public static coordinateRecorder getInstance(MovementWindow observee)
        {
            if (instance == null)
            {
                instance = new coordinateRecorder();
            }

            return(instance);
        }
        public MovementWindow(MainWindow mainWindow , string mode , int complexity , int Speed, System.Windows.Media.Color color1 , System.Windows.Media.Color color2 , System.Windows.Media.Color color3 )
        {
            InitializeComponent();

            Pointer1.Stroke = new SolidColorBrush(color1);
            this.color1 = new SolidColorBrush(color1);
            Pointer1.DataContext = model;
            Pointer2.Stroke = new SolidColorBrush(color2);
            this.color2 = new SolidColorBrush(color2);
            StimulyEllipse1.Stroke = this.color1;
            CheckPointEllipse.Stroke = this.color2;
            Pointer2.DataContext = model;
            lineBrush = new SolidColorBrush(color3);
            CourseSpeed = Speed;

            this.queue1 = new AnimationQueue(StimulyEllipse1, Canvas.LeftProperty, Canvas.TopProperty);
            this.mainWindow = mainWindow;
            recorder = coordinateRecorder.getInstance(this);
            holder =    CoordinateDataBuffer.GetInstance();

            t = new System.Timers.Timer();
            t.Elapsed += new ElapsedEventHandler(SendInfo);
            t.Interval += 100;

            this.SetBinding(Window.WidthProperty, new Binding("RezolutionX") { Source = model, Mode = BindingMode.OneWayToSource });
            this.SetBinding(Window.HeightProperty, new Binding("RezolutionY") { Source = model, Mode = BindingMode.OneWayToSource });

            if (complexity == 0)
            {
                CourseSpeed += 4; // Lowest complexity trajectory has too many coordinates and the animation moves to slow. For this increment the course speed more .
            }

            if (mode == "Asynchronous")
            {
                generate = Asynchronous;
                checkPointTimer = new System.Timers.Timer();
                checkPointTimer.Interval = 1000.0 / CourseSpeed * 50;
                checkPointTimer.Elapsed += new ElapsedEventHandler(ShowNextCheckPoint);
                queue1.checkPointHandler += new EventHandler(ShowNextCheckPoint);
                StimulyEllipse1.Visibility = Visibility.Visible;
                CheckPointEllipse.Visibility = Visibility.Visible;
            }

            if (mode == "Synchronous")
            {
                generate = Synchronous;
                StimulyEllipse1.Visibility = Visibility.Visible;
            }
            CourseComplexity = complexity;
        }
Example #6
0
 public void Clear()
 {
     instance = null;
 }
        public MovementWindow(MainWindow mainWindow , System.Windows.Media.Color color1, System.Windows.Media.Color color2, System.Windows.Media.Color color3 , int StrokeThickness)
        {
            InitializeComponent();
            Pointer1.Stroke = new SolidColorBrush(color1);
            Pointer1.DataContext = model;
            Pointer2.Stroke = new SolidColorBrush(color2);
            Pointer2.DataContext = model;
            lineBrush = new SolidColorBrush(color3);
            this.StrokeThickness = StrokeThickness;

            this.mainWindow = mainWindow;
            recorder = coordinateRecorder.getInstance(this);
            holder = CoordinateDataBuffer.GetInstance();
            this.queue1 = new AnimationQueue(StimulyEllipse1, Canvas.LeftProperty, Canvas.TopProperty);
            t = new System.Timers.Timer();
            t.Elapsed += new ElapsedEventHandler(SendInfo);
            t.Interval += 100;

            this.SetBinding(Window.WidthProperty, new Binding("RezolutionX") { Source = model, Mode = BindingMode.OneWayToSource });
            this.SetBinding(Window.HeightProperty, new Binding("RezolutionY") { Source = model, Mode = BindingMode.OneWayToSource });

            generate = Self_Paced;
            CourseComplexity = 0;
            StimulyEllipse1.Visibility = Visibility.Visible;
        }
 public void Clear()
 {
     instance = null;
 }