Index: trunk/ippTasks/stack.pro
===================================================================
--- trunk/ippTasks/stack.pro	(revision 28649)
+++ trunk/ippTasks/stack.pro	(revision 29689)
@@ -8,13 +8,22 @@
 check.globals
 
+if ($?POLL_LIMIT_STACK == 0) set POLL_LIMIT_STACK = 10
+
+macro set.stack.poll
+  if ($0 != 2)
+    echo "USAGE:set.stack.poll (value)"
+    break
+  end
+
+  $POLL_LIMIT_STACK = $1
+end
+
 ### Initialise the books containing the tasks to do
 book init stackSumSkyfile
 book init stackPendingSummary
-#book init stackCleanup
 
 ### Database lists
 $stackSkycell_DB = 0
 $stack_revert_DB = 0
-#$stackCleanup_DB = 0
 $stackSummary_DB = 0
 
@@ -22,5 +31,4 @@
 macro stack.status
   book listbook stackSumSkyfile
-#  book listbook stackCleanup
 end
 
@@ -29,5 +37,4 @@
   book init stackSumSkyfile
   book init stackPendingSummary
-#  book init stackCleanup
 end
 
@@ -81,26 +88,4 @@
   end
 end
-
-
-
-
-
-# macro stack.cleanup.on
-#   task stack.cleanup.load
-#     active true
-#   end
-#   task stack.cleanup.run
-#     active true
-#   end
-# end
-
-# macro stack.cleanup.off
-#   task stack.cleanup.load
-#     active false
-#   end
-#   task stack.cleanup.run
-#     active false
-#   end
-# end
 
 
@@ -132,6 +117,6 @@
     add_poll_args run
     add_poll_labels run
-    # reduce the limit (the last one takes precedence)
-    $run = $run -limit 40
+    # change the limit (the last one on the command line takes precedence)
+    $run = $run -limit $POLL_LIMIT_STACK
     command $run
   end
@@ -246,125 +231,4 @@
   end
 end
-
-
-# # select images ready for stack analysis
-# # new entries are added to stackCleanup
-# # skip already-present entries
-# task	       stack.cleanup.load
-#   host         local
-
-#   periods      -poll $LOADPOLL
-#   periods      -exec $LOADEXEC
-#   periods      -timeout 30
-#   npending     1
-#   active       false
-
-#   stdout NULL
-#   stderr $LOGDIR/stack.cleanup.log
-
-#   task.exec
-#     if ($LABEL:n == 0) break
-#     $run = stacktool -pendingcleanuprun
-#     if ($DB:n == 0)
-#       option DEFAULT
-#     else
-#       # save the DB name for the exit tasks
-#       option $DB:$stackCleanup_DB
-#       $run = $run -dbname $DB:$stackCleanup_DB
-#       $stackCleanup_DB ++
-#       if ($stackCleanup_DB >= $DB:n) set stackCleanup_DB = 0
-#     end
-#     add_poll_args run
-#     add_poll_labels run
-#     command $run
-#   end
-
-#   # success
-#   task.exit    0
-#     # convert 'stdout' to book format
-#     ipptool2book stdout stackCleanup -key stack_id -uniq -setword dbname $options:0 -setword pantaskState INIT
-#     if ($VERBOSE > 2)
-#       book listbook stackCleanup
-#     end
-
-#     # delete existing entries in the appropriate pantaskStates
-#     process_cleanup stackCleanup
-#   end
-
-#   # locked list
-#   task.exit    default
-#     showcommand failure
-#   end
-
-#   task.exit    crash
-#     showcommand crash
-#   end
-
-#   # operation times out?
-#   task.exit    timeout
-#     showcommand timeout
-#   end
-# end
-
-# # run the ipp_cleanup.pl script on pending images
-# task	       stack.cleanup.run
-#   periods      -poll $RUNPOLL
-#   periods      -exec $RUNEXEC
-#   periods      -timeout 60
-#   active       false
-
-#   task.exec
-#     book npages stackCleanup -var N
-#     if ($N == 0) break
-#     if ($NETWORK == 0) break
-    
-#     # look for new images in stackCleanup (pantaskState == INIT)
-#     book getpage stackCleanup 0 -var pageName -key pantaskState INIT
-#     if ("$pageName" == "NULL") break
-
-#     book setword stackCleanup $pageName pantaskState RUN
-#     book getword stackCleanup $pageName camera -var CAMERA
-#     book getword stackCleanup $pageName state -var CLEANUP_MODE
-#     book getword stackCleanup $pageName stack_id -var STACK_ID
-#     book getword stackCleanup $pageName dbname -var DBNAME
-
-#     # specify choice of local or remote host based on camera and stack (class_id)
-#     set.host.for.camera $CAMERA FPA
-
-#     stdout $LOGDIR/stack.cleanup.log
-#     stderr $LOGDIR/stack.cleanup.log
-
-#     # XXX is everything listed here needed?
-#     $run = ipp_cleanup.pl --stage stack --stage_id $STACK_ID --camera $CAMERA --mode $CLEANUP_MODE
-#     add_standard_args run
-
-#     # save the pageName for future reference below
-#     options $pageName
-
-#     # create the command line
-#     if ($VERBOSE > 1)
-#       echo command $run
-#     end
-#     command $run
-#   end
-
-#   # default exit status
-#   task.exit    default
-#     process_exit stackCleanup $options:0 $JOB_STATUS
-#   end
-
-#   task.exit    crash
-#     showcommand crash
-#     book setword stackCleanup $options:0 pantaskState CRASH
-#   end
-
-#   # operation timed out?
-#   task.exit    timeout
-#     showcommand timeout
-#     book setword stackCleanup $options:0 pantaskState TIMEOUT
-#   end
-# end
-
-
 
 
