IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2013, 1:09:34 PM (13 years ago)
Author:
bills
Message:

Implement ACTION = 'PREVIEW' for postage stamp requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstampparse.pl

    r35363 r35364  
    411411
    412412    if ($action eq 'LIST') {
     413        # LIST is not allowed by caller. Can't get here.
    413414        return list_targets($rowList);
    414415    }
     
    516517    $row->{need_magic} = $need_magic;
    517518
    518     $num_jobs += queueJobs($mode, \@rowList, $imageList);
     519    $num_jobs += queueJobs($action, \@rowList, $imageList);
    519520
    520521    # if a row slipped through with no jobs add a faulted one
     
    538539    my $image = shift;
    539540    my $need_magic = shift;
    540     my $mode = shift;
     541    my $action = shift;
    541542
    542543    my $rownum = $row->{ROWNUM};
     
    621622    write_params($output_base, $image);
    622623
    623     my $newState = "run";
     624    my $newState = $action eq 'PROCESS' ? "run" : "parsed";
    624625    my $fault = 0;
    625626    my $dep_id;
    626627
    627     queueUpdatesIfNeeded($stage, $image, $option_mask, \$newState, \$fault, \$dep_id);
     628    queueUpdatesIfNeeded($action, $stage, $image, $option_mask, \$newState, \$fault, \$dep_id);
    628629
    629630    my $command = "$pstamptool -addjob  -req_id $req_id -job_type $row->{JOB_TYPE}"
     
    654655sub queueJobs
    655656{
    656     my $mode = shift;
     657    my $action = shift;
    657658    my $rowList = shift;
    658659    my $imageList = shift;
     
    674675        my_die( "error: unexpected number of rows for get_image request: $n", $PS_EXIT_PROG_ERROR) if $n != 1;
    675676
    676         $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $mode);
     677        $num_jobs = queueGetImageJobs($firstRow, $imageList, $stage, $need_magic, $action);
    677678
    678679    } else {
     
    702703                my $row = $rowList->[$i];
    703704
    704                 $num_jobs += queueJobForImage($row, $stage, $image, $need_magic, $mode);
     705                $num_jobs += queueJobForImage($row, $stage, $image, $need_magic, $action);
    705706            }
    706707        }
     
    716717    my $stage = shift;
    717718    my $need_magic = shift;
    718     my $mode = shift;
     719    my $action = shift;
    719720
    720721    my $num_jobs = 0;
     
    763764        write_params($output_base, $image);
    764765
    765         my $newState = "run";
     766        my $newState = $action eq 'PROCESS' ? "run" : "parsed";
    766767        my $fault = 0;
    767768        my $dep_id;
    768769
    769         queueUpdatesIfNeeded($stage, $image, $option_mask, \$newState, \$fault, \$dep_id);
     770        queueUpdatesIfNeeded($action, $stage, $image, $option_mask, \$newState, \$fault, \$dep_id);
    770771
    771772        $num_jobs++;
     
    909910sub get_dependent
    910911{
    911     my ($r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $component, $need_magic) = @_;
     912    my ($action, $r_jobState, $r_fault, $r_dep_id, $imagedb, $state, $stage, $stage_id, $component, $need_magic) = @_;
    912913
    913914    # chipRun's can be in full state if destreaking is necessary
     
    928929    my $command = "$pstamptool -getdependent -stage $stage -stage_id $stage_id -imagedb $imagedb -component $component -outdir $outdir";
    929930    $command .= " -need_magic" if $need_magic;
     931    $command .= ' -hold' if $action eq 'PREVIEW';
    930932
    931933    # compute rlabel for the run.
     
    977979
    978980sub queueUpdatesIfNeeded {
     981    my $action = shift;
    979982    my $stage = shift;
    980983    my $image = shift;
     
    10261029                    # set up to queue an update run
    10271030                    my $require_magic = ($need_magic or $image->{magicked});
    1028                     get_dependent(\$$r_newState, \$$r_fault, $r_dep_id, $image->{imagedb},
     1031                    get_dependent($action, \$$r_newState, \$$r_fault, $r_dep_id, $image->{imagedb},
    10291032                        $run_state, $stage, $image->{stage_id}, $image->{component}, $require_magic );
    10301033                }
Note: See TracChangeset for help on using the changeset viewer.