77* Author:
88* License: GPL Version 2
99* System: Linux
10- *
10+ *
1111* Copyright (c) 2004 All rights reserved.
1212*
1313********************************************************************/
@@ -217,7 +217,7 @@ int emcOperatorError(const char *fmt, ...)
217217 error_msg.error [0 ] = 0 ;
218218 // append error string
219219 va_start (ap, fmt);
220- vsnprintf (&error_msg.error [strlen (error_msg.error )],
220+ vsnprintf (&error_msg.error [strlen (error_msg.error )],
221221 sizeof (error_msg.error ) - strlen (error_msg.error ), fmt, ap);
222222 va_end (ap);
223223
@@ -466,7 +466,7 @@ static int checkInterpList(NML_INTERP_LIST * il, EMC_STAT * /*stat*/)
466466 emcOperatorError (" %s" , error_msg->error );
467467 break ;
468468 }
469-
469+
470470 // FIXME: there was limit checking tests below, see if they were needed
471471 case EMC_TRAJ_LINEAR_MOVE_TYPE:
472472 break ;
@@ -535,7 +535,7 @@ void readahead_reading(void)
535535 EMC_TASK_INTERP::WAITING;
536536 interp_list.clear ();
537537 emcAbortCleanup (EMC_ABORT::INTERPRETER_ERROR,
538- " interpreter error" );
538+ " interpreter error" );
539539 } else if (execRetval == -1
540540 || execRetval == INTERP_EXIT ) {
541541 emcStatus->task .interpState =
@@ -585,7 +585,7 @@ void readahead_reading(void)
585585
586586 if (emcStatus->task .readLine < programStartLine &&
587587 emcTaskPlanLevel () == 0 ) {
588-
588+
589589 // update the position with our current position, as the other positions are only skipped through
590590 CANON_UPDATE_END_POINT (emcStatus->motion .traj .actualPosition .tran .x ,
591591 emcStatus->motion .traj .actualPosition .tran .y ,
@@ -648,7 +648,7 @@ static void mdi_execute_hook(void)
648648 emcTaskCommand == 0 &&
649649 emcStatus->task .execState ==
650650 EMC_TASK_EXEC::DONE) {
651- emcTaskPlanClearWait ();
651+ emcTaskPlanClearWait ();
652652 mdi_execute_wait = 0 ;
653653 mdi_execute_hook ();
654654 }
@@ -670,11 +670,11 @@ static void mdi_execute_hook(void)
670670 // determine when a MDI command actually finishes normally.
671671 if (interp_list.len () == 0 &&
672672 emcTaskCommand == 0 &&
673- emcStatus->task .execState == EMC_TASK_EXEC::DONE &&
674- emcStatus->task .interpState != EMC_TASK_INTERP::IDLE &&
673+ emcStatus->task .execState == EMC_TASK_EXEC::DONE &&
674+ emcStatus->task .interpState != EMC_TASK_INTERP::IDLE &&
675675 emcStatus->motion .traj .queue == 0 &&
676- emcStatus->io .status == RCS_STATUS::DONE &&
677- !mdi_execute_wait &&
676+ emcStatus->io .status == RCS_STATUS::DONE &&
677+ !mdi_execute_wait &&
678678 !mdi_execute_next) {
679679
680680 // finished. Check for dequeuing of queued MDI command is done in emcTaskPlan().
@@ -1076,7 +1076,7 @@ static int emcTaskPlan(void)
10761076 case EMC_TASK_PLAN_STEP_TYPE:
10771077 // handles case where first action is to step the program
10781078 taskPlanRunCmd.line = 0 ; // run from start
1079- /* ! \todo FIXME-- can have GUI set this; send a run instead of a
1079+ /* ! \todo FIXME-- can have GUI set this; send a run instead of a
10801080 step */
10811081 retval = emcTaskIssueCommand (&taskPlanRunCmd);
10821082 if (retval != 0 ) break ;
@@ -1174,6 +1174,7 @@ static int emcTaskPlan(void)
11741174 break ;
11751175
11761176 case EMC_TASK_PLAN_STEP_TYPE:
1177+ emcStatus->motion .traj .single_stepping = 1 ;
11771178 stepping = 1 ; // set stepping mode in case it's not
11781179 steppingWait = 0 ; // clear the wait
11791180 break ;
@@ -1188,7 +1189,7 @@ static int emcTaskPlan(void)
11881189
11891190 // handle interp readahead logic
11901191 readahead_reading ();
1191-
1192+
11921193 break ; // EMC_TASK_INTERP::READING
11931194
11941195 case EMC_TASK_INTERP::PAUSED: // ON, AUTO, PAUSED
@@ -1249,6 +1250,7 @@ static int emcTaskPlan(void)
12491250 break ;
12501251
12511252 case EMC_TASK_PLAN_STEP_TYPE:
1253+ emcStatus->motion .traj .single_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 .single_stepping = 1 ;
13271330 stepping = 1 ; // set stepping mode in case it's not
13281331 steppingWait = 0 ; // clear the wait
13291332 break ;
@@ -1892,10 +1895,10 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
18921895
18931896 case EMC_TRAJ_PROBE_TYPE:
18941897 retval = emcTrajProbe (
1895- ((EMC_TRAJ_PROBE *) cmd)->pos ,
1898+ ((EMC_TRAJ_PROBE *) cmd)->pos ,
18961899 ((EMC_TRAJ_PROBE *) cmd)->type ,
18971900 ((EMC_TRAJ_PROBE *) cmd)->vel ,
1898- ((EMC_TRAJ_PROBE *) cmd)->ini_maxvel ,
1901+ ((EMC_TRAJ_PROBE *) cmd)->ini_maxvel ,
18991902 ((EMC_TRAJ_PROBE *) cmd)->acc ,
19001903 ((EMC_TRAJ_PROBE *) cmd)->ini_maxjerk ,
19011904 ((EMC_TRAJ_PROBE *) cmd)->probe_type );
@@ -1908,7 +1911,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
19081911 emcAuxInputWaitIndex = -1 ;
19091912 taskExecDelayTimeout = 0.0 ;
19101913 } else {
1911- emcAuxInputWaitType = emcAuxInputWaitMsg->wait_type ; // remember what we are waiting for
1914+ emcAuxInputWaitType = emcAuxInputWaitMsg->wait_type ; // remember what we are waiting for
19121915 emcAuxInputWaitIndex = emcAuxInputWaitMsg->index ; // remember the input to look at
19131916 emcStatus->task .input_timeout = 2 ; // set timeout flag, gets cleared if input changes before timeout happens
19141917 // set the timeout clock to expire at 'now' + delay time
@@ -1925,7 +1928,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
19251928 emcTrajUpdateTag (((EMC_TRAJ_LINEAR_MOVE *) cmd)->tag );
19261929 retval = emcTrajRigidTap (((EMC_TRAJ_RIGID_TAP *) cmd)->pos ,
19271930 ((EMC_TRAJ_RIGID_TAP *) cmd)->vel ,
1928- ((EMC_TRAJ_RIGID_TAP *) cmd)->ini_maxvel ,
1931+ ((EMC_TRAJ_RIGID_TAP *) cmd)->ini_maxvel ,
19291932 ((EMC_TRAJ_RIGID_TAP *) cmd)->acc ,
19301933 ((EMC_TRAJ_RIGID_TAP *) cmd)->ini_maxjerk ,
19311934 ((EMC_TRAJ_RIGID_TAP *) cmd)->scale );
@@ -2125,6 +2128,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
21252128 // clear out the interpreter state
21262129 emcStatus->task .interpState = EMC_TASK_INTERP::IDLE;
21272130 emcStatus->task .execState = EMC_TASK_EXEC::DONE;
2131+ emcStatus->motion .traj .single_stepping = 0 ;
21282132 stepping = 0 ;
21292133 steppingWait = 0 ;
21302134
@@ -2219,6 +2223,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
22192223 break ;
22202224
22212225 case EMC_TASK_PLAN_EXECUTE_TYPE:
2226+ emcStatus->motion .traj .single_stepping = 0 ;
22222227 stepping = 0 ;
22232228 steppingWait = 0 ;
22242229 execute_msg = (EMC_TASK_PLAN_EXECUTE *) cmd;
@@ -2314,6 +2319,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
23142319 retval = -1 ;
23152320 break ;
23162321 }
2322+ emcStatus->motion .traj .single_stepping = 0 ;
23172323 stepping = 0 ;
23182324 steppingWait = 0 ;
23192325 if (!taskplanopen && emcStatus->task .file [0 ] != 0 ) {
@@ -2362,6 +2368,7 @@ static int emcTaskIssueCommand(NMLmsg * cmd)
23622368 emcTrajResume ();
23632369 emcStatus->task .interpState = interpResumeState;
23642370 emcStatus->task .task_paused = 0 ;
2371+ emcStatus->motion .traj .single_stepping = 0 ;
23652372 stepping = 0 ;
23662373 steppingWait = 0 ;
23672374 retval = 0 ;
@@ -2592,6 +2599,7 @@ static int emcTaskExecute(void)
25922599 // clear out the interpreter state
25932600 emcStatus->task .interpState = EMC_TASK_INTERP::IDLE;
25942601 emcStatus->task .execState = EMC_TASK_EXEC::DONE;
2602+ emcStatus->motion .traj .single_stepping = 0 ;
25952603 stepping = 0 ;
25962604 steppingWait = 0 ;
25972605
@@ -2740,7 +2748,7 @@ static int emcTaskExecute(void)
27402748 }
27412749 // delay can be also be because we wait for an input
27422750 // if the index is set (not -1)
2743- if (emcAuxInputWaitIndex >= 0 ) {
2751+ if (emcAuxInputWaitIndex >= 0 ) {
27442752 switch (emcAuxInputWaitType) {
27452753 case WAIT_MODE_HIGH:
27462754 if (emcStatus->motion .synch_di [emcAuxInputWaitIndex] != 0 ) {
@@ -2751,12 +2759,12 @@ static int emcTaskExecute(void)
27512759 }
27522760 break ;
27532761
2754- case WAIT_MODE_RISE:
2762+ case WAIT_MODE_RISE:
27552763 if (emcStatus->motion .synch_di [emcAuxInputWaitIndex] == 0 ) {
27562764 emcAuxInputWaitType = WAIT_MODE_HIGH;
27572765 }
27582766 break ;
2759-
2767+
27602768 case WAIT_MODE_LOW:
27612769 if (emcStatus->motion .synch_di [emcAuxInputWaitIndex] == 0 ) {
27622770 emcStatus->task .input_timeout = 0 ; // clear timeout flag
@@ -2778,7 +2786,7 @@ static int emcTaskExecute(void)
27782786 emcStatus->task .execState = EMC_TASK_EXEC::DONE;
27792787 emcStatus->task .delayLeft = 0 ;
27802788 break ;
2781-
2789+
27822790 default :
27832791 emcOperatorError (" Unknown Wait Mode" );
27842792 }
@@ -3437,7 +3445,7 @@ int main(int argc, char *argv[])
34373445
34383446 // check for subordinate errors, and halt task if so
34393447 if ( emcStatus->motion .status == RCS_STATUS::ERROR
3440- && emcStatus->motion .on_soft_limit ) {
3448+ && emcStatus->motion .on_soft_limit ) {
34413449 if (!gave_soft_limit_message) {
34423450 emcOperatorError (" On Soft Limit" );
34433451 // if gui does not provide a means to switch to joint mode
@@ -3466,7 +3474,7 @@ int main(int argc, char *argv[])
34663474 }
34673475 // motion already should have reported this condition (and set RCS_STATUS::ERROR?)
34683476 // an M19 orient failed to complete within timeout
3469- // if ((emcStatus->motion.status == RCS_STATUS::ERROR) &&
3477+ // if ((emcStatus->motion.status == RCS_STATUS::ERROR) &&
34703478 // (emcStatus->motion.spindle.orient_state == EMCMOT_ORIENT_FAULTED) &&
34713479 // (emcStatus->motion.spindle.orient_fault != 0)) {
34723480 // emcOperatorError("wait for orient complete timed out");
@@ -3499,6 +3507,7 @@ int main(int argc, char *argv[])
34993507 // clear out the interpreter state
35003508 emcStatus->task .interpState = EMC_TASK_INTERP::IDLE;
35013509 emcStatus->task .execState = EMC_TASK_EXEC::DONE;
3510+ emcStatus->motion .traj .single_stepping = 0 ;
35023511 stepping = 0 ;
35033512 steppingWait = 0 ;
35043513
0 commit comments