IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 7, 2009, 4:08:25 PM (17 years ago)
Author:
Paul Price
Message:

Merging trunk (r25026) to get up-to-date on old branch.

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippTasks/camera.pro

    r23230 r25027  
    77
    88book init camPendingExp
    9 book init camPendingCleanup
    109
    1110macro camera.status
    1211  book listbook camPendingExp
    13   book listbook camPendingCleanup
    1412end
    1513
    1614macro camera.reset
    1715  book init camPendingExp
    18   book init camPendingCleanup
    1916end
    2017
     
    3734end
    3835
    39 macro camera.cleanup.on
    40   task camera.cleanup.load
    41     active true
    42   end
    43   task camera.cleanup.run
    44     active true
    45   end
    46 end
    47 
    48 macro camera.cleanup.off
    49   task camera.cleanup.load
    50     active false
    51   end
    52   task camera.cleanup.run
    53     active false
    54   end
    55 end
    56 
    5736# this variable will cycle through the known database names
    5837$camera_DB = 0
     38$camera_revert_DB = 0
    5939
    6040# select images ready for camera analysis
     
    7353
    7454  task.exec
     55    if ($LABEL:n == 0) break
    7556    $run = camtool -pendingexp
    7657    if ($DB:n == 0)
     
    8465    end
    8566    add_poll_args run
     67    add_poll_labels run
    8668    command $run
    8769  end
     
    197179end
    198180
    199 # this variable will cycle through the known database names
    200 $camera_cleanup_DB = 0
    201 
    202 # select images ready for cam analysis
    203 # new entries are added to camPendingImfile
    204 # skip already-present entries
    205 task           camera.cleanup.load
     181task camera.revert
    206182  host         local
    207183
    208   periods      -poll $LOADPOLL
    209   periods      -exec $LOADEXEC
    210   periods      -timeout 30
     184  periods      -poll 5.0
     185  periods      -exec 60.0
     186  periods      -timeout 120.0
    211187  npending     1
    212   active       false
    213188
    214189  stdout NULL
    215   stderr $LOGDIR/camera.cleanup.log
     190  stderr $LOGDIR/revert.log
    216191
    217192  task.exec
    218     $run = camtool -pendingcleanuprun
     193    if ($LABEL:n == 0) break
     194    $run = camtool -revertprocessedexp
    219195    if ($DB:n == 0)
    220196      option DEFAULT
    221197    else
    222198      # save the DB name for the exit tasks
    223       option $DB:$camera_cleanup_DB
    224       $run = $run -dbname $DB:$camera_cleanup_DB
    225       $camera_cleanup_DB ++
    226       if ($camera_cleanup_DB >= $DB:n) set camera_cleanup_DB = 0
    227     end
    228     add_poll_args run
     199      option $DB:$camera_revert_DB
     200      $run = $run -dbname $DB:$camera_revert_DB
     201      $camera_revert_DB ++
     202      if ($camera_revert_DB >= $DB:n) set camera_revert_DB = 0
     203    end
     204    add_poll_labels run
    229205    command $run
    230206  end
     
    232208  # success
    233209  task.exit    0
    234     # convert 'stdout' to book format
    235     ipptool2book stdout camPendingCleanup -key cam_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    236     if ($VERBOSE > 2)
    237       book listbook camPendingCleanup
    238     end
    239 
    240     # delete existing entries in the appropriate pantaskStates
    241     process_cleanup camPendingCleanup
    242210  end
    243211
     
    256224  end
    257225end
    258 
    259 # run the ipp_cleanup.pl script on pending images
    260 task           camera.cleanup.run
    261   periods      -poll $RUNPOLL
    262   periods      -exec $RUNEXEC
    263   periods      -timeout 60
    264   active       false
    265 
    266   task.exec
    267     book npages camPendingCleanup -var N
    268     if ($N == 0) break
    269     if ($NETWORK == 0) break
    270    
    271     # look for new images in camPendingCleanup (pantaskState == INIT)
    272     book getpage camPendingCleanup 0 -var pageName -key pantaskState INIT
    273     if ("$pageName" == "NULL") break
    274 
    275     book setword camPendingCleanup $pageName pantaskState RUN
    276     book getword camPendingCleanup $pageName camera -var CAMERA
    277     book getword camPendingCleanup $pageName state  -var CLEANUP_MODE
    278     book getword camPendingCleanup $pageName cam_id -var CAM_ID
    279     book getword camPendingCleanup $pageName dbname -var DBNAME
    280 
    281     # specify choice of local or remote host based on camera and cam (class_id)
    282     set.host.for.camera $CAMERA FPA
    283 
    284     stdout $LOGDIR/camera.cleanup.log
    285     stderr $LOGDIR/camera.cleanup.log
    286 
    287     # XXX is everything listed here needed?
    288     $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE
    289     add_standard_args run
    290 
    291     # save the pageName for future reference below
    292     options $pageName
    293 
    294     # create the command line
    295     if ($VERBOSE > 1)
    296       echo command $run
    297     end
    298     command $run
    299   end
    300 
    301   # default exit status
    302   task.exit    default
    303     process_exit camPendingCleanup $options:0 $JOB_STATUS
    304   end
    305 
    306   task.exit    crash
    307     showcommand crash
    308     book setword camPendingCleanup $options:0 pantaskState CRASH
    309   end
    310 
    311   # operation timed out?
    312   task.exit    timeout
    313     showcommand timeout
    314     book setword camPendingCleanup $options:0 pantaskState TIMEOUT
    315   end
    316 end
Note: See TracChangeset for help on using the changeset viewer.