diff --git a/MatterControlLib/ApplicationView/ApplicationController.cs b/MatterControlLib/ApplicationView/ApplicationController.cs index 490713212..c5466ca76 100644 --- a/MatterControlLib/ApplicationView/ApplicationController.cs +++ b/MatterControlLib/ApplicationView/ApplicationController.cs @@ -2606,6 +2606,8 @@ namespace MatterHackers.MatterControl // Slice bool slicingSucceeded = false; + printer.ViewState.SlicingItem = true; + await this.Tasks.Execute("Slicing".Localize(), printer, async (reporter, cancellationToken) => { slicingSucceeded = await Slicer.SliceItem( @@ -2616,6 +2618,8 @@ namespace MatterHackers.MatterControl cancellationToken); }); + printer.ViewState.SlicingItem = false; + // Skip loading GCode output if slicing failed if (!slicingSucceeded) { diff --git a/MatterControlLib/ApplicationView/BedConfig.cs b/MatterControlLib/ApplicationView/BedConfig.cs index bac808cd6..f24aa54bf 100644 --- a/MatterControlLib/ApplicationView/BedConfig.cs +++ b/MatterControlLib/ApplicationView/BedConfig.cs @@ -369,6 +369,7 @@ namespace MatterHackers.MatterControl internal void EnsureGCodeLoaded() { if (this.LoadedGCode == null + && !this.Printer.ViewState.SlicingItem && File.Exists(this.EditContext?.GCodeFilePath(this.Printer))) { UiThread.RunOnIdle(async () => diff --git a/MatterControlLib/ApplicationView/PrinterViewState.cs b/MatterControlLib/ApplicationView/PrinterViewState.cs index 46de0530d..1a9f8af86 100644 --- a/MatterControlLib/ApplicationView/PrinterViewState.cs +++ b/MatterControlLib/ApplicationView/PrinterViewState.cs @@ -185,5 +185,7 @@ namespace MatterHackers.MatterControl UserSettings.Instance.set(UserSettingsKey.SelectedObjectPanelWidth, minimumValue.ToString()); } } + + public bool SlicingItem { get; set; } } } \ No newline at end of file