gcode_reader.emulate.tools¶
Classes¶
A subtractive tool, such as a CNC mill, controlled by a spindle speed. |
|
A base class representing a generic tool on a manufacturing machine. |
Module Contents¶
- class gcode_reader.emulate.tools.MillingTool(options, diameter: float = 1.0)[source]¶
Bases:
ToolA subtractive tool, such as a CNC mill, controlled by a spindle speed.
Initializes a new Tool instance.
- Parameters:
options (MachineOptions) – An instance of the MachineOptions class containing machine and tool configuration.
- process_command(command: gcode_reader.emulate.commands.Command, process_data: gcode_reader.emulate.operations.SubtractiveProcessData)[source]¶
Propagates spindle speed into process_data on every command.
Updates self.spindle_speed if a Mill command provides an explicit speed, then writes the current speed to process_data whenever the spindle is on.
- Parameters:
command (Command) – The command to process.
process_data (SubtractiveProcessData) – The data object to populate.
- Returns:
The updated SubtractiveProcessData object.
- diameter = 1.0¶
- spindle_speed = 0.0¶
- class gcode_reader.emulate.tools.Tool(options: gcode_reader.emulate.machine_options.MachineOptions = None)[source]¶
A base class representing a generic tool on a manufacturing machine.
This class manages the tool’s fundamental state. It provides a common interface for processing commands and can be extended by specific tool types.
- options¶
Configuration options for the machine and tool.
- Type:
Initializes a new Tool instance.
- Parameters:
options (MachineOptions) – An instance of the MachineOptions class containing machine and tool configuration.
- process_command(command: gcode_reader.emulate.commands.Command, process_data: gcode_reader.emulate.operations.ProcessData)[source]¶
Processes a command to update the tool’s state and record data.
Subclasses should extend this to handle tool-specific command attributes (e.g. spindle speed, extrusion volume). Tool direction is tracked by the machine via
_tool_rotateand does not need to be set here.- Parameters:
command (Command) – The command to be processed.
process_data (ProcessData) – The data object to populate with post-processing information.
- Returns:
The updated ProcessData object.
- on = True¶
- property options¶