regards,

Michael
Index: task/emctask.cc
===================================================================
RCS file: /cvs/emc2/src/emc/task/emctask.cc,v
retrieving revision 1.36
diff -U3 -r1.36 emctask.cc
--- task/emctask.cc	1 Mar 2009 00:50:33 -0000	1.36
+++ task/emctask.cc	3 Jun 2009 13:22:37 -0000
@@ -353,6 +353,11 @@
 	    }
 	}
     }
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanInit() returned %d\n", retval);
+    }
+
     return retval;
 }
 
@@ -360,6 +365,10 @@
 {
     waitFlag = 1;
 
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanSetWait() called\n");
+    }
+
     return 0;
 }
 
@@ -372,6 +381,10 @@
 {
     waitFlag = 0;
 
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanClearWait() called\n");
+    }
+
     return 0;
 }
 
@@ -389,7 +402,13 @@
 
 int emcTaskPlanSynch()
 {
-    return interp.synch();
+    int retval = interp.synch();
+    
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanSynch() returned %d\n", retval);
+    }
+
+    return retval;
 }
 
 int emcTaskPlanExit()
@@ -411,6 +430,11 @@
 	return retval;
     }
     taskplanopen = 1;
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanOpen(%s) returned %d\n", file, retval);
+    }
+
     return retval;
 }
 
@@ -429,6 +453,11 @@
     if (retval > INTERP_MIN_ERROR) {
 	print_interp_error(retval);
     }
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanRead() returned %d\n", retval);
+    }
+
     return retval;
 }
 
@@ -449,6 +478,11 @@
     if(command != 0) {
 	FINISH();
     }
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanExecute(0) return %d\n", retval);
+    }
+
     return retval;
 }
 
@@ -461,6 +495,11 @@
     if(command != 0) { // this means MDI
 	FINISH();
     }
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanExecute(%s) returned %d\n", command, retval);
+    }
+
     return retval;
 }
 
@@ -477,7 +516,13 @@
 
 int emcTaskPlanLine()
 {
-    return interp.line();
+    int retval = interp.line();
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanLine() returned %d\n", retval);
+    }
+    
+    return retval;
 }
 
 int emcTaskPlanCommand(char *cmd)
@@ -485,6 +530,12 @@
     char buf[LINELEN];
 
     strcpy(cmd, interp.command(buf, LINELEN));
+
+    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
+        rcs_print("emcTaskPlanCommand(%s) called. (line_number=%d)\n",
+          cmd, emcStatus->task.readLine);
+    }
+
     return 0;
 }
 
Index: task/emctaskmain.cc
===================================================================
RCS file: /cvs/emc2/src/emc/task/emctaskmain.cc,v
retrieving revision 1.137
diff -U3 -r1.137 emctaskmain.cc
--- task/emctaskmain.cc	26 May 2009 08:31:09 -0000	1.137
+++ task/emctaskmain.cc	3 Jun 2009 13:22:41 -0000
@@ -581,9 +581,6 @@
 		emcTaskQueueCommand(emcCommand);
 		// signify no more reading
 		emcTaskPlanSetWait();
-		if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-		    rcs_print("emcTaskPlanSetWait() called\n");
-		}
 		// then resynch interpreter
 		emcTaskQueueCommand(&taskPlanSynchCmd);
 		break;
@@ -701,9 +698,6 @@
 		emcTaskQueueCommand(emcCommand);
 		// signify no more reading
 		emcTaskPlanSetWait();
-		if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-		    rcs_print("emcTaskPlanSetWait() called\n");
-		}
 		// then resynch interpreter
 		emcTaskQueueCommand(&taskPlanSynchCmd);
 		break;
@@ -809,9 +803,6 @@
 		    emcTaskQueueCommand(emcCommand);
 		    // signify no more reading
 		    emcTaskPlanSetWait();
-		    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-			rcs_print("emcTaskPlanSetWait() called\n");
-		    }
 		    // then resynch interpreter
 		    emcTaskQueueCommand(&taskPlanSynchCmd);
 		    break;
@@ -898,84 +889,44 @@
 			// delay reading of next line until all is done
 			if (interp_list.len() == 0 &&
 			    emcTaskCommand == 0 &&
-			    emcStatus->task.execState ==
-			    EMC_TASK_EXEC_DONE) {
+			    emcStatus->task.execState == EMC_TASK_EXEC_DONE) {
+			    // 
 			    emcTaskPlanClearWait();
-			    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-				rcs_print
-				    ("emcTaskPlanClearWait() called\n");
-			    }
 			}
 		    } else {
 			readRetval = emcTaskPlanRead();
-			if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-			    rcs_print("emcTaskPlanRead() returned %d\n",
-				      readRetval);
-			}
-			/*! \todo MGS FIXME
-			   This next bit of code is goofy for the following reasons:
-			   1. It uses numbers when these values are #defined in interp_return.hh...
-			   2. This if() actually evaluates to if (readRetval != INTERP_OK)...
-			   3. The "end of file" comment is inaccurate...
+			/*! \todo MGS FIXME The "end of file" comment is inaccurate...
 			   *** Need to look at all calls to things that return INTERP_xxx values! ***
 			   MGS */
-			if (readRetval > INTERP_MIN_ERROR || readRetval == 3	/* INTERP_ENDFILE 
-										 */  ||
-			    readRetval == 1 /* INTERP_EXIT */  ||
-			    readRetval == 2	/* INTERP_ENDFILE,
-						   INTERP_EXECUTE_FINISH */ ) {
-			    /* emcTaskPlanRead retval != INTERP_OK
-			       Signal to the rest of the system that that the interp
+			if (readRetval != INTERP_OK) {
+			    /* Signal to the rest of the system that that the interp
 			       is now in a paused state. */
-			    /*! \todo FIXME The above test *should* be reduced to:
-			       readRetVal != INTERP_OK
-			       (N.B. Watch for negative error codes.) */
+			       /* (N.B. Watch for negative error codes.) */
 			    emcStatus->task.interpState =
 				EMC_TASK_INTERP_WAITING;
 			} else {
 			    // got a good line
 			    // record the line number and command
 			    emcStatus->task.readLine = emcTaskPlanLine();
-			    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-				rcs_print
-				    ("emcTaskPlanLine() returned %d\n",
-				     emcStatus->task.readLine);
-			    }
 
 			    interp_list.set_line_number(emcStatus->task.
 							readLine);
 			    emcTaskPlanCommand((char *) &emcStatus->task.
 					       command);
-			    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-				rcs_print
-				    ("emcTaskPlanCommand(%s) called. (line_number=%d)\n",
-				     ((char *) &emcStatus->task.command),
-				     emcStatus->task.readLine);
-			    }
 			    // and execute it
 			    execRetval = emcTaskPlanExecute(0);
-			    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-				rcs_print
-				    ("emcTaskPlanExecute(0) return %d\n",
-				     execRetval);
-			    }
 			    if (execRetval == -1 /* INTERP_ERROR */  ||
-				execRetval > INTERP_MIN_ERROR || execRetval == 1	/* INTERP_EXIT
-											 */ ) {
+				execRetval > INTERP_MIN_ERROR || 
+				execRetval == INTERP_EXIT) {
 				// end of file
 				emcStatus->task.interpState =
 				    EMC_TASK_INTERP_WAITING;
-			    } else if (execRetval == 2	/* INTERP_EXECUTE_FINISH
-							 */ ) {
+			    } else if (execRetval == INTERP_EXECUTE_FINISH) {
 				// INTERP_EXECUTE_FINISH signifies
 				// that no more reading should be done until
 				// everything
 				// outstanding is completed
 				emcTaskPlanSetWait();
-				if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-				    rcs_print
-					("emcTaskPlanSetWait() called\n");
-				}
 				// and resynch interp WM
 				emcTaskQueueCommand(&taskPlanSynchCmd);
 			    } else if (execRetval != 0) {
@@ -985,7 +936,6 @@
                                 emcStatus->task.motionLine = 0;
                                 emcStatus->task.readLine = 0;
 			    } else {
-
 				// executed a good line
 			    }
 
@@ -993,8 +943,7 @@
 			    // read
 			    // through it
 			    if (programStartLine < 0 ||
-				emcStatus->task.readLine <
-				programStartLine) {
+				emcStatus->task.readLine < programStartLine) {
 				// we're stepping over lines, so check them
 				// for
 				// limits, etc. and clear then out
@@ -1012,17 +961,18 @@
 			    }
 
 			    if (emcStatus->task.readLine < programStartLine) {
-			    
-				//update the position with our current position, as the other positions are only skipped through
-				CANON_UPDATE_END_POINT(emcStatus->motion.traj.actualPosition.tran.x,
-						       emcStatus->motion.traj.actualPosition.tran.y,
-						       emcStatus->motion.traj.actualPosition.tran.z,
-						       emcStatus->motion.traj.actualPosition.a,
-						       emcStatus->motion.traj.actualPosition.b,
-						       emcStatus->motion.traj.actualPosition.c,
-						       emcStatus->motion.traj.actualPosition.u,
-						       emcStatus->motion.traj.actualPosition.v,
-						       emcStatus->motion.traj.actualPosition.w);
+				//update the position with our current position, 
+				//as the other positions are only skipped through
+				CANON_UPDATE_END_POINT(
+				  emcStatus->motion.traj.actualPosition.tran.x,
+				  emcStatus->motion.traj.actualPosition.tran.y,
+				  emcStatus->motion.traj.actualPosition.tran.z,
+				  emcStatus->motion.traj.actualPosition.a,
+				  emcStatus->motion.traj.actualPosition.b,
+				  emcStatus->motion.traj.actualPosition.c,
+				  emcStatus->motion.traj.actualPosition.u,
+				  emcStatus->motion.traj.actualPosition.v,
+				  emcStatus->motion.traj.actualPosition.w);
 			    }
 
                             if (count++ < EMC_TASK_INTERP_MAX_LEN
@@ -1278,9 +1228,6 @@
 		emcTaskQueueCommand(emcCommand);
 		// signify no more reading
 		emcTaskPlanSetWait();
-		if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-		    rcs_print("emcTaskPlanSetWait() called\n");
-		}
 		// then resynch interpreter
 		emcTaskQueueCommand(&taskPlanSynchCmd);
 		break;
@@ -1462,7 +1409,7 @@
 
     if (0 == cmd) {
         if (EMC_DEBUG & EMC_DEBUG_TASK_ISSUE) {
-            printf("emcTaskIssueCommand() null command\n");
+            rcs_print("emcTaskIssueCommand() null command\n");
         }
 	return 0;
     }
@@ -1953,10 +1900,6 @@
     case EMC_TASK_PLAN_OPEN_TYPE:
 	open_msg = (EMC_TASK_PLAN_OPEN *) cmd;
 	retval = emcTaskPlanOpen(open_msg->file);
-	if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-	    rcs_print("emcTaskPlanOpen(%s) returned %d\n", open_msg->file,
-		      retval);
-	}
 	if (retval > INTERP_MIN_ERROR) {
 	    retval = -1;
 	}
@@ -1987,18 +1930,11 @@
 		interp_list.set_line_number(--pseudoMdiLineNumber);
 	    }
 	    execRetval = emcTaskPlanExecute(execute_msg->command, pseudoMdiLineNumber);
-	    if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-		rcs_print("emcTaskPlanExecute(%s) returned %d\n",
-			  execute_msg->command, execRetval);
-	    }
 	    if (execRetval == 2 /* INTERP_ENDFILE */ ) {
 		// this is an end-of-file
 		// need to flush execution, so signify no more reading
 		// until all is done
 		emcTaskPlanSetWait();
-		if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-		    rcs_print("emcTaskPlanSetWait() called\n");
-		}
 		// and resynch the interpreter WM
 		emcTaskQueueCommand(&taskPlanSynchCmd);
 		// it's success, so retval really is 0
@@ -2068,9 +2004,6 @@
 
     case EMC_TASK_PLAN_INIT_TYPE:
 	retval = emcTaskPlanInit();
-	if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-	    rcs_print("emcTaskPlanInit() returned %d\n", retval);
-	}
 	if (retval > INTERP_MIN_ERROR) {
 	    retval = -1;
 	}
@@ -2078,9 +2011,6 @@
 
     case EMC_TASK_PLAN_SYNCH_TYPE:
 	retval = emcTaskPlanSynch();
-	if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-	    rcs_print("emcTaskPlanSynch() returned %d\n", retval);
-	}
 	if (retval > INTERP_MIN_ERROR) {
 	    retval = -1;
 	}
@@ -2116,7 +2046,7 @@
     }
 /* debug */
     if ((EMC_DEBUG & EMC_DEBUG_TASK_ISSUE) && retval) {
-    	printf("emcTaskIssueCommand() returning: %d\n", retval);
+    	rcs_print("emcTaskIssueCommand() returning: %d\n", retval);
     }
     return retval;
 }
@@ -3163,7 +3093,7 @@
     /* debugging */
     if (emcTaskNoDelay) {
 	if (EMC_DEBUG & EMC_DEBUG_INTERP) {
-	    printf("cycle times (seconds): %f min, %f max\n", minTime,
+	    rcs_print("cycle times (seconds): %f min, %f max\n", minTime,
 	       maxTime);
 	}
     }
Index: nml_intf/interpl.cc
===================================================================
RCS file: /cvs/emc2/src/emc/nml_intf/interpl.cc,v
retrieving revision 1.11
diff -U3 -r1.11 interpl.cc
--- nml_intf/interpl.cc	7 Jan 2009 22:34:30 -0000	1.11
+++ nml_intf/interpl.cc	3 Jun 2009 13:22:41 -0000
@@ -20,6 +20,7 @@
 
 #include "rcs.hh"		// LinkedList
 #include "interpl.hh"		// these decls
+#include "emc.hh"
 #include "emcglb.h"
 #include "linklist.hh"
 #include "nmlmsg.hh"            /* class NMLmsg */
@@ -88,15 +89,12 @@
 								   size %
 								   32), 1);
 
-// #ifdef DEBUG_INTERPL
-#if 1
     if (EMC_DEBUG & EMC_DEBUG_INTERP_LIST) {
 	rcs_print
-	    ("NML_INTERP_LIST::append(nml_msg{size=%d,type=%d}) : list_size=%d, line_number = %d\n",
-	     nml_msg.size, nml_msg.type, linked_list_ptr->list_size,
-	     temp_node.line_number);
+	    ("NML_INTERP_LIST::append(nml_msg{size=%d,type=%s}) : list_size=%d, line_number=%d\n",
+	     nml_msg.size, emc_symbol_lookup(nml_msg.type),
+	     linked_list_ptr->list_size, temp_node.line_number);
     }
-#endif
 
     return 0;
 }
@@ -161,14 +159,12 @@
 								   size %
 								   32), 1);
 
-#ifdef DEBUG_INTERPL
     if (EMC_DEBUG & EMC_DEBUG_INTERP_LIST) {
 	rcs_print
-	    ("NML_INTERP_LIST::append(nml_msg{size=%d,type=%d}) : list_size=%d, line_number = %d\n",
-	     nml_msg_ptr->size, nml_msg_ptr->type,
+	    ("NML_INTERP_LIST::append(nml_msg_ptr{size=%d,type=%s}) : list_size=%d, line_number=%d\n",
+	     nml_msg_ptr->size, emc_symbol_lookup(nml_msg_ptr->type),
 	     linked_list_ptr->list_size, temp_node.line_number);
     }
-#endif
 
     return 0;
 }
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to