Contact me: hankecnc@gmail.com

英寸模式支持。 #168

推推 grbl 3年前 (2023-02-02) 248次浏览
关闭
tomauga 打开了这个问题 2017 年 6 月 10 日 · 5 条评论
关闭

英寸模式支持。#168

tomauga 打开了这个问题 2017 年 6 月 10 日 · 5 条评论

评论

英寸模式支持。 #168

使用 Windows 7 和连接到 TinyG 的 CNCJS 桌面版本 1.9.5。

在英寸/毫米模式之间切换时,如果 UI 会通过将当前单位转换为新单位来更改点动增量值,那就太好了。

当我启动 CNCJS 并点动时,单位为毫米。使用 G20(英寸单位)运行文件后,默认单位为英寸。使用“1”按钮慢跑一步实际上移动 1 英寸而不是 1 毫米。

我想另一种方法是在运行可能切换单位的文件后将 GUI 返回到选定的单位。

英寸模式支持。 #168

如果它也转换探测增量,甚至宏的增量,那也很好。

英寸模式支持。 #168
合作者

对于您的第一个问题,有一个鼠标悬停工具提示,显示增量按钮的当前单位。在 G20(英寸)和 G21(毫米)之间切换时,将更新用户输入值。例如,0.5 英寸 <-> 12.7 毫米。

G20英寸模式

英寸模式支持。 #168

G21 毫米模式

英寸模式支持。 #168

我可以在数字旁边添加单位,以便用户可以看到。


二、CNCjs中Grbl控制器和TinyG控制器的一些区别:

  • Grbl 控制器将在运行文件后发送软件复位 ( ctrl-x),因此它始终会强制将单位模式更改为 G21 (mm)。
'gcode:stop': () => {
    this.event.trigger('gcode:stop');
    this.workflow.stop();
    const activeState = _.get(this.state, 'status.activeState', '');
    const delay = 500; // 500ms
    if (activeState === GRBL_ACTIVE_STATE_RUN) {
        this.write(socket, '!'); // hold
    }
    setTimeout(() => {
        this.write(socket, '\x18'); // ctrl-x
    }, delay);
}
  • 对于 TinyG 控制器,我没有发送软件重置,作业完成后仅发送队列刷新和清除命令:
'gcode:stop': () => {
    this.event.trigger('gcode:stop');
    this.workflow.stop();
    this.writeln(socket, '!%'); // feedhold and queue flush
    setTimeout(() => {
        this.writeln(socket, '{clear:null}');
        this.writeln(socket, '{"qr":""}'); // queue report
    }, 250); // delay 250ms
}

你的建议很好,我可以添加配置选项,允许用户在运行文件后指定首选单位。例如:

Change the units after running a file:
[ ] Leave it as is
[ ] Revert changes to the previous units
[ ] Specify the units you want to use: G20 or G21
英寸模式支持。 #168
合作者

如果它也转换探测增量,甚至宏的增量,那也很好。

@AustinSaintAubin
在 G20 和 G21 之间切换时,Probe widget 中的用户输入值将更新,“转换的探测增量”是什么意思?

英寸模式支持。 #168 奇顿 添加了 小哥 标签 2017 年 6 月 10 日
英寸模式支持。 #168
作者

这看起来很棒 Cheton。谢谢!

英寸模式支持。 #168
合作者

对 CNCjs 1.9.13 中的轴小部件进行了一些改进,您将知道当前使用的单位。

英寸模式支持。 #168