IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34448 for trunk


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

start working on postage stamp request interface version 2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm

    r33511 r34448  
    2525                    $PSTAMP_SELECT_WEIGHT
    2626                    $PSTAMP_SELECT_CMF
     27                    $PSTAMP_SELECT_SOURCES
    2728                    $PSTAMP_SELECT_PSF
    2829                    $PSTAMP_SELECT_BACKMDL
     
    3233                    $PSTAMP_SELECT_UNCONV
    3334                    $PSTAMP_RESTORE_BACKGROUND
     35                    $PSTAMP_USE_IMFILE_ID
     36                    $PSTAMP_NO_WAIT_FOR_UPDATE
    3437                    $PSTAMP_REQUEST_UNCENSORED
    3538                    $PSTAMP_REQUIRE_UNCENSORED
    36                     $PSTAMP_USE_IMFILE_ID
    37                     $PSTAMP_NO_WAIT_FOR_UPDATE
    3839                    $PSTAMP_SUCCESS
    3940                    $PSTAMP_FIRST_ERROR_CODE
     
    5960our $PSTAMP_RANGE_IN_PIXELS  = 2;
    6061
     62# Definition of the bits in OPTION_MASK
    6163our $PSTAMP_SELECT_IMAGE     = 1;
    6264our $PSTAMP_SELECT_MASK      = 2;
    6365our $PSTAMP_SELECT_VARIANCE  = 4;
    6466our $PSTAMP_SELECT_WEIGHT    = 4;
     67our $PSTAMP_SELECT_SOURCES   = 8;
    6568our $PSTAMP_SELECT_CMF       = 8;
    6669our $PSTAMP_SELECT_PSF       = 16;
    6770our $PSTAMP_SELECT_BACKMDL   = 32;
    6871our $PSTAMP_SELECT_JPEG      = 64;
     72# unused 128
     73# unused 256
    6974our $PSTAMP_SELECT_UNCOMPRESSED = 512;
    70 our $PSTAMP_SELECT_INVERSE   = 1024;
    71 our $PSTAMP_SELECT_UNCONV    = 2048;
    72 our $PSTAMP_RESTORE_BACKGROUND = 4096;
    73 
    74 our $PSTAMP_USE_IMFILE_ID    = 16384;
    75 
     75our $PSTAMP_SELECT_INVERSE      = 1024;
     76our $PSTAMP_SELECT_UNCONV       = 2048;
     77our $PSTAMP_RESTORE_BACKGROUND  = 4096;
     78# unused 8192
     79
     80our $PSTAMP_USE_IMFILE_ID      = 16384;
    7681our $PSTAMP_NO_WAIT_FOR_UPDATE = 32768;
    77 our $PSTAMP_REQUEST_UNCENSORED = 1 << 16;
    78 our $PSTAMP_REQUIRE_UNCENSORED = 1 << 17;
     82our $PSTAMP_REQUEST_UNCENSORED = 0x10000;
     83our $PSTAMP_REQUIRE_UNCENSORED = 0x20000;
    7984
    8085# job and result codes
     
    162167    my $fields_output;
    163168    {
    164         my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME";
     169        my $command = "echo $request_file_name | $fields -x 0 EXTNAME EXTVER REQ_NAME ACTION USERNAME EMAIL";
    165170        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    166171            run(command => $command, verbose => $verbose);
    167172        $fields_output = join "", @$stdout_buf;
    168173    }
    169     my (undef, $extname, $extver, $req_name) = split " ", $fields_output;
     174    my (undef, $extname, $extver, $req_name, $action, $username, $email) = split " ", $fields_output;
    170175
    171176    # make sure the file contains what we are expecting
     
    174179                    if !$extname or ($extname ne "PS1_PS_REQUEST");
    175180    die "REQ_NAME not found in $request_file_name"  if (!$req_name);
    176     die "wrong EXTVER $extver found in $request_file_name" if ($extver ne "1");
     181    die "wrong EXTVER $extver found in $request_file_name" if ($extver ne "2" and $extver ne "1");
    177182
    178183    my %header;
     
    180185    $header{EXTVER}   = $extver;
    181186    $header{EXTNAME}  = $extname;
     187    if ($extver > 1) {
     188        $header{ACTION} = $action;
     189        $header{USER} = $username;
     190        $header{EMAIL} = $email;
     191    } else {
     192        $header{ACTION} = $action = "PROCESS";
     193        $header{USERNAME} = 'null';
     194        $header{EMAIL} = 'null';
     195    }
     196
     197    if ($action eq "LIST") {
     198        return (\%header, undef);
     199    } elsif ($action ne "PROCESS") {
     200        die "unexpected request ACTION found: $action in $request_file_name";
     201    }
     202
    182203
    183204    #
Note: See TracChangeset for help on using the changeset viewer.