Beispiel #1
0
        private void button_end_interview_click(object sender, RoutedEventArgs e)
        {
            SelfscoreWindow window = new SelfscoreWindow();

            window.Width  = this.ActualWidth;
            window.Height = this.ActualHeight;
            if (this.WindowState == WindowState.Maximized)
            {
                window.WindowState = WindowState.Maximized;
            }
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            string gesture_name = "";

            int[] gestureArray = { this.gestureDetector.num_frames_leaning, this.gestureDetector.num_frames_touchingface, this.gestureDetector.num_frames_crossing, this.gestureDetector.num_frames_pointing, this.gestureDetector.num_frames_tilting };

            int maxValue = gestureArray.Max();
            int maxIndex = gestureArray.ToList().IndexOf(maxValue);

            switch (maxIndex)
            {
            case 0:
                gesture_name = "lean forward!";
                break;

            case 1:
                gesture_name = "touch your face!";
                break;

            case 2:
                gesture_name = "cross your arms!";
                break;

            case 3:
                gesture_name = "point at something!";
                break;

            case 4:
                gesture_name = "tilt your head!";
                break;

            default:
                gesture_name = "default";
                break;
            }


            window.setScore(this.gestureDetector.GestureResultView.Overall_Score);
            window.setWorstGesture(gesture_name);


            window.Show();
            //this.MainWindow_Closing(this, null);
            //this.kinectSensor.IsAvailableChanged =;
            this.Close();
        }
        private void button_end_interview_click(object sender, RoutedEventArgs e)
        {
            SelfscoreWindow window = new SelfscoreWindow();
            window.Width = this.ActualWidth;
            window.Height = this.ActualHeight;
            if (this.WindowState == WindowState.Maximized)
            {
                window.WindowState = WindowState.Maximized;
            }
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;

            string gesture_name = "";

            int[] gestureArray = { this.gestureDetector.num_frames_leaning, this.gestureDetector.num_frames_touchingface, this.gestureDetector.num_frames_crossing, this.gestureDetector.num_frames_pointing, this.gestureDetector.num_frames_tilting };

            int maxValue = gestureArray.Max();
            int maxIndex = gestureArray.ToList().IndexOf(maxValue);

            switch (maxIndex)
            {
                case 0:
                    gesture_name = "lean forward!";
                    break;
                case 1:
                    gesture_name = "touch your face!";
                    break;
                case 2:
                    gesture_name = "cross your arms!";
                    break;
                case 3:
                    gesture_name = "point at something!";
                    break;
                case 4:
                    gesture_name = "tilt your head!";
                    break;
                default:
                    gesture_name = "default";
                    break;
            }


            window.setScore(this.gestureDetector.GestureResultView.Overall_Score);
            window.setWorstGesture(gesture_name);

            
            window.Show();
            //this.MainWindow_Closing(this, null);
            //this.kinectSensor.IsAvailableChanged =;
            this.Close();
        }