提示词:

对标 LinuxCNC,分阶段完善 Web 版数控系统仿真的 WASM 程序,继续补齐 G 代码语法并严格测试。

总结:
对齐 LinuxCNC read_g 的 G80 特例:同一行 G80 与另一个运动模态 G 码共存时不触发同组冲突;新增 G80 G1 与 G1 G80 用例。已通过 ./test-native.sh 和 ./test-linuxcnc-source-link.sh。
This commit is contained in:
wangdequan
2026-05-23 18:02:25 +08:00
parent f3f3a1dfa5
commit a227ad14a6
2 changed files with 28 additions and 3 deletions

View File

@@ -3582,6 +3582,26 @@ int main() {
sizeof(same_modal_group_g_program) - 1) != 0,
"expected LinuxCNC to reject two G codes from the same modal group");
const char g80_before_motion_program[] =
"G21 G90\n"
"F100\n"
"G80 G1 X1\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
g80_before_motion_program,
sizeof(g80_before_motion_program) - 1) == 0,
"expected LinuxCNC to allow G80 before another motion G code");
const char g80_after_motion_program[] =
"G21 G90\n"
"F100\n"
"G1 G80 X1\n";
events.clear();
ok &= expect(cnc_sim_parse_program(sim,
g80_after_motion_program,
sizeof(g80_after_motion_program) - 1) == 0,
"expected LinuxCNC to allow G80 after another motion G code");
const char same_modal_group_m_program[] =
"G21 G90\n"
"M3 M4\n";