IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 18, 2012, 3:52:27 PM (14 years ago)
Author:
bills
Message:

Start working on version 2 of the postage stamp fits interface

File:
1 edited

Legend:

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

    r33670 r34447  
    9393my $fields_output;
    9494{
    95     my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME";
     95    my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USER EMAIL";
    9696    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    9797        run(command => $command, verbose => $verbose);
     
    102102    $fields_output = join "", @$stdout_buf;
    103103}
    104 my (undef, $extname, $extver, $req_name) = split " ", $fields_output;
     104my (undef, $extname, $extver, $req_name, $action, $username, $email) = split " ", $fields_output;
    105105
    106106# make sure the file contains what we are expecting
     
    109109my_die("$request_file_name is not a PS1_PS_REQEST", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST";
    110110my_die("REQ_NAME not found in $request_file_name", $PS_EXIT_PROG_ERROR)  if (!$req_name);
    111 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
     111my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1" and $extver ne "2");
    112112
    113113
     
    230230    # the images of interest for this new row doesn't match the list.
    231231    # process the list ...
    232     $num_jobs += processRows(\@rowList);
     232    $num_jobs += processRows($action, \@rowList);
    233233
    234234    # and reset the list to contain just the new row
     
    238238# out of rows process the list
    239239if (scalar @rowList > 0) {
    240     $num_jobs += processRows(\@rowList);
    241 }
    242 
    243 if (($mode eq "queue_job") and ($num_jobs eq 0)) {
     240    $num_jobs += processRows($action, \@rowList);
     241}
     242
     243if (($action eq 'LIST' or $mode eq "queue_job") and ($num_jobs eq 0)) {
    244244    print STDERR "no jobs created for $req_name\n" if $verbose;
    245245    insertFakeJobForRow(undef, 0, $PSTAMP_INVALID_REQUEST);
     
    387387}
    388388
    389 sub processRows {
     389sub list_targets {
    390390    my $rowList = shift;
    391391    my $num_jobs = 0;
     392
     393    $num_jobs = 1;
     394    return $num_jobs;
     395}
     396
     397sub processRows {
     398    my $action = shift;
     399    my $rowList = shift;
     400    my $num_jobs = 0;
     401
     402    if ($action eq 'LIST') {
     403        return list_targets($rowList);
     404    }
    392405
    393406    # all rows in the list are compatible
Note: See TracChangeset for help on using the changeset viewer.