Ejemplo n.º 1
0
        public SittingStandingPage()
        {
            InitializeComponent();

            //Set exercise repetitions based on settings or default (10)
            startreps      = Int32.Parse(Application.Current.Properties["sittingReps"].ToString());
            sittingCounter = startreps;

            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

                _userReporter              = new PlayersController();
                _userReporter.BodyEntered += UserReporter_BodyEntered;
                _userReporter.BodyLeft    += UserReporter_BodyLeft;
                _userReporter.Start();

                _gesture = new Sitting();
                _gesture.GestureRecognized += Gesture_GestureRecognized;

                _recorder = new Kinect2CSV();
                _timer    = new Stopwatch();
            }
        }
        public WalkingPage()
        {
            InitializeComponent();

            _sensor = KinectSensor.GetDefault();

            if (_sensor != null)
            {
                _sensor.Open();

                _reader = _sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.Infrared | FrameSourceTypes.Body);
                _reader.MultiSourceFrameArrived += Reader_MultiSourceFrameArrived;

                _userReporter              = new PlayersController();
                _userReporter.BodyEntered += UserReporter_BodyEntered;
                _userReporter.BodyLeft    += UserReporter_BodyLeft;
                _userReporter.Start();


                _recorder = new Kinect2CSV();
                _timer    = new Stopwatch();
            }
        }