gcode_reader.emulate.tools ========================== .. py:module:: gcode_reader.emulate.tools Classes ------- .. autoapisummary:: gcode_reader.emulate.tools.MillingTool gcode_reader.emulate.tools.Tool Module Contents --------------- .. py:class:: MillingTool(options, diameter: float = 1.0) Bases: :py:obj:`Tool` A subtractive tool, such as a CNC mill, controlled by a spindle speed. .. attribute:: spindle_speed The current rotational speed of the spindle in RPM. :type: float .. attribute:: diameter The diameter of the milling tool. :type: float Initializes a new Tool instance. :param options: An instance of the MachineOptions class containing machine and tool configuration. :type options: MachineOptions .. py:method:: process_command(command: gcode_reader.emulate.commands.Command, process_data: gcode_reader.emulate.operations.SubtractiveProcessData) 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. :param command: The command to process. :type command: Command :param process_data: The data object to populate. :type process_data: SubtractiveProcessData :returns: The updated SubtractiveProcessData object. .. py:attribute:: diameter :value: 1.0 .. py:attribute:: spindle_speed :value: 0.0 .. py:class:: Tool(options: gcode_reader.emulate.machine_options.MachineOptions = None) 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. .. attribute:: on Indicates if the tool is currently active. :type: bool .. attribute:: options Configuration options for the machine and tool. :type: MachineOptions Initializes a new Tool instance. :param options: An instance of the MachineOptions class containing machine and tool configuration. :type options: MachineOptions .. py:method:: process_command(command: gcode_reader.emulate.commands.Command, process_data: gcode_reader.emulate.operations.ProcessData) 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_rotate`` and does not need to be set here. :param command: The command to be processed. :type command: Command :param process_data: The data object to populate with post-processing information. :type process_data: ProcessData :returns: The updated ProcessData object. .. py:method:: reset_history() .. py:attribute:: on :value: True .. py:property:: options