Skip to content

Commit 9ef0943

Browse files
author
Chad Woitas
committed
Add Stepping Status to emcmodule
1 parent 7a6b06a commit 9ef0943

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

docs/src/config/python-interface.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ see <<python:reading-ini-values,ReadingINI file values>> for an example.
278278
*paused*:: '(returns boolean)' -
279279
`motion paused` flag.
280280

281+
*stepping*:: '(returns boolean)' -
282+
`motion stepping` flag.
283+
281284
*pocket_prepped*:: '(returns integer)' -
282285
A Tx command completed, and this pocket is prepared. -1 if no
283286
prepared pocket.

src/emc/nml_intf/emc_nml.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ class EMC_TRAJ_STAT:public EMC_TRAJ_STAT_MSG {
984984
bool queueFull; // non-zero means can't accept another motion
985985
int id; // id of the currently executing motion
986986
bool paused; // non-zero means motion paused
987+
bool stepping; // non-zero means motion stepping single block
987988
double scale; // velocity scale factor
988989
double rapid_scale; // rapid scale factor
989990
//double spindle_scale; // moved to EMC_SPINDLE_STAT

src/emc/task/emctaskmain.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ static int emcTaskPlan(void)
11741174
break;
11751175

11761176
case EMC_TASK_PLAN_STEP_TYPE:
1177+
emcStatus->motion.traj.stepping = 1;
11771178
stepping = 1; // set stepping mode in case it's not
11781179
steppingWait = 0; // clear the wait
11791180
break;
@@ -1249,6 +1250,7 @@ static int emcTaskPlan(void)
12491250
break;
12501251

12511252
case EMC_TASK_PLAN_STEP_TYPE:
1253+
emcStatus->motion.traj.stepping = 1;
12521254
stepping = 1;
12531255
steppingWait = 0;
12541256
if (emcStatus->motion.traj.paused &&
@@ -1324,6 +1326,7 @@ static int emcTaskPlan(void)
13241326
break;
13251327

13261328
case EMC_TASK_PLAN_STEP_TYPE:
1329+
emcStatus->motion.traj.stepping = 1;
13271330
stepping = 1; // set stepping mode in case it's not
13281331
steppingWait = 0; // clear the wait
13291332
break;
@@ -2123,6 +2126,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
21232126
// clear out the interpreter state
21242127
emcStatus->task.interpState = EMC_TASK_INTERP::IDLE;
21252128
emcStatus->task.execState = EMC_TASK_EXEC::DONE;
2129+
emcStatus->motion.traj.stepping = 0;
21262130
stepping = 0;
21272131
steppingWait = 0;
21282132

@@ -2217,6 +2221,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
22172221
break;
22182222

22192223
case EMC_TASK_PLAN_EXECUTE_TYPE:
2224+
emcStatus->motion.traj.stepping = 0;
22202225
stepping = 0;
22212226
steppingWait = 0;
22222227
execute_msg = (EMC_TASK_PLAN_EXECUTE *) cmd;
@@ -2312,6 +2317,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
23122317
retval = -1;
23132318
break;
23142319
}
2320+
emcStatus->motion.traj.stepping = 0;
23152321
stepping = 0;
23162322
steppingWait = 0;
23172323
if (!taskplanopen && emcStatus->task.file[0] != 0) {
@@ -2360,6 +2366,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
23602366
emcTrajResume();
23612367
emcStatus->task.interpState = interpResumeState;
23622368
emcStatus->task.task_paused = 0;
2369+
emcStatus->motion.traj.stepping = 0;
23632370
stepping = 0;
23642371
steppingWait = 0;
23652372
retval = 0;
@@ -2590,6 +2597,7 @@ static int emcTaskExecute(void)
25902597
// clear out the interpreter state
25912598
emcStatus->task.interpState = EMC_TASK_INTERP::IDLE;
25922599
emcStatus->task.execState = EMC_TASK_EXEC::DONE;
2600+
emcStatus->motion.traj.stepping = 0;
25932601
stepping = 0;
25942602
steppingWait = 0;
25952603

@@ -3497,6 +3505,7 @@ int main(int argc, char *argv[])
34973505
// clear out the interpreter state
34983506
emcStatus->task.interpState = EMC_TASK_INTERP::IDLE;
34993507
emcStatus->task.execState = EMC_TASK_EXEC::DONE;
3508+
emcStatus->motion.traj.stepping = 0;
35003509
stepping = 0;
35013510
steppingWait = 0;
35023511

src/emc/usr_intf/axis/extensions/emcmodule.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ static PyMemberDef Stat_members[] = {
466466
{(char*)"queue_full", T_BOOL, O(motion.traj.queueFull), READONLY, NULL},
467467
{(char*)"motion_id", T_INT, O(motion.traj.id), READONLY, NULL},
468468
{(char*)"paused", T_BOOL, O(motion.traj.paused), READONLY, NULL},
469+
{(char*)"stepping", T_BOOL, O(motion.traj.stepping), READONLY, NULL},
469470
{(char*)"feedrate", T_DOUBLE, O(motion.traj.scale), READONLY, NULL},
470471
{(char*)"rapidrate", T_DOUBLE, O(motion.traj.rapid_scale), READONLY, NULL},
471472
{(char*)"velocity", T_DOUBLE, O(motion.traj.velocity), READONLY, NULL},

0 commit comments

Comments
 (0)