Traceback (most recent call last):
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/gremlin.py", line 275, in expose
else: self.redraw_ortho()
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/rs274/glcanon.py", line 356, in inner
return f(self, *args, **kw)
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/rs274/glcanon.py", line 649, in redraw_ortho
self.redraw()
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/rs274/glcanon.py", line 1368, in redraw
self.cache_tool(current_tool)
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/rs274/glcanon.py", line 1468, in cache_tool
self.lathetool(current_tool)
File "/home/cnc/linuxcnc/linuxcnc-dev-master/lib/python/rs274/glcanon.py", line 1799, in lathetool
dx, dy = self.lathe_shapes[orientation]
IndexError: list index out of range
如果您在车床配置的工具表中输入一个超出 glcanon
lathe_shapes
(0-9) 范围的方向值,并尝试更改为该工具,您会收到以下错误并且 gremlin 已死,直到您重新启动 gmoccapy:对于 2.8,您只会得到一个空对话框(请参阅https://forum.linuxcnc.org/gmoccapy/46182-radius-compensation-lathe)
一种解决方案是在 glcanon 中捕获这种情况:https
://github.com/LinuxCNC/linuxcnc/blob/master/lib/python/rs274/glcanon.py#L1792-L1800 但是如何将其传递给 gmoccapy?
另一种解决方案是验证工具表的输入,就像在 Axis 中所做的那样。