Remove ActivePrinter from serial ports, pass settings to port calls

- Add PrinterSettings to PortFactory Create/PortAvailable methods
- Add ApplicationController->LogInfo for status reporting
- Remove printer coupling in tcp/x3g for status reporting
- Issue MatterHackers/MCCentral#4549
Remove ActivePrinter from ApplicationController
This commit is contained in:
John Lewin 2018-11-30 12:35:56 -08:00
parent d850573340
commit bc4efaf18a
12 changed files with 116 additions and 71 deletions

View file

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MatterHackers.MatterControl;
using MatterHackers.MatterControl.SlicerConfiguration;
/*****************************************************
* Initialization Requirements:
@ -33,12 +34,12 @@ namespace MatterHackers.Plugins.X3GDriver
private bool waitForResponse;
private bool dtrEnable;
public X3GSerialPortWrapper(string serialPortName, PrinterConfig printer)
public X3GSerialPortWrapper(string serialPortName, PrinterSettings settings)
{
port = FrostedSerialPortFactory.GetAppropriateFactory("raw").Create(serialPortName);
port = FrostedSerialPortFactory.GetAppropriateFactory("raw").Create(serialPortName, settings);
printerDetails = new X3GPrinterDetails();
writer = new X3GWriter(printerDetails, printer);
reader = new X3GReader(printerDetails, printer);
writer = new X3GWriter(printerDetails, settings);
reader = new X3GReader(printerDetails, settings);
timeSinceLastCommandSent = new Stopwatch();
timeSinceLastOK = new Stopwatch();
sentCommandQueue = new Queue<string>();