开源改变世界

Gmoccapy:gremlin 因工具表中错误的方向值而崩溃 #1773

推推 grbl 2年前 (2023-01-31) 158次浏览
关闭
hansu 打开了这个问题 2022 年 6 月 24 日 · 2 条评论 · 由#2080修复
关闭

Gmoccapy:gremlin 因工具表中错误的方向值而崩溃#1773

hansu 打开了这个问题 2022 年 6 月 24 日 · 2 条评论 · 由#2080修复

注释

Gmoccapy:gremlin 因工具表中错误的方向值而崩溃 #1773
成员

如果您在车床配置的工具表中输入一个超出 glcanon lathe_shapes(0-9) 范围的方向值,并尝试更改为该工具,您会收到以下错误并且 gremlin 已死,直到您重新启动 gmoccapy:

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

对于 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 中所做的那样。

Gmoccapy:gremlin 因工具表中错误的方向值而崩溃 #1773 汉苏 补充道 影响gmoccapy 佳能 EMC Canon层(emctask的一部分)标签 2022 年 6 月 24 日
Gmoccapy:gremlin 因工具表中错误的方向值而崩溃 #1773
合作者

我认为验证工具偏移小部件中的输入并捕获 glcanon 中的错误(我只使用通用工具形状)将是可行的方法。

Gmoccapy:gremlin 因工具表中错误的方向值而崩溃 #1773
成员作者
韩素 评论了 2022 年 6 月 25 日  

好的,我现在在更改值时添加了验证。
但我认为在加载或/和保存时进行验证也很好。
当在负载上检测到超出范围时,我可以将该值设置为零或保留它并以某种方式标记它。
后者需要在应用(保存)时进行额外验证,但会让用户看到旧的、错误的值。
不确定这里是否真的需要这种努力。