diff --git a/src/emc/task/emctaskmain.cc b/src/emc/task/emctaskmain.cc index febd808abc6..9c3d432315e 100644 --- a/src/emc/task/emctaskmain.cc +++ b/src/emc/task/emctaskmain.cc @@ -535,6 +535,7 @@ void readahead_reading(void) emcStatus->task.execState == EMC_TASK_EXEC::DONE) { emcTaskPlanClearWait(); + goto interpret_again; } } else { readRetval = emcTaskPlanRead(); @@ -2876,6 +2877,7 @@ static int emcTaskExecute(void) emcStatus->motion.traj.switchkins_changed = false; emcTaskPlanSynch(); emcStatus->task.execState = EMC_TASK_EXEC::DONE; + emcTaskEager = 1; } break; } diff --git a/tests/kins-switch/test-ui.py b/tests/kins-switch/test-ui.py index 19a85744a15..b5c1d1363d7 100755 --- a/tests/kins-switch/test-ui.py +++ b/tests/kins-switch/test-ui.py @@ -70,7 +70,6 @@ def mdi(cmd): c.auto(linuxcnc.AUTO_RUN, 0) said = [] -seen = [kins_type()] at_switch = None strayed = [0.0] * JOINTS w_reached = 0.0 @@ -79,10 +78,8 @@ def mdi(cmd): s.poll() now = joints() k = kins_type() - if k != seen[-1]: - seen.append(k) - if k == 1 and at_switch is None: - at_switch = now + if k == 1 and at_switch is None: + at_switch = now if k == 1 and at_switch is not None: for j in CARRIED: strayed[j] = max(strayed[j], abs(now[j] - at_switch[j])) @@ -112,19 +109,18 @@ def mdi(cmd): print("W ran to %.4f, the other joints held to %.2e" % (w_reached, max(strayed[j] for j in CARRIED))) -# the abort routine's G13.1 fires at estop reset, so the machine may stand -# in identity (1) already when the program starts; either way the program -# itself walks 0, 1, 0, 1 +# the program walks 0, 1, 0, 1 and the line after each selection reports +# what the interpreter holds and what motion runs; the pin read there is +# the check that the selection went through before the next line, which +# no sampler on this side could make (a selection undone on the next +# line holds for one servo period) want = [0, 1, 0, 1] -if seen[-4:] != want: - error("motion.kins-type went %s, not ...%s" % (seen, want)) - reported = [m[1].strip() for m in said if m[1].strip().startswith("KINSTYPE=")] -want_reported = ["KINSTYPE=%d.000000" % k for k in want] +want_reported = ["KINSTYPE=%d.000000 PIN=%d.000000" % (k, k) for k in want] if reported != want_reported: - error("#<_kins_type> reported %s" % (reported,)) + error("the lines after the selections reported %s" % (reported,)) else: - print("#<_kins_type> reported %s" % " ".join(reported)) + print("the lines after the selections reported %s" % " | ".join(reported)) # ---- a negative kinematics number is refused ----------------------------- diff --git a/tests/kins-switch/test.ngc b/tests/kins-switch/test.ngc index 96c03dfef17..6ff7f64423d 100644 --- a/tests/kins-switch/test.ngc +++ b/tests/kins-switch/test.ngc @@ -1,12 +1,14 @@ ; never assume the startup kinematics: the abort routine's G13.1 leaves -; the machine in identity +; the machine in identity. The line after each selection reads the +; kinematics motion runs, motion.kins-type, next to the interpreter's: +; a selection is a queue buster, so the next line sees it switched g12.1 p0 ; a pose the two kinematics disagree about: the tilt folds the pivot into ; the joints that carry X, Y and Z, so the joints are not the axis values g0 x10 y10 z-5 b-22.5 c45 -(debug, KINSTYPE=#<_kins_type>) +(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>) g12.1 p1 -(debug, KINSTYPE=#<_kins_type>) +(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>) ; identity kinematics: W is joint 5 alone, so nothing else may move g1 w10 f1000 ; the dwell ends the stroke on its endpoint instead of blending past it @@ -14,9 +16,9 @@ g4 p0.1 g0 w0 ; numeric selection puts back the kinematics the program started in g12.1 p0 -(debug, KINSTYPE=#<_kins_type>) +(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>) ; and G13.1 cancels to identity, which on this module is kinematics 1: ; it is the flag that decides, not the number g13.1 -(debug, KINSTYPE=#<_kins_type>) +(debug, KINSTYPE=#<_kins_type> PIN=#<_hal[motion.kins-type]>) m2