Clearing the screen when stopped pressed or when the video finishes.

This commit is contained in:
Tadas Baltrusaitis 2017-01-05 18:13:49 -05:00
parent 25cb1c7ecb
commit bb382043ee
2 changed files with 29 additions and 8 deletions

View File

@ -286,7 +286,7 @@ namespace OpenFaceOffline
}
}
EndFeatureExtractionMode();
EndMode();
}
@ -771,11 +771,11 @@ namespace OpenFaceOffline
}
// When the processing is done re-enable the components
private void EndFeatureExtractionMode()
private void EndMode()
{
Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 2, 0), (Action)(() =>
Dispatcher.Invoke(DispatcherPriority.Render, new TimeSpan(0, 0, 0, 1, 0), (Action)(() =>
{
SettingsMenu.IsEnabled = true;
RecordingMenu.IsEnabled = true;
AUSetting.IsEnabled = true;
@ -785,6 +785,27 @@ namespace OpenFaceOffline
NextFiveFramesButton.IsEnabled = false;
NextFrameButton.IsEnabled = false;
// Clean up the interface itself
video.Source = null;
auClassGraph.Update(new Dictionary<string, double>());
auRegGraph.Update(new Dictionary<string, double>());
YawLabel.Content = "0°";
RollLabel.Content = "0°";
PitchLabel.Content = "0°";
XPoseLabel.Content = "0 mm";
YPoseLabel.Content = "0 mm";
ZPoseLabel.Content = "0 mm";
nonRigidGraph.Update(new List<double>());
GazeXLabel.Content = "0°";
GazeYLabel.Content = "0°";
AlignedFace.Source = null;
AlignedHOG.Source = null;
}));
}
@ -900,12 +921,11 @@ namespace OpenFaceOffline
// Stop capture and tracking
thread_paused = false;
thread_running = false;
// Let the processing thread finish
processing_thread.Join();
PauseButton.IsEnabled = false;
NextFrameButton.IsEnabled = false;
NextFiveFramesButton.IsEnabled = false;
StopButton.IsEnabled = false;
// Clean up the interface
EndMode();
}
}

View File

@ -121,6 +121,7 @@ namespace OpenFaceOffline
{
num_bars = data.Count;
barGrid.Children.Clear();
graphs.Clear();
// Make sure AUs are sorted
var data_labels = data.Keys.ToList();