Changeset 25027 for branches/pap/ippTasks/chip.pro
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTasks/chip.pro (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippTasks/chip.pro
r23945 r25027 3 3 ## these tasks use the book chipPendingImfile 4 4 5 ## XXX the cleanup stage probably needs to mimic the chip processing stages, with an exposure and imfile layer6 ## can we define the cleanup stages in a separate file derived from this file?7 8 5 # test for required global variables 9 6 check.globals 10 7 11 8 book init chipPendingImfile 12 book init chipPendingCleanup13 9 14 10 macro chip.status 15 11 book listbook chipPendingImfile 16 book listbook chipPendingCleanup17 12 end 18 13 19 14 macro chip.reset 20 15 book init chipPendingImfile 21 book init chipPendingCleanup22 16 end 23 17 … … 46 40 end 47 41 48 macro chip.cleanup.on49 task chip.cleanup.load50 active true51 end52 task chip.cleanup.run53 active true54 end55 end56 57 macro chip.cleanup.off58 task chip.cleanup.load59 active false60 end61 task chip.cleanup.run62 active false63 end64 end65 66 42 # this variable will cycle through the known database names 67 43 $chip_DB = 0 44 $chip_revert_DB = 0 68 45 69 46 # select images ready for chip analysis … … 82 59 83 60 task.exec 61 if ($LABEL:n == 0) break 84 62 $run = chiptool -pendingimfile 85 63 if ($DB:n == 0) … … 93 71 end 94 72 add_poll_args run 73 add_poll_labels run 95 74 command $run 96 75 end … … 207 186 208 187 # Set a fault code in the database 209 !chiptool -addprocessedimfile -dbname $DBNAME -chip_id $CHIP_ID -class_id $CLASS_ID -fault $EXIT_CRASH_ERR188 exec chiptool -addprocessedimfile -dbname $DBNAME -chip_id $CHIP_ID -class_id $CLASS_ID -fault $EXIT_CRASH_ERR 210 189 process_exit chipPendingImfile $options:0 $EXIT_CRASH_ERR 211 190 end … … 227 206 228 207 periods -poll $LOADPOLL 229 periods -exec $LOADEXEC 230 periods -timeout 30 208 # periods -exec $LOADEXEC 209 periods -exec 30 210 periods -timeout 60 231 211 npending 1 232 212 … … 235 215 236 216 task.exec 217 if ($LABEL:n == 0) break 237 218 $run = chiptool -advanceexp -limit 10 238 219 if ($DB:n == 0) … … 246 227 end 247 228 add_poll_args run 229 add_poll_labels run 248 230 command $run 249 231 end … … 268 250 end 269 251 270 # this variable will cycle through the known database names 271 $chip_cleanup_DB = 0 272 273 # select images ready for chip analysis 274 # new entries are added to chipPendingImfile 275 # skip already-present entries 276 task chip.cleanup.load 252 task chip.revert 277 253 host local 278 254 279 periods -poll $LOADPOLL280 periods -exec $LOADEXEC281 periods -timeout 30255 periods -poll 5.0 256 periods -exec 60.0 257 periods -timeout 120.0 282 258 npending 1 283 active false284 259 285 260 stdout NULL 286 stderr $LOGDIR/chip.cleanup.log 287 288 task.exec 289 $run = chiptool -pendingcleanuprun 261 stderr $LOGDIR/revert.log 262 263 task.exec 264 if ($LABEL:n == 0) break 265 $run = chiptool -revertprocessedimfile 290 266 if ($DB:n == 0) 291 267 option DEFAULT 292 268 else 293 269 # save the DB name for the exit tasks 294 option $DB:$chip_ cleanup_DB295 $run = $run -dbname $DB:$chip_ cleanup_DB296 $chip_ cleanup_DB ++297 if ($chip_ cleanup_DB >= $DB:n) set chip_cleanup_DB = 0298 end 299 add_poll_ args run270 option $DB:$chip_revert_DB 271 $run = $run -dbname $DB:$chip_revert_DB 272 $chip_revert_DB ++ 273 if ($chip_revert_DB >= $DB:n) set chip_revert_DB = 0 274 end 275 add_poll_labels run 300 276 command $run 301 277 end … … 303 279 # success 304 280 task.exit 0 305 # convert 'stdout' to book format306 ipptool2book stdout chipPendingCleanup -key chip_id -uniq -setword dbname $options:0 -setword pantaskState INIT307 if ($VERBOSE > 2)308 book listbook chipPendingCleanup309 end310 311 # delete existing entries in the appropriate pantaskStates312 process_cleanup chipPendingCleanup313 281 end 314 282 … … 327 295 end 328 296 end 329 330 # run the ipp_cleanup.pl script on pending images331 task chip.cleanup.run332 periods -poll $RUNPOLL333 periods -exec $RUNEXEC334 periods -timeout 60335 active false336 337 task.exec338 book npages chipPendingCleanup -var N339 if ($N == 0) break340 if ($NETWORK == 0) break341 342 # look for new images in chipPendingCleanup (pantaskState == INIT)343 book getpage chipPendingCleanup 0 -var pageName -key pantaskState INIT344 if ("$pageName" == "NULL") break345 346 book setword chipPendingCleanup $pageName pantaskState RUN347 book getword chipPendingCleanup $pageName camera -var CAMERA348 book getword chipPendingCleanup $pageName state -var CLEANUP_MODE349 book getword chipPendingCleanup $pageName chip_id -var CHIP_ID350 book getword chipPendingCleanup $pageName dbname -var DBNAME351 352 # specify choice of local or remote host based on camera and chip (class_id)353 set.host.for.camera $CAMERA FPA354 355 stdout $LOGDIR/chip.cleanup.log356 stderr $LOGDIR/chip.cleanup.log357 358 # XXX is everything listed here needed?359 $run = ipp_cleanup.pl --stage chip --stage_id $CHIP_ID --camera $CAMERA --mode $CLEANUP_MODE360 add_standard_args run361 362 # save the pageName for future reference below363 options $pageName364 365 # create the command line366 if ($VERBOSE > 1)367 echo command $run368 end369 command $run370 end371 372 # default exit status373 task.exit default374 process_exit chipPendingCleanup $options:0 $JOB_STATUS375 end376 377 task.exit crash378 showcommand crash379 book setword chipPendingCleanup $options:0 pantaskState CRASH380 end381 382 # operation timed out?383 task.exit timeout384 showcommand timeout385 book setword chipPendingCleanup $options:0 pantaskState TIMEOUT386 end387 end
Note:
See TracChangeset
for help on using the changeset viewer.
