'Initializes a printcore instance. Pass the port and baud rate to
connect immediately'

def __init__(self, port=None, baud=None, dtr=None):

    self.baud = None
    self.dtr = None
    self.port = None
    self.analyzer = gcoder.GCode()
    self.printer = None
    self.clear = 0
    self.online = False
    self.printing = False
    self.mainqueue = None
    self.priqueue = Queue(0)
    self.queueindex = 0
    self.lineno = 0
    self.resendfrom = (-1)
    self.paused = False
    self.sentlines = {}
    self.log = deque(maxlen=10000)
    self.sent = []
    self.writefailures = 0
    self.tempcb = None
    self.recvcb = None
    self.sendcb = None
    self.preprintsendcb = None
    self.printsendcb = None
    self.layerchangecb = None
    self.errorcb = None
    self.startcb = None
    self.endcb = None
    self.onlinecb = None
    self.loud = False
    self.tcp_streaming_mode = False
    self.greetings = ['start', 'Grbl    ']
    self.wait = 0
    self.read_thread = None
    self.stop_read_thread = False
    self.send_thread = None
    self.stop_send_thread = False
    self.print_thread = None
    self.event_handler = PRINTCORE_HANDLER
    for handler in self.event_handler:
        try:
            handler.on_init()
        except:
            logging.error(traceback.format_exc())
    if ((port is not None) and (baud is not None)):
        self.connect(port, baud)
    self.xy_feedrate = None
    self.z_feedrate = None
