Fix extraneous tool selection codes in merged Excellon files
This commit is contained in:
parent
33a35f796d
commit
dcb31f3131
1 changed files with 4 additions and 2 deletions
|
|
@ -46,13 +46,15 @@ class ExcellonContext:
|
|||
|
||||
def select_tool(self, tool):
|
||||
""" Select the current tool. Retract drill first if necessary. """
|
||||
if self.current_tool != tool:
|
||||
current_id = self.tools.get(id(self.current_tool))
|
||||
new_id = self.tools[id(tool)]
|
||||
if new_id != current_id:
|
||||
if self.drill_down:
|
||||
yield 'M16' # drill up
|
||||
self.drill_down = False
|
||||
|
||||
self.current_tool = tool
|
||||
yield f'T{self.tools[id(tool)]:02d}'
|
||||
yield f'T{new_id:02d}'
|
||||
|
||||
def drill_mode(self):
|
||||
""" Enter drill mode. """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue