From d2c86dff32bf4abc699ace2d64aa3043e9051fdd Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Wed, 16 Jan 2019 09:31:49 -0800 Subject: [PATCH] Added config for collect on f5 --- .../ApplicationView/ApplicationController.cs | 9 +++++++++ Program.cs | 1 + 2 files changed, 10 insertions(+) diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index f52dbcc15..4ca408069 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -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) { diff --git a/Program.cs b/Program.cs index 7042fb473..0ea3ed60e 100644 --- a/Program.cs +++ b/Program.cs @@ -123,6 +123,7 @@ namespace MatterHackers.MatterControl config.Bind("Agg:GraphicsMode", AggContext.Config.GraphicsMode); Slicer.RunInProcess = config.GetValue("MatterControl:Slicer:Debug"); + Application.EnableF5Collect = config.GetValue("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));