Prevent GCode load during slicing
- Issue MatterHackers/MCCentral#5453 Crash after switching to 3D GCode view while slicing
This commit is contained in:
parent
75fb57b805
commit
4d345c73ee
3 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 () =>
|
||||
|
|
|
|||
|
|
@ -185,5 +185,7 @@ namespace MatterHackers.MatterControl
|
|||
UserSettings.Instance.set(UserSettingsKey.SelectedObjectPanelWidth, minimumValue.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public bool SlicingItem { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue