Consider print volume bounds when validating printable items

- Issue MatterHackers/MCCentral#4009
Starting a print with nothing on the bed leaves the printer never
completing the print.
This commit is contained in:
John Lewin 2018-08-23 13:24:48 -07:00
parent 05f26f9f5c
commit aae88b1275
3 changed files with 17 additions and 7 deletions

View file

@ -37,6 +37,7 @@ using MatterHackers.Localizations;
using MatterHackers.MatterControl.CustomWidgets;
using MatterHackers.MatterControl.Library;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.MeshVisualizer;
using MatterHackers.VectorMath;
namespace MatterHackers.MatterControl.PartPreviewWindow
@ -146,9 +147,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
};
button.Click += (s, e) =>
{
// Exit if the bed is not GCode and the bed has no items
// Exit if the bed is not GCode and the bed has no printable items
if ((printer.Bed.EditContext.SourceItem as ILibraryAsset)?.ContentType != "gcode"
&& printer.Bed.Scene.Children.Count <= 0)
&& !printer.PrintableItems(printer.Bed.EditContext.Content).Any())
{
return;
}