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 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;
        }
        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;
        }
        private coordinateRecorder()
        {
            buffer = CoordinateDataBuffer.GetInstance();

            directoryPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            watch = new Stopwatch();

            string fileName = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".txt";
            logPath = System.IO.Path.Combine(SessionLogDirectoryPresent(), fileName);
            logstream = new StreamWriter(logPath, true);

            timer = new System.Timers.Timer();
            timer.Interval = 1;
            timer.Elapsed += new ElapsedEventHandler(Record);
        }
예제 #5
0
        private coordinateRecorder()
        {
            buffer = CoordinateDataBuffer.GetInstance();

            directoryPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            watch         = new Stopwatch();

            string fileName = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".txt";

            logPath   = System.IO.Path.Combine(SessionLogDirectoryPresent(), fileName);
            logstream = new StreamWriter(logPath, true);

            timer          = new System.Timers.Timer();
            timer.Interval = 1;
            timer.Elapsed += new ElapsedEventHandler(Record);
        }
 internal void Clear()
 {
     instance = null;
 }
 public static CoordinateDataBuffer GetInstance() => instance ?? (instance = new CoordinateDataBuffer());
        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;
        }
예제 #9
0
 internal void Clear()
 {
     instance = null;
 }
예제 #10
0
 public static CoordinateDataBuffer GetInstance() => instance ?? (instance = new CoordinateDataBuffer());