gcode_reader.emulate.commands

Classes

AbsolutePosition

An Absolute Position configuration command. Typically G90.

Arc

An arced movement to a location at a specified feed rate about a center point

ArcExtrude

Specifies a composition of arc movement to a location at a feed rate about a center point, and an extrusion rate for a toolhead

ArcMill

Specifies a composition of arc movement to a location at a feed rate about a center point, and an extrusion rate for a toolhead

Command

Base class for abstract representation of a G-code line's Words

Comment

Base class for abstract representation of a G-code line's Words

Config

Class for codes that modify a machine's configuration

CoordinateSystemChange

A coordinate-system selection command that may carry target coordinates.

Dwell

Informs the machine to rest at the most recent location for a specified amount of time

Extrude

Specifies a deposit amount for a toolhead

FeedRate

A feedrate configuration command. Used to only update the feedrate state.

G

A G-code configuration command.

IncrementalPosition

An Incremental Position configuration command. Typically G91.

M

A M-code configuration command.

MachineCoordinates

A Machine Coordinate System command. Typically G53.

Mill

Specifies a spindle rate for a milling toolhead

Move

A Linear Movement to a location at a specified feed rate

MoveExtrude

Specifies a composition of movement to a location at a feed rate, and an extrusion rate for a toolhead

MoveMill

Composition of a linear movement and a milling toolhead spindle rate

Purge

Dwells while extruding

WorkCoordinates

A Work Coordinate System command. Typically G54.

Module Contents

class gcode_reader.emulate.commands.AbsolutePosition(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Config

An Absolute Position configuration command. Typically G90.

TAG = '#ABSOLUTE_POS'
class gcode_reader.emulate.commands.Arc(arc_center: list = None, location: list = None, feed_rate: float = None, **kwargs)[source]

Bases: Move

An arced movement to a location at a specified feed rate about a center point

ATTRIBUTES = ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings')
TAG = '#ARC_MOVE'
property arc_center
class gcode_reader.emulate.commands.ArcExtrude(arc_center: list = None, location: list = None, feed_rate: float = None, deposited_volume: float = 0, **kwargs)[source]

Bases: Arc, Extrude

Specifies a composition of arc movement to a location at a feed rate about a center point, and an extrusion rate for a toolhead

ATTRIBUTES = ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'deposited_volume',...
TAG = '#MOVE_EXTRUDE#ARC_MOVE'
class gcode_reader.emulate.commands.ArcMill(arc_center: list = None, location: list = None, feed_rate: float = None, spindle: float = None, **kwargs)[source]

Bases: Arc, Mill

Specifies a composition of arc movement to a location at a feed rate about a center point, and an extrusion rate for a toolhead

ATTRIBUTES = ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'spindle', 'G',...
TAG = '#MOVE_MILL#ARC_MOVE'
class gcode_reader.emulate.commands.Command(**kwargs)[source]

Base class for abstract representation of a G-code line’s Words

classmethod from_words(word_map=flavors['default']['word_map'], **words)[source]

Creates a new command from a set of words and word_map

to_dict() dict[source]
ATTRIBUTES = ('G', 'comment', 'raw', 'settings')
TAG = ''
property comment
property process_data_type
processed_by = None
property raw
settings
class gcode_reader.emulate.commands.Comment(**kwargs)[source]

Bases: Command

Base class for abstract representation of a G-code line’s Words

TAG = '#COMMENT'
class gcode_reader.emulate.commands.Config(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Command

Class for codes that modify a machine’s configuration

ATTRIBUTES = ('code', 'settings', 'G', 'comment', 'raw', 'settings')
TAG = '#CONFIG'
property code
property is_modal_group
settings
class gcode_reader.emulate.commands.CoordinateSystemChange(location=None, **kwargs)[source]

Bases: Config

A coordinate-system selection command that may carry target coordinates.

This is a configuration command (not a motion command). It may optionally carry XYZ coordinates — e.g. G53 X0 Y0 Z0 — which are stored in location. It inherits from Config, not Move, so that isinstance(cmd, Move) correctly returns False for these commands.

ATTRIBUTES = ('location', 'code', 'settings', 'G', 'comment', 'raw', 'settings')
TAG = ''
property location
class gcode_reader.emulate.commands.Dwell(time_ms: float = None, time_s: float = None, **kwargs)[source]

Bases: Command

Informs the machine to rest at the most recent location for a specified amount of time

ATTRIBUTES = ('time_s', 'time_ms', 'G', 'comment', 'raw', 'settings')
TAG = '#DWELL'
property time_ms
property time_s
class gcode_reader.emulate.commands.Extrude(deposited_volume: float = None, **kwargs)[source]

Bases: Command

Specifies a deposit amount for a toolhead

ATTRIBUTES = ('deposited_volume', 'extrusion_rate', 'G', 'comment', 'raw', 'settings')
TAG = '#EXTRUDE'
property deposited_volume
property extrusion_rate
class gcode_reader.emulate.commands.FeedRate(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Config

A feedrate configuration command. Used to only update the feedrate state.

TAG = '#FEED_RATE'
class gcode_reader.emulate.commands.G(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Config

A G-code configuration command.

property G
TAG = '#G#CONFIG'
class gcode_reader.emulate.commands.IncrementalPosition(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Config

An Incremental Position configuration command. Typically G91.

TAG = '#INCREMENTAL_POS'
class gcode_reader.emulate.commands.M(code: int = None, settings: dict = None, **kwargs)[source]

Bases: Config

A M-code configuration command.

ATTRIBUTES = ('M', 'code', 'settings', 'G', 'comment', 'raw', 'settings')
property M
TAG = '#M#CONFIG'
class gcode_reader.emulate.commands.MachineCoordinates(location=None, **kwargs)[source]

Bases: CoordinateSystemChange

A Machine Coordinate System command. Typically G53.

TAG = '#MACHINE_COORD'
class gcode_reader.emulate.commands.Mill(spindle: float = None, **kwargs)[source]

Bases: Command

Specifies a spindle rate for a milling toolhead

ATTRIBUTES = ('spindle', 'G', 'comment', 'raw', 'settings')
TAG = '#MILL'
property spindle
class gcode_reader.emulate.commands.Move(location: list = None, feed_rate: float = None, **kwargs)[source]

Bases: Command

A Linear Movement to a location at a specified feed rate

ATTRIBUTES = ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings')
TAG = '#LINEAR_MOVE'
property feed_rate
property location
class gcode_reader.emulate.commands.MoveExtrude(location: list = None, feed_rate: float = None, deposited_volume: float = 0.0, **kwargs)[source]

Bases: Move, Extrude

Specifies a composition of movement to a location at a feed rate, and an extrusion rate for a toolhead

ATTRIBUTES = ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'deposited_volume',...
TAG = '#MOVE_EXTRUDE'
class gcode_reader.emulate.commands.MoveMill(location: list = None, feed_rate: float = None, spindle=None, **kwargs)[source]

Bases: Move, Mill

Composition of a linear movement and a milling toolhead spindle rate

ATTRIBUTES = ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'spindle', 'G', 'comment', 'raw',...
TAG = '#MOVE_MILL'
class gcode_reader.emulate.commands.Purge(time_ms=None, deposited_volume: float = None, **kwargs)[source]

Bases: Dwell, Extrude

Dwells while extruding

ATTRIBUTES = ('feed_rate', 'time_s', 'time_ms', 'G', 'comment', 'raw', 'settings', 'deposited_volume',...
TAG = '#DWELL#EXTRUDE'
class gcode_reader.emulate.commands.WorkCoordinates(location=None, **kwargs)[source]

Bases: CoordinateSystemChange

A Work Coordinate System command. Typically G54.

TAG = '#WORK_COORD'