private void Connect(string portname) { if (portname == string.Empty) return; var isvalid = SerialPort.GetPortNames().Any(i => i == portname); if (isvalid) { Printer.Context.Close(); DirectPrinterSender dps = new DirectPrinterSender(portname); CNCContext context = new CNCContext(dps); context.Open(); Window.PrinterPort = portname; Printer.SetContext(context); } }
public GCodeContext(CNCContext context, ITextPrinter textprinter) { CNC = context; TextPrinter = textprinter; }
public HandContext(CNCContext context) { Context = context; }
public HandContext(CNCContext context) { Context = context; }
public GCodeContext(CNCContext context, ITextPrinter textprinter) { CNC = context; TextPrinter = textprinter; }
public void SetContext(CNCContext context) { Context = context; GCodeContext = new GCodeContext(context,Window); HandContext = new HandContext(context); }