X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=3d671d76ae0c90f20a54050b37498f98fc703120;hb=8c339125008c925eefda7c815ccabac9c577ae3f;hp=185711b5b428f1b3099b0def7030e4a7afd75f03;hpb=3e780d5e889b981487da08cfdef8d9017d46fa8b;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index 185711b5..3d671d76 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -63,10 +63,9 @@ $filterdef = bless ([ $totalspots = $hfspots = $vhfspots = 0; $use_db_for_search = 0; -our $usetac = 1; -our $readback; +our $readback = 0; -if ($usetac) { +if ($readback) { $readback = `which tac`; chomp $readback; } @@ -293,7 +292,7 @@ sub search return $main::dbh->spot_search($hint, $dayfrom, $dayto, $to-$from, $dxchan); } -# $expr =~ s/\$f(\d\d?)/\$ref->[$1]/g; # swap the letter n for the correct field name + # $expr =~ s/\$f(\d\d?)/\$ref->[$1]/g; # swap the letter n for the correct field name # $expr =~ s/\$f(\d)/\$spots[$1]/g; # swap the letter n for the correct field name @@ -313,16 +312,17 @@ sub search my @spots; my $recs; - for ($i = $count = 0; $count < $to && $i < $maxdays; ++$i) { # look thru $maxdays worth of files only + for ($i = $count = 0; $count < $to && $i < $maxdays; ++$i) { # look thru $maxdays worth of files only last if $now->cmp($todate) <= 0; my $fn = $fp->fn($now->sub($i)); if ($readback) { dbg("Spot::search search using tac fn: $fn $i") if isdbg('search'); $fh = IO::File->new("$readback $fn |"); - } else { + } + else { dbg("Spot::search search fn: $fp->{fn} $i") if isdbg('search'); - $fh = $fp->open($now->sub($i)); # get the next file + $fh = $fp->open($now->sub($i)); # get the next file } if ($fh) { my $rec = 0; @@ -343,9 +343,8 @@ sub search return ("Spot search error", $@) if $@; } } - - - return $readback ? @out : reverse @out; + @out = sort {$b->[2] <=> $a->[2]} @out if @out; + return @out; } # change a freq range->regular expression