Gcode

Gcode

class hotwing_core.Gcode(formatter_name=None, units='inches', feedrate=None)[source]

The Gcode object maintains a list of gcode commands and allows you to add commands easily.

Contains a GCodeFormatter class, to which all of the formatting is delegated to.

Variables:
  • units – units - “inches” or “millimeters”
  • feedrate – feedrate - units per min (default 5 for inch units, 125 for mm units)
dwell(time, options=[])[source]

time in seconds

fast_move(coords, options=[])[source]
move(coords, options=[])[source]
normalize()[source]

go through the code and offset it so that min values are 0

set_formatter(formatter_name)[source]
code

returns the gcode as a list

code_as_str

MachineCommand

class hotwing_core.gcode.MachineCommand(type_, data, options=[])[source]

This represents the data for a single command for a machine move.

Parameters:
  • type_ (str) – type of command
  • values (dict) – data to hold data related to the command
  • options (list) – additional options that can be read and utilized when formatting or outputting gcode.
Variables:
  • type_ (str) – type of command
  • data (dict) – data to hold data related to the command
has_option(option)[source]

Determine if value is in the options list

Parameters:option (str) – value to check
Returns:Boolean