コード例 #1
0
        public PrinterConnection()
        {
            virtualPrinter = new VirtualPrinter();
            if (Environment.OSVersion.Platform == PlatformID.Unix)
                port = "/dev/ttyUSB0";
            job = new Printjob(this);
            timer = new System.Timers.Timer();
            timer.Interval = 100;
            timer.AutoReset = true;
            timer.Elapsed += handleTimer;
            timer.Start();

            try
            {
                string dir = Main.globalSettings.Workdir;
                if (dir.Length > 0 && Main.globalSettings.LogEnabled)
                    logWriter = new StreamWriter(dir + Path.DirectorySeparatorChar + "repetier.log");
            }
            catch
            {
                logWriter = null;
            }
            writeEvent = new AutoResetEvent(false);
        }
コード例 #2
0
 public VirtualPrinterConnector()
 {
     virtualPrinter = new VirtualPrinter(this);
     con = Main.conn;
     job = new Printjob(Main.conn);
 }