? interpl_len_from_ini.patch
? emc/interpl_len_from_ini.patch
Index: emc/nml_intf/emccfg.h
===================================================================
RCS file: /cvs/emc2/src/emc/nml_intf/emccfg.h,v
retrieving revision 1.8
diff -U3 -r1.8 emccfg.h
--- emc/nml_intf/emccfg.h	4 May 2009 22:30:41 -0000	1.8
+++ emc/nml_intf/emccfg.h	26 May 2009 06:44:23 -0000
@@ -33,6 +33,9 @@
 /* cycle time for emctio, in seconds */
 #define DEFAULT_EMC_IO_CYCLE_TIME 0.100
 
+/* default interp len */
+#define DEFAULT_EMC_TASK_INTERP_MAX_LEN 1000
+
 /* default name of EMC_TOOL tool table file */
 #define DEFAULT_TOOL_TABLE_FILE "tool.tbl"
 
Index: emc/nml_intf/emcglb.c
===================================================================
RCS file: /cvs/emc2/src/emc/nml_intf/emcglb.c,v
retrieving revision 1.9
diff -U3 -r1.9 emcglb.c
--- emc/nml_intf/emcglb.c	27 Apr 2008 01:43:32 -0000	1.9
+++ emc/nml_intf/emcglb.c	26 May 2009 06:44:23 -0000
@@ -31,6 +31,8 @@
 
 double EMC_IO_CYCLE_TIME = DEFAULT_EMC_IO_CYCLE_TIME;
 
+int EMC_TASK_INTERP_MAX_LEN = DEFAULT_EMC_TASK_INTERP_MAX_LEN;
+
 char TOOL_TABLE_FILE[LINELEN] = DEFAULT_TOOL_TABLE_FILE;
 
 double TRAJ_DEFAULT_VELOCITY = DEFAULT_TRAJ_DEFAULT_VELOCITY;
Index: emc/task/emctaskmain.cc
===================================================================
RCS file: /cvs/emc2/src/emc/task/emctaskmain.cc,v
retrieving revision 1.136
diff -U3 -r1.136 emctaskmain.cc
--- emc/task/emctaskmain.cc	24 May 2009 05:11:18 -0000	1.136
+++ emc/task/emctaskmain.cc	26 May 2009 06:44:25 -0000
@@ -378,8 +378,8 @@
 static int interpResumeState = EMC_TASK_INTERP_IDLE;
 static int programStartLine = 0;	// which line to run program from
 // how long the interp list can be
-/*! \todo FIXME-- make an ini file global */
-#define EMC_TASK_INTERP_MAX_LEN 1000
+
+static int EMC_TASK_INTERP_MAX_LEN;
 
 int stepping = 0;
 int steppingWait = 0;
@@ -1025,7 +1025,7 @@
 						       emcStatus->motion.traj.actualPosition.w);
 			    }
 
-                            if (count++ < 1000
+                            if (count++ < EMC_TASK_INTERP_MAX_LEN
                                     && emcStatus->task.interpState == EMC_TASK_INTERP_READING
                                     && interp_list.len() <= EMC_TASK_INTERP_MAX_LEN * 2/3) {
                                 goto interpret_again;
@@ -2854,6 +2854,16 @@
 	// not found, use default
     }
 
+    if (NULL != (inistring = inifile.Find("INTERP_MAX_LEN", "TASK"))) {
+	if (1 == sscanf(inistring, "%d", &EMC_TASK_INTERP_MAX_LEN)) {
+	    if (EMC_TASK_INTERP_MAX_LEN <= 0) {
+	    	EMC_TASK_INTERP_MAX_LEN = DEFAULT_EMC_TASK_INTERP_MAX_LEN;
+	    }
+	} else {
+	    EMC_TASK_INTERP_MAX_LEN = DEFAULT_EMC_TASK_INTERP_MAX_LEN;
+	}
+    }
+
     if (NULL != (inistring = inifile.Find("RS274NGC_STARTUP_CODE", "EMC"))) {
 	// copy to global
 	strcpy(RS274NGC_STARTUP_CODE, inistring);
