IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15474


Ignore:
Timestamp:
Nov 6, 2007, 12:02:09 PM (19 years ago)
Author:
Paul Price
Message:

Altering so that parsing the output from chiptool doesn't take forever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/ipp_serial_chip.pl

    r14492 r15474  
    3838
    3939# Phase 2 imfile processing
    40 my $list;
     40my @whole;                      # The whole list for processing
    4141{
    4242    my $command = "$chiptool -pendingimfile -dbname $dbname"; # Command to run
     
    4444        run( command => $command, verbose => 1 );
    4545    die "Unable to get phase 2 imfile list: $error_code\n" if not $success;
    46     $list = parse_md_list( $mdcParser->parse( join( '', @$stdout_buf ) ) ) or
    47         die "Unable to parse output from chiptool.\n";
     46    my @whole = split /\n/, join( '', @$stdout_buf );
    4847}
    4948
    50 foreach my $item (@$list) {
    51     my $chip_id = $item->{chip_id};
    52     my $exp_id = $item->{exp_id};
    53     my $exp_tag = $item->{exp_tag};
    54     my $camera = $item->{camera};
    55     my $class_id = $item->{class_id};
    56     my $uri = $item->{uri};
    57     my $reduction = $item->{reduction};
    58    
    59     my $command = "$chip --chip_id $chip_id --exp_id $exp_id --exp_tag $exp_tag --class_id $class_id --uri $uri --dbname $dbname --camera $camera";
    60     $command .= " --reduction $reduction" if defined $reduction;
    61     $command .= " --no-op" if defined $no_op;
    62     $command .= " --no-update" if defined $no_update;
    63     $command .= " --workdir $workdir" if defined $workdir;
    64     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    65         run( command => $command, verbose => 1 );
    66     die "Unable to do phase 2 processing on $chip_id $class_id: $error_code\n" if not $success;
     49my @single = ();
     50
     51while ( scalar @while > 0 ) {
     52    my $value = shift @whole;
     53    push @single, $value;
     54    if ($value =~ /^\s*END\s*$/) {
     55        push @single, "\n";
     56       
     57        my $list = parse_md_list( $mdcParser->parse( join( "\n", @single ) ) ) or
     58            die "Unable to parse output from chiptool.\n";
     59           
     60        foreach my $item (@$list) {
     61            my $chip_id = $item->{chip_id};
     62            my $exp_id = $item->{exp_id};
     63            my $exp_tag = $item->{exp_tag};
     64            my $camera = $item->{camera};
     65            my $class_id = $item->{class_id};
     66            my $uri = $item->{uri};
     67            my $reduction = $item->{reduction};
     68           
     69            my $command = "$chip --chip_id $chip_id --exp_id $exp_id --exp_tag $exp_tag --class_id $class_id --uri $uri --dbname $dbname --camera $camera";
     70            $command .= " --reduction $reduction" if defined $reduction;
     71            $command .= " --no-op" if defined $no_op;
     72            $command .= " --no-update" if defined $no_update;
     73            $command .= " --workdir $workdir" if defined $workdir;
     74            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     75                run( command => $command, verbose => 1 );
     76            die "Unable to do phase 2 processing on $chip_id $class_id: $error_code\n" if not $success;
     77        }
     78
     79        @single = ();
     80
     81    }
    6782}
    6883
Note: See TracChangeset for help on using the changeset viewer.