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