Changeset 25027 for branches/pap/ippScripts/scripts/ipp_serial_chip.pl
- Timestamp:
- Aug 7, 2009, 4:08:25 PM (17 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/ipp_serial_chip.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ippScripts/scripts/ipp_serial_chip.pl
r18446 r25027 13 13 use Pod::Usage qw( pod2usage ); 14 14 15 my ($dbname, # Database name to use16 $workdir_default, # Default working directory17 $verbose, # Verbose operations?18 $no_op, # No operations?19 $no_update, # No updating?15 my ($dbname, # Database name to use 16 $workdir_default, # Default working directory 17 $verbose, # Verbose operations? 18 $no_op, # No operations? 19 $no_update, # No updating? 20 20 ); 21 21 GetOptions( 22 'dbname=s' => \$dbname,23 'workdir=s' => \$workdir_default,24 'verbose' => \$verbose,25 'no-op' => \$no_op,26 'no-update' => \$no_update,22 'dbname=s' => \$dbname, 23 'workdir=s' => \$workdir_default, 24 'verbose' => \$verbose, 25 'no-op' => \$no_op, 26 'no-update' => \$no_update, 27 27 ) or pod2usage( 2 ); 28 28 29 29 pod2usage( -msg => "Required options: --dbname --workdir", 30 -exitval => 3,31 ) unless30 -exitval => 3, 31 ) unless 32 32 defined $dbname; 33 33 34 34 $workdir_default = `pwd` unless defined $workdir_default; 35 35 36 my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser36 my $mdcParser = PS::IPP::Metadata::Config->new; # Metadata config parser 37 37 my $ipprc = PS::IPP::Config->new; # IPP Configuration 38 38 … … 44 44 45 45 # Imfile processing 46 my @whole; # The whole list for processing46 my @whole; # The whole list for processing 47 47 { 48 48 my $command = "$chiptool -pendingimfile -dbname $dbname"; # Command to run 49 49 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 50 run( command => $command, verbose => 1 );50 run( command => $command, verbose => 1 ); 51 51 die "Unable to get phase 2 imfile list: $error_code\n" if not $success; 52 52 @whole = split /\n/, join( '', @$stdout_buf ); … … 59 59 push @single, $value; 60 60 if ($value =~ /^\s*END\s*$/) { 61 push @single, "\n"; 62 63 my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) ) or 64 die "Unable to parse output from chiptool.\n"; 65 66 foreach my $item (@$list) { 67 my $chip_id = $item->{chip_id}; 68 my $exp_id = $item->{exp_id}; 69 my $exp_tag = $item->{exp_tag}; 70 my $camera = $item->{camera}; 71 my $class_id = $item->{class_id}; 72 my $uri = $item->{uri}; 73 my $reduction = $item->{reduction}; 74 my $workdir = $item->{workdir}; 75 $workdir = $workdir_default unless (defined $workdir or $workdir ne "NULL"); 61 push @single, "\n"; 76 62 77 my $outroot = caturi( $workdir, $exp_tag, "$exp_tag.ch.$chip_id" ); 78 $ipprc->outroot_prepare( $outroot );63 my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) ) or 64 die "Unable to parse output from chiptool.\n"; 79 65 80 my $command = "$chip --chip_id $chip_id --exp_id $exp_id --class_id $class_id --uri $uri --dbname $dbname --camera $camera --outroot $outroot"; 81 $command .= " --reduction $reduction" if defined $reduction; 82 $command .= " --verbose" if defined $verbose; 83 $command .= " --no-op" if defined $no_op; 84 $command .= " --no-update" if defined $no_update; 85 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 86 run( command => $command, verbose => 1 ); 87 die "Unable to do phase 2 processing on $chip_id $class_id: $error_code\n" if not $success; 88 } 66 foreach my $item (@$list) { 67 my $chip_id = $item->{chip_id}; 68 my $exp_id = $item->{exp_id}; 69 my $exp_tag = $item->{exp_tag}; 70 my $chip_imfile_id = $item->{chip_imfile_id}; 71 my $camera = $item->{camera}; 72 my $class_id = $item->{class_id}; 73 my $uri = $item->{uri}; 74 my $reduction = $item->{reduction}; 75 my $state = $item->{state}; 76 my $workdir = $item->{workdir}; 77 $workdir = $workdir_default unless (defined $workdir or $workdir ne "NULL"); 89 78 90 @single = (); 79 my $outroot = caturi( $workdir, $exp_tag, "$exp_tag.ch.$chip_id" ); 80 $ipprc->outroot_prepare( $outroot ); 81 82 my $command = "$chip --chip_id $chip_id --chip_imfile_id $chip_imfile_id --exp_id $exp_id --class_id $class_id --uri $uri --dbname $dbname --camera $camera --outroot $outroot --run-state $state"; 83 $command .= " --reduction $reduction" if defined $reduction; 84 $command .= " --verbose" if defined $verbose; 85 $command .= " --no-op" if defined $no_op; 86 $command .= " --no-update" if defined $no_update; 87 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 88 run( command => $command, verbose => 1 ); 89 die "Unable to do phase 2 processing on $chip_id $class_id: $error_code\n" if not $success; 90 } 91 92 @single = (); 91 93 92 94 }
Note:
See TracChangeset
for help on using the changeset viewer.
