Changeset 32378
- Timestamp:
- Sep 8, 2011, 3:08:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20110622/ippScripts/scripts/chip_imfile.pl
- Property svn:mergeinfo set to
r30518 r32378 44 44 my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose, 45 45 $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned ); 46 46 47 GetOptions( 47 48 'exp_id=s' => \$exp_id, # Exposure identifier … … 88 89 } 89 90 90 my ($log Dest, $traceDest);91 my ($logRule, $traceDest); 91 92 if ($run_state eq 'new') { 92 $log Dest = prepare_output("LOG.IMFILE", $outroot, $class_id, 0);93 $logRule = "LOG.IMFILE"; 93 94 $traceDest = prepare_output("TRACE.IMFILE", $outroot, $class_id, 1); 94 95 } else { 95 $log Dest = prepare_output("LOG.IMFILE.UPDATE", $outroot, $class_id, 1);96 $logRule = "LOG.IMFILE.UPDATE"; 96 97 $traceDest = prepare_output("TRACE.IMFILE.UPDATE", $outroot, $class_id, 1); 97 98 } 98 99 99 100 if ($redirect) { 100 $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR ); 101 my $logDest = $ipprc->filename($logRule, $outroot, $class_id); 102 103 $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR ); 104 101 105 print STDOUT "\n\n"; 102 106 print STDOUT "Starting script $0 on $host\n\n"; … … 115 119 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files 116 120 117 &my_die("Couldn't find input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri);121 # &my_die("Couldn't find input file: $uri\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($uri); 118 122 119 123 # outroot examples (HOST components must be set) … … 264 268 ## Read camera config to get the current good burntool state : 265 269 ## XXX This is extremely slow. Any better way to do this? 266 my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -"; 267 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 268 run(command => $camera_config_cmd, verbose => 0); 269 unless ($success) { 270 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 271 &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 272 } 273 274 my $camData = $mdcParser->parse(join "", @$stdout_buf) or 275 &my_die("Unable to parse ppConfigDump metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 276 277 my $burntoolStateGood; 278 my $burntoolStateGoodUpdate; 279 foreach my $camEntry (@$camData) { 280 if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD") { 281 $burntoolStateGood = $camEntry->{value}; 282 } 283 if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD.UPDATE") { 284 $burntoolStateGoodUpdate = $camEntry->{value}; 285 } 286 } 270 ## my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -"; 271 ## ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 272 ## run(command => $camera_config_cmd, verbose => 0); 273 ## unless ($success) { 274 ## $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 275 ## &my_die("Unable to perform ppConfigDump: $error_code", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 276 ## } 277 ## 278 ## my $camData = $mdcParser->parse(join "", @$stdout_buf) or 279 ## &my_die("Unable to parse ppConfigDump metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 280 281 ## XXX short term hack until we have a C-based parser 282 my $burntoolStateGood = 14; 283 my $burntoolStateGoodUpdate = 13; 284 ## foreach my $camEntry (@$camData) { 285 ## if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD") { 286 ## $burntoolStateGood = $camEntry->{value}; 287 ## } 288 ## if ($camEntry->{name} eq "BURNTOOL.STATE.GOOD.UPDATE") { 289 ## $burntoolStateGoodUpdate = $camEntry->{value}; 290 ## } 291 ## } 287 292 288 293 if ($run_state eq 'new') { … … 446 451 $command .= " -image_id $chip_imfile_id" if defined $chip_imfile_id; 447 452 $command .= " -source_id $source_id" if defined $source_id; 448 $command .= " -tracedest $traceDest -log $logDest";453 $command .= " -tracedest $traceDest"; 449 454 $command .= " -dbname $dbname" if defined $dbname; 450 455
Note:
See TracChangeset
for help on using the changeset viewer.
