IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12836


Ignore:
Timestamp:
Apr 16, 2007, 3:25:44 PM (19 years ago)
Author:
eugene
Message:

un-comment extname_rule

File:
1 edited

Legend:

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

    r12830 r12836  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.35 2007-04-13 03:15:04 price Exp $
     3# $Id: Config.pm,v 1.36 2007-04-17 01:25:44 eugene Exp $
    44
    55package PS::IPP::Config;
     
    380380
    381381# Return an EXTNAME From the EXTNAME.RULE table in the camera configuration
    382 ##  sub extname_rule
    383 ##  {
    384 ##      my $self = shift;               # Configuration object
    385 ##      my $name = shift;               # Name of the EXTNAME to build
    386 ##      my $component = shift;  # For replacing {CHIP.NAME}
    387 ## 
    388 ##      unless (defined $self and defined $name) {
    389 ##      carp "Programming error";
    390 ##      exit($PS_EXIT_PROG_ERROR);
    391 ##      }
    392 ## 
    393 ##      my $camera = $self->{camera}; # Camera configuration
    394 ##      unless (defined $camera) {
    395 ##      carp "Camera has not yet been defined.\n";
    396 ##      return undef;
    397 ##      }
    398 ## 
    399 ##      my $extname_rules = metadataLookupMD($camera, 'EXTNAME.RULES'); # File rules
    400 ##      unless (defined $extname_fules) {
    401 ##      carp "Can't find EXTNAME.RULES in camera configuration.\n";
    402 ##      return undef;
    403 ##      }
    404 ## 
    405 ##      my $extname = metadataLookupStr($file, $name); # File name
    406 ##      unless (defined $extname) {
    407 ##      carp "Can't find $name within EXTNAME.RULES in camera configuration.\n";
    408 ##      return undef;
    409 ##      }
    410 ## 
    411 ##      if ($extname =~ /\{CHIP\.NAME\}/) {
    412 ##      unless (defined $component) {
    413 ##          carp "Programming error";
    414 ##          exit($PS_EXIT_PROG_ERROR);
    415 ##      }
    416 ##      $extname =~ s/\{CHIP\.NAME\}/$component/;
    417 ##      }
    418 ## 
    419 ##      return $extname;
    420 ##  }   
     382sub extname_rule
     383{
     384    my $self = shift;           # Configuration object
     385    my $name = shift;           # Name of the EXTNAME to build
     386    my $component = shift;      # For replacing {CHIP.NAME}
     387
     388    unless (defined $self and defined $name) {
     389        carp "Programming error";
     390        exit($PS_EXIT_PROG_ERROR);
     391    }
     392
     393    my $camera = $self->{camera}; # Camera configuration
     394    unless (defined $camera) {
     395        carp "Camera has not yet been defined.\n";
     396        return undef;
     397    }
     398
     399    my $extname_rules = _mdLookupMD($camera, 'EXTNAME.RULES');  # File rules
     400    unless (defined $extname_rules) {
     401        carp "Can't find EXTNAME.RULES in camera configuration.\n";
     402        return undef;
     403    }
     404
     405    my $extname = _mdLookupStr($extname_rules, $name); # File name
     406    unless (defined $extname) {
     407        carp "Can't find $name within EXTNAME.RULES in camera configuration.\n";
     408        return undef;
     409    }
     410
     411    if ($extname =~ /\{CHIP\.NAME\}/) {
     412        unless (defined $component) {
     413            carp "Programming error";
     414            exit($PS_EXIT_PROG_ERROR);
     415        }
     416        $extname =~ s/\{CHIP\.NAME\}/$component/;
     417    }
     418
     419    return $extname;
     420}   
    421421
    422422# Return the DVO.CAMERADIR in the camera configuration
Note: See TracChangeset for help on using the changeset viewer.