Пример #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            logger.TraceEvent(TraceEventType.Start, 0);

            MainWindow mw = new MainWindow();

            //Instantiate and Start IntAirAct
            intAirAct = IAIntAirAct.New();

            intAirAct.Route(IARoute.Post("/mrivisualizer/slice/{slicenumber}"), delegate(IARequest request, IAResponse response)
            {
                int slice = int.Parse(request.Parameters["slicenumber"]);
                logger.TraceEvent(TraceEventType.Verbose, 0, "Updating to {0}", slice);
                Dispatcher.BeginInvoke((Action) delegate()
                {
                    mw.showSlice(slice);
                });
            });

            intAirAct.Start();

            mw.Show();
        }
Пример #2
0
        public void TestMethod1()
        {
            ia = IAIntAirAct.New();
            ia.Start();
            ia.Stop();

            mse = new MSEKinectManager();

            //Setup();
            //Teardown();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("Window Loaded");

            // Look through all sensors and start the first connected one.
            // This requires that a Kinect is connected at the time of app startup.
            // To make your app robust against plug/unplug,
            // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit
            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                if (potentialSensor.Status == KinectStatus.Connected)
                {
                    this.sensor = potentialSensor;
                    break;
                }
            }

            if (null != this.sensor)
            {
                // Turn on the depth stream to receive depth frames
                this.sensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);

                // Allocate space to put the depth pixels we'll receive
                this.depthPixels = new short[this.sensor.DepthStream.FramePixelDataLength];

                // Allocate space to put the color pixels we'll create
                this.colorPixels = new byte[this.sensor.DepthStream.FramePixelDataLength * sizeof(int)];

                // This is the bitmap we'll display on-screen
                this.colorBitmap = new WriteableBitmap(this.sensor.DepthStream.FrameWidth, this.sensor.DepthStream.FrameHeight, 96.0, 96.0, PixelFormats.Bgr32, null);

                // Set the image we display to point to the bitmap where we'll put the image data
                //this.Image.Source = this.colorBitmap;

                // Add an event handler to be called whenever there is new depth frame data
                this.sensor.DepthFrameReady += this.SensorDepthFrameReady;

                this.sensor.DepthStream.Range = DepthRange.Near;
                xPositionAverage = new RollingAverage(5);

                // Start the sensor!
                try
                {
                    this.sensor.Start();
                }
                catch (IOException)
                {
                    this.sensor = null;
                    Debug.WriteLine("no kinect");
                    MessageBox.Show("Kinect Error");
                }
            }
            else
                MessageBox.Show("No Kinect");

            intAirAct = IAIntAirAct.New();
            intAirAct.Start();
        }
        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            intAirAct = IAIntAirAct.New();
            timer = new Timer(1000);

            //Registers Event Handlers
            intAirAct.DeviceFound += DeviceFound;
            intAirAct.DeviceLost += DeviceLost;
            timer.Elapsed += TimerElapsed;

            intAirAct.Start();
            timer.Start();
        }