IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13724


Ignore:
Timestamp:
Jun 8, 2007, 12:53:39 PM (19 years ago)
Author:
eugene
Message:

rejection is now a recipe, parsed by ppConfigDump

File:
1 edited

Legend:

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

    r13693 r13724  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.58 2007-06-07 02:29:11 price Exp $
     3# $Id: Config.pm,v 1.59 2007-06-08 22:53:39 eugene Exp $
    44
    55package PS::IPP::Config;
     
    166166    close $file;
    167167    $self->{camera} = $parser->parse( join '', @contents); # The parsed metadata config
     168    $self->{cameraName} = $name;
    168169
    169170    unless (defined $self->{camera}) {
     
    222223    my $pathname = metadataLookupStr($path_list, $name); # Path of interest
    223224    unless (defined $pathname) {
    224         carp "Unable to find camera configuration file $pathname\n" ;
     225        carp "Unable to find datapath $name\n" ;
    225226        exit($PS_EXIT_CONFIG_ERROR);
    226227    }
     
    548549
    549550    unless (defined $self->{rejection}) {
    550         my $camera = $self->{camera}; # Camera configuration
     551        my $camera = $self->{cameraName}; # Camera name
    551552        unless (defined $camera) {
    552553            carp "Camera has not yet been defined.\n";
     
    554555        }
    555556       
    556         my $rejName = metadataLookupStr($camera, 'REJECTIONS'); # Name of rejection file
    557         unless (defined $rejName) {
    558             carp "Can't find REJECTIONS list in camera configuration.\n";
    559             return undef;
    560         }
     557        # rejections are saved as a recipe: REJECTIONS
     558        my @rejContents = `ppConfigDump -dump-recipe REJECTIONS -camera $camera -`;
    561559       
    562         my $rejRealName = $self->_find_config($rejName); # Resolved filename, after hunting the PATH
    563 
    564         my $rejFile;            # Rejection file handle
    565         unless (open $rejFile, $rejRealName) {
    566             carp "Unable to open rejection file $rejRealName: $!";
    567             exit($PS_EXIT_CONFIG_ERROR);
    568         }
    569         my @rejContents = <$rejFile>; # Contents of the rejection file
    570         close $rejFile;
    571 
     560        # load from resulting psMetadataConfig
    572561        $self->{rejection} = $parser->parse( join '', @rejContents); # The rejection metadata
    573562        unless (defined $self->{rejection}) {
    574             carp "Unable to parse rejection file $rejRealName.";
     563            carp "Unable to parse REJECTION recipe for $camera.";
    575564            exit($PS_EXIT_CONFIG_ERROR);
    576565        }
Note: See TracChangeset for help on using the changeset viewer.