2 # show dx using the dxcc number as the basis for searchs for each callsign or prefix entered
7 my ($self, $line) = @_;
8 my @list = split /\s+/, $line; # split the line up
14 my ($fromday, $today);
18 while ($f = shift @list) { # next field
19 # print "f: $f list: ", join(',', @list), "\n";
21 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count?
22 next if $from && $to > $from;
25 ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
28 if (lc $f eq 'on' && $list[0]) { # is it freq range?
30 my @r = split '/', $list[0];
31 # print "r0: $r[0] r1: $r[1]\n";
32 @freq = Bands::get_freq($r[0], $r[1]);
33 if (@freq) { # yup, get rid of extranous param
34 # print "freq: ", join(',', @freq), "\n";
39 if (lc $f eq 'day' && $list[0]) {
41 ($fromday, $today) = split '-', $list[0];
46 @ans = Prefix::extract($f); # is it a callsign/prefix?
50 # no dxcc country, no answer!
51 if (@ans) { # we have a valid prefix!
53 # first deal with the prefix
57 my $str = "Prefix: $pre";
60 # build up a search string for this dxcc country/countries
62 $expr .= " || " if $expr ne "(";
64 $expr .= "\$f5 == $n";
65 my $name = $a->name();
66 $str .= " Dxcc: $n ($name)";
68 $str = pack "A$l", " ";
73 # now deal with any frequencies specified
77 for ($i = 0; $i < @freq; $i += 2) {
78 $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||";
85 # print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
88 my @res = Spot::search($expr, $fromday, $today, $from, $to);
93 push @out, Spot::formatl(@dx);
96 @out = $self->msg('e4');