summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-31 22:34:28 +0200
committerjaseg <git@jaseg.de>2023-03-31 22:34:28 +0200
commit909766a3a0818dc6f33fb1de58c5d4e6dd83dd07 (patch)
treea98d3af33fa27236578289415b8030f3b02c571b
parent845224e2d6afef782c5d4206fe1a1b503d37583a (diff)
downloadgerbonara-909766a3a0818dc6f33fb1de58c5d4e6dd83dd07.tar.gz
gerbonara-909766a3a0818dc6f33fb1de58c5d4e6dd83dd07.tar.bz2
gerbonara-909766a3a0818dc6f33fb1de58c5d4e6dd83dd07.zip
Fix extraneous tool selection codes in merged Excellon files
-rwxr-xr-xgerbonara/excellon.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gerbonara/excellon.py b/gerbonara/excellon.py
index 1ce9c64..d395ecf 100755
--- a/gerbonara/excellon.py
+++ b/gerbonara/excellon.py
@@ -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. """