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);
            }
        }
Example #2
0
 public GCodeContext(CNCContext context, ITextPrinter textprinter)
 {
     CNC = context;
     TextPrinter = textprinter;
 }
Example #3
0
 public HandContext(CNCContext context)
 {
     Context = context;
 }
Example #4
0
 public HandContext(CNCContext context)
 {
     Context = context;
 }
Example #5
0
 public GCodeContext(CNCContext context, ITextPrinter textprinter)
 {
     CNC         = context;
     TextPrinter = textprinter;
 }
Example #6
0
 public void SetContext(CNCContext context)
 {
     Context = context;
     GCodeContext = new GCodeContext(context,Window);
     HandContext = new HandContext(context);
 }