Changeset 27718 for trunk/ippScripts/scripts/register_imfile.pl
- Timestamp:
- Apr 21, 2010, 11:35:15 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/register_imfile.pl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/register_imfile.pl
r26378 r27718 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 my $date = `date`; 10 11 print "\n\n"; 11 print "Starting script $0 on $host \n\n";12 print "Starting script $0 on $host at $date\n\n"; 12 13 13 14 use vars qw( $VERSION ); … … 115 116 my $burntoolStateGood = 0; 116 117 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 } 127 128 } 128 129 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. 130 131 } 131 132 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 152 153 } 153 154 $cmdflags .= " -burntool_state $burntoolState ";
Note:
See TracChangeset
for help on using the changeset viewer.
