X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdx.pl;h=42fb646c8c8748d0eaf07b2f422928c12e77d942;hb=07e07de14eea115273999b9706b591b586e88479;hp=e3d3aed284a3fdd4431830e158314355c9acfd4e;hpb=e5b0e3dee551a224de284a5ba550098256fcb268;p=spider.git diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index e3d3aed2..42fb646c 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -20,7 +20,7 @@ my $info; my $expr; while ($f = shift @list) { # next field - print "f: $f list: ", join(',', @list), "\n"; +# print "f: $f list: ", join(',', @list), "\n"; if (!$from && !$to) { ($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count? next if $from && $to > $from; @@ -30,28 +30,28 @@ while ($f = shift @list) { # next field next if $to; } if (lc $f eq 'on' && $list[0]) { # is it freq range? - print "yup freq\n"; +# print "yup freq\n"; my @r = split '/', $list[0]; - print "r0: $r[0] r1: $r[1]\n"; +# print "r0: $r[0] r1: $r[1]\n"; @freq = Bands::get_freq($r[0], $r[1]); if (@freq) { # yup, get rid of extranous param - print "freq: ", join(',', @freq), "\n"; +# print "freq: ", join(',', @freq), "\n"; shift @list; next; } } if (lc $f eq 'day' && $list[0]) { - print "got day\n"; +# print "got day\n"; ($fromday, $today) = split '-', shift(@list); next; } if (lc $f eq 'info' && $list[0]) { - print "got info\n"; +# print "got info\n"; $info = shift @list; next; } if (lc $f eq 'spotter' && $list[0]) { - print "got spotter\n"; +# print "got spotter\n"; $spotter = uc shift @list; next; } @@ -79,7 +79,7 @@ if (@freq) { $expr .= ($expr) ? " && (" : "("; my $i; for ($i; $i < @freq; $i += 2) { - $expr .= "(\$f0 >= $freq[0] && \$f0 <= $freq[1]) ||"; + $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||"; } chop $expr; chop $expr; @@ -100,7 +100,7 @@ if ($spotter) { $expr .= "\$f4 =~ /$spotter/o"; } -print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n"; +#print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n"; # now do the search my @res = Spot::search($expr, $fromday, $today, $from, $to); @@ -108,9 +108,7 @@ my $ref; my @dx; foreach $ref (@res) { @dx = @$ref; - my $t = ztime($dx[2]); - my $d = cldate($dx[2]); - push @out, sprintf "%9s %-12s %s %s %-28s <%s>", $dx[0], $dx[1], $d, $t, $dx[3], $dx[4]; + push @out, Spot::formatl(@dx); } return (1, @out);