示例#1
0
        /// <summary>
        /// Function that allows to enable checkboxes just after a recording, in function of the elements caught
        /// </summary>
        public void enableCheckBox()
        {
            foreach (KeyValuePair <JointType, bool> key in Agitation.getCatchedJoin())
            {
                if (key.Key == JointType.HipCenter)
                {
                    choiceResultView.chkAgitationHips.IsEnabled = true;
                }
                else if (key.Key == JointType.HandLeft)
                {
                    choiceResultView.chkAgitationLHand.IsEnabled = true;
                }
                else if (key.Key == JointType.HandRight)
                {
                    choiceResultView.chkAgitationRHand.IsEnabled = true;
                }
                else if (key.Key == JointType.KneeLeft)
                {
                    choiceResultView.chkAgitationLKnee.IsEnabled = true;
                }
                else if (key.Key == JointType.KneeRight)
                {
                    choiceResultView.chkAgitationRKnee.IsEnabled = true;
                }
                else if (key.Key == JointType.ShoulderLeft)
                {
                    choiceResultView.chkAgitationLShoulder.IsEnabled = true;
                }
                else if (key.Key == JointType.ShoulderRight)
                {
                    choiceResultView.chkAgitationRShoulder.IsEnabled = true;
                }
            }
            choiceResultView.chkArmsMotion.IsEnabled  = true;
            choiceResultView.chkArmsCrossed.IsEnabled = true;
            choiceResultView.chkHandsJoined.IsEnabled = true;

            if (TrackingSideToolViewModel.get().FaceTracking)
            {
                choiceResultView.chkFace.IsEnabled = true;
                if (TrackingSideToolViewModel.get().emo)
                {
                    choiceResultView.chkEmotion.IsEnabled = true;
                }
                if (lookingDirection.detect)
                {
                    choiceResultView.chkLookDirec.IsEnabled = true;
                }
            }

            if (TrackingSideToolViewModel.get().SpeedRate)
            {
                choiceResultView.chkAudio.IsEnabled           = true;
                choiceResultView.chkNumberSyllables.IsEnabled = true;
            }
        }
示例#2
0
        /// <summary>
        /// Function called when the user clicked on the OK button of the window
        /// </summary>
        private void ShowResults()
        {
            if ((isLoad && NbRecording > 0) || IsAtLeastOneCheckBoxIsChecked(choiceResultView.stkPanel))
            {
                choiceResultView.Close();
                List <bool> lbool = new List <bool>();
                lbool.Add(choiceResultView.chkAgitationHips.IsChecked.HasValue && choiceResultView.chkAgitationHips.IsChecked.Value); // this is a way to convert a bool? to a bool
                lbool.Add(choiceResultView.chkAgitationLHand.IsChecked.HasValue && choiceResultView.chkAgitationLHand.IsChecked.Value);
                lbool.Add(choiceResultView.chkAgitationLKnee.IsChecked.HasValue && choiceResultView.chkAgitationLKnee.IsChecked.Value);
                lbool.Add(choiceResultView.chkAgitationLShoulder.IsChecked.HasValue && choiceResultView.chkAgitationLShoulder.IsChecked.Value);
                lbool.Add(choiceResultView.chkAgitationRHand.IsChecked.HasValue && choiceResultView.chkAgitationRHand.IsChecked.Value);
                lbool.Add(choiceResultView.chkAgitationRKnee.IsChecked.HasValue && choiceResultView.chkAgitationRKnee.IsChecked.Value);
                lbool.Add(choiceResultView.chkAgitationRShoulder.IsChecked.HasValue && choiceResultView.chkAgitationRShoulder.IsChecked.Value);
                lbool.Add(choiceResultView.chkHandsJoined.IsChecked.HasValue && choiceResultView.chkHandsJoined.IsChecked.Value);
                lbool.Add(choiceResultView.chkArmsCrossed.IsChecked.HasValue && choiceResultView.chkArmsCrossed.IsChecked.Value);
                lbool.Add(choiceResultView.chkEmotion.IsChecked.HasValue && choiceResultView.chkEmotion.IsChecked.Value);
                lbool.Add(choiceResultView.chkLookDirec.IsChecked.HasValue && choiceResultView.chkLookDirec.IsChecked.Value);
                lbool.Add(choiceResultView.chkNumberSyllables.IsChecked.HasValue && choiceResultView.chkNumberSyllables.IsChecked.Value);
                var results = new ResultsView(lbool);
                if (isLoad) //if the windowis called after a user click on the "Open charts analysis"
                {
                    List <string> listpathdate = new List <string>();

                    if (lastRecord) // to know if the "Last Record" choice is selected in the comboBox
                    {
                        listpathdate.Add(listpath.ElementAt(0));
                    }
                    else
                    {
                        foreach (string s in listpath)
                        {
                            DateTime date = Tools.getDateFromPath(s);
                            if (date.CompareTo(maxDate) <= 0 && date.CompareTo(minDate) >= 0) // we compare the minimum date and the maximum date
                            {
                                listpathdate.Add(s);
                            }
                        }
                    }
                    ((ResultsViewModel)results.DataContext).loadManyCharts(listpathdate); // we called the function to load files
                }
                else //if the window is called after the user clicked on the button "Display my results"
                {
                    ((ResultsViewModel)results.DataContext).getAgitationStatistics(Agitation.getAgitationStats());
                    List <IGraph> temp = new List <IGraph>();
                    temp.AddRange(HandsJoined.getHandStatistics());
                    temp.AddRange(ArmsCrossed.getArmsStatistics());
                    ((ResultsViewModel)results.DataContext).getArmsMotion(temp); //temp is a union between HandsJoined.getHandStatistics() and ArmsCrossed.getArmsStatistics()
                    if (TrackingSideToolViewModel.get().FaceTracking)
                    {
                        List <IGraph> listGraphFace = new List <IGraph>();
                        listGraphFace.AddRange(EmotionRecognition.getEmotionsStatistics());
                        listGraphFace.AddRange(lookingDirection.getLookingStatistics());

                        ((ResultsViewModel)results.DataContext).getFaceStatistics(listGraphFace);
                    }
                    if (TrackingSideToolViewModel.get().SpeedRate)
                    {
                        List <IGraph> listGraphVoice = new List <IGraph>();
                        listGraphVoice.AddRange(AudioProvider.getVoiceStatistics());
                        ((ResultsViewModel)results.DataContext).getVoiceStatistics(listGraphVoice);
                    }
                }
                ((ResultsViewModel)results.DataContext).addResultsPartToView();
                results.Show();
            }
        }