Changeset 24685
- Timestamp:
- Jul 6, 2009, 12:53:30 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTasks/magic.pro (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTasks/magic.pro
r24675 r24685 11 11 book init magicToProcess 12 12 book init magicToDS 13 book init magicDSToRevert 13 14 14 15 ### Database lists … … 16 17 $magicToProcess_DB = 0 17 18 $magicToDS_DB = 0 19 $magicDSToRevert_DB = 0 20 21 #list of stages 22 $STAGE:n = 0 23 list STAGE -add "raw" 24 list STAGE -add "chip" 25 #list STAGE -add "camera" 26 list STAGE -add "warp" 27 list STAGE -add "diff" 28 $magicDSRevertStage = 0 18 29 19 30 ### Check status of tasks … … 22 33 book listbook magicToProcess 23 34 book listbook magicToDS 35 book listbook magicDSToRevert 24 36 end 25 37 … … 29 41 book init magicToProcess 30 42 book init magicToDS 43 book init magicDSToRevert 31 44 end 32 45 … … 53 66 end 54 67 68 macro magic.ds.revert.on 69 task magic.ds.revert.load 70 active true 71 end 72 task magic.ds.revert.run 73 active false 74 end 75 end 55 76 ### Turn tasks off 56 77 macro magic.off … … 74 95 end 75 96 end 97 98 macro magic.ds.revert.off 99 task magic.ds.revert.load 100 active false 101 end 102 task magic.ds.revert.run 103 active false 104 end 105 end 106 76 107 77 108 task magic.tree.load … … 95 126 $run = $run -dbname $DB:$magicToTree_DB 96 127 $magicToTree_DB ++ 97 if ($magicToTree_DB >= $DB:n) setmagicToTree_DB = 0128 if ($magicToTree_DB >= $DB:n) $magicToTree_DB = 0 98 129 end 99 130 add_poll_args run … … 477 508 end 478 509 510 task magic.ds.revert.load 511 host local 512 513 periods -poll $LOADPOLL 514 periods -exec $LOADEXEC 515 periods -timeout 20 516 npending 1 517 active false 518 519 stdout NULL 520 stderr $LOGDIR/magic.ds.revert.log 521 522 task.exec 523 $run = magicdstool -torevert -stage $STAGE:$magicDSRevertStage 524 $magicDSRevertStage ++ 525 if ($magicDSRevertStage >= $STAGE:n) set magicDSRevertStage = 0 526 527 if ($DB:n == 0) 528 option DEFAULT 529 else 530 531 # save the DB name for the exit tasks 532 option $DB:$magicDSToRevert_DB 533 $run = $run -dbname $DB:$magicDSToRevert_DB 534 535 # only bump database number after we have gone through all of the stages 536 if ($magicDSRevertStage == 0) 537 $magicDSToRevert_DB ++ 538 end 539 if ($magicDSToRevert_DB >= $DB:n) set magicDSToRevert_DB = 0 540 end 541 add_poll_args run 542 add_poll_labels run 543 command $run 544 end 545 546 # success 547 task.exit 0 548 # convert 'stdout' to book format 549 ipptool2book stdout magicDSToRevert -key magic_ds_id:component -uniq -setword dbname $options:0 -setword pantaskState INIT 550 if ($VERBOSE > 2) 551 book listbook magicDSToRevert 552 end 553 554 # delete existing entries in the appropriate pantaskStates 555 process_cleanup magicDSToRevert 556 end 557 558 # locked list 559 task.exit default 560 showcommand failure 561 end 562 563 task.exit crash 564 showcommand crash 565 end 566 567 # operation times out? 568 task.exit timeout 569 showcommand timeout 570 end 571 end 572 573 task magic.ds.revert.run 574 periods -poll $RUNPOLL 575 periods -exec $RUNEXEC 576 periods -timeout 60 577 active false 578 579 task.exec 580 book npages magicDSToRevert -var N 581 if ($N == 0) break 582 if ($NETWORK == 0) break 583 584 # look for new images (pantaskState == INIT) 585 book getpage magicDSToRevert 0 -var pageName -key pantaskState INIT 586 if ("$pageName" == "NULL") break 587 588 book setword magicDSToRevert $pageName pantaskState RUN 589 book getword magicDSToRevert $pageName exp_id -var EXP_ID 590 book getword magicDSToRevert $pageName magic_ds_id -var MAGIC_DS_ID 591 book getword magicDSToRevert $pageName camera -var CAMERA 592 book getword magicDSToRevert $pageName streaks_uri -var STREAKS 593 book getword magicDSToRevert $pageName stage -var STAGE 594 book getword magicDSToRevert $pageName stage_id -var STAGE_ID 595 book getword magicDSToRevert $pageName component -var COMPONENT 596 book getword magicDSToRevert $pageName uri -var URI 597 book getword magicDSToRevert $pageName path_base -var PATH_BASE 598 book getword magicDSToRevert $pageName inverse -var INVERSE 599 book getword magicDSToRevert $pageName cam_path_base -var CAM_PATH_BASE 600 book getword magicDSToRevert $pageName outroot -var OUTROOT 601 book getword magicDSToRevert $pageName recoveryroot -var RECROOT 602 book getword magicDSToRevert $pageName re_place -var REPLACE 603 book getword magicDSToRevert $pageName dbname -var DBNAME 604 605 sprintf logfile "%s/%s.mds.%s.%s.%s.log" $OUTROOT $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT 606 607 host anyhost 608 609 # TODO: do not add recoveryroot or replace if they are null or zero 610 611 $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --streaks $STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE 612 if ("$INVERSE" == "T") 613 # Inverse subtraction 614 $run = $run --inverse 615 end 616 617 add_standard_args run 618 619 # save the pageName for future reference below 620 options $pageName 621 622 # create the command line 623 if ($VERBOSE > 1) 624 echo command $run 625 end 626 command $run 627 end 628 629 # default exit status 630 task.exit 0 631 process_exit magicDSToRevert $options:0 $JOB_STATUS 632 end 633 634 # locked list 635 task.exit default 636 showcommand failure 637 process_exit magicDSToRevert $options:0 $JOB_STATUS 638 end 639 640 task.exit crash 641 showcommand crash 642 book setword magicDSToRevert $options:0 pantaskState CRASH 643 end 644 645 # operation timed out? 646 task.exit timeout 647 showcommand timeout 648 book setword magicDSToRevert $options:0 pantaskState TIMEOUT 649 end 650 end 651
Note:
See TracChangeset
for help on using the changeset viewer.
