Exemplo n.º 1
0
        void kinect_IsAvailableChanged(KinectSensor sender, IsAvailableChangedEventArgs args)
        {
            // Kinectが接続された
            if (args.IsAvailable)
            {
                // カラーを設定する
                if (colorFrameReader == null)
                {
                    // カラー画像の情報を作成する(BGRAフォーマット)
                    colorFrameDesc = kinect.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);

                    colorBitmap       = new WriteableBitmap(colorFrameDesc.Width, colorFrameDesc.Height);
                    ImageColor.Source = colorBitmap;

                    colorBuffer = new byte[colorFrameDesc.Width * colorFrameDesc.Height * colorFrameDesc.BytesPerPixel];

                    // カラーリーダーを開く
                    colorFrameReader = kinect.ColorFrameSource.OpenReader();
                    colorFrameReader.FrameArrived += colorFrameReader_FrameArrived;
                }

                ImageColor.Source = colorBitmap;

                TextStatus.Text = "Kinectが接続されました";
            }
            // Kinectが外された
            else
            {
                // イメージを初期化する
                ImageColor.Source = null;

                TextStatus.Text = "Kinectが外されました";
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// changes the state of the UI based on whether a sensor is available
        /// </summary>
        /// <param name="sender">sender of the parameter</param>
        /// <param name="args">event parameters</param>
        private void IsAvailableChanged(KinectSensor sender, IsAvailableChangedEventArgs args)
        {
            this.SetViewState();

            if (args.IsAvailable)
            {
                // trigger controls to start rendering
                this.lastSwapChainPanel.Start();

                foreach (DXSwapPanel panel in Thumbnails.Items)
                {
                    if (panel != null)
                    {
                        KinectEvolution.Xaml.Controls.Base.Panel dx
                            = panel.DXPanel as KinectEvolution.Xaml.Controls.Base.Panel;
                        dx.Start();
                    }
                }

                if (this.lastSelectedTechIndex == -1)
                {
                    this.lastSelectedTechIndex = 0;
                }

                Thumbnails.SelectedIndex = this.lastSelectedTechIndex;
            }
        }
Exemplo n.º 3
0
 private void OnKinectSensorChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (this.OnTrackingFace != null)
     {
         this.OnTrackingFace(sender, e.IsAvailable);
     }
 }
Exemplo n.º 4
0
        void KinectV2StatusHelper_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (KinectV2StatusChanged != null)  //Only do this is there are subscribers to the event
            {
                KinectV2StatusEventArgs args = new KinectV2StatusEventArgs();
                if (e.IsAvailable)
                {
                    args.Status = KinectBase.KinectStatus.Connected;
                    System.Diagnostics.Debug.WriteLine("Kinect 2 connected (event).");
                }
                else
                {
                    if (KinectSensor.GetDefault().IsOpen)
                    {
                        args.Status = KinectBase.KinectStatus.NotReady;
                        System.Diagnostics.Debug.WriteLine("Kinect 2 not ready (event).");
                    }
                    else
                    {
                        args.Status = KinectBase.KinectStatus.Disconnected;
                        System.Diagnostics.Debug.WriteLine("Kinect 2 disconnected (event).");
                    }
                }
                args.KinectNumber   = 0; //This is always 0 because the Kinect v2 only supports 1 Kinect
                args.UniqueKinectID = KinectSensor.GetDefault().UniqueKinectId;

                OnKinectV2StatusChanged(args);
            }
        }
Exemplo n.º 5
0
        //kinect関連
        //----------------------------------------------------------------------------------------------------------------------------------------

        /// <summary>
        /// Kinectの抜き差し検知イベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void kinect_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            // Kinectが接続された
            if (e.IsAvailable)
            {
                Check.Text = "Connect";
                // カラーを設定する
                if (colorFrameReader == null)
                {
                    //カラー画像の情報を作成する(BGRA)
                    colorFrameDesc = kinect.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);

                    //データを読み込むカラーリーダーを開くとイベントハンドラの登録
                    colorFrameReader = kinect.ColorFrameSource.OpenReader();
                    colorFrameReader.FrameArrived += colorFrameReader_FrameArrived;
                }

                if (bodyFrameReader == null)
                {
                    // Bodyを入れる配列を作る
                    bodies = new Body[kinect.BodyFrameSource.BodyCount];

                    // ボディーリーダーを開く
                    bodyFrameReader = kinect.BodyFrameSource.OpenReader();
                    bodyFrameReader.FrameArrived += bodyFrameReader_FrameArrived;
                }
            }
            // Kinectが外された
            else
            {
                Check.Text = "UnConnect";
            }
        }
        void kinect_IsAvailableChanged( KinectSensor sender, IsAvailableChangedEventArgs args )
        {
            // Kinectが接続された
            if ( args.IsAvailable ) {
                // カラーを設定する
                if ( colorFrameReader == null ) {
                    // カラー画像の情報を作成する(BGRAフォーマット)
                    colorFrameDesc = kinect.ColorFrameSource.CreateFrameDescription( ColorImageFormat.Bgra );

                    colorBitmap = new WriteableBitmap( colorFrameDesc.Width, colorFrameDesc.Height );
                    ImageColor.Source = colorBitmap;

                    colorBuffer = new byte[colorFrameDesc.Width * colorFrameDesc.Height * colorFrameDesc.BytesPerPixel];

                    // カラーリーダーを開く
                    colorFrameReader = kinect.ColorFrameSource.OpenReader();
                    colorFrameReader.FrameArrived += colorFrameReader_FrameArrived;
                }

                ImageColor.Source = colorBitmap;

                TextStatus.Text = "Kinectが接続されました";
            }
            // Kinectが外された
            else {
                // イメージを初期化する
                ImageColor.Source = null;

                TextStatus.Text = "Kinectが外されました";
            }
        }
        /// <summary>
        /// Handle the availability change o the sensor
        /// </summary>
        private async void OnKinectAvailabilityChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (e.IsAvailable == false)
            {
                // Update status
                Status.Content = "Kinect is unavailable.";

                if (_isRecording)
                {
                    // Stop recording and render as-is
                    await StopRecording();
                }
                else
                {
                    // Disable recording
                    StartRecordingButton.IsEnabled = false;
                }

                // Update UI
                KinectCamera.Visibility      = Visibility.Collapsed;
                KinectUnavailable.Visibility = Visibility.Visible;
            }
            else
            {
                // Update status
                Status.Content = "Kinect is available.";

                // Update UI
                StartRecordingButton.IsEnabled = true;
                KinectCamera.Visibility        = Visibility.Visible;
                KinectUnavailable.Visibility   = Visibility.Collapsed;
            }
        }
Exemplo n.º 8
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (AvailabilityChange != null)
     {
         AvailabilityChange(this, e);
     }
 }
Exemplo n.º 9
0
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (sensor.IsAvailable)
            {
                //KinectStatusLbl.Text = "KINECT 2.0 connected";
                //BitmapImage bitmap = new BitmapImage();
                //bitmap.BeginInit();
                //bitmap.UriSource = new Uri("./../images/connected.png", UriKind.Relative);
                //bitmap.EndInit();

                //KinectStatusImg.Source = bitmap;
                ShowKinectStatus.Visibility         = Visibility.Visible;
                KinectNotConnectedStatus.Visibility = Visibility.Collapsed;
            }
            else
            {
                //BitmapImage bitmap = new BitmapImage();
                //bitmap.BeginInit();
                //bitmap.UriSource = new Uri("./../images/disconnected.png", UriKind.Relative);
                //bitmap.EndInit();

                //KinectStatusImg.Source = bitmap;


                //KinectStatusLbl.Text = "KINECT 2.0 not connected";

                ShowKinectStatus.Visibility         = Visibility.Collapsed;
                KinectNotConnectedStatus.Visibility = Visibility.Visible;
            }
        }
        private void OnAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            var isAvailable = e.IsAvailable;

            trayIcon.Icon = (isAvailable) ? Properties.Resources.KinectGreen : Properties.Resources.KinectRed;
            trayIcon.Text = (isAvailable) ? Text + " (Running)" : Text + " (Disconnect)";
        }
 void AvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     Debug.WriteLine("availability changed");
     if (e.IsAvailable)
     {
         Debug.WriteLine("Ready");
     }
 }
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                     : Properties.Resources.SensorNotAvailableStatusText;
     this.StatusText = this.kinectSensor.IsAvailable ? "Kinect is connected"
                                                  : "Kinect is not available";
 }
Exemplo n.º 13
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     //this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
     //                                                : Properties.Resources.SensorNotAvailableStatusText;
     this.StatusText = this.kinectSensor.IsAvailable ? "RunningStatusText"
                                                     : "SensorNotAvailableStatusText";
 }
Exemplo n.º 14
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (this.kinectSensor != null)
     {
         // on failure, set the status text
         this.Title = "Kv2 Tongue Detector - " + (this.kinectSensor.IsAvailable ? "Running" : "Sensor Not Available");
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Updates the UI regarding Kinect's avaliability.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event</param>
        private void Kinect_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (!_kinect.IsAvailable)
            {
                DepthImage.Source = (ImageSource)Resources["KinectNotAvailable"];
            }

            Console.WriteLine("Kinect status: " + (_kinect.IsAvailable ? "available" : "not available"));
        }
Exemplo n.º 16
0
        private void Kinect_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            EventHandler <IsAvailableChangedEventArgs> handler = IsAvailableChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Exemplo n.º 17
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (this.kinectSensor != null)
     {
         // on failure, set the status text
         this.StatusText = this.kinectSensor.IsAvailable ? "Running"
                                                         : "Error";
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// Handles the event when the sensor becomes unavailable (e.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     if (this.kinectSensor != null)
     {
         this.kinectStatus.Text = this.kinectSensor.IsAvailable ? availableKinect
                                                     : noKinect;
     }
 }
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (_sensor != null)
     {
         // on failure, set the status text
         this.StatusText = _sensor.IsAvailable ? "Kinect is Connected"
                                                         : "Kinect is Not Connected";
     }
 }
Exemplo n.º 20
0
 private void Runtime_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         if (this.OnReset != null)
         {
             this.OnReset(sender, new EventArgs());
         }
     }
 }
Exemplo n.º 21
0
        /// <summary>
        /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            // on failure, set the status text
            this.StatusText = this.kinectSensor.IsAvailable ? ProjectK.ErgoMC.Assessment.Properties.Resources.RunningStatusText : ProjectK.ErgoMC.Assessment.Properties.Resources.SensorNotAvailableStatusText;


            img_status.Source = this.kinectSensor.IsAvailable ? new BitmapImage(new Uri(@"/Images/Status_running.png", UriKind.Relative)) :
                                new BitmapImage(new Uri(@"/Images/Status_notfound.png", UriKind.Relative))
            ;
        }
Exemplo n.º 22
0
 /// <summary>
 /// P check status sensor
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SensorAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (!this.activeKinect.IsAvailable)
     {
         RuntimeLogPrint("sensor NOT available");
     }
     else
     {
         RuntimeLogPrint("sensor ready");
     }
 }
Exemplo n.º 23
0
        private void OnKinectIsAvailableChanged(object kinect, IsAvailableChangedEventArgs args)
        {
            isKinectAvailable = args.IsAvailable;

            if (outletData == null)
            {
                SetLSLStreamInfo();
            }

            UpdateKinectCaptureRelatedUI();
        }
Exemplo n.º 24
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         Console.Out.WriteLine("Kinect sensor attached");
     }
     else
     {
         Console.Out.WriteLine("Kinect sensor detached");
     }
 }
Exemplo n.º 25
0
 private void AvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         //sensorStatus.Text = "Sensor: On";
     }
     else
     {
         //sensorStatus.Text = "Sensor: Off";
     }
 }
Exemplo n.º 26
0
 void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         Console.WriteLine("Kinect sensor is now available.");
     }
     else
     {
         Console.WriteLine("Kinect sensor is not available.");
     }
 }
Exemplo n.º 27
0
 /// <summary>
 /// Listener for sensor availability
 /// </summary>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable == true)
     {
         this.StatusText = Properties.Resources.SensorIsAvailableStatusText;
     }
     else
     {
         this.StatusText = Properties.Resources.NoSensorStatusText;
     }
 }
Exemplo n.º 28
0
 void sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         SendInfo(string.Format("Sensor available {0}", DateTime.Now));
     }
     else
     {
         SendInfo(string.Format("Sensor unavailable {0}", DateTime.Now));
     }
 }
Exemplo n.º 29
0
 void kinectSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     try
     {
         this.statusText = this.kinectSensor.IsAvailable.ToString();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 30
0
 private void KinectSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         ledKinect.Fill = ledKinectBrush;
     }
     else
     {
         ledKinect.Fill = ledIdleBrush;
     }
 }
Exemplo n.º 31
0
        /// <summary>
        /// Called when the Kinect SDK changes its device availability.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void SensorOnIsAvailableChanged(object sender, IsAvailableChangedEventArgs args)
        {
            _bodyCapture?.Stop();

            if (args.IsAvailable)
            {
                Log.Information($"Kinect available ({_sensor.UniqueKinectId})");

                _kinectElement = FindKinect(_sensor.UniqueKinectId, _elements);
                if (_kinectElement == null)
                {
                    Log.Warning("No Kinect element found in scene.");
                    return;
                }
                Log.Information($"Kinect element found ({_kinectElement})");

                _assetMap  = BuildTracking(_kinectElement);
                _trackList = _assetMap.Keys.Select(j => j).ToArray();
                if (_trackList.Length == 0)
                {
                    Log.Warning("No tracking desired?");
                    return;
                }
                Log.Information($"Tracking {_trackList.Length} joints " +
                                $"({string.Join(", ", _trackList.Select(j => j.ToString()))})");

                _bodyCapture = new BodyCapture(_sensor, _trackList);
                _bodyCapture.OnBodyDetected += Body_OnDetected;
                _bodyCapture.OnBodyUpdated  += Body_OnUpdated;
                _bodyCapture.OnBodyLost     += Body_OnLost;
                _bodyCapture.Start();

                _active = true;
            }
            else if (_active)
            {
                Log.Information("Lost connection to Kinect.");

                _kinectElement = null;

                // TODO: Reset lookup tables

                foreach (var bodyElements in _bodyElements.Values)
                {
                    if (bodyElements != null)
                    {
                        _network.Destroy(bodyElements.RootElement.Id);
                    }
                }
                _bodyElements.Clear();

                _active = false;
            }
        }
        // Kinectの挿抜イベント
        void kinect_IsAvailableChanged( object sender, IsAvailableChangedEventArgs e )
        {
            // Kinectが接続された
            if ( e.IsAvailable ) {
                // カラーを設定する
                if ( colorFrameReader == null ) {
                    colorFrameReader = kinect.ColorFrameSource.OpenReader();
                    colorFrameReader.FrameArrived += colorFrameReader_FrameArrived;
                }

                TextStatus.Text = "Kinectが接続されました";
            }
            // Kinectが外された
            else {
                // イメージを初期化する
                ImageColor.Source = null;

                TextStatus.Text = "Kinectが外されました";
            }
        }
Exemplo n.º 33
0
 void sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     UpdateSensorStatus();
 }
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     Instance.StatusText = Instance.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                     : Properties.Resources.NoSensorStatusText;
 }
Exemplo n.º 35
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     this.cameraStatusLabel.Text = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                     : Properties.Resources.NoSensorStatusText;
 }
 void AvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     Debug.WriteLine("availability changed");
     if (e.IsAvailable)
     {
         Debug.WriteLine("Ready");
     }
 }
Exemplo n.º 37
0
        void KinectV2StatusHelper_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (KinectV2StatusChanged != null)  //Only do this is there are subscribers to the event
            {
                KinectV2StatusEventArgs args = new KinectV2StatusEventArgs();
                if (e.IsAvailable)
                {
                    args.Status = KinectBase.KinectStatus.Connected;
                    System.Diagnostics.Debug.WriteLine("Kinect 2 connected (event).");
                }
                else
                {
                    if (KinectSensor.GetDefault().IsOpen)
                    {
                        args.Status = KinectBase.KinectStatus.NotReady;
                        System.Diagnostics.Debug.WriteLine("Kinect 2 not ready (event).");
                    }
                    else
                    {
                        args.Status = KinectBase.KinectStatus.Disconnected;
                        System.Diagnostics.Debug.WriteLine("Kinect 2 disconnected (event).");
                    }
                }
                args.KinectNumber = 0; //This is always 0 because the Kinect v2 only supports 1 Kinect
                args.UniqueKinectID = KinectSensor.GetDefault().UniqueKinectId;

                OnKinectV2StatusChanged(args);
            }
        }
Exemplo n.º 38
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (this._sensor != null)
     {
         // on failure, set the status text
         WelcomeText.Text += "Sensor_IsAvailableChanged" + this._sensor.IsAvailable + "\n";// ? Properties.Resources.RunningStatusText
                                                        // : Properties.Resources.SensorNotAvailableStatusText;
     }
 }
Exemplo n.º 39
0
        /// <summary>
        /// Called when the kinect sensor is available.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="IsAvailableChangedEventArgs"/> instance containing the event data.</param>
        private void OnSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            // This call is automatically dispatched to the main thread, so no
            // synchronization is needed
            base.RaisePropertyChanged(() => UniqueKinectId);
            base.RaisePropertyChanged(() => IsSensorOpen);
            base.RaisePropertyChanged(() => IsSensorAvailable);

            if(e.IsAvailable)
            {
                m_readerInfraredFrame = m_sensor.InfraredFrameSource.OpenReader();
                m_readerInfraredFrame.FrameArrived += OnReaderInfraredFrame_FrameArrived;

                m_readerLongExposureInfraredFrame = m_sensor.LongExposureInfraredFrameSource.OpenReader();
                m_readerLongExposureInfraredFrame.FrameArrived += OnReaderLongExposureInfrared_FrameArrived;

                m_readerColorFrame = m_sensor.ColorFrameSource.OpenReader();
                m_readerColorFrame.FrameArrived += OnReaderColorFrame_FrameArrived;

                m_readerDepthFrame = m_sensor.DepthFrameSource.OpenReader();
                m_readerDepthFrame.FrameArrived += OnReaderDepthFrame_FrameArrived;

                m_readerBodyFrame = m_sensor.BodyFrameSource.OpenReader();
                m_readerBodyFrame.FrameArrived += OnReaderBodyFrame_FrameArrived;

                m_readerBodyIndexFrame = m_sensor.BodyIndexFrameSource.OpenReader();
                m_readerBodyIndexFrame.FrameArrived += OnReaderBodyIndexFrame_FrameArrived;
            }
            else
            {
                CommonTools.SafeDispose(ref m_readerInfraredFrame);
                CommonTools.SafeDispose(ref m_readerColorFrame);
                CommonTools.SafeDispose(ref m_readerDepthFrame);
                CommonTools.SafeDispose(ref m_readerBodyFrame);
                CommonTools.SafeDispose(ref m_readerBodyIndexFrame);
            }
        }
Exemplo n.º 40
0
 private static void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     Console.WriteLine(string.Format("KINECT STATUS CHANGE: {0}", (e.IsAvailable) ? "Available" : "Not Available"));
 }
Exemplo n.º 41
0
 private void OnKinectSensorIsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
     => IsAvailableChanged?.Invoke(this, e);
Exemplo n.º 42
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
 }
Exemplo n.º 43
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     StatusText = this.kinectSensor.IsAvailable ? "Kinect Ready :)" : "Keine Kinect gefunden...";
 }
Exemplo n.º 44
0
        /// <summary>
        /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (_kinectSensor != null)
            {
                if (!_kinectSensor.IsOpen)
                {
                    // open the sensor
                    _kinectSensor.Open();
                }
                // on failure, set the status text
                _kinectAvailiable = _kinectSensor.IsAvailable;

                //setup kinect events etc
                if (_kinectAvailiable)
                {
                    SetupKinect();
                }
            }
        }
Exemplo n.º 45
0
 /* Changes the status text based on whether the kinect is connected
  */
 private void Sensor_IsAvailableChanged(object sender,
     IsAvailableChangedEventArgs args)
 {
     this.KinectStatusText = this.kinectSensor.IsAvailable ?
         "Kinect Running" : "Kinect Not Available";
 }
Exemplo n.º 46
0
        private void OnKinectStatusChanged(object sender, IsAvailableChangedEventArgs e)
        {

        }
Exemplo n.º 47
0
        /// <summary>
        /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            // on failure, set the status text
            this.StatusText = this.kinectSensor.IsAvailable ? ProjectK.ErgoMC.Assessment.Properties.Resources.RunningStatusText : ProjectK.ErgoMC.Assessment.Properties.Resources.SensorNotAvailableStatusText;


            img_status.Source = this.kinectSensor.IsAvailable ? new BitmapImage(new Uri(@"/Images/Status_running.png", UriKind.Relative)) :
                new BitmapImage(new Uri(@"/Images/Status_notfound.png", UriKind.Relative))
                ;
        }
Exemplo n.º 48
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.KinectReady : Properties.Resources.NoSensor;
 }
Exemplo n.º 49
0
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (!sensorAvailabel && currentlySetupKinect)
     {
         isAvailable.Signal();
         sensorAvailabel = true;
     }
 }
Exemplo n.º 50
0
 private void Sensor_IsAvailableChanged(KinectSensor sender, IsAvailableChangedEventArgs args)
 {
     this.StatusText = this.kinectSensor.IsAvailable ? "Running" : "Not Available";
 }
Exemplo n.º 51
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                     : Properties.Resources.SensorNotAvailableStatusText;
 }
Exemplo n.º 52
0
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            if (sensor.IsAvailable)
            {
                //KinectStatusLbl.Text = "KINECT 2.0 connected";
                //BitmapImage bitmap = new BitmapImage();
                //bitmap.BeginInit();
                //bitmap.UriSource = new Uri("./../images/connected.png", UriKind.Relative);
                //bitmap.EndInit();

                //KinectStatusImg.Source = bitmap;
                ShowKinectStatus.Visibility = Visibility.Visible;
                KinectNotConnectedStatus.Visibility = Visibility.Collapsed;
            }
            else
            {
                //BitmapImage bitmap = new BitmapImage();
                //bitmap.BeginInit();
                //bitmap.UriSource = new Uri("./../images/disconnected.png", UriKind.Relative);
                //bitmap.EndInit();

                //KinectStatusImg.Source = bitmap;

                //KinectStatusLbl.Text = "KINECT 2.0 not connected";

                ShowKinectStatus.Visibility = Visibility.Collapsed;
                KinectNotConnectedStatus.Visibility = Visibility.Visible;

            }
        }
Exemplo n.º 53
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (this.kinectSensor != null)
     {
         // on failure, set the status text
         this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                         : Properties.Resources.SensorNotAvailableStatusText;
     }
 }
Exemplo n.º 54
0
 private void Runtime_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     if (e.IsAvailable)
     {
         if (this.OnReset != null)
         {
             this.OnReset(sender, new EventArgs());
         }
     }
 }
Exemplo n.º 55
0
 /// <summary>
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     if (this.kinectSensor.IsAvailable)
     {
         if (this.panTilt.IsReady)
         {
             this.statusText = Microsoft.Samples.Kinect.BodyBasics.Properties.Resources.RunningStatusText;
         }
         else
         {
             this.statusText = Microsoft.Samples.Kinect.BodyBasics.Properties.Resources.PanTiltNotAvailableStatusText;
         }
     }
     else{
          this.statusText = Microsoft.Samples.Kinect.BodyBasics.Properties.Resources.SensorNotAvailableStatusText;
     }
 }
 /// <summary>
 /// Handles the event when the sensor becomes unavailable (e.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // on failure, set the status text
     this.KinectStatusText = this.kinectSensor.IsAvailable ? "Connected"
                                                           : "Disconnected";
     if (this.PropertyChanged != null)
     {
         this.PropertyChanged(this, new PropertyChangedEventArgs("KinectStatusText"));
     }
 }
Exemplo n.º 57
0
        //Process a change in the availability of Kinect
        private void KSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            IsAvailable = e.IsAvailable;
            iRGBVideo = null;

            iUpdateTitle(IsAvailable);
        }
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     Debugger.Log(1, "Sensor available? ", e.IsAvailable.ToString());
 }
 /// <summary>
 /// Maneja los eventos que hacen que los sensores dejen de estar disponibles (Por ej. pausado, cerrado, desenchufado).
 /// Handles the event which the sensor becomes unavailable (E.g. paused, closed, unplugged).
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
 {
     // Cuando haya error, pone el texto de estado.
     // on failure, set the status text.
     this.StatusText = this.kinectSensor.IsAvailable ? Properties.Resources.RunningStatusText
                                                     : Properties.Resources.SensorNotAvailableStatusText;
 }
Exemplo n.º 60
0
        private void Sensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs e)
        {
            // on failure, set the status text
            if (!this.KinectSensor.IsAvailable)
            {
                _kinectState = false;
            }
            else
            {
                _kinectState = true;
            }

            this.NotifyStateListenersOfUpdate(_kinectState);
        }