public void StopCapture() { recording = false; if (sKLFileStream == null) { return; } CaptureStopwatch.Stop(); if (sKLFileStream != null) { sKLFileStream.Close(); } sKLFileStream = null; if (SKLRecording != null) { SKLRecording.Clear(); } HendlerHolder.OpenNewPlayerWindow(true, SKLFileName); SKLFileName = null; ChangeContentWhileRecordingOrPlaying(false); SKLRecording = TSkeletonHelper.ReadRecordingFromFile(SKLFileName); LoadSKLRecording(SKLFileName); ChangeContentWhileRecordingOrPlaying(false); if (SKLRecording != null) { ProgressSlider.Maximum = SKLRecording.Count - 1; ProgressSlider.Value = ProgressSlider.Maximum; ProgressSlider.Value = 0; if (SKLRecording.Count > 0) { DrawImage((TSkeleton[])SKLRecording[0]); } } else { ProgressSlider.Maximum = 0; ProgressSlider.Value = 0; DrawImage(null); } }
private void ComputeButton_Click(object sender, RoutedEventArgs e) { ArrayList skelRecording = TSkeletonHelper.ReadRecordingFromFile(SKLFileTextBox.Text); int clastersCount = int.Parse(ClasterCountBox.Text); double minimaTimeDistanceBox = double.Parse(MinimaTimeDistanceBox.Text, CultureInfo.InvariantCulture); double epsilon = double.Parse(textBoxEpsilon.Text, CultureInfo.InvariantCulture); int maxIterations = int.Parse(textBoxMaxIterations.Text, CultureInfo.InvariantCulture); try { String GDLVersion = "1.1"; if (radioButtonGDL1_0.IsChecked == true) { GDLVersion = "1.0"; } if (radioButtonGDL1_1.IsChecked == true) { GDLVersion = "1.1"; } //if (radioButtonGDL1_1.IsChecked == true) //!! GDLVersion = "1.1"; keyFrames = RGDLTrainer(skelRecording, InputGDLtextBox.Text, OutputGDLtextBox.Text, clastersCount, minimaTimeDistanceBox, textBoxRuleName.Text, GDLVersion, epsilon, maxIterations); OutputGDLFile = OutputGDLtextBox.Text; //this.Close(); this.Visibility = Visibility.Hidden; } catch (RGDLException ex) { MessageBox.Show(ex.Message, "R-GDL Exception", MessageBoxButton.OK); } }
public void LoadSKLRecording(String SKLFile) { ArrayList SKLRecordingHelp = null; try { SKLRecordingHelp = TSkeletonHelper.ReadRecordingFromFile(SKLFile); } catch (Exception e) { String msg = "SKL file " + SKLFile + " loading error: " + e.Message; HendlerHolder.DisplayMessage(this, msg); return; } if (SKLRecordingHelp == null) { String msg = "SKL file " + SKLFile + " seems to be empty."; HendlerHolder.DisplayMessage(this, msg); return; } sKLFileName = SKLFile; SKLRecording = SKLRecordingHelp; if (SKLRecording != null) { ProgressSlider.Maximum = SKLRecording.Count - 1; ProgressSlider.Value = ProgressSlider.Maximum; ProgressSlider.Value = 0; if (SKLRecording.Count > 0) { DrawImage((TSkeleton[])SKLRecording[0]); } } else { ProgressSlider.Maximum = 0; ProgressSlider.Value = 0; DrawImage(null); } }