Exemplo n.º 1
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="bluetooth">Communication instance</param>
 /// <param name="target"> Target</param>
 public ObjectTracker(BluetoothDevice bluetooth, Indicator target)
 {
     Target = target;
     Bluetooth = bluetooth;
     Worker = new BackgroundWorker();
     Worker.DoWork += Tracking;
 }
Exemplo n.º 2
0
        public ObjectTracker(BluetoothDevice bluetooth, Indicator target, System.Windows.Controls.CheckBox activator)
        {
            Target = target;
            Bluetooth = bluetooth;
            Activator = activator;
            TimerClock = new Timer();
            TimerClock.Interval = 5000;
            TimerClock.Tick += TimerClockTick;

            Found = false;
        }
        /// <summary>
        /// Default constructor
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            Slow = false;
            // Initialize sequence
            Sequence = new MoveItemsCollection();
            tblSequences.ItemsSource = Sequence;
            // Initialize Moves
            cbDirection.ItemsSource = MoveItem.AvailableMoves;
            
            // get local video device information
            LocalVideoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            // initialize gamepad Control object
            GamePad = new GamepadDevice(navUp, navDown, navLeft, navRight, actTriangle, actCircle, actCross, actSquare,
                                       actL2, actR2, actL1, actR1, actSelect, actStart);

            // Organize virtual keypad
            VirtualButtons = new Key[14];
            // Register keypad
            Keypad_Init();
            Keypad_CommandMap();


            // Initialize Tracker
            Tracker= new BackgroundWorker();
            Tracker.WorkerSupportsCancellation = true;

            Tracker.DoWork+= Tracking;
            Tracker.RunWorkerCompleted += TrackingTerminated;
            // initiate target
            Target = new Indicator();

            ObjTracker = new ObjectTracker(Bluetooth, Target);
            ObjTracker.Worker.RunWorkerCompleted += TrackingTerminated;

            tabControl.Items.Remove(tabPlayer);
        }