Esempio n. 1
0
        public MSEKinectManager(bool RequireKinect = false)
        {
            if (RequireKinect)
                TestKinectAvailability();

            //Instantiate Components
            intAirAct = IAIntAirAct.New();
            locator = new Locator();
            pairingRecognizer = new PairingRecognizer(locator, intAirAct);
            gestureController = new GestureController();
            personManager = new PersonManager(locator, gestureController, intAirAct);
            deviceManager = new DeviceManager(locator, intAirAct);
        }
Esempio n. 2
0
        void deviceRemoved(DeviceManager deviceManager, PairableDevice pairableDevice)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                if (DeviceControlDictionary.ContainsKey(pairableDevice.Identifier))
                {
                    canvas.Children.Remove(DeviceControlDictionary[pairableDevice.Identifier]);
                    unpairedDeviceStackPanel.Children.Remove(DeviceControlDictionary[pairableDevice.Identifier]);
                    surfaceStackPanel.Children.Remove(DeviceControlDictionary[pairableDevice.Identifier]);

                    DeviceControlDictionary.Remove(pairableDevice.Identifier);
                }
            }));
        }
Esempio n. 3
0
        void deviceAdded(DeviceManager deviceManager, PairableDevice pairableDevice)
        {
            // Finds the matching IADevice from the pairableDevice Identifier
            IADevice iaDevice = deviceManager.IntAirAct.Devices.Find(d => d.Name.Equals(pairableDevice.Identifier));

            if (iaDevice.SupportedRoutes.Contains(Routes.BecomePairedRoute))
            {
                Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                {
                    DeviceControlDictionary[pairableDevice.Identifier] = new DeviceControl(pairableDevice, iaDevice);
                    unpairedDeviceStackPanel.Children.Add(DeviceControlDictionary[pairableDevice.Identifier]);
                }));
            }
            else if (iaDevice.SupportedRoutes.Contains(Routes.GetLocationRoute))
            {
                Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                {
                    DeviceControlDictionary[pairableDevice.Identifier] = new DeviceControl(pairableDevice, iaDevice);
                    surfaceStackPanel.Children.Add(DeviceControlDictionary[pairableDevice.Identifier]);
                }));
            }
        }