gscrib.codes
Maps machine operations to G/M-code commands.
This module contains a table that translates our internal enum values into their corresponding G-Code instructions. The GCodeBuilder class uses this mapping to generate valid G-Code output.
- class gscrib.codes.GCodeEntry(enum, instruction, description)
Bases:
objectRepresents a single G-Code instruction entry.
- class gscrib.codes.GCodeTable(values)
Bases:
objectMapping table for G-Code instructions.
This class maintains a collection of
GCodeEntryobjects, providing a way to store and retrieve G-Code instructions and their descriptions based on the internal enum representations. Each entry is uniquely identified by a combination of its enum type and value.- Parameters:
values (Tuple[GCodeEntry, ...])
- add_entry(entry)
Add a new entry to the table.
- Parameters:
entry (GCodeEntry) – The GCodeEntry to add to the table.
- Raises:
KeyError – If an entry for the given enum already exists in the table.
- Return type:
None