IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 25, 2009, 4:22:33 PM (17 years ago)
Author:
watersc1
Message:

Commented out clean up stages, and moved that code to science.cleanup.pro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/camera.pro

    r24098 r24595  
    77
    88book init camPendingExp
    9 book init camPendingCleanup
     9#book init camPendingCleanup
    1010
    1111macro camera.status
    1212  book listbook camPendingExp
    13   book listbook camPendingCleanup
     13#  book listbook camPendingCleanup
    1414end
    1515
    1616macro camera.reset
    1717  book init camPendingExp
    18   book init camPendingCleanup
     18#  book init camPendingCleanup
    1919end
    2020
     
    3737end
    3838
    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
     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
    5656
    5757# this variable will cycle through the known database names
     
    199199end
    200200
    201 # this variable will cycle through the known database names
    202 $camera_cleanup_DB = 0
    203 
    204 # select images ready for cam analysis
    205 # new entries are added to camPendingImfile
    206 # skip already-present entries
    207 task           camera.cleanup.load
    208   host         local
    209 
    210   periods      -poll $LOADPOLL
    211   periods      -exec $LOADEXEC
    212   periods      -timeout 30
    213   npending     1
    214   active       false
    215 
    216   stdout NULL
    217   stderr $LOGDIR/camera.cleanup.log
    218 
    219   task.exec
    220     if ($LABEL:n == 0) break
    221     $run = camtool -pendingcleanuprun
    222     if ($DB:n == 0)
    223       option DEFAULT
    224     else
    225       # save the DB name for the exit tasks
    226       option $DB:$camera_cleanup_DB
    227       $run = $run -dbname $DB:$camera_cleanup_DB
    228       $camera_cleanup_DB ++
    229       if ($camera_cleanup_DB >= $DB:n) set camera_cleanup_DB = 0
    230     end
    231     add_poll_args run
    232     add_poll_labels run
    233     command $run
    234   end
    235 
    236   # success
    237   task.exit    0
    238     # convert 'stdout' to book format
    239     ipptool2book stdout camPendingCleanup -key cam_id -uniq -setword dbname $options:0 -setword pantaskState INIT
    240     if ($VERBOSE > 2)
    241       book listbook camPendingCleanup
    242     end
    243 
    244     # delete existing entries in the appropriate pantaskStates
    245     process_cleanup camPendingCleanup
    246   end
    247 
    248   # locked list
    249   task.exit    default
    250     showcommand failure
    251   end
    252 
    253   task.exit    crash
    254     showcommand crash
    255   end
    256 
    257   # operation times out?
    258   task.exit    timeout
    259     showcommand timeout
    260   end
    261 end
    262 
    263 # run the ipp_cleanup.pl script on pending images
    264 task           camera.cleanup.run
    265   periods      -poll $RUNPOLL
    266   periods      -exec $RUNEXEC
    267   periods      -timeout 60
    268   active       false
    269 
    270   task.exec
    271     book npages camPendingCleanup -var N
    272     if ($N == 0) break
    273     if ($NETWORK == 0) break
     201# # this variable will cycle through the known database names
     202# $camera_cleanup_DB = 0
     203
     204# # select images ready for cam analysis
     205# # new entries are added to camPendingImfile
     206# # skip already-present entries
     207# task         camera.cleanup.load
     208#   host         local
     209
     210#   periods      -poll $LOADPOLL
     211#   periods      -exec $LOADEXEC
     212#   periods      -timeout 30
     213#   npending     1
     214#   active       false
     215
     216#   stdout NULL
     217#   stderr $LOGDIR/camera.cleanup.log
     218
     219#   task.exec
     220#     if ($LABEL:n == 0) break
     221#     $run = camtool -pendingcleanuprun
     222#     if ($DB:n == 0)
     223#       option DEFAULT
     224#     else
     225#       # save the DB name for the exit tasks
     226#       option $DB:$camera_cleanup_DB
     227#       $run = $run -dbname $DB:$camera_cleanup_DB
     228#       $camera_cleanup_DB ++
     229#       if ($camera_cleanup_DB >= $DB:n) set camera_cleanup_DB = 0
     230#     end
     231#     add_poll_args run
     232#     add_poll_labels run
     233#     command $run
     234#   end
     235
     236#   # success
     237#   task.exit    0
     238#     # convert 'stdout' to book format
     239#     ipptool2book stdout camPendingCleanup -key cam_id -uniq -setword dbname $options:0 -setword pantaskState INIT
     240#     if ($VERBOSE > 2)
     241#       book listbook camPendingCleanup
     242#     end
     243
     244#     # delete existing entries in the appropriate pantaskStates
     245#     process_cleanup camPendingCleanup
     246#   end
     247
     248#   # locked list
     249#   task.exit    default
     250#     showcommand failure
     251#   end
     252
     253#   task.exit    crash
     254#     showcommand crash
     255#   end
     256
     257#   # operation times out?
     258#   task.exit    timeout
     259#     showcommand timeout
     260#   end
     261# end
     262
     263# # run the ipp_cleanup.pl script on pending images
     264# task         camera.cleanup.run
     265#   periods      -poll $RUNPOLL
     266#   periods      -exec $RUNEXEC
     267#   periods      -timeout 60
     268#   active       false
     269
     270#   task.exec
     271#     book npages camPendingCleanup -var N
     272#     if ($N == 0) break
     273#     if ($NETWORK == 0) break
    274274   
    275     # look for new images in camPendingCleanup (pantaskState == INIT)
    276     book getpage camPendingCleanup 0 -var pageName -key pantaskState INIT
    277     if ("$pageName" == "NULL") break
    278 
    279     book setword camPendingCleanup $pageName pantaskState RUN
    280     book getword camPendingCleanup $pageName camera -var CAMERA
    281     book getword camPendingCleanup $pageName state  -var CLEANUP_MODE
    282     book getword camPendingCleanup $pageName cam_id -var CAM_ID
    283     book getword camPendingCleanup $pageName dbname -var DBNAME
    284 
    285     # specify choice of local or remote host based on camera and cam (class_id)
    286     set.host.for.camera $CAMERA FPA
    287 
    288     stdout $LOGDIR/camera.cleanup.log
    289     stderr $LOGDIR/camera.cleanup.log
    290 
    291     # XXX is everything listed here needed?
    292     $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE
    293     add_standard_args run
    294 
    295     # save the pageName for future reference below
    296     options $pageName
    297 
    298     # create the command line
    299     if ($VERBOSE > 1)
    300       echo command $run
    301     end
    302     command $run
    303   end
    304 
    305   # default exit status
    306   task.exit    default
    307     process_exit camPendingCleanup $options:0 $JOB_STATUS
    308   end
    309 
    310   task.exit    crash
    311     showcommand crash
    312     book setword camPendingCleanup $options:0 pantaskState CRASH
    313   end
    314 
    315   # operation timed out?
    316   task.exit    timeout
    317     showcommand timeout
    318     book setword camPendingCleanup $options:0 pantaskState TIMEOUT
    319   end
    320 end
     275#     # look for new images in camPendingCleanup (pantaskState == INIT)
     276#     book getpage camPendingCleanup 0 -var pageName -key pantaskState INIT
     277#     if ("$pageName" == "NULL") break
     278
     279#     book setword camPendingCleanup $pageName pantaskState RUN
     280#     book getword camPendingCleanup $pageName camera -var CAMERA
     281#     book getword camPendingCleanup $pageName state  -var CLEANUP_MODE
     282#     book getword camPendingCleanup $pageName cam_id -var CAM_ID
     283#     book getword camPendingCleanup $pageName dbname -var DBNAME
     284
     285#     # specify choice of local or remote host based on camera and cam (class_id)
     286#     set.host.for.camera $CAMERA FPA
     287
     288#     stdout $LOGDIR/camera.cleanup.log
     289#     stderr $LOGDIR/camera.cleanup.log
     290
     291#     # XXX is everything listed here needed?
     292#     $run = ipp_cleanup.pl --stage camera --stage_id $CAM_ID --camera $CAMERA --mode $CLEANUP_MODE
     293#     add_standard_args run
     294
     295#     # save the pageName for future reference below
     296#     options $pageName
     297
     298#     # create the command line
     299#     if ($VERBOSE > 1)
     300#       echo command $run
     301#     end
     302#     command $run
     303#   end
     304
     305#   # default exit status
     306#   task.exit    default
     307#     process_exit camPendingCleanup $options:0 $JOB_STATUS
     308#   end
     309
     310#   task.exit    crash
     311#     showcommand crash
     312#     book setword camPendingCleanup $options:0 pantaskState CRASH
     313#   end
     314
     315#   # operation timed out?
     316#   task.exit    timeout
     317#     showcommand timeout
     318#     book setword camPendingCleanup $options:0 pantaskState TIMEOUT
     319#   end
     320# end
Note: See TracChangeset for help on using the changeset viewer.