Added config for collect on f5

This commit is contained in:
Lars Brubaker 2019-01-16 09:31:49 -08:00
parent 62b6906315
commit d2c86dff32
2 changed files with 10 additions and 0 deletions

View file

@ -3046,6 +3046,8 @@ If you experience adhesion problems, please re-run leveling."
private static string lastSection = "";
private static Stopwatch timer;
public static bool EnableF5Collect { get; set; }
public static SystemWindow LoadRootWindow(int width, int height)
{
timer = Stopwatch.StartNew();
@ -3140,6 +3142,13 @@ If you experience adhesion problems, please re-run leveling."
});
}
if (EnableF5Collect
&& keyEvent.KeyCode == Keys.F5)
{
GC.Collect();
systemWindow.Invalidate();
}
if (!keyEvent.Handled
&& gcode2D != null)
{

View file

@ -123,6 +123,7 @@ namespace MatterHackers.MatterControl
config.Bind("Agg:GraphicsMode", AggContext.Config.GraphicsMode);
Slicer.RunInProcess = config.GetValue<bool>("MatterControl:Slicer:Debug");
Application.EnableF5Collect = config.GetValue<bool>("MatterControl:Application:EnableF5Collect");
// Make sure we have the right working directory as we assume everything relative to the executable.
Directory.SetCurrentDirectory(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));