IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32378


Ignore:
Timestamp:
Sep 8, 2011, 3:08:13 PM (15 years ago)
Author:
bills
Message:

Use new function to rename existing log files. Remove -log option to ppImage.
It will inherit stdout

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20110622/ippScripts/scripts/chip_imfile.pl

    r30518 r32378  
    4444my ( $exp_id, $chip_id, $class_id, $chip_imfile_id, $uri, $camera, $outroot, $dbname, $run_state, $reduction, $threads, $verbose,
    4545     $no_update, $save_temps, $no_op, $redirect, $magicked, $deburned );
     46
    4647GetOptions(
    4748    'exp_id=s'          => \$exp_id,    # Exposure identifier
     
    8889}
    8990
    90 my ($logDest, $traceDest);
     91my ($logRule, $traceDest);
    9192if ($run_state eq 'new') {
    92     $logDest = prepare_output("LOG.IMFILE", $outroot, $class_id, 0);
     93    $logRule = "LOG.IMFILE";
    9394    $traceDest = prepare_output("TRACE.IMFILE",  $outroot, $class_id, 1);
    9495} else {
    95     $logDest = prepare_output("LOG.IMFILE.UPDATE", $outroot, $class_id, 1);
     96    $logRule = "LOG.IMFILE.UPDATE";
    9697    $traceDest = prepare_output("TRACE.IMFILE.UPDATE",  $outroot, $class_id, 1);
    9798}
    9899
    99100if ($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
    101105    print STDOUT "\n\n";
    102106    print STDOUT "Starting script $0 on $host\n\n";
     
    115119my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
    116120
    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);
    118122
    119123# outroot examples (HOST components must be set)
     
    264268        ## Read camera config to get the current good burntool state :
    265269        ## 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        ## }
    287292
    288293        if ($run_state eq 'new') {
     
    446451    $command .= " -image_id $chip_imfile_id" if defined $chip_imfile_id;
    447452    $command .= " -source_id $source_id" if defined $source_id;
    448     $command .= " -tracedest $traceDest -log $logDest";
     453    $command .= " -tracedest $traceDest";
    449454    $command .= " -dbname $dbname" if defined $dbname;
    450455
Note: See TracChangeset for help on using the changeset viewer.