Changeset 12836
- Timestamp:
- Apr 16, 2007, 3:25:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
r12830 r12836 1 1 # Copyright (c) 2006 Paul Price, Joshua Hoblitt 2 2 # 3 # $Id: Config.pm,v 1.3 5 2007-04-13 03:15:04 price Exp $3 # $Id: Config.pm,v 1.36 2007-04-17 01:25:44 eugene Exp $ 4 4 5 5 package PS::IPP::Config; … … 380 380 381 381 # Return an EXTNAME From the EXTNAME.RULE table in the camera configuration 382 ##sub extname_rule383 ##{384 ##my $self = shift; # Configuration object385 ##my $name = shift; # Name of the EXTNAME to build386 ##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 configuration394 ##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 rules400 ## 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 name406 ##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 ##}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 = _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 } 421 421 422 422 # Return the DVO.CAMERADIR in the camera configuration
Note:
See TracChangeset
for help on using the changeset viewer.
