Unblock native XYZAC TP oracle

This commit is contained in:
2026-08-31 20:08:00 +08:00
parent 18436149a2
commit 6015293ee9
17 changed files with 49339 additions and 61 deletions

View File

@@ -0,0 +1,26 @@
diff --git a/src/emc/task/emctaskmain.cc b/src/emc/task/emctaskmain.cc
--- a/src/emc/task/emctaskmain.cc
+++ b/src/emc/task/emctaskmain.cc
@@ -3490,4 +3490,9 @@ int main(int argc, char *argv[])
// since emcStatus was passed to the WM init functions, it
// will be updated in the _update() functions above. There's
// no need to call the individual functions on all WM items.
+ // EMC_TASK_STAT_MSG::heartbeat is the native task-cycle oracle used by
+ // external clients. Keep it monotonic and publish it with this cycle's
+ // status image so a reader can identify every task tick without relying on
+ // wall-clock sampling.
+ emcStatus->task.heartbeat++;
emcStatusBuffer->write(emcStatus);
diff --git a/src/emc/usr_intf/axis/extensions/emcmodule.cc b/src/emc/usr_intf/axis/extensions/emcmodule.cc
--- a/src/emc/usr_intf/axis/extensions/emcmodule.cc
+++ b/src/emc/usr_intf/axis/extensions/emcmodule.cc
@@ -409,4 +409,7 @@ static PyMemberDef Stat_members[] = {
{(char*)"echo_serial_number", T_INT, O(echo_serial_number), READONLY},
{(char*)"echo_serial_number", T_INT, O(echo_serial_number), READONLY},
{(char*)"state", T_INT, O(status), READONLY},
+ {(char*)"task_heartbeat", T_UINT, O(task.heartbeat), READONLY,
+ "Native EMC task-loop heartbeat. This counter is incremented by the "
+ "LinuxCNC task thread and is suitable for identifying native status ticks."},
// task