public void Setup()
        {
            //client = IAIntAirAct.New();
            Client = IAIntAirAct.New();
            Server = new MSEKinectManager();
            clientConnected = false;
            serverConnected = false;
            doneWaitingForResponse = false;

            Client.Port = ClientPort;
            Server.IntAirAct.Port = ServerPort;

            // Increment the port numbers, so that if the current test run crashes, we don't try to use unreclaimed ports on the next test
            ClientPort++;
            ServerPort++;

            // In the tests, we wait on clientConnected and serverConnected, to be certain that each IntAirAct instance has registered the other
            // We use known ports to 'uniquely' identify instances during the test, since other IntAirAct devices may exist on the network during the test
            Client.DeviceFound += delegate(IADevice device, bool ownDevice)
            {
                if (device.Port == Server.IntAirAct.Port)
                    clientConnected = true;
            };

            Server.IntAirAct.DeviceFound += delegate(IADevice device, bool ownDevice)
            {
                if (device.Port == Client.Port)
                    serverConnected = true;
            };
        }
Exemple #2
0
        public void Teardown()
        {
            Client.Stop();
            Server.Stop();

            Client = null;
            Server = null;
        }
Exemple #3
0
        static void Main()
        {
            _source.TraceEvent(TraceEventType.Start, 0, "MSEKinectBootstrapper");

            MSEKinectManager km = new MSEKinectManager();
            km.Start();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
Exemple #4
0
        public void TestMethod1()
        {
            ia = IAIntAirAct.New();
            ia.Start();
            ia.Stop();

            mse = new MSEKinectManager();

            //Setup();
            //Teardown();
        }
Exemple #5
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Dispatcher.Invoke(new Action(delegate()
            {

            DrawingResources.GenerateGridLines(canvas, GridLines, GridLinesScaleSlider.Value);
            GridLines.ShowGridLines = true;

            // When we do the event handling through XAML, an event fires before the Window is loaded, and it freezes the program, so we do event binding after Window is loaded
            GridLinesScaleSlider.ValueChanged += UpdateGridlines;
            GridLinesCheckBox.Checked += ChangeGridlineVisibility;
            GridLinesCheckBox.Unchecked += ChangeGridlineVisibility;
            RangeCheckBox.Checked += ChangeRangeVisibility;
            RangeCheckBox.Unchecked += ChangeRangeVisibility;

            //Create Dictionaries for DeviceControl, PersonControl
            DeviceControlDictionary = new Dictionary<string, DeviceControl>();
            PersonControlDictionary = new Dictionary<PairablePerson, PersonControl>();
            TrackerControlDictionary = new Dictionary<string, TrackerControl>();

            //Initialize and Start MSEKinectManager
            kinectManager = new MSEKinectManager();
            kinectManager.Start();

            // The tracker is created in the PersonManager constructor, so there's actually no way for us to listen for its creation the first time
            //trackerChanged(kinectManager.PersonManager, kinectManager.PersonManager.Tracker);

            //Setup Events for Device Addition and Removal, Person Addition and Removal
            kinectManager.DeviceManager.DeviceAdded += deviceAdded;
            kinectManager.DeviceManager.DeviceRemoved += deviceRemoved;
            kinectManager.PersonManager.PersonAdded += personAdded;
            kinectManager.PersonManager.PersonRemoved += personRemoved;
            kinectManager.PersonManager.newKinectDiscovered += KinectDiscovered;
            kinectManager.PersonManager.kinectRemoved += KinectRemoved;

            //Seperate components for displaying the visible skeletons
            skeletonRenderer = new SkeletonRenderer(SkeletonBasicsImage);

            //// Values retrieved from:
            //// http://blogs.msdn.com/b/kinectforwindows/archive/2012/01/20/near-mode-what-it-is-and-isn-t.aspx
            //// http://msdn.microsoft.com/en-us/library/jj131033.aspx
            //tracker.MinRange = 0.8;
            //tracker.MaxRange = 4;
            //tracker.FieldOfView = 57;

            }));
        }
        public void Teardown()
        {
            Client.Stop();
            Server.Stop();

            Client = null;
            Server = null;

            // Wait a few seconds at the end of each test, to allow networking dependencies to clean up
            System.Threading.Thread.Sleep(2000);
        }