X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdxcc.pl;fp=cmd%2Fshow%2Fdxcc.pl;h=0000000000000000000000000000000000000000;hb=ef646bd5c8fc8606448c8ac2019e048427741f67;hp=f5826e47c9be561d208ca62123f35385d1b866c9;hpb=cc8043c4d905986b3dc949bbde21ed4aeb254f8c;p=spider.git diff --git a/cmd/show/dxcc.pl b/cmd/show/dxcc.pl deleted file mode 100644 index f5826e47..00000000 --- a/cmd/show/dxcc.pl +++ /dev/null @@ -1,99 +0,0 @@ -# -# show dx using the dxcc number as the basis for searchs for each callsign or prefix entered -# -# $Id$ -# - -my ($self, $line) = @_; -my @list = split /\s+/, $line; # split the line up - -my @out; -my $f; -my $call; -my ($from, $to); -my ($fromday, $today); -my @freq; -my @ans; - -while ($f = shift @list) { # next field -# 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; - } - if (!$to) { - ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count? - next if $to; - } - if (lc $f eq 'on' && $list[0]) { # is it freq range? -# print "yup freq\n"; - my @r = split '/', $list[0]; -# 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"; - shift @list; - next; - } - } - if (lc $f eq 'day' && $list[0]) { -# print "got day\n"; - ($fromday, $today) = split '-', $list[0]; - shift @list; - next; - } - if (!@ans) { - @ans = Prefix::extract($f); # is it a callsign/prefix? - } -} - -# no dxcc country, no answer! -if (@ans) { # we have a valid prefix! - - # first deal with the prefix - my $pre = shift @ans; - my $a; - my $expr = "("; - my $str = "Prefix: $pre"; - my $l = length $str; - - # build up a search string for this dxcc country/countries - foreach $a (@ans) { - $expr .= " || " if $expr ne "("; - my $n = $a->dxcc(); - $expr .= "\$f5 == $n"; - my $name = $a->name(); - $str .= " Dxcc: $n ($name)"; - push @out, $str; - $str = pack "A$l", " "; - } - $expr .= ")"; - push @out, $str; - - # now deal with any frequencies specified - if (@freq) { - $expr .= " && ("; - my $i; - for ($i = 0; $i < @freq; $i += 2) { - $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||"; - } - chop $expr; - chop $expr; - $expr .= ")"; - } - -# 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); - my $ref; - my @dx; - foreach $ref (@res) { - @dx = @$ref; - push @out, Spot::formatl(@dx); - } -} else { - @out = $self->msg('e4'); -} - -return (1, @out);