More making printerConnection passed to classes.

This commit is contained in:
Lars Brubaker 2017-09-03 11:48:08 -07:00
parent a0e77afa66
commit 3dd9270797
34 changed files with 151 additions and 351 deletions

View file

@ -62,22 +62,22 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
return result;
}
public void Run()
public void Run(PrinterConnection printerConnection)
{
if (PrinterConnection.Instance.PrinterIsConnected)
if (printerConnection.PrinterIsConnected)
{
PrinterConnection.Instance.MacroStart();
SendCommandToPrinter(GCode);
printerConnection.MacroStart();
SendCommandToPrinter(printerConnection, GCode);
if (GCode.Contains(MacroProcessingStream.MacroPrefix))
{
SendCommandToPrinter("\n" + MacroProcessingStream.MacroPrefix + "close()");
SendCommandToPrinter(printerConnection, "\n" + MacroProcessingStream.MacroPrefix + "close()");
}
}
}
protected void SendCommandToPrinter(string command)
protected void SendCommandToPrinter(PrinterConnection printerConnection, string command)
{
PrinterConnection.Instance.SendLineToPrinterNow(command);
printerConnection.SendLineToPrinterNow(command);
}
}
}