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;
 }
Exemple #3
0
 public HandContext(CNCContext context)
 {
     Context = context;
 }
Exemple #4
0
 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);
 }