IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37487


Ignore:
Timestamp:
Oct 13, 2014, 2:58:06 PM (12 years ago)
Author:
watersc1
Message:

Final revision to attempt to fix PART issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_poll.pl

    r37322 r37487  
    164164while (my $line = <STATFILE>) {
    165165    chomp $line;
    166     unless ($line =~ /dbinfo/) { next; }
     166#    unless ($line =~ /dbinfo/) { next; }
    167167
    168168    my @words = split (" ", $line);
    169169
    170     my ($stage_id, $class_id) = get_stage_id_from_dbinfo ($words[0]);
    171     print STDERR "stage_id : $stage_id, class_id: $class_id\n";
     170    my ($stage_id, $class_id, $component) = get_stage_id_from_filename ($words[0]);
     171    unless(defined($stage_id)) {
     172        print STDERR "Unable to convert file: $words[0]\n";
     173        next;
     174    }
     175#    print STDERR "stage_id : $stage_id, class_id: $class_id, \n";
    172176
    173177    if ($words[1] eq "PASS") {
    174         push @dbinfo_files, $words[0];
     178        if ($line =~ /dbinfo/) {
     179            push @dbinfo_files, $words[0];
     180        }
    175181        $stage_pass{$stage_id} = 1;
    176182        $Npass ++;
     
    189195if (1) {
    190196  foreach my $file (@dbinfo_files) {
     197      my ($stage_id, $class_id) = get_stage_id_from_dbinfo ($file);
     198      if (defined($stage_part{$stage_id})||
     199          defined($stage_fail{$stage_id})) {
     200          print STDERR "Skipping $file as it is not complete: " . $stage_part{$stage_id} . " " . $stage_fail{$stage_id} . "\n";
     201          next;
     202
     203      }
    191204      open(DBF,"$file") || warn "Missing file $file\n";
    192205      my $cmd = <DBF>;
     
    465478}
    466479
     480sub get_stage_id_from_filename {
     481    my $file = shift;
     482    my $stage = shift;
     483    my $stage_id = -1;
     484    my $class_id = '';
     485
     486    if ($stage eq 'chip') {
     487        ($stage_id, $class_id, $component) = $file =~ /ch\.(\d*).(XY\d\d).([\w\.]+)$/;
     488    }
     489    elsif ($stage eq 'camera') {
     490        if ($file =~ /XY/) {
     491            ($stage_id, $class_id, $component) = $file =~ /cm\.(\d*).(XY\d\d)\.([\w\.]+)$/;
     492        }
     493        else {
     494            ($stage_id, $component) = $file =~ /cm\.(\d*)\.([\w\.]+)$/;
     495            $class_id = 0;
     496        }
     497    }
     498    elsif ($stage eq 'warp') {
     499        ($stage_id, $class_id, $component) = $file =~ /wrp\.(\d*)\.(skycell.\d\d\d\d.\d\d\d).([\w\.]+)$/;
     500    }
     501    elsif ($stage eq 'stack') {
     502        ($stage_id, $component) = $file =~ /stk\.(\d*)\.([\w\.]+)$/;
     503        $class_id = 0;
     504    }
     505    return($stage_id,$class_id,$component);
     506}
     507
     508
     509
    467510sub fail_component {
    468511    my $remote_id = shift;
Note: See TracChangeset for help on using the changeset viewer.