NAME

Gcode::Interpreter - Simulate Gcode-reading machines such as 3D printers, CNC mills etc.

SYNOPSIS

  use Gcode::Interpreter;

  $interpreter = Gcode::Interpreter->new();

  $interpreter->parse_line('G1 X1.0 Y1.0 Z1.0 E1.0');

  $position_ref = $interpreter->position();

  $stats_ref = $interpreter->stats();

DESCRIPTION

This module is an umbrella class for those below it. That is, apart from to provide a stub, this module really hands off the real work elsewhere.

At the moment, there is only one such sub-module, for the Ultimaker series of 3D printers. It's possible that other printer types, CNC machines and other Gcode-talkers could be added at a later date. If that happens, then it is likely that the specifics of this module will change to become a generic super-set of all the sub-modules.

For now, the constructor for this module returns a Gcode::Interpreter::Ultimaker object, which then provides the real implementation of the methods described below.

METHODS

new

The constructor currently just returns a Gcode::Interpreter::Ultimaker object.

Takes a string argument that is the name of the sub-object. At present, if it's not 'Ultimaker' then the constructor die()s. If it's either missing or 'Ultimaker' then a Gcode::Interpreter::Ultimaker object is returned.

position

This is a stub method that just returns a reference to a list of four elements, each of which is 'undef'.

stats

This is a stub method that just returns a reference to a hash with two keys, 'duration' and 'extruded', both of which have 'undef' values.

process_line

This is a stb method that takes a string argument and always returns false.

SEE ALSO

Gcode::Interpreter::Ultimaker