IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 12:49:05 PM (16 years ago)
Author:
eugene
Message:

merging changes from trunk into branches/pap

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ippScripts/scripts/register_imfile.pl

    r26378 r28003  
    88use Sys::Hostname;
    99my $host = hostname();
     10my $date = `date`;
    1011print "\n\n";
    11 print "Starting script $0 on $host\n\n";
     12print "Starting script $0 on $host at $date\n\n";
    1213
    1314use vars qw( $VERSION );
     
    115116    my $burntoolStateGood = 0;
    116117    foreach my $line (split /\n/, $out1) {
    117         if ($line =~ /FPA.BURNTOOL.APPLIED/) {
    118             $line =~ s/^\s+//;
    119             $burntoolState = (split /\s+/, $line)[2];
    120         }
    121         if ($line =~ /FPA.CAMERA/) {
    122             $line =~ s/^\s+//;
    123             if ((split /\s+/, $line)[2] eq 'GPC1') {
    124                 $isGPC1 = 1;
    125             }
    126         }
     118        if ($line =~ /FPA.BURNTOOL.APPLIED/) {
     119            $line =~ s/^\s+//;
     120            $burntoolState = (split /\s+/, $line)[2];
     121        }
     122        if ($line =~ /FPA.CAMERA/) {
     123            $line =~ s/^\s+//;
     124            if ((split /\s+/, $line)[2] eq 'GPC1') {
     125                $isGPC1 = 1;
     126            }
     127        }
    127128    }
    128129    if ($isGPC1 != 1) {
    129         $burntoolState = 0; # If it's not GPC1, you shouldn't have run burntool.
     130        $burntoolState = 0; # If it's not GPC1, you shouldn't have run burntool.
    130131    }
    131132    elsif (($isGPC1 == 1) && ($burntoolState == 1)) {
    132 #       print STDERR "In the good region: >>$burntoolState<<\n";
    133         my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -dump-camera -";
    134         my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    135             IPC::Cmd::run(command => $ppConfigDump_cmd, verbose => $verbose);
    136         unless ($success) {
    137             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    138             warn ("Unable to perform ppConfigDump");
    139             exit($error_code);
    140         }
    141 
    142         # This is ugly, but doing a full parse for one entry is a bit wasteful.
    143         foreach my $line (split /\n/, (join "", @$stdout_buf)) {
    144             if ($line =~ /BURNTOOL.STATE.GOOD/) {
    145                 $line =~ s/^\s+//;
    146                 $burntoolStateGood = (split /\s+/, $line)[2];
    147                 last;
    148             }
    149         }
    150         $burntoolState = $burntoolStateGood; # Positive because this has the header table.
    151        
     133#       print STDERR "In the good region: >>$burntoolState<<\n";
     134        my $ppConfigDump_cmd = "$ppConfigDump -camera GPC1 -dump-camera -";
     135        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     136            IPC::Cmd::run(command => $ppConfigDump_cmd, verbose => $verbose);
     137        unless ($success) {
     138            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     139            warn ("Unable to perform ppConfigDump");
     140            exit($error_code);
     141        }
     142
     143        # This is ugly, but doing a full parse for one entry is a bit wasteful.
     144        foreach my $line (split /\n/, (join "", @$stdout_buf)) {
     145            if ($line =~ /BURNTOOL.STATE.GOOD/) {
     146                $line =~ s/^\s+//;
     147                $burntoolStateGood = (split /\s+/, $line)[2];
     148                last;
     149            }
     150        }
     151        $burntoolState = $burntoolStateGood; # Positive because this has the header table.
     152
    152153    }
    153154    $cmdflags .= " -burntool_state $burntoolState ";
     
    173174$command .= " -hostname $host" if defined $host;
    174175$command .= " -dbname $dbname" if defined $dbname;
     176$command .= " -data_state full";
    175177$command .= " $cmdflags";
    176178
Note: See TracChangeset for help on using the changeset viewer.