IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 11, 2011, 4:29:48 PM (15 years ago)
Author:
watersc1
Message:

Trying to merge back into trunk.

Location:
branches/czw_branch/20101203
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20101203

  • branches/czw_branch/20101203/ippTasks

  • branches/czw_branch/20101203/ippTasks/register.pro

    r30118 r30586  
    99book init regPendingExp
    1010book init regPendingBurntoolImfile
     11book init regDates
    1112
    1213macro register.reset
     
    1415  book init regPendingExp
    1516  book init regPendingBurntoolImfile
     17  book init regDates
    1618end
    1719
     
    2123  book listbook regPendingExp
    2224  book listbook regPendingBurntoolImfile
     25  book listbook regDates
    2326end
    2427
     
    3033    active true
    3134  end
     35  task register.imfile.revert
     36    active false
     37  end
    3238  task register.exp.load
    3339    active true
     
    5157    active false
    5258  end
     59  task register.imfile.revert
     60    active false
     61  end
    5362  task register.exp.load
    5463    active false
     
    6574end
    6675
    67 $valid_burntool_value = 14
     76macro register.revert.on
     77  task register.imfile.revert
     78    active true
     79  end
     80end
     81
     82macro register.revert.off
     83  task register.imfile.revert
     84    active false
     85  end
     86end
     87
     88macro burntool.on
     89  task register.burntool.load
     90    active true
     91  end
     92  task register.burntool.run
     93    active true
     94  end
     95end
     96
     97macro burntool.off
     98  task register.burntool.load
     99    active false
     100  end
     101  task register.burntool.run
     102    active false
     103  end
     104end
     105
     106macro register.add.date
     107  if ($0 != 4)
     108    echo "USAGE: register.add.date (YYYY-MM-DD) (DBNAME) (VALID_BURNTOOL)"
     109    break
     110  end
     111
     112   book newpage regDates $1
     113   book setword regDates $1 nsState NEW
     114   book setword regDates $1 dbname $2
     115   book setword regDates $1 valid_burntool $3
     116end
     117
     118
     119# $valid_burntool_value = 14
     120$sunrise = 17:30:00
     121$sunset  = 03:30:00
    68122
    69123macro replace.survey.values
     
    147201$regPendingImfile_DB = 0
    148202$regPendingBurntoolImfile_DB = 0
     203$regRevertImfile_DB = 0
    149204$regPendingExp_DB = 0
    150205
     
    265320    # XXX register_imfile.pl differs from the standard script : it does not have an 'outroot' argument, and it does not take '--redirect'
    266321    $run = register_imfile.pl --exp_id $EXP_ID --tmp_class_id $TMP_CLASS_ID --tmp_exp_name $TMP_EXP_NAME --uri $URI --logfile $logfile --bytes $BYTES --md5sum $MD5SUM
     322    $run = $run --sunset $sunset --sunrise $sunrise
    267323    add_standard_args run
    268324
     
    295351  end
    296352end
     353
     354task register.imfile.revert
     355  host         local
     356  periods      -poll 60.0
     357  periods      -exec 1800.0
     358  periods      -timeout 120.0
     359  npending     1
     360
     361  stdout       NULL
     362  stderr       $LOGDIR/register.imfile.revert.log
     363
     364  task.exec
     365    $run = regtool -revertprocessedimfile
     366    if ($DB:n == 0)
     367      option DEFAULT
     368    else
     369      option $DB:$regRevertImfile_DB
     370      $run = $run -dbname $DB:$regRevertImfile_DB
     371      $regRevertImfile_DB ++
     372      if ($regRevertImfile_DB >= $DB:n) set regRevertImfile_DB = 0
     373    end
     374    add_poll_args run
     375    command $run
     376  end
     377
     378  # success
     379  task.exit    0
     380  end
     381
     382  # locked list
     383  task.exit    default
     384    showcommand failure
     385  end
     386
     387  task.exit    crash
     388    showcommand crash
     389  end
     390
     391  # operation times out
     392  task.exit    timeout
     393    showcommand timeout
     394  end
     395end
     396
    297397
    298398# select exposures ready for register_exp.pl
     
    463563  # select entried from the current DB; cycle to the next DB, if it exists
    464564  task.exec
     565     book npages regDates -var Npages
     566     if ($Npages == 0)
     567       $today = `date -u +%Y-%m-%d`
     568       $dbname = $DB:0
     569       $valid_burntool = 14
     570     else
     571       book getpage regDates $reg_datePAGE -var today
     572       book getword regDates $today dbname -var dbname
     573       book getword regDates $today valid_burntool -var valid_burntool
     574       $reg_datePAGE ++
     575       if ($reg_datePAGE >= $Npages) set reg_datePAGE = 0
     576     end
     577
    465578    $run = regtool -pendingburntoolimfile
    466     $today = `date -u +%Y-%m-%d`
     579
    467580# debugging purposes
    468 #    $today = "2010-12-06"
    469     $run = $run -date $today -valid_burntool $valid_burntool_value
    470     if ($DB:n == 0)
    471       option DEFAULT
    472     else
    473       # save the DB name for the exit tasks
    474       option $DB:$regPendingBurntoolImfile_DB
    475       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
    476       $regPendingBurntoolImfile_DB ++
    477       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
    478     end
     581#   $today = "2010-12-25"
     582    $dateobs_begin = $today\T$sunset
     583    $dateobs_end   = $today\T$sunrise
     584    $run = $run -dateobs_begin $dateobs_begin -dateobs_end $dateobs_end -valid_burntool $valid_burntool
     585    $run = $run -dbname $dbname
     586    option $dbname
     587#     if ($DB:n == 0)
     588#       option DEFAULT
     589#     else
     590#       # save the DB name for the exit tasks
     591#       option $DB:$regPendingBurntoolImfile_DB
     592#       $run = $run -dbname $DB:$regPendingBurntoolImfile_DB
     593#       if ("$dbname" != "$DB:$regPendingBurntoolImfile_DB")
     594#         break
     595#       end
     596#       $regPendingBurntoolImfile_DB ++
     597#       if ($regPendingBurntoolImfile_DB >= $DB:n) set regPendingBurntoolImfile_DB = 0
     598#     end
    479599
    480600#    echo $run
     
    574694end
    575695
    576    
     696task   register.initday.load
     697  host            local
     698  periods         -poll $LOADPOLL
     699  periods         -exec $LOADEXEC
     700  periods         -timeout 30
     701  trange          0:00:00 1:00:00 -nmax 1
     702  npending        1
     703
     704  task.exec
     705    $today = `date -u +%Y-%m-%d`
     706    book newpage regDates $today
     707    book setword regDates $today nsState NEW
     708    book setword regDates $today dbname $DB:0
     709    book setword regDates $today valid_burntool 14
     710
     711    command true
     712  end
     713
     714  task.exit       0
     715    # nothing to do here?
     716  end
     717  # locked list
     718  task.exit    default
     719    showcommand failure
     720  end
     721  task.exit    crash
     722    showcommand crash
     723  end
     724  #operation times out?
     725  task.exit    timeout
     726    showcommand timeout
     727  end
     728end
     729
    577730   
    578731 
Note: See TracChangeset for help on using the changeset viewer.