Update wasm port validation state

This commit is contained in:
wangdequan
2026-07-10 03:22:55 -04:00
parent 49a8bad404
commit 2e922ad628
91 changed files with 3292 additions and 1488 deletions

View File

@@ -1,119 +0,0 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 -70.000000
5222 -50.000000
5223 -110.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000

View File

@@ -1,119 +0,0 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 -70.000000
5222 -50.000000
5223 -110.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000

View File

@@ -1,207 +0,0 @@
# Sat Jun 06 15:59:10 CST 2026
#
# This file: ./xyzab-tdr_cmds.hal
# Created by: /home/cnc/桌面/cnc_wams/linuxcnc/lib/hallib/basic_sim.tcl
# With options:
# From inifile: /home/cnc/桌面/cnc_wams/linuxcnc/configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr.ini
# Halfiles: LIB:basic_sim.tcl
#
# This file contains the hal commands produced by basic_sim.tcl
# (and any hal commands executed prior to its execution).
# ------------------------------------------------------------------
# To use ./xyzab-tdr_cmds.hal in the original inifile (or a copy of it),
# edit to change:
# [HAL]
# HALFILE = LIB:basic_sim.tcl parameters
# to:
# [HAL]
# HALFILE = ./xyzab-tdr_cmds.hal
#
# Notes:
# 1) Inifile Variables substitutions specified in the inifile
# and interpreted by halcmd are automatically substituted
# in the created halfile (./xyzab-tdr_cmds.hal).
# 2) Input pins connected to a signal with no writer are
# not included in the setp listings herein so must be added
# manually
#
# user space components
loadusr -W hal_manualtoolchange
# components
#preloaded module: loadrt tpmod
#preloaded module: loadrt homemod
loadrt xyzab_tdr_kins
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=5
#loadrt __servo-thread (not loaded by loadrt, no args saved)
loadrt pid names=J0_pid,J1_pid,J2_pid,J3_pid,J4_pid
loadrt mux2 names=J0_mux,J1_mux,J2_mux,J3_mux,J4_mux
loadrt ddt names=J0_vel,J0_accel,J1_vel,J1_accel,J2_vel,J2_accel,J3_vel,J3_accel,J4_vel,J4_accel
loadrt sim_home_switch names=J0_switch,J1_switch,J2_switch,J3_switch,J4_switch
loadrt sim_spindle names=sim_spindle
loadrt limit2 names=limit_speed
loadrt lowpass names=spindle_mass
loadrt near names=near_speed
loadrt scale names=rpm_rps
# pin aliases
# param aliases
# signals
# nets
net J0:acc J0_accel.out
net J0:enable joint.0.amp-enable-out => J0_pid.enable
net J0:homesw J0_switch.home-sw => joint.0.home-sw-in
net J0:on-pos J0_pid.output => J0_mux.in1
net J0:pos-cmd joint.0.motor-pos-cmd => J0_pid.command
net J0:pos-fb J0_mux.out => J0_mux.in0 J0_switch.cur-pos J0_vel.in joint.0.motor-pos-fb
net J0:vel J0_vel.out => J0_accel.in
net J1:acc J1_accel.out
net J1:enable joint.1.amp-enable-out => J1_pid.enable
net J1:homesw J1_switch.home-sw => joint.1.home-sw-in
net J1:on-pos J1_pid.output => J1_mux.in1
net J1:pos-cmd joint.1.motor-pos-cmd => J1_pid.command
net J1:pos-fb J1_mux.out => J1_mux.in0 J1_switch.cur-pos J1_vel.in joint.1.motor-pos-fb
net J1:vel J1_vel.out => J1_accel.in
net J2:acc J2_accel.out
net J2:enable joint.2.amp-enable-out => J2_pid.enable
net J2:homesw J2_switch.home-sw => joint.2.home-sw-in
net J2:on-pos J2_pid.output => J2_mux.in1
net J2:pos-cmd joint.2.motor-pos-cmd => J2_pid.command
net J2:pos-fb J2_mux.out => J2_mux.in0 J2_switch.cur-pos J2_vel.in joint.2.motor-pos-fb
net J2:vel J2_vel.out => J2_accel.in
net J3:acc J3_accel.out
net J3:enable joint.3.amp-enable-out => J3_pid.enable
net J3:homesw J3_switch.home-sw => joint.3.home-sw-in
net J3:on-pos J3_pid.output => J3_mux.in1
net J3:pos-cmd joint.3.motor-pos-cmd => J3_pid.command
net J3:pos-fb J3_mux.out => J3_mux.in0 J3_switch.cur-pos J3_vel.in joint.3.motor-pos-fb
net J3:vel J3_vel.out => J3_accel.in
net J4:acc J4_accel.out
net J4:enable joint.4.amp-enable-out => J4_pid.enable
net J4:homesw J4_switch.home-sw => joint.4.home-sw-in
net J4:on-pos J4_pid.output => J4_mux.in1
net J4:pos-cmd joint.4.motor-pos-cmd => J4_pid.command
net J4:pos-fb J4_mux.out => J4_mux.in0 J4_switch.cur-pos J4_vel.in joint.4.motor-pos-fb
net J4:vel J4_vel.out => J4_accel.in
net estop:loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
net sample:enable motion.motion-enabled => J0_mux.sel J1_mux.sel J2_mux.sel J3_mux.sel J4_mux.sel
net spindle-at-speed near_speed.out => spindle.0.at-speed
net spindle-index-enable sim_spindle.index-enable <=> spindle.0.index-enable
net spindle-orient spindle.0.orient => spindle.0.is-oriented
net spindle-pos sim_spindle.position-fb => spindle.0.revs
net spindle-rpm-filtered spindle_mass.out => near_speed.in2 rpm_rps.in
net spindle-rps-filtered rpm_rps.out => spindle.0.speed-in
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in near_speed.in1
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
net tool:change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool:changed hal_manualtoolchange.changed => iocontrol.0.tool-changed
net tool:prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool:prep-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
# parameter values
setp J0_accel.tmax 0
setp J0_mux.tmax 0
setp J0_pid.do-pid-calcs.tmax 0
setp J0_switch.tmax 0
setp J0_vel.tmax 0
setp J1_accel.tmax 0
setp J1_mux.tmax 0
setp J1_pid.do-pid-calcs.tmax 0
setp J1_switch.tmax 0
setp J1_vel.tmax 0
setp J2_accel.tmax 0
setp J2_mux.tmax 0
setp J2_pid.do-pid-calcs.tmax 0
setp J2_switch.tmax 0
setp J2_vel.tmax 0
setp J3_accel.tmax 0
setp J3_mux.tmax 0
setp J3_pid.do-pid-calcs.tmax 0
setp J3_switch.tmax 0
setp J3_vel.tmax 0
setp J4_accel.tmax 0
setp J4_mux.tmax 0
setp J4_pid.do-pid-calcs.tmax 0
setp J4_switch.tmax 0
setp J4_vel.tmax 0
setp limit_speed.tmax 0
setp motion-command-handler.tmax 0
setp motion-controller.tmax 0
setp near_speed.difference 10
setp near_speed.scale 1.1
setp near_speed.tmax 0
setp rpm_rps.tmax 0
setp servo-thread.tmax 0
setp sim_spindle.scale 0.01666667
setp sim_spindle.tmax 0
setp spindle_mass.gain 0.07
setp spindle_mass.tmax 0
# realtime thread/function links
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf J0_pid.do-pid-calcs servo-thread
addf J1_pid.do-pid-calcs servo-thread
addf J2_pid.do-pid-calcs servo-thread
addf J3_pid.do-pid-calcs servo-thread
addf J4_pid.do-pid-calcs servo-thread
addf J0_mux servo-thread
addf J1_mux servo-thread
addf J2_mux servo-thread
addf J3_mux servo-thread
addf J4_mux servo-thread
addf J0_vel servo-thread
addf J0_accel servo-thread
addf J1_vel servo-thread
addf J1_accel servo-thread
addf J2_vel servo-thread
addf J2_accel servo-thread
addf J3_vel servo-thread
addf J3_accel servo-thread
addf J4_vel servo-thread
addf J4_accel servo-thread
addf J0_switch servo-thread
addf J1_switch servo-thread
addf J2_switch servo-thread
addf J3_switch servo-thread
addf J4_switch servo-thread
addf limit_speed servo-thread
addf spindle_mass servo-thread
addf rpm_rps servo-thread
addf near_speed servo-thread
addf sim_spindle servo-thread
# setp commands for unconnected input pins
setp J0_pid.FF0 1.0
setp J0_pid.Pgain 0
setp J0_pid.Dgain 0
setp J0_pid.Igain 0
setp J0_pid.FF1 0
setp J0_pid.FF2 0
setp J1_pid.FF0 1.0
setp J1_pid.Pgain 0
setp J1_pid.Dgain 0
setp J1_pid.Igain 0
setp J1_pid.FF1 0
setp J1_pid.FF2 0
setp J2_pid.FF0 1.0
setp J2_pid.Pgain 0
setp J2_pid.Dgain 0
setp J2_pid.Igain 0
setp J2_pid.FF1 0
setp J2_pid.FF2 0
setp J3_pid.FF0 1.0
setp J3_pid.Pgain 0
setp J3_pid.Dgain 0
setp J3_pid.Igain 0
setp J3_pid.FF1 0
setp J3_pid.FF2 0
setp J4_pid.FF0 1.0
setp J4_pid.Pgain 0
setp J4_pid.Dgain 0
setp J4_pid.Igain 0
setp J4_pid.FF1 0
setp J4_pid.FF2 0
setp sim_spindle.scale 0.01666667
setp limit_speed.maxv 5000.0
setp spindle_mass.gain .07
setp near_speed.scale 1.1
setp near_speed.difference 10

View File

@@ -1,207 +0,0 @@
# Sat Jun 06 15:43:11 CST 2026
#
# This file: ./xyzac-trt_cmds.hal
# Created by: /home/cnc/桌面/cnc_wams/linuxcnc/lib/hallib/basic_sim.tcl
# With options:
# From inifile: /home/cnc/桌面/cnc_wams/linuxcnc/configs/sim/axis/vismach/5axis/table-rotary-tilting/xyzac-trt.ini
# Halfiles: LIB:basic_sim.tcl
#
# This file contains the hal commands produced by basic_sim.tcl
# (and any hal commands executed prior to its execution).
# ------------------------------------------------------------------
# To use ./xyzac-trt_cmds.hal in the original inifile (or a copy of it),
# edit to change:
# [HAL]
# HALFILE = LIB:basic_sim.tcl parameters
# to:
# [HAL]
# HALFILE = ./xyzac-trt_cmds.hal
#
# Notes:
# 1) Inifile Variables substitutions specified in the inifile
# and interpreted by halcmd are automatically substituted
# in the created halfile (./xyzac-trt_cmds.hal).
# 2) Input pins connected to a signal with no writer are
# not included in the setp listings herein so must be added
# manually
#
# user space components
loadusr -W hal_manualtoolchange
# components
#preloaded module: loadrt tpmod
#preloaded module: loadrt homemod
loadrt xyzac-trt-kins sparm=identityfirst
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=5
#loadrt __servo-thread (not loaded by loadrt, no args saved)
loadrt pid names=J0_pid,J1_pid,J2_pid,J3_pid,J4_pid
loadrt mux2 names=J0_mux,J1_mux,J2_mux,J3_mux,J4_mux
loadrt ddt names=J0_vel,J0_accel,J1_vel,J1_accel,J2_vel,J2_accel,J3_vel,J3_accel,J4_vel,J4_accel
loadrt sim_home_switch names=J0_switch,J1_switch,J2_switch,J3_switch,J4_switch
loadrt sim_spindle names=sim_spindle
loadrt limit2 names=limit_speed
loadrt lowpass names=spindle_mass
loadrt near names=near_speed
loadrt scale names=rpm_rps
# pin aliases
# param aliases
# signals
# nets
net J0:acc J0_accel.out
net J0:enable joint.0.amp-enable-out => J0_pid.enable
net J0:homesw J0_switch.home-sw => joint.0.home-sw-in
net J0:on-pos J0_pid.output => J0_mux.in1
net J0:pos-cmd joint.0.motor-pos-cmd => J0_pid.command
net J0:pos-fb J0_mux.out => J0_mux.in0 J0_switch.cur-pos J0_vel.in joint.0.motor-pos-fb
net J0:vel J0_vel.out => J0_accel.in
net J1:acc J1_accel.out
net J1:enable joint.1.amp-enable-out => J1_pid.enable
net J1:homesw J1_switch.home-sw => joint.1.home-sw-in
net J1:on-pos J1_pid.output => J1_mux.in1
net J1:pos-cmd joint.1.motor-pos-cmd => J1_pid.command
net J1:pos-fb J1_mux.out => J1_mux.in0 J1_switch.cur-pos J1_vel.in joint.1.motor-pos-fb
net J1:vel J1_vel.out => J1_accel.in
net J2:acc J2_accel.out
net J2:enable joint.2.amp-enable-out => J2_pid.enable
net J2:homesw J2_switch.home-sw => joint.2.home-sw-in
net J2:on-pos J2_pid.output => J2_mux.in1
net J2:pos-cmd joint.2.motor-pos-cmd => J2_pid.command
net J2:pos-fb J2_mux.out => J2_mux.in0 J2_switch.cur-pos J2_vel.in joint.2.motor-pos-fb
net J2:vel J2_vel.out => J2_accel.in
net J3:acc J3_accel.out
net J3:enable joint.3.amp-enable-out => J3_pid.enable
net J3:homesw J3_switch.home-sw => joint.3.home-sw-in
net J3:on-pos J3_pid.output => J3_mux.in1
net J3:pos-cmd joint.3.motor-pos-cmd => J3_pid.command
net J3:pos-fb J3_mux.out => J3_mux.in0 J3_switch.cur-pos J3_vel.in joint.3.motor-pos-fb
net J3:vel J3_vel.out => J3_accel.in
net J4:acc J4_accel.out
net J4:enable joint.4.amp-enable-out => J4_pid.enable
net J4:homesw J4_switch.home-sw => joint.4.home-sw-in
net J4:on-pos J4_pid.output => J4_mux.in1
net J4:pos-cmd joint.4.motor-pos-cmd => J4_pid.command
net J4:pos-fb J4_mux.out => J4_mux.in0 J4_switch.cur-pos J4_vel.in joint.4.motor-pos-fb
net J4:vel J4_vel.out => J4_accel.in
net estop:loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
net sample:enable motion.motion-enabled => J0_mux.sel J1_mux.sel J2_mux.sel J3_mux.sel J4_mux.sel
net spindle-at-speed near_speed.out => spindle.0.at-speed
net spindle-index-enable sim_spindle.index-enable <=> spindle.0.index-enable
net spindle-orient spindle.0.orient => spindle.0.is-oriented
net spindle-pos sim_spindle.position-fb => spindle.0.revs
net spindle-rpm-filtered spindle_mass.out => near_speed.in2 rpm_rps.in
net spindle-rps-filtered rpm_rps.out => spindle.0.speed-in
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in near_speed.in1
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
net tool:change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool:changed hal_manualtoolchange.changed => iocontrol.0.tool-changed
net tool:prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool:prep-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
# parameter values
setp J0_accel.tmax 0
setp J0_mux.tmax 0
setp J0_pid.do-pid-calcs.tmax 0
setp J0_switch.tmax 0
setp J0_vel.tmax 0
setp J1_accel.tmax 0
setp J1_mux.tmax 0
setp J1_pid.do-pid-calcs.tmax 0
setp J1_switch.tmax 0
setp J1_vel.tmax 0
setp J2_accel.tmax 0
setp J2_mux.tmax 0
setp J2_pid.do-pid-calcs.tmax 0
setp J2_switch.tmax 0
setp J2_vel.tmax 0
setp J3_accel.tmax 0
setp J3_mux.tmax 0
setp J3_pid.do-pid-calcs.tmax 0
setp J3_switch.tmax 0
setp J3_vel.tmax 0
setp J4_accel.tmax 0
setp J4_mux.tmax 0
setp J4_pid.do-pid-calcs.tmax 0
setp J4_switch.tmax 0
setp J4_vel.tmax 0
setp limit_speed.tmax 0
setp motion-command-handler.tmax 0
setp motion-controller.tmax 0
setp near_speed.difference 10
setp near_speed.scale 1.1
setp near_speed.tmax 0
setp rpm_rps.tmax 0
setp servo-thread.tmax 0
setp sim_spindle.scale 0.01666667
setp sim_spindle.tmax 0
setp spindle_mass.gain 0.07
setp spindle_mass.tmax 0
# realtime thread/function links
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf J0_pid.do-pid-calcs servo-thread
addf J1_pid.do-pid-calcs servo-thread
addf J2_pid.do-pid-calcs servo-thread
addf J3_pid.do-pid-calcs servo-thread
addf J4_pid.do-pid-calcs servo-thread
addf J0_mux servo-thread
addf J1_mux servo-thread
addf J2_mux servo-thread
addf J3_mux servo-thread
addf J4_mux servo-thread
addf J0_vel servo-thread
addf J0_accel servo-thread
addf J1_vel servo-thread
addf J1_accel servo-thread
addf J2_vel servo-thread
addf J2_accel servo-thread
addf J3_vel servo-thread
addf J3_accel servo-thread
addf J4_vel servo-thread
addf J4_accel servo-thread
addf J0_switch servo-thread
addf J1_switch servo-thread
addf J2_switch servo-thread
addf J3_switch servo-thread
addf J4_switch servo-thread
addf limit_speed servo-thread
addf spindle_mass servo-thread
addf rpm_rps servo-thread
addf near_speed servo-thread
addf sim_spindle servo-thread
# setp commands for unconnected input pins
setp J0_pid.FF0 1.0
setp J0_pid.Pgain 0
setp J0_pid.Dgain 0
setp J0_pid.Igain 0
setp J0_pid.FF1 0
setp J0_pid.FF2 0
setp J1_pid.FF0 1.0
setp J1_pid.Pgain 0
setp J1_pid.Dgain 0
setp J1_pid.Igain 0
setp J1_pid.FF1 0
setp J1_pid.FF2 0
setp J2_pid.FF0 1.0
setp J2_pid.Pgain 0
setp J2_pid.Dgain 0
setp J2_pid.Igain 0
setp J2_pid.FF1 0
setp J2_pid.FF2 0
setp J3_pid.FF0 1.0
setp J3_pid.Pgain 0
setp J3_pid.Dgain 0
setp J3_pid.Igain 0
setp J3_pid.FF1 0
setp J3_pid.FF2 0
setp J4_pid.FF0 1.0
setp J4_pid.Pgain 0
setp J4_pid.Dgain 0
setp J4_pid.Igain 0
setp J4_pid.FF1 0
setp J4_pid.FF2 0
setp sim_spindle.scale 0.01666667
setp limit_speed.maxv 5000.0
setp spindle_mass.gain .07
setp near_speed.scale 1.1
setp near_speed.difference 10

View File

@@ -20,7 +20,7 @@ grid_size = 1.0
view = p
mouse_btn_mode = 4
hide_cursor = False
system_name_tool = Working Offset
system_name_tool = Tool
system_name_g5x = G5x
system_name_rot = Rot
system_name_g92 = G92
@@ -36,7 +36,7 @@ system_name_g59.3 = G59.3
jump_to_dir = /home/gmoccapy
show_keyboard_on_offset = False
show_keyboard_on_tooledit = False
show_keyboard_on_edit = False
show_keyboard_on_edit = True
show_keyboard_on_mdi = False
show_keyboard_on_file_selection = False
spindle_bar_min = 0.0
@@ -73,25 +73,4 @@ reload_tool = True
tool_in_spindle = 0
blockheight = 0.0
use_toolmeasurement = False
kbd_height = 250
kbd_width = 880
kbd_set_height = False
kbd_set_width = False
info_tab_page = 0
jog_btn_size = 48
jog_box_width = 360
toolpage_use_calc = True
offsetpage_use_calc = True
gcodeview_font = monospace 10
hide_titlebar = False
icon_theme = classic
gcode_theme = classic
audio_enabled = True
hide_tooltips = False
system_name_g28 = G28
system_name_g30 = G30
iconview_sortorder = 0
iconview_sortbydate = 1
iconview_folderfirst = 0
sort_by_date = False

View File

@@ -1,202 +0,0 @@
# Fri Jun 26 05:57:43 EDT 2026
#
# This file: ./xyzac-trt_cmds.hal
# Created by: /home/meswork/cnc_wams/linuxcnc/lib/hallib/basic_sim.tcl
# With options: -no_use_hal_manualtoolchange
# From inifile: /home/meswork/cnc_wams/linuxcnc/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt.ini
# Halfiles: {LIB:basic_sim.tcl -no_use_hal_manualtoolchange}
#
# This file contains the hal commands produced by basic_sim.tcl
# (and any hal commands executed prior to its execution).
# ------------------------------------------------------------------
# To use ./xyzac-trt_cmds.hal in the original inifile (or a copy of it),
# edit to change:
# [HAL]
# HALFILE = LIB:basic_sim.tcl parameters
# to:
# [HAL]
# HALFILE = ./xyzac-trt_cmds.hal
#
# Notes:
# 1) Inifile Variables substitutions specified in the inifile
# and interpreted by halcmd are automatically substituted
# in the created halfile (./xyzac-trt_cmds.hal).
# 2) Input pins connected to a signal with no writer are
# not included in the setp listings herein so must be added
# manually
#
# components
#preloaded module: loadrt tpmod
#preloaded module: loadrt homemod
loadrt xyzac-trt-kins
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=5
#loadrt __servo-thread (not loaded by loadrt, no args saved)
loadrt pid names=J0_pid,J1_pid,J2_pid,J3_pid,J4_pid
loadrt mux2 names=J0_mux,J1_mux,J2_mux,J3_mux,J4_mux
loadrt ddt names=J0_vel,J0_accel,J1_vel,J1_accel,J2_vel,J2_accel,J3_vel,J3_accel,J4_vel,J4_accel
loadrt sim_home_switch names=J0_switch,J1_switch,J2_switch,J3_switch,J4_switch
loadrt sim_spindle names=sim_spindle
loadrt limit2 names=limit_speed
loadrt lowpass names=spindle_mass
loadrt near names=near_speed
loadrt scale names=rpm_rps
# pin aliases
# param aliases
# signals
# nets
net J0:acc J0_accel.out
net J0:enable joint.0.amp-enable-out => J0_pid.enable
net J0:homesw J0_switch.home-sw => joint.0.home-sw-in
net J0:on-pos J0_pid.output => J0_mux.in1
net J0:pos-cmd joint.0.motor-pos-cmd => J0_pid.command
net J0:pos-fb J0_mux.out => J0_mux.in0 J0_switch.cur-pos J0_vel.in joint.0.motor-pos-fb
net J0:vel J0_vel.out => J0_accel.in
net J1:acc J1_accel.out
net J1:enable joint.1.amp-enable-out => J1_pid.enable
net J1:homesw J1_switch.home-sw => joint.1.home-sw-in
net J1:on-pos J1_pid.output => J1_mux.in1
net J1:pos-cmd joint.1.motor-pos-cmd => J1_pid.command
net J1:pos-fb J1_mux.out => J1_mux.in0 J1_switch.cur-pos J1_vel.in joint.1.motor-pos-fb
net J1:vel J1_vel.out => J1_accel.in
net J2:acc J2_accel.out
net J2:enable joint.2.amp-enable-out => J2_pid.enable
net J2:homesw J2_switch.home-sw => joint.2.home-sw-in
net J2:on-pos J2_pid.output => J2_mux.in1
net J2:pos-cmd joint.2.motor-pos-cmd => J2_pid.command
net J2:pos-fb J2_mux.out => J2_mux.in0 J2_switch.cur-pos J2_vel.in joint.2.motor-pos-fb
net J2:vel J2_vel.out => J2_accel.in
net J3:acc J3_accel.out
net J3:enable joint.3.amp-enable-out => J3_pid.enable
net J3:homesw J3_switch.home-sw => joint.3.home-sw-in
net J3:on-pos J3_pid.output => J3_mux.in1
net J3:pos-cmd joint.3.motor-pos-cmd => J3_pid.command
net J3:pos-fb J3_mux.out => J3_mux.in0 J3_switch.cur-pos J3_vel.in joint.3.motor-pos-fb
net J3:vel J3_vel.out => J3_accel.in
net J4:acc J4_accel.out
net J4:enable joint.4.amp-enable-out => J4_pid.enable
net J4:homesw J4_switch.home-sw => joint.4.home-sw-in
net J4:on-pos J4_pid.output => J4_mux.in1
net J4:pos-cmd joint.4.motor-pos-cmd => J4_pid.command
net J4:pos-fb J4_mux.out => J4_mux.in0 J4_switch.cur-pos J4_vel.in joint.4.motor-pos-fb
net J4:vel J4_vel.out => J4_accel.in
net estop:loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
net sample:enable motion.motion-enabled => J0_mux.sel J1_mux.sel J2_mux.sel J3_mux.sel J4_mux.sel
net spindle-at-speed near_speed.out => spindle.0.at-speed
net spindle-index-enable sim_spindle.index-enable <=> spindle.0.index-enable
net spindle-orient spindle.0.orient => spindle.0.is-oriented
net spindle-pos sim_spindle.position-fb => spindle.0.revs
net spindle-rpm-filtered spindle_mass.out => near_speed.in2 rpm_rps.in
net spindle-rps-filtered rpm_rps.out => spindle.0.speed-in
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in near_speed.in1
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
net tool:change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
net tool:prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
# parameter values
setp J0_accel.tmax 0
setp J0_mux.tmax 0
setp J0_pid.do-pid-calcs.tmax 0
setp J0_switch.tmax 0
setp J0_vel.tmax 0
setp J1_accel.tmax 0
setp J1_mux.tmax 0
setp J1_pid.do-pid-calcs.tmax 0
setp J1_switch.tmax 0
setp J1_vel.tmax 0
setp J2_accel.tmax 0
setp J2_mux.tmax 0
setp J2_pid.do-pid-calcs.tmax 0
setp J2_switch.tmax 0
setp J2_vel.tmax 0
setp J3_accel.tmax 0
setp J3_mux.tmax 0
setp J3_pid.do-pid-calcs.tmax 0
setp J3_switch.tmax 0
setp J3_vel.tmax 0
setp J4_accel.tmax 0
setp J4_mux.tmax 0
setp J4_pid.do-pid-calcs.tmax 0
setp J4_switch.tmax 0
setp J4_vel.tmax 0
setp limit_speed.tmax 0
setp motion-command-handler.tmax 0
setp motion-controller.tmax 0
setp near_speed.difference 10
setp near_speed.scale 1.1
setp near_speed.tmax 0
setp rpm_rps.tmax 0
setp servo-thread.tmax 0
setp sim_spindle.scale 0.01666667
setp sim_spindle.tmax 0
setp spindle_mass.gain 0.07
setp spindle_mass.tmax 0
# realtime thread/function links
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf J0_pid.do-pid-calcs servo-thread
addf J1_pid.do-pid-calcs servo-thread
addf J2_pid.do-pid-calcs servo-thread
addf J3_pid.do-pid-calcs servo-thread
addf J4_pid.do-pid-calcs servo-thread
addf J0_mux servo-thread
addf J1_mux servo-thread
addf J2_mux servo-thread
addf J3_mux servo-thread
addf J4_mux servo-thread
addf J0_vel servo-thread
addf J0_accel servo-thread
addf J1_vel servo-thread
addf J1_accel servo-thread
addf J2_vel servo-thread
addf J2_accel servo-thread
addf J3_vel servo-thread
addf J3_accel servo-thread
addf J4_vel servo-thread
addf J4_accel servo-thread
addf J0_switch servo-thread
addf J1_switch servo-thread
addf J2_switch servo-thread
addf J3_switch servo-thread
addf J4_switch servo-thread
addf limit_speed servo-thread
addf spindle_mass servo-thread
addf rpm_rps servo-thread
addf near_speed servo-thread
addf sim_spindle servo-thread
# setp commands for unconnected input pins
setp J0_pid.FF0 1.0
setp J0_pid.Pgain 0
setp J0_pid.Dgain 0
setp J0_pid.Igain 0
setp J0_pid.FF1 0
setp J0_pid.FF2 0
setp J1_pid.FF0 1.0
setp J1_pid.Pgain 0
setp J1_pid.Dgain 0
setp J1_pid.Igain 0
setp J1_pid.FF1 0
setp J1_pid.FF2 0
setp J2_pid.FF0 1.0
setp J2_pid.Pgain 0
setp J2_pid.Dgain 0
setp J2_pid.Igain 0
setp J2_pid.FF1 0
setp J2_pid.FF2 0
setp J3_pid.FF0 1.0
setp J3_pid.Pgain 0
setp J3_pid.Dgain 0
setp J3_pid.Igain 0
setp J3_pid.FF1 0
setp J3_pid.FF2 0
setp J4_pid.FF0 1.0
setp J4_pid.Pgain 0
setp J4_pid.Dgain 0
setp J4_pid.Igain 0
setp J4_pid.FF1 0
setp J4_pid.FF2 0
setp sim_spindle.scale 0.01666667
setp limit_speed.maxv 5000.0
setp spindle_mass.gain .07
setp near_speed.scale 1.1
setp near_speed.difference 10

View File

@@ -1,119 +0,0 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 0.000000
5222 0.000000
5223 0.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000

View File

@@ -1,119 +0,0 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 0.000000
5222 0.000000
5223 0.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000

View File

@@ -1,437 +0,0 @@
#include "emccanon_wasm_subset.hh"
/*
* WASM canonical linear-motion subset derived from
* LinuxCNC src/emc/task/emccanon.cc.
*
* Upstream anchors:
* - INIT_CANON(): initializes CanonConfig_t, offsets, endpoint, feed state, and units.
* - ON_RESET(): drops pending canonical segments.
* - FINISH(): flushes pending canonical segments.
* - USE_LENGTH_UNITS(): sets canon.lengthUnits.
* - GET_EXTERNAL_LENGTH_UNITS()/GET_EXTERNAL_ANGLE_UNITS(): read EMC_STAT motion units.
* - GET_EXTERNAL_POSITION()/GET_EXTERNAL_POSITION_X/Y/Z/A/B/C(): expose the current canonical endpoint.
* - generate_fast_move(): emits EMC_TRAJ_LINEAR_MOVE for traverse-like moves.
* - generate_move(): emits EMC_TRAJ_LINEAR_MOVE for feed moves.
* - STRAIGHT_TRAVERSE(): canonical traverse entry point.
* - STRAIGHT_FEED(): canonical feed entry point.
* - DWELL(): emits EMC_TRAJ_DELAY to interp_list.
* - SET_MOTION_CONTROL_MODE(): emits EMC_TRAJ_SET_TERM_COND to interp_list.
* - SET_SPINDLE_SPEED(): emits EMC_SPINDLE_SPEED to interp_list.
* - START_SPINDLE_CLOCKWISE()/START_SPINDLE_COUNTERCLOCKWISE(): emit EMC_SPINDLE_ON to interp_list.
* - STOP_SPINDLE_TURNING(): emits EMC_SPINDLE_OFF to interp_list.
* - SELECT_TOOL(): emits EMC_TOOL_PREPARE to interp_list.
* - CHANGE_TOOL(): emits EMC_TOOL_LOAD to interp_list.
* - CHANGE_TOOL_NUMBER(): emits EMC_TOOL_SET_NUMBER to interp_list.
* - RELOAD_TOOLDATA(): emits EMC_TOOL_LOAD_TOOL_TABLE to interp_list.
* - SET_MOTION_OUTPUT_BIT()/CLEAR_MOTION_OUTPUT_BIT()/SET_AUX_OUTPUT_BIT()/CLEAR_AUX_OUTPUT_BIT():
* emit EMC_MOTION_SET_DOUT to interp_list.
* - SET_MOTION_OUTPUT_VALUE()/SET_AUX_OUTPUT_VALUE(): emit EMC_MOTION_SET_AOUT to interp_list.
* - WAIT(): emits EMC_AUX_INPUT_WAIT to interp_list.
*
* Full emccanon.cc owns CanonConfig_t, offsets, unit conversion, interp_list,
* tags, NURBS, spindle/tool/coolant, and many other canonical callbacks. This
* subset stops at a canonical linear-move envelope so task-HAL can keep using
* the existing standalone runtime edge while moving motion generation toward
* upstream canonical function families.
*/
namespace {
int units_from_external(double external_length_units)
{
if (external_length_units > 0.038 && external_length_units < 0.041) {
return LC_EMCCANON_SUBSET_UNITS_INCHES;
}
return LC_EMCCANON_SUBSET_UNITS_MM;
}
void set_linear_move(int line, const LcEmcCanonSubsetPose *end, double velocity,
int motion_type, LcEmcCanonSubsetLinearMove *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetLinearMove{};
out->line = line;
out->motion_type = motion_type;
out->velocity = velocity;
if (end) {
out->end = *end;
}
}
void set_spindle_command(int command, int spindle, double speed, int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetSpindleCommand{};
out->command = command;
out->spindle = spindle;
out->speed = speed;
out->wait_for_at_speed = wait_for_at_speed;
}
void set_tool_command(int command, int tool, LcEmcCanonSubsetToolCommand *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetToolCommand{};
out->command = command;
out->tool = tool;
}
void set_output_command(int command, int index, int start, int end, int now,
double value, LcEmcCanonSubsetOutputCommand *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetOutputCommand{};
out->command = command;
out->index = index;
out->start = start;
out->end = end;
out->now = now;
out->value = value;
}
} // namespace
extern "C" {
void lc_emccanon_subset_init(double external_length_units,
double external_angle_units,
LcEmcCanonSubsetState *state)
{
if (!state) {
return;
}
*state = LcEmcCanonSubsetState{};
state->initialized = 1;
state->external_length_units = external_length_units == 0.0 ? 1.0 : external_length_units;
state->external_angle_units = external_angle_units == 0.0 ? 1.0 : external_angle_units;
state->length_units = units_from_external(state->external_length_units);
}
void lc_emccanon_subset_on_reset(LcEmcCanonSubsetState *state)
{
if (!state) {
return;
}
state->reset_count += 1;
state->endpoint = LcEmcCanonSubsetPose{};
}
void lc_emccanon_subset_finish(LcEmcCanonSubsetState *state)
{
if (!state) {
return;
}
state->finish_count += 1;
}
void lc_emccanon_subset_use_length_units(int units,
LcEmcCanonSubsetState *state)
{
if (!state) {
return;
}
state->length_units = units;
}
void lc_emccanon_subset_update_endpoint(const LcEmcCanonSubsetPose *position,
LcEmcCanonSubsetState *state)
{
if (!state || !position) {
return;
}
state->endpoint = *position;
}
void lc_emccanon_subset_get_external_position(const LcEmcCanonSubsetState *state,
LcEmcCanonSubsetPose *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetPose{};
if (state) {
*out = state->endpoint;
}
}
double lc_emccanon_subset_get_external_length_units(const LcEmcCanonSubsetState *state)
{
if (!state || state->external_length_units == 0.0) {
return 1.0;
}
return state->external_length_units;
}
double lc_emccanon_subset_get_external_angle_units(const LcEmcCanonSubsetState *state)
{
if (!state || state->external_angle_units == 0.0) {
return 1.0;
}
return state->external_angle_units;
}
int lc_emccanon_subset_get_external_length_unit_type(const LcEmcCanonSubsetState *state)
{
return state ? state->length_units : LC_EMCCANON_SUBSET_UNITS_MM;
}
void lc_emccanon_subset_straight_traverse(int line, const LcEmcCanonSubsetPose *end,
double velocity,
LcEmcCanonSubsetLinearMove *out)
{
set_linear_move(line, end, velocity, LC_EMCCANON_SUBSET_MOTION_TRAVERSE, out);
}
void lc_emccanon_subset_straight_feed(int line, const LcEmcCanonSubsetPose *end,
double velocity,
LcEmcCanonSubsetLinearMove *out)
{
set_linear_move(line, end, velocity, LC_EMCCANON_SUBSET_MOTION_FEED, out);
}
void lc_emccanon_subset_dwell(double seconds, LcEmcCanonSubsetDelay *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetDelay{};
out->seconds = seconds < 0.0 ? 0.0 : seconds;
}
void lc_emccanon_subset_set_motion_control_mode(int mode,
double tolerance,
LcEmcCanonSubsetTermCond *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetTermCond{};
out->mode = mode;
out->tolerance = tolerance < 0.0 ? 0.0 : tolerance;
switch (mode) {
case LC_EMCCANON_SUBSET_PATH_CONTINUOUS:
out->condition = LC_EMCCANON_SUBSET_TERM_BLEND;
break;
case LC_EMCCANON_SUBSET_PATH_EXACT_PATH:
out->condition = LC_EMCCANON_SUBSET_TERM_EXACT;
break;
case LC_EMCCANON_SUBSET_PATH_EXACT_STOP:
default:
out->condition = LC_EMCCANON_SUBSET_TERM_STOP;
break;
}
}
void lc_emccanon_subset_set_spindle_speed(int spindle,
double speed,
LcEmcCanonSubsetSpindleCommand *out)
{
set_spindle_command(
LC_EMCCANON_SUBSET_SPINDLE_SET_SPEED,
spindle,
speed < 0.0 ? 0.0 : speed,
0,
out);
}
void lc_emccanon_subset_start_spindle_clockwise(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out)
{
set_spindle_command(
LC_EMCCANON_SUBSET_SPINDLE_START_CW,
spindle,
0.0,
wait_for_at_speed ? 1 : 0,
out);
}
void lc_emccanon_subset_start_spindle_counterclockwise(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out)
{
set_spindle_command(
LC_EMCCANON_SUBSET_SPINDLE_START_CCW,
spindle,
0.0,
wait_for_at_speed ? 1 : 0,
out);
}
void lc_emccanon_subset_stop_spindle_turning(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out)
{
set_spindle_command(
LC_EMCCANON_SUBSET_SPINDLE_STOP,
spindle,
0.0,
wait_for_at_speed ? 1 : 0,
out);
}
void lc_emccanon_subset_select_tool(int tool,
LcEmcCanonSubsetToolCommand *out)
{
set_tool_command(LC_EMCCANON_SUBSET_TOOL_PREPARE, tool, out);
}
void lc_emccanon_subset_change_tool(LcEmcCanonSubsetToolCommand *out)
{
set_tool_command(LC_EMCCANON_SUBSET_TOOL_LOAD, 0, out);
}
void lc_emccanon_subset_change_tool_number(int tool,
LcEmcCanonSubsetToolCommand *out)
{
set_tool_command(LC_EMCCANON_SUBSET_TOOL_SET_NUMBER, tool, out);
}
void lc_emccanon_subset_reload_tooldata(LcEmcCanonSubsetToolCommand *out)
{
set_tool_command(LC_EMCCANON_SUBSET_TOOL_LOAD_TABLE, 0, out);
}
void lc_emccanon_subset_set_motion_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_SET_MOTION_BIT,
index,
1,
1,
0,
1.0,
out);
}
void lc_emccanon_subset_clear_motion_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_CLEAR_MOTION_BIT,
index,
0,
0,
0,
0.0,
out);
}
void lc_emccanon_subset_set_aux_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_SET_AUX_BIT,
index,
1,
1,
1,
1.0,
out);
}
void lc_emccanon_subset_clear_aux_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_CLEAR_AUX_BIT,
index,
0,
0,
1,
0.0,
out);
}
void lc_emccanon_subset_set_motion_output_value(int index,
double value,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_SET_MOTION_VALUE,
index,
0,
0,
0,
value,
out);
}
void lc_emccanon_subset_set_aux_output_value(int index,
double value,
LcEmcCanonSubsetOutputCommand *out)
{
set_output_command(
LC_EMCCANON_SUBSET_OUTPUT_SET_AUX_VALUE,
index,
0,
0,
1,
value,
out);
}
void lc_emccanon_subset_wait_input(int index,
int input_type,
int wait_type,
double timeout,
LcEmcCanonSubsetOutputCommand *out)
{
if (!out) {
return;
}
*out = LcEmcCanonSubsetOutputCommand{};
out->command = LC_EMCCANON_SUBSET_OUTPUT_WAIT;
out->index = index;
out->input_type = input_type;
out->wait_type = wait_type;
out->timeout = timeout < 0.0 ? 0.0 : timeout;
}
const char *lc_emccanon_subset_source_path(void)
{
return "src/emc/task/emccanon.cc";
}
const char *lc_emccanon_subset_anchor_list(void)
{
return "INIT_CANON,ON_RESET,FINISH,USE_LENGTH_UNITS,GET_EXTERNAL_LENGTH_UNITS,GET_EXTERNAL_ANGLE_UNITS,GET_EXTERNAL_POSITION,GET_EXTERNAL_POSITION_X,GET_EXTERNAL_POSITION_Y,GET_EXTERNAL_POSITION_Z,GET_EXTERNAL_POSITION_A,GET_EXTERNAL_POSITION_B,GET_EXTERNAL_POSITION_C,generate_fast_move,generate_move,STRAIGHT_TRAVERSE,STRAIGHT_FEED,DWELL,SET_MOTION_CONTROL_MODE,SET_SPINDLE_SPEED,START_SPINDLE_CLOCKWISE,START_SPINDLE_COUNTERCLOCKWISE,STOP_SPINDLE_TURNING,SELECT_TOOL,CHANGE_TOOL,CHANGE_TOOL_NUMBER,RELOAD_TOOLDATA,SET_MOTION_OUTPUT_BIT,CLEAR_MOTION_OUTPUT_BIT,SET_AUX_OUTPUT_BIT,CLEAR_AUX_OUTPUT_BIT,SET_MOTION_OUTPUT_VALUE,SET_AUX_OUTPUT_VALUE,WAIT";
}
const char *lc_emccanon_subset_init_finish_unit_anchor_list(void)
{
return "INIT_CANON,ON_RESET,FINISH,USE_LENGTH_UNITS,GET_EXTERNAL_LENGTH_UNITS,GET_EXTERNAL_ANGLE_UNITS,GET_EXTERNAL_POSITION,GET_EXTERNAL_POSITION_X,GET_EXTERNAL_POSITION_Y,GET_EXTERNAL_POSITION_Z,GET_EXTERNAL_POSITION_A,GET_EXTERNAL_POSITION_B,GET_EXTERNAL_POSITION_C";
}
const char *lc_emccanon_subset_straight_motion_anchor_list(void)
{
return "generate_fast_move,generate_move,STRAIGHT_TRAVERSE,STRAIGHT_FEED,EMC_TRAJ_LINEAR_MOVE,interp_list";
}
const char *lc_emccanon_subset_dwell_path_control_anchor_list(void)
{
return "DWELL,EMC_TRAJ_DELAY,SET_MOTION_CONTROL_MODE,EMC_TRAJ_SET_TERM_COND,interp_list";
}
const char *lc_emccanon_subset_spindle_tool_anchor_list(void)
{
return "SET_SPINDLE_SPEED,START_SPINDLE_CLOCKWISE,START_SPINDLE_COUNTERCLOCKWISE,STOP_SPINDLE_TURNING,EMC_SPINDLE_SPEED,EMC_SPINDLE_ON,EMC_SPINDLE_OFF,SELECT_TOOL,CHANGE_TOOL,CHANGE_TOOL_NUMBER,RELOAD_TOOLDATA,EMC_TOOL_PREPARE,EMC_TOOL_LOAD,EMC_TOOL_SET_NUMBER,EMC_TOOL_LOAD_TOOL_TABLE,interp_list";
}
const char *lc_emccanon_subset_motion_output_anchor_list(void)
{
return "SET_MOTION_OUTPUT_BIT,CLEAR_MOTION_OUTPUT_BIT,SET_AUX_OUTPUT_BIT,CLEAR_AUX_OUTPUT_BIT,SET_MOTION_OUTPUT_VALUE,SET_AUX_OUTPUT_VALUE,WAIT,EMC_MOTION_SET_DOUT,EMC_MOTION_SET_AOUT,EMC_AUX_INPUT_WAIT,interp_list";
}
} // extern "C"

View File

@@ -1,193 +0,0 @@
#ifndef LINUXCNC_EMCCANON_WASM_SUBSET_HH
#define LINUXCNC_EMCCANON_WASM_SUBSET_HH
#ifdef __cplusplus
extern "C" {
#endif
enum LcEmcCanonSubsetMotionType {
LC_EMCCANON_SUBSET_MOTION_TRAVERSE = 1,
LC_EMCCANON_SUBSET_MOTION_FEED = 2,
};
enum LcEmcCanonSubsetUnits {
LC_EMCCANON_SUBSET_UNITS_MM = 1,
LC_EMCCANON_SUBSET_UNITS_INCHES = 2,
LC_EMCCANON_SUBSET_UNITS_CM = 3,
};
enum LcEmcCanonSubsetPathMode {
LC_EMCCANON_SUBSET_PATH_CONTINUOUS = 1,
LC_EMCCANON_SUBSET_PATH_EXACT_PATH = 2,
LC_EMCCANON_SUBSET_PATH_EXACT_STOP = 3,
};
enum LcEmcCanonSubsetTermCondition {
LC_EMCCANON_SUBSET_TERM_BLEND = 1,
LC_EMCCANON_SUBSET_TERM_EXACT = 2,
LC_EMCCANON_SUBSET_TERM_STOP = 3,
};
enum LcEmcCanonSubsetSpindleCommandType {
LC_EMCCANON_SUBSET_SPINDLE_SET_SPEED = 1,
LC_EMCCANON_SUBSET_SPINDLE_START_CW = 2,
LC_EMCCANON_SUBSET_SPINDLE_START_CCW = 3,
LC_EMCCANON_SUBSET_SPINDLE_STOP = 4,
};
enum LcEmcCanonSubsetToolCommandType {
LC_EMCCANON_SUBSET_TOOL_PREPARE = 1,
LC_EMCCANON_SUBSET_TOOL_LOAD = 2,
LC_EMCCANON_SUBSET_TOOL_SET_NUMBER = 3,
LC_EMCCANON_SUBSET_TOOL_LOAD_TABLE = 4,
};
enum LcEmcCanonSubsetOutputCommandType {
LC_EMCCANON_SUBSET_OUTPUT_SET_MOTION_BIT = 1,
LC_EMCCANON_SUBSET_OUTPUT_CLEAR_MOTION_BIT = 2,
LC_EMCCANON_SUBSET_OUTPUT_SET_AUX_BIT = 3,
LC_EMCCANON_SUBSET_OUTPUT_CLEAR_AUX_BIT = 4,
LC_EMCCANON_SUBSET_OUTPUT_SET_MOTION_VALUE = 5,
LC_EMCCANON_SUBSET_OUTPUT_SET_AUX_VALUE = 6,
LC_EMCCANON_SUBSET_OUTPUT_WAIT = 7,
};
enum LcEmcCanonSubsetInputType {
LC_EMCCANON_SUBSET_INPUT_DIGITAL = 1,
LC_EMCCANON_SUBSET_INPUT_ANALOG = 2,
};
struct LcEmcCanonSubsetPose {
double x;
double y;
double z;
double a;
double b;
double c;
};
struct LcEmcCanonSubsetState {
int initialized;
int finish_count;
int reset_count;
int length_units;
double external_length_units;
double external_angle_units;
LcEmcCanonSubsetPose endpoint;
};
struct LcEmcCanonSubsetLinearMove {
int line;
int motion_type;
double velocity;
LcEmcCanonSubsetPose end;
};
struct LcEmcCanonSubsetDelay {
double seconds;
};
struct LcEmcCanonSubsetTermCond {
int mode;
int condition;
double tolerance;
};
struct LcEmcCanonSubsetSpindleCommand {
int command;
int spindle;
double speed;
int wait_for_at_speed;
};
struct LcEmcCanonSubsetToolCommand {
int command;
int tool;
};
struct LcEmcCanonSubsetOutputCommand {
int command;
int index;
int start;
int end;
int now;
double value;
int input_type;
int wait_type;
double timeout;
};
void lc_emccanon_subset_init(double external_length_units,
double external_angle_units,
LcEmcCanonSubsetState *state);
void lc_emccanon_subset_on_reset(LcEmcCanonSubsetState *state);
void lc_emccanon_subset_finish(LcEmcCanonSubsetState *state);
void lc_emccanon_subset_use_length_units(int units,
LcEmcCanonSubsetState *state);
void lc_emccanon_subset_update_endpoint(const LcEmcCanonSubsetPose *position,
LcEmcCanonSubsetState *state);
void lc_emccanon_subset_get_external_position(const LcEmcCanonSubsetState *state,
LcEmcCanonSubsetPose *out);
double lc_emccanon_subset_get_external_length_units(const LcEmcCanonSubsetState *state);
double lc_emccanon_subset_get_external_angle_units(const LcEmcCanonSubsetState *state);
int lc_emccanon_subset_get_external_length_unit_type(const LcEmcCanonSubsetState *state);
void lc_emccanon_subset_straight_traverse(int line, const LcEmcCanonSubsetPose *end,
double velocity,
LcEmcCanonSubsetLinearMove *out);
void lc_emccanon_subset_straight_feed(int line, const LcEmcCanonSubsetPose *end,
double velocity,
LcEmcCanonSubsetLinearMove *out);
void lc_emccanon_subset_dwell(double seconds, LcEmcCanonSubsetDelay *out);
void lc_emccanon_subset_set_motion_control_mode(int mode,
double tolerance,
LcEmcCanonSubsetTermCond *out);
void lc_emccanon_subset_set_spindle_speed(int spindle,
double speed,
LcEmcCanonSubsetSpindleCommand *out);
void lc_emccanon_subset_start_spindle_clockwise(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out);
void lc_emccanon_subset_start_spindle_counterclockwise(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out);
void lc_emccanon_subset_stop_spindle_turning(int spindle,
int wait_for_at_speed,
LcEmcCanonSubsetSpindleCommand *out);
void lc_emccanon_subset_select_tool(int tool,
LcEmcCanonSubsetToolCommand *out);
void lc_emccanon_subset_change_tool(LcEmcCanonSubsetToolCommand *out);
void lc_emccanon_subset_change_tool_number(int tool,
LcEmcCanonSubsetToolCommand *out);
void lc_emccanon_subset_reload_tooldata(LcEmcCanonSubsetToolCommand *out);
void lc_emccanon_subset_set_motion_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_clear_motion_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_set_aux_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_clear_aux_output_bit(int index,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_set_motion_output_value(int index,
double value,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_set_aux_output_value(int index,
double value,
LcEmcCanonSubsetOutputCommand *out);
void lc_emccanon_subset_wait_input(int index,
int input_type,
int wait_type,
double timeout,
LcEmcCanonSubsetOutputCommand *out);
const char *lc_emccanon_subset_source_path(void);
const char *lc_emccanon_subset_anchor_list(void);
const char *lc_emccanon_subset_init_finish_unit_anchor_list(void);
const char *lc_emccanon_subset_straight_motion_anchor_list(void);
const char *lc_emccanon_subset_dwell_path_control_anchor_list(void);
const char *lc_emccanon_subset_spindle_tool_anchor_list(void);
const char *lc_emccanon_subset_motion_output_anchor_list(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,377 +0,0 @@
#include "emctask_wasm_subset.hh"
#include <cstring>
/*
* WASM task subset derived from LinuxCNC src/emc/task/emctask.cc.
*
* Upstream anchors:
* - emcTaskAbort(): clears interpreter/task execution state and resynchronizes the plan.
* - emcTaskSetMode(): switches manual/mdi/auto task mode and synchronizes trajectory mode.
* - emcTaskSetState(): switches estop/off/on state and issues motion enable/disable/abort edges.
* - determineMode(): traj mode + mdiOrAuto -> task mode.
* - determineState(): traj enabled + io estop -> task state.
* - emcTaskUpdate(): writes task mode/state and motionLine from motion id.
* - emcTaskPlanSetWait()/IsWait()/ClearWait(): own the interpreter wait flag.
* - emcTaskPlanSynch()/Open()/Close()/Reset(): synchronize, open, close, and reset the interpreter plan.
* - emcTaskPlanRead()/Execute()/Line()/Level()/Command(): read interpreter lines,
* expose line/command metadata, and append executed work to interp_list.
*
* This file is intentionally narrow. Full emctask.cc also owns interpreter,
* NML, dynamic loading, IO, and native process edges that are not part of this
* standalone WASM subset yet.
*/
namespace {
int determine_mode(int traj_mode, int mdi_or_auto)
{
if (traj_mode == LC_EMC_TASK_SUBSET_TRAJ_FREE) {
return LC_EMC_TASK_SUBSET_MODE_MANUAL;
}
if (traj_mode == LC_EMC_TASK_SUBSET_TRAJ_TELEOP) {
return LC_EMC_TASK_SUBSET_MODE_MANUAL;
}
return mdi_or_auto;
}
int determine_state(int traj_enabled, int io_estop)
{
if (io_estop) {
return LC_EMC_TASK_SUBSET_STATE_ESTOP;
}
if (!traj_enabled) {
return LC_EMC_TASK_SUBSET_STATE_ESTOP_RESET;
}
return LC_EMC_TASK_SUBSET_STATE_ON;
}
void clear_command_result(LcEmcTaskSubsetCommandResult *result)
{
if (!result) {
return;
}
*result = LcEmcTaskSubsetCommandResult{};
}
void clear_plan_result(LcEmcTaskSubsetPlanResult *result)
{
if (!result) {
return;
}
*result = LcEmcTaskSubsetPlanResult{};
}
void clear_plan_io_result(LcEmcTaskSubsetPlanIoResult *result)
{
if (!result) {
return;
}
*result = LcEmcTaskSubsetPlanIoResult{};
}
void copy_plan_state(const LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
if (!state || !result) {
return;
}
result->wait_flag = state->wait_flag;
result->taskplanopen = state->taskplanopen;
result->line = state->read_line;
result->level = state->level;
}
} // namespace
extern "C" {
void lc_emctask_subset_update(const LcEmcTaskSubsetUpdateInput *input,
LcEmcTaskSubsetUpdateResult *result)
{
if (!input || !result) {
return;
}
result->mode = determine_mode(input->traj_mode, input->mdi_or_auto);
result->state = determine_state(input->traj_enabled, input->io_estop);
result->should_abort_on_state_drop =
input->old_task_state == LC_EMC_TASK_SUBSET_STATE_ON &&
result->state != LC_EMC_TASK_SUBSET_STATE_ON;
result->motion_line = input->motion_id > 0 ? input->motion_id : 0;
}
void lc_emctask_subset_abort(LcEmcTaskSubsetCommandResult *result)
{
clear_command_result(result);
if (!result) {
return;
}
result->should_clear_interpreter = 1;
result->should_abort_motion = 1;
result->should_plan_synch = 1;
}
void lc_emctask_subset_set_mode(int mode,
int all_homed,
int jogging_active,
LcEmcTaskSubsetCommandResult *result)
{
clear_command_result(result);
if (!result) {
return;
}
if (jogging_active) {
result->mode = mode;
return;
}
switch (mode) {
case LC_EMC_TASK_SUBSET_MODE_MANUAL:
result->mode = LC_EMC_TASK_SUBSET_MODE_MANUAL;
result->traj_mode = all_homed ? LC_EMC_TASK_SUBSET_TRAJ_TELEOP : LC_EMC_TASK_SUBSET_TRAJ_FREE;
result->should_clear_interpreter = 1;
break;
case LC_EMC_TASK_SUBSET_MODE_MDI:
result->mode = LC_EMC_TASK_SUBSET_MODE_MDI;
result->traj_mode = LC_EMC_TASK_SUBSET_TRAJ_COORD;
result->should_clear_interpreter = 1;
result->should_plan_synch = 1;
break;
case LC_EMC_TASK_SUBSET_MODE_AUTO:
result->mode = LC_EMC_TASK_SUBSET_MODE_AUTO;
result->traj_mode = LC_EMC_TASK_SUBSET_TRAJ_COORD;
result->should_clear_interpreter = 1;
result->should_plan_synch = 1;
break;
default:
result->retval = -1;
break;
}
}
void lc_emctask_subset_set_state(int state,
int old_state,
LcEmcTaskSubsetCommandResult *result)
{
(void)old_state;
clear_command_result(result);
if (!result) {
return;
}
result->state = state;
switch (state) {
case LC_EMC_TASK_SUBSET_STATE_OFF:
result->should_clear_interpreter = 1;
result->should_abort_motion = 1;
result->should_traj_disable = 1;
result->should_reset_homing = 1;
result->should_unhome = 1;
result->should_plan_synch = 1;
break;
case LC_EMC_TASK_SUBSET_STATE_ON:
result->should_traj_enable = 1;
break;
case LC_EMC_TASK_SUBSET_STATE_ESTOP_RESET:
result->should_clear_interpreter = 1;
result->should_plan_synch = 1;
break;
case LC_EMC_TASK_SUBSET_STATE_ESTOP:
result->should_clear_interpreter = 1;
result->should_abort_motion = 1;
result->should_traj_disable = 1;
result->should_reset_homing = 1;
result->should_unhome = 1;
result->should_plan_synch = 1;
break;
default:
result->retval = -1;
break;
}
}
void lc_emctask_subset_plan_set_wait(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result) {
return;
}
state->wait_flag = 1;
copy_plan_state(state, result);
}
int lc_emctask_subset_plan_is_wait(const LcEmcTaskSubsetPlanState *state)
{
return state ? state->wait_flag : 0;
}
void lc_emctask_subset_plan_clear_wait(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result) {
return;
}
state->wait_flag = 0;
copy_plan_state(state, result);
}
void lc_emctask_subset_plan_synch(const LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result) {
return;
}
result->should_synch = 1;
copy_plan_state(state, result);
}
void lc_emctask_subset_plan_open(const char *file,
int staged_file_available,
LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result || !file || !staged_file_available) {
if (result) {
result->retval = -1;
}
return;
}
state->motion_line = 0;
state->current_line = 0;
state->read_line = 0;
state->taskplanopen = 1;
result->should_reset_lines = 1;
copy_plan_state(state, result);
}
void lc_emctask_subset_plan_close(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result) {
return;
}
state->taskplanopen = 0;
result->should_close = 1;
copy_plan_state(state, result);
}
void lc_emctask_subset_plan_reset(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result)
{
clear_plan_result(result);
if (!state || !result) {
return;
}
state->wait_flag = 0;
state->read_line = 0;
state->current_line = 0;
state->motion_line = 0;
result->should_reset = 1;
result->should_reset_lines = 1;
copy_plan_state(state, result);
}
void lc_emctask_subset_plan_read(const LcEmcTaskSubsetPlanState *state,
int next_line,
int line_count,
LcEmcTaskSubsetPlanIoResult *result)
{
clear_plan_io_result(result);
if (!state || !result || !state->taskplanopen) {
if (result) {
result->retval = -1;
}
return;
}
if (state->wait_flag) {
result->retval = 2;
result->should_set_wait = 1;
result->line = state->read_line;
result->level = state->level;
return;
}
if (next_line < 0 || next_line >= line_count) {
result->retval = 1;
result->should_set_wait = 1;
result->line = 0;
result->level = state->level;
return;
}
result->retval = 0;
result->line = next_line + 1;
result->level = state->level;
result->should_execute = 1;
}
void lc_emctask_subset_plan_execute(const char *command,
int mdi,
int inpos,
int line_number,
LcEmcTaskSubsetPlanIoResult *result)
{
clear_plan_io_result(result);
if (!result || !command) {
if (result) {
result->retval = -1;
}
return;
}
if (mdi && command[0] != '\0' && inpos) {
result->should_synch_before_execute = 1;
}
result->retval = 0;
result->line = line_number > 0 ? line_number : 0;
result->level = 0;
result->should_append_to_interp_list = command[0] != '\0';
result->should_finish = mdi ? 1 : 0;
}
int lc_emctask_subset_plan_line(const LcEmcTaskSubsetPlanState *state)
{
return state ? state->read_line : 0;
}
int lc_emctask_subset_plan_level(const LcEmcTaskSubsetPlanState *state)
{
return state ? state->level : 0;
}
int lc_emctask_subset_plan_command(const char *command, char *out, int out_len)
{
if (!command || !out || out_len <= 0) {
return -1;
}
std::strncpy(out, command, static_cast<std::size_t>(out_len - 1));
out[out_len - 1] = '\0';
return 0;
}
const char *lc_emctask_subset_source_path(void)
{
return "src/emc/task/emctask.cc";
}
const char *lc_emctask_subset_anchor_list(void)
{
return "emcTaskAbort,emcTaskSetMode,emcTaskSetState,determineMode,determineState,emcTaskUpdate,emcTaskPlanSetWait,emcTaskPlanIsWait,emcTaskPlanClearWait,emcTaskPlanSynch,emcTaskPlanOpen,emcTaskPlanClose,emcTaskPlanReset,emcTaskPlanRead,emcTaskPlanExecute,emcTaskPlanLine,emcTaskPlanLevel,emcTaskPlanCommand";
}
const char *lc_emctask_subset_state_mode_anchor_list(void)
{
return "emcTaskAbort,emcTaskSetMode,emcTaskSetState,emcTaskPlanSynch,emcTaskPlanClose,emcTaskPlanReset";
}
const char *lc_emctask_subset_plan_anchor_list(void)
{
return "emcTaskPlanSetWait,emcTaskPlanIsWait,emcTaskPlanClearWait,emcTaskPlanSynch,emcTaskPlanOpen,emcTaskPlanClose,emcTaskPlanReset";
}
const char *lc_emctask_subset_plan_read_execute_anchor_list(void)
{
return "emcTaskPlanRead,emcTaskPlanExecute,emcTaskPlanLine,emcTaskPlanLevel,emcTaskPlanCommand,interp_list";
}
} // extern "C"

View File

@@ -1,136 +0,0 @@
#ifndef LINUXCNC_EMCTASK_WASM_SUBSET_HH
#define LINUXCNC_EMCTASK_WASM_SUBSET_HH
#ifdef __cplusplus
extern "C" {
#endif
enum LcEmcTaskSubsetMode {
LC_EMC_TASK_SUBSET_MODE_MANUAL = 1,
LC_EMC_TASK_SUBSET_MODE_AUTO = 2,
LC_EMC_TASK_SUBSET_MODE_MDI = 3,
};
enum LcEmcTaskSubsetState {
LC_EMC_TASK_SUBSET_STATE_ESTOP = 1,
LC_EMC_TASK_SUBSET_STATE_ESTOP_RESET = 2,
LC_EMC_TASK_SUBSET_STATE_ON = 3,
LC_EMC_TASK_SUBSET_STATE_OFF = 4,
};
enum LcEmcTaskSubsetTrajMode {
LC_EMC_TASK_SUBSET_TRAJ_FREE = 1,
LC_EMC_TASK_SUBSET_TRAJ_TELEOP = 2,
LC_EMC_TASK_SUBSET_TRAJ_COORD = 3,
};
struct LcEmcTaskSubsetUpdateInput {
int traj_mode;
int mdi_or_auto;
int traj_enabled;
int io_estop;
int old_task_state;
int motion_id;
};
struct LcEmcTaskSubsetUpdateResult {
int mode;
int state;
int should_abort_on_state_drop;
int motion_line;
};
struct LcEmcTaskSubsetCommandResult {
int retval;
int mode;
int state;
int traj_mode;
int should_clear_interpreter;
int should_abort_motion;
int should_traj_enable;
int should_traj_disable;
int should_reset_homing;
int should_unhome;
int should_plan_synch;
};
struct LcEmcTaskSubsetPlanState {
int wait_flag;
int taskplanopen;
int motion_line;
int current_line;
int read_line;
int level;
};
struct LcEmcTaskSubsetPlanResult {
int retval;
int wait_flag;
int taskplanopen;
int should_reset_lines;
int should_synch;
int should_close;
int should_reset;
int line;
int level;
};
struct LcEmcTaskSubsetPlanIoResult {
int retval;
int line;
int level;
int should_execute;
int should_set_wait;
int should_synch_before_execute;
int should_finish;
int should_append_to_interp_list;
};
void lc_emctask_subset_update(const LcEmcTaskSubsetUpdateInput *input,
LcEmcTaskSubsetUpdateResult *result);
void lc_emctask_subset_abort(LcEmcTaskSubsetCommandResult *result);
void lc_emctask_subset_set_mode(int mode,
int all_homed,
int jogging_active,
LcEmcTaskSubsetCommandResult *result);
void lc_emctask_subset_set_state(int state,
int old_state,
LcEmcTaskSubsetCommandResult *result);
void lc_emctask_subset_plan_set_wait(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
int lc_emctask_subset_plan_is_wait(const LcEmcTaskSubsetPlanState *state);
void lc_emctask_subset_plan_clear_wait(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
void lc_emctask_subset_plan_synch(const LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
void lc_emctask_subset_plan_open(const char *file,
int staged_file_available,
LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
void lc_emctask_subset_plan_close(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
void lc_emctask_subset_plan_reset(LcEmcTaskSubsetPlanState *state,
LcEmcTaskSubsetPlanResult *result);
void lc_emctask_subset_plan_read(const LcEmcTaskSubsetPlanState *state,
int next_line,
int line_count,
LcEmcTaskSubsetPlanIoResult *result);
void lc_emctask_subset_plan_execute(const char *command,
int mdi,
int inpos,
int line_number,
LcEmcTaskSubsetPlanIoResult *result);
int lc_emctask_subset_plan_line(const LcEmcTaskSubsetPlanState *state);
int lc_emctask_subset_plan_level(const LcEmcTaskSubsetPlanState *state);
int lc_emctask_subset_plan_command(const char *command, char *out, int out_len);
const char *lc_emctask_subset_source_path(void);
const char *lc_emctask_subset_anchor_list(void);
const char *lc_emctask_subset_state_mode_anchor_list(void);
const char *lc_emctask_subset_plan_anchor_list(void);
const char *lc_emctask_subset_plan_read_execute_anchor_list(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,241 +0,0 @@
#include "taskintf_wasm_subset.hh"
/*
* WASM task-to-motion subset derived from LinuxCNC src/emc/task/taskintf.cc.
*
* Upstream anchors:
* - emcMotionInit(): initialize traj/joint/axis/spindle motion edge.
* - emcMotionUpdate(): read usrmot status/config/internal/error into EMC_MOTION_STAT.
* - emcMotionAbort(): jog abort + traj abort through the motion interface.
* - emcTrajSetMotionId/Enable/Disable/Abort/Pause/Step/Resume(): set EMCMOT_* command and write it.
* - emcTrajLinearMove(): populate line motion command fields.
* - emcJogIncr(): populate jog increment command fields.
* - emcJointHome()/emcJointUnhome(): populate joint home command fields.
* - emcMotionSetAout(): populate analog-output motion command fields.
*
* The full upstream file owns usrmot, NML, INI config, and native motion
* process edges. This subset stops at the command envelope boundary so the
* standalone WASM runtime can forward through lcmot_* without owning LinuxCNC
* motion semantics in the task layer.
*/
namespace {
void clear_command(LcTaskIntfSubsetMotionCommand *out)
{
if (!out) {
return;
}
*out = LcTaskIntfSubsetMotionCommand{};
}
void set_simple(int command, LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = command;
}
} // namespace
extern "C" {
void lc_taskintf_subset_traj_abort(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_ABORT, out);
}
void lc_taskintf_subset_traj_enable(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_ENABLE, out);
}
void lc_taskintf_subset_traj_disable(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_DISABLE, out);
}
void lc_taskintf_subset_traj_set_motion_id(int id, LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_TRAJ_SET_MOTION_ID;
out->motion_id = id;
}
void lc_taskintf_subset_traj_pause(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_PAUSE, out);
}
void lc_taskintf_subset_traj_step(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_STEP, out);
}
void lc_taskintf_subset_traj_resume(LcTaskIntfSubsetMotionCommand *out)
{
set_simple(LC_TASKINTF_SUBSET_COMMAND_TRAJ_RESUME, out);
}
void lc_taskintf_subset_joint_home(int joint, LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_JOINT_HOME;
out->joint = joint;
}
void lc_taskintf_subset_joint_unhome(int joint, LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_JOINT_UNHOME;
out->joint = joint;
}
void lc_taskintf_subset_jog_incr(int axis, double distance, double velocity,
LcTaskIntfSubsetMotionCommand *out)
{
lc_taskintf_subset_jog_incr_ex(axis, distance, velocity, 0, 0, out);
}
void lc_taskintf_subset_jog_incr_ex(int nr, double distance, double velocity,
int joint_jog_mode, int motion_id,
LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_JOG_INCR;
out->axis = joint_jog_mode ? -1 : nr;
out->joint = joint_jog_mode ? nr : -1;
out->distance = distance;
out->velocity = velocity;
out->motion_id = motion_id;
}
void lc_taskintf_subset_set_aout(int index, double start, double end, int now,
LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_SET_AOUT;
out->aout_index = index;
out->aout_now = now;
out->aout_start = start;
out->aout_end = end;
}
void lc_taskintf_subset_linear_move(int line, const LcTaskIntfSubsetPose *pose,
double velocity, int motion_type,
LcTaskIntfSubsetMotionCommand *out)
{
lc_taskintf_subset_linear_move_ex(
line,
pose,
velocity,
motion_type,
velocity,
0.0,
0.0,
line,
out);
}
void lc_taskintf_subset_linear_move_ex(int line, const LcTaskIntfSubsetPose *pose,
double velocity, int motion_type,
double ini_maxvel, double acceleration,
double ini_maxjerk, int motion_id,
LcTaskIntfSubsetMotionCommand *out)
{
clear_command(out);
if (!out) {
return;
}
out->command = LC_TASKINTF_SUBSET_COMMAND_TRAJ_LINEAR_MOVE;
out->line = line;
out->motion_type = motion_type;
out->motion_id = motion_id;
out->velocity = velocity;
out->ini_maxvel = ini_maxvel;
out->acceleration = acceleration;
out->ini_maxjerk = ini_maxjerk;
if (pose) {
out->pose = *pose;
}
}
int lc_taskintf_subset_motion_init(const char *ini_path, const char *ini_text)
{
return lcmot_init_from_ini(ini_path, ini_text);
}
int lc_taskintf_subset_motion_update(LcmotStatusSnapshot *status,
LcmotConfigSnapshot *config,
char *error_text,
int error_text_len)
{
if (!status || !config) {
return -1;
}
if (lcmot_read_status_snapshot(status) != 0) {
return -1;
}
if (lcmot_read_config_snapshot(config) != 0) {
return -1;
}
if (error_text && error_text_len > 0) {
error_text[0] = '\0';
(void)lcmot_read_error_message(error_text, error_text_len);
}
return 0;
}
void lc_taskintf_subset_motion_abort(LcTaskIntfSubsetMotionCommand *out)
{
lc_taskintf_subset_traj_abort(out);
}
const char *lc_taskintf_subset_source_path(void)
{
return "src/emc/task/taskintf.cc";
}
const char *lc_taskintf_subset_anchor_list(void)
{
return "emcTrajSetMotionId,emcTrajEnable,emcTrajDisable,emcTrajAbort,emcTrajPause,emcTrajStep,emcTrajResume,emcTrajLinearMove,emcJogIncr,emcJointHome,emcJointUnhome,emcMotionSetAout";
}
const char *lc_taskintf_subset_motion_bridge_anchor_list(void)
{
return "emcMotionInit,emcMotionUpdate,emcMotionAbort,usrmotReadEmcmotStatus,usrmotReadEmcmotConfig,usrmotReadEmcmotError";
}
const char *lc_taskintf_subset_traj_control_anchor_list(void)
{
return "emcTrajSetMotionId,emcTrajEnable,emcTrajDisable,emcTrajAbort,emcTrajPause,emcTrajStep,emcTrajResume";
}
const char *lc_taskintf_subset_linear_move_anchor_list(void)
{
return "emcTrajLinearMove,EMCMOT_SET_LINE,usrmotWriteEmcmotCommand";
}
const char *lc_taskintf_subset_jog_home_switchkins_anchor_list(void)
{
return "emcJogIncr,emcJointHome,emcJointUnhome,emcMotionSetAout,EMCMOT_JOG_INCR,EMCMOT_JOINT_HOME,EMCMOT_JOINT_UNHOME,EMCMOT_SET_AOUT,usrmotWriteEmcmotCommand";
}
} // extern "C"

View File

@@ -1,95 +0,0 @@
#ifndef LINUXCNC_TASKINTF_WASM_SUBSET_HH
#define LINUXCNC_TASKINTF_WASM_SUBSET_HH
#include "linuxcnc_motion_runtime.h"
#ifdef __cplusplus
extern "C" {
#endif
enum LcTaskIntfSubsetCommand {
LC_TASKINTF_SUBSET_COMMAND_NONE = 0,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_ABORT = 1,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_PAUSE = 2,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_STEP = 3,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_RESUME = 4,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_LINEAR_MOVE = 5,
LC_TASKINTF_SUBSET_COMMAND_JOG_INCR = 6,
LC_TASKINTF_SUBSET_COMMAND_JOINT_HOME = 7,
LC_TASKINTF_SUBSET_COMMAND_SET_AOUT = 8,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_ENABLE = 9,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_DISABLE = 10,
LC_TASKINTF_SUBSET_COMMAND_TRAJ_SET_MOTION_ID = 11,
LC_TASKINTF_SUBSET_COMMAND_JOINT_UNHOME = 12,
};
struct LcTaskIntfSubsetPose {
double x;
double y;
double z;
double a;
double b;
double c;
};
struct LcTaskIntfSubsetMotionCommand {
int command;
int line;
int axis;
int joint;
int motion_type;
int aout_index;
int aout_now;
int motion_id;
double velocity;
double ini_maxvel;
double acceleration;
double ini_maxjerk;
double distance;
double aout_start;
double aout_end;
LcTaskIntfSubsetPose pose;
};
void lc_taskintf_subset_traj_abort(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_enable(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_disable(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_set_motion_id(int id, LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_pause(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_step(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_traj_resume(LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_joint_home(int joint, LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_joint_unhome(int joint, LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_jog_incr(int axis, double distance, double velocity,
LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_jog_incr_ex(int nr, double distance, double velocity,
int joint_jog_mode, int motion_id,
LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_set_aout(int index, double start, double end, int now,
LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_linear_move(int line, const LcTaskIntfSubsetPose *pose,
double velocity, int motion_type,
LcTaskIntfSubsetMotionCommand *out);
void lc_taskintf_subset_linear_move_ex(int line, const LcTaskIntfSubsetPose *pose,
double velocity, int motion_type,
double ini_maxvel, double acceleration,
double ini_maxjerk, int motion_id,
LcTaskIntfSubsetMotionCommand *out);
int lc_taskintf_subset_motion_init(const char *ini_path, const char *ini_text);
int lc_taskintf_subset_motion_update(LcmotStatusSnapshot *status,
LcmotConfigSnapshot *config,
char *error_text,
int error_text_len);
void lc_taskintf_subset_motion_abort(LcTaskIntfSubsetMotionCommand *out);
const char *lc_taskintf_subset_source_path(void);
const char *lc_taskintf_subset_anchor_list(void);
const char *lc_taskintf_subset_motion_bridge_anchor_list(void);
const char *lc_taskintf_subset_traj_control_anchor_list(void);
const char *lc_taskintf_subset_linear_move_anchor_list(void);
const char *lc_taskintf_subset_jog_home_switchkins_anchor_list(void);
#ifdef __cplusplus
}
#endif
#endif