X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=8b703306e25e0f1b94f86c1bbbddabca0a2a70e1;hb=963a74a359bda8ac6c348977f70d85e8e879697a;hp=3d671d76ae0c90f20a54050b37498f98fc703120;hpb=e884309a839e931eedb2efdc2a09901300bf4e31;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index 3d671d76..8b703306 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -330,11 +330,20 @@ sub search while (<$fh>) { my @r = split /\^/; ++$rec; + if ($dxchan) { + my ($gotone, undef) = $dxchan->{spotsfilter}->it(@r); + next unless $gotone; + } if (&$ecode(\@r)) { ++$count; next if $count < $from; - push @out, \@r; - last if $count >= $to; + if ($readback) { + push @out, \@r; + last if $count >= $to; + } else { + push @out, \@r; + shift @out if $count >= $to; + } } } dbg("Spot::search recs read: $rec") if isdbg('search'); @@ -384,24 +393,6 @@ sub formatl return sprintf "%8.1f %-11s %s %s %-28.28s%7s>", $_[0], $_[1], $d, $t, ($_[3]||''), "<$_[4]" ; } -# -# return all the spots from a day's file as an array of references -# the parameter passed is a julian day -sub readfile($) -{ - my @spots; - - my $fh = $fp->open(shift); - if ($fh) { - my $in; - while (<$fh>) { - chomp; - push @spots, [ split '\^' ]; - } - } - return @spots; -} - # enter the spot for dup checking and return true if it is already a dup sub dup {