- Timestamp:
- Mar 23, 2023, 2:05:41 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/check_chip_locations.pl
r42415 r42430 13 13 use Getopt::Long qw( GetOptions :config auto_help auto_version ); 14 14 15 # USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) 16 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt 17 18 my ($fulldate, $dateword, $chiplist ) = &parse_cmdopts;15 # USAGE: check_chip_locations.pl --dateobs (night) --chiplist (file) --stage (v0,v1,etc) 16 # USAGE: check_chip_locations.pl --dateobs 2010/05/01 --chiplist gpc1.chips.txt --stage v0 17 18 my ($fulldate, $dateword, $chiplist, $stage) = &parse_cmdopts; 19 19 my ($neb_dbh, $gpc_dbh) = &parse_db_config ('nebulous.config'); 20 20 … … 30 30 31 31 # output files: 32 # instance lists by host: YYYYMMDD/HOSTNAME.inst. txt32 # instance lists by host: YYYYMMDD/HOSTNAME.inst.STAGE.txt 33 33 # chip states by chip: YYYYMMDD/CHIPNAME.uris.txt 34 34 … … 79 79 my @hostnames = keys %hostcount; 80 80 foreach my $myname (@hostnames) { 81 print $hostfh " host $myname =$hostcount{$myname}\n";81 print $hostfh "$myname $hostcount{$myname}\n"; 82 82 } 83 83 close ($hostfh); … … 231 231 232 232 if (not defined $hostfile{$hostname}) { 233 open ($hostfile{$hostname}, ">$dateword/$hostname.inst. txt");233 open ($hostfile{$hostname}, ">$dateword/$hostname.inst.$stage.txt"); 234 234 ## XXX deal with open failure here 235 235 } … … 330 330 sub parse_cmdopts { 331 331 332 my ($dateobs, $chiplist );333 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist ) || pod2usage(2);332 my ($dateobs, $chiplist, $stage); 333 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'stage=s' => \$stage) || pod2usage(2); 334 334 335 335 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 336 336 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 337 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 337 338 338 339 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 343 344 pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_month < 1) or ($date_month > 12); 344 345 pod2usage( -msg => "Cannot interpret date, use YYYY/MM/DD", -exitval => 2) if ($date_day < 1) or ($date_day > 31); 346 345 347 my $fulldate = "$date_year/$date_month/$date_day"; 346 347 348 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 348 349 349 return ($fulldate, $dateword, $chiplist )350 return ($fulldate, $dateword, $chiplist, $stage) 350 351 } 351 352
Note:
See TracChangeset
for help on using the changeset viewer.
