Skip to content


This module holds the standard implementation of the :class:PrinterInterface and it helpers.

Printer(fileManager, analysisQueue, printerProfileManager) #

Bases: PrinterInterface, comm.MachineComPrintCallback

Default implementation of the :class:PrinterInterface. Manages the communication layer object and registers itself with it as a callback to react to changes on the communication layer.

cancel_print(user = None, *args, **kwargs) #

Cancel the current printjob.

commands(commands, tags = None, force = False, *args, **kwargs) #

Sends one or more gcode commands to the printer.

connect(port = None, baudrate = None, profile = None, *args, **kwargs) #

Connects to the printer. If port and/or baudrate is provided, uses these settings, otherwise autodetection will be attempted.

disconnect(*args, **kwargs) #

Closes the connection to the printer.

on_comm_log(message) #

Callback method for the comm object, called upon log output.

on_comm_message(message) #

Callback method for the comm object, called upon message exchanges via serial. Stores the message in the message buffer, truncates buffer to the last 300 lines.

on_comm_progress() #

Callback method for the comm object, called upon any change in progress of the printjob. Triggers storage of new values for printTime, printTimeLeft and the current progress.

on_comm_state_change(state) #

Callback method for the comm object, called if the connection state changes.

on_comm_z_change(newZ) #

Callback method for the comm object, called upon change of the z-layer.

pause_print(user = None, *args, **kwargs) #

Pause the current printjob.

refresh_sd_files(blocking = False, *args, **kwargs) #

Refreshes the list of file stored on the SD card attached to printer (if available and printer communication available). Optional blocking parameter allows making the method block (max 10s) until the file list has been received (and can be accessed via self._comm.getSdFiles()). Defaults to an asynchronous operation.

resume_print(user = None, *args, **kwargs) #

Resume the current printjob.

start_print(pos = None, user = None, *args, **kwargs) #

Starts the currently loaded print job. Only starts if the printer is connected and operational, not currently printing and a printjob is loaded