gcode_reader.emulate.commands ============================= .. py:module:: gcode_reader.emulate.commands Classes ------- .. autoapisummary:: gcode_reader.emulate.commands.AbsolutePosition gcode_reader.emulate.commands.Arc gcode_reader.emulate.commands.ArcExtrude gcode_reader.emulate.commands.ArcMill gcode_reader.emulate.commands.Command gcode_reader.emulate.commands.Comment gcode_reader.emulate.commands.Config gcode_reader.emulate.commands.CoordinateSystemChange gcode_reader.emulate.commands.Dwell gcode_reader.emulate.commands.Extrude gcode_reader.emulate.commands.FeedRate gcode_reader.emulate.commands.G gcode_reader.emulate.commands.IncrementalPosition gcode_reader.emulate.commands.M gcode_reader.emulate.commands.MachineCoordinates gcode_reader.emulate.commands.Mill gcode_reader.emulate.commands.Move gcode_reader.emulate.commands.MoveExtrude gcode_reader.emulate.commands.MoveMill gcode_reader.emulate.commands.Purge gcode_reader.emulate.commands.WorkCoordinates Module Contents --------------- .. py:class:: AbsolutePosition(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Config` An Absolute Position configuration command. Typically G90. .. py:attribute:: TAG :value: '#ABSOLUTE_POS' .. py:class:: Arc(arc_center: list = None, location: list = None, feed_rate: float = None, **kwargs) Bases: :py:obj:`Move` An arced movement to a location at a specified feed rate about a center point .. py:attribute:: ATTRIBUTES :value: ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#ARC_MOVE' .. py:property:: arc_center .. py:class:: ArcExtrude(arc_center: list = None, location: list = None, feed_rate: float = None, deposited_volume: float = 0, **kwargs) Bases: :py:obj:`Arc`, :py:obj:`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 .. py:attribute:: ATTRIBUTES :value: ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'deposited_volume',... .. py:attribute:: TAG :value: '#MOVE_EXTRUDE#ARC_MOVE' .. py:class:: ArcMill(arc_center: list = None, location: list = None, feed_rate: float = None, spindle: float = None, **kwargs) Bases: :py:obj:`Arc`, :py:obj:`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 .. py:attribute:: ATTRIBUTES :value: ('arc_center', 'location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'spindle', 'G',... .. py:attribute:: TAG :value: '#MOVE_MILL#ARC_MOVE' .. py:class:: Command(**kwargs) Base class for abstract representation of a G-code line's Words .. py:method:: from_words(word_map=flavors['default']['word_map'], **words) :classmethod: Creates a new command from a set of words and word_map .. py:method:: to_dict() -> dict .. py:attribute:: ATTRIBUTES :value: ('G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '' .. py:property:: comment .. py:property:: process_data_type .. py:attribute:: processed_by :value: None .. py:property:: raw .. py:attribute:: settings .. py:class:: Comment(**kwargs) Bases: :py:obj:`Command` Base class for abstract representation of a G-code line's Words .. py:attribute:: TAG :value: '#COMMENT' .. py:class:: Config(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Command` Class for codes that modify a machine's configuration .. py:attribute:: ATTRIBUTES :value: ('code', 'settings', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#CONFIG' .. py:property:: code .. py:property:: is_modal_group .. py:attribute:: settings .. py:class:: CoordinateSystemChange(location=None, **kwargs) Bases: :py:obj:`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. .. py:attribute:: ATTRIBUTES :value: ('location', 'code', 'settings', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '' .. py:property:: location .. py:class:: Dwell(time_ms: float = None, time_s: float = None, **kwargs) Bases: :py:obj:`Command` Informs the machine to rest at the most recent location for a specified amount of time .. py:attribute:: ATTRIBUTES :value: ('time_s', 'time_ms', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#DWELL' .. py:property:: time_ms .. py:property:: time_s .. py:class:: Extrude(deposited_volume: float = None, **kwargs) Bases: :py:obj:`Command` Specifies a deposit amount for a toolhead .. py:attribute:: ATTRIBUTES :value: ('deposited_volume', 'extrusion_rate', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#EXTRUDE' .. py:property:: deposited_volume .. py:property:: extrusion_rate .. py:class:: FeedRate(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Config` A feedrate configuration command. Used to only update the feedrate state. .. py:attribute:: TAG :value: '#FEED_RATE' .. py:class:: G(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Config` A G-code configuration command. .. py:property:: G .. py:attribute:: TAG :value: '#G#CONFIG' .. py:class:: IncrementalPosition(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Config` An Incremental Position configuration command. Typically G91. .. py:attribute:: TAG :value: '#INCREMENTAL_POS' .. py:class:: M(code: int = None, settings: dict = None, **kwargs) Bases: :py:obj:`Config` A M-code configuration command. .. py:attribute:: ATTRIBUTES :value: ('M', 'code', 'settings', 'G', 'comment', 'raw', 'settings') .. py:property:: M .. py:attribute:: TAG :value: '#M#CONFIG' .. py:class:: MachineCoordinates(location=None, **kwargs) Bases: :py:obj:`CoordinateSystemChange` A Machine Coordinate System command. Typically G53. .. py:attribute:: TAG :value: '#MACHINE_COORD' .. py:class:: Mill(spindle: float = None, **kwargs) Bases: :py:obj:`Command` Specifies a spindle rate for a milling toolhead .. py:attribute:: ATTRIBUTES :value: ('spindle', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#MILL' .. py:property:: spindle .. py:class:: Move(location: list = None, feed_rate: float = None, **kwargs) Bases: :py:obj:`Command` A Linear Movement to a location at a specified feed rate .. py:attribute:: ATTRIBUTES :value: ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings') .. py:attribute:: TAG :value: '#LINEAR_MOVE' .. py:property:: feed_rate .. py:property:: location .. py:class:: MoveExtrude(location: list = None, feed_rate: float = None, deposited_volume: float = 0.0, **kwargs) Bases: :py:obj:`Move`, :py:obj:`Extrude` Specifies a composition of movement to a location at a feed rate, and an extrusion rate for a toolhead .. py:attribute:: ATTRIBUTES :value: ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'deposited_volume',... .. py:attribute:: TAG :value: '#MOVE_EXTRUDE' .. py:class:: MoveMill(location: list = None, feed_rate: float = None, spindle=None, **kwargs) Bases: :py:obj:`Move`, :py:obj:`Mill` Composition of a linear movement and a milling toolhead spindle rate .. py:attribute:: ATTRIBUTES :value: ('location', 'feed_rate', 'G', 'comment', 'raw', 'settings', 'spindle', 'G', 'comment', 'raw',... .. py:attribute:: TAG :value: '#MOVE_MILL' .. py:class:: Purge(time_ms=None, deposited_volume: float = None, **kwargs) Bases: :py:obj:`Dwell`, :py:obj:`Extrude` Dwells while extruding .. py:attribute:: ATTRIBUTES :value: ('feed_rate', 'time_s', 'time_ms', 'G', 'comment', 'raw', 'settings', 'deposited_volume',... .. py:attribute:: TAG :value: '#DWELL#EXTRUDE' .. py:class:: WorkCoordinates(location=None, **kwargs) Bases: :py:obj:`CoordinateSystemChange` A Work Coordinate System command. Typically G54. .. py:attribute:: TAG :value: '#WORK_COORD'