Decouple MatterControl components from PrinterConnection

- Move relevant aspects to ApplicationController
This commit is contained in:
John Lewin 2017-06-16 18:04:47 -07:00
parent d07173285c
commit 8afc92ae33
21 changed files with 297 additions and 299 deletions

View file

@ -54,7 +54,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private TextWidget gcodeProcessingStateInfoText;
private ViewGcodeWidget gcodeViewWidget;
private PrintItemWrapper printItem => PrinterConnection.Instance.ActivePrintItem;
private PrintItemWrapper printItem => ApplicationController.Instance.ActivePrintItem;
private bool startedSliceFromGenerateButton = false;
private Button generateGCodeButton;
private FlowLayoutWidget buttonBottomPanel;
@ -828,7 +828,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// because the gcode finished creating for the print that is printing.
// We don't want to be notified if any other updates happen to this gcode while it is printing.
if (PrinterConnection.Instance.PrinterIsPrinting
&& PrinterConnection.Instance.ActivePrintItem == printItem)
&& ApplicationController.Instance.ActivePrintItem == printItem)
{
printItem.SlicingOutputMessage -= sliceItem_SlicingOutputMessage;
printItem.SlicingDone -= sliceItem_Done;