private void OnExecuteMainWindow() { est = new Estimation(dataContext.Inputs); if (dataContext.Inputs.IsOptimizing) { gaView = new GAParameters(); gaView.DataContext = dataContext; gaView.Show(); } else { ResultsView resView = new ResultsView(est.Estimate()); resView.Show(); } }
private void BTN_GoToResults_Click(object sender, RoutedEventArgs e) { if(CurrentGame.GameState != GameState.Finished) { MessageBox.Show("You must submit the results for this match before continuing", "Submit Results", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { ResultsView results = new ResultsView(TourneyView.Tourney, TourneyConfig.ReadFromFile()); results.Owner = Application.Current.MainWindow; results.Show(); } }
/// <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(); } }
private void Start() { Debug.Assert(_resultsView); _resultsView.Show(); }