so that I only have one sh/dx to maintain.
+23Dec01=======================================================================
+1. allow sh/dx on 1000/4000 (or 1000-4000).
+2. merge sh/dx and sh/dxcc commands (Alias sh/dxcc to sh/dx dxcc). You can
+now do things like 'sh/dxcc oq2 by w dxcc'.
20Dec01=======================================================================
1. Fix 'not' in filtering
2. alter default max spots to 100 and the no of WWV to 5
'^sho?w?/c/n', 'show/configuration nodes', 'show/configuration',
'^sho?w?/c$', 'show/configuration', 'show/configuration',
'^sho?w?/com', 'dbavail', 'dbavail',
+ '^sho?w?/dxcc', 'show/dx dxcc', 'show/dx',
'^sho?w?/dx/(\d+)-(\d+)', 'show/dx $1-$2', 'show/dx',
'^sho?w?/dx/(\d+)', 'show/dx $1', 'show/dx',
'^sho?w?/dx/d(\d+)', 'show/dx from $1', 'show/dx',
on <band> - eg 160m 20m 2m 23cm 6mm
on <region> - eg hf vhf uhf shf (see SHOW/BANDS)
+on <from>/<to> - eg 1000/4000 14000-30000 (in Khz)
+ <from>-<to>
<number> - the number of spots you want
<from>-<to> - <from> spot no <to> spot no in the selected list
+<from>/<to>
<prefix> - for a spotted callsign beginning with <prefix>
*<suffix> - for a spotted callsign ending in <suffix>
day <number> - starting <number> days ago
day <from>-<to> - <from> days <to> days ago
-
+ <from>/<to>
+
info <text> - any spots containing <text> in the info or remarks
by <call> - any spots spotted by <call> (spotter <call> is the
qra [<locator>] - this will look for the specific locator if you specify
one or else anything that looks like a locator.
+
+dxcc - treat the prefix as a 'country' and look for spots
+ from that country regardless of actual prefix.
+ eg dxcc oq2
+
+ You can also use this with the 'by' keyword so
+ eg by W dxcc
e.g.
SH/DX iota
SH/DX iota eu-064
SH/DX qra jn86
+ SH/DX dxcc oq2
+ SH/DX dxcc oq2 by w dxcc
=== 0^SHOW/DXCC <prefix>^Interrogate the spot database by country
This command takes the <prefix> (which can be a full or partial
callsign if desired), looks up which internal country number it is
and then displays all the spots as per SH/DX for that country.
+
+This is now an alias for 'SHOW/DX DXCC'
The options for SHOW/DX also apply to this command.
e.g.
SH/DXCC G
- SH/DXCC W on 20m info iota
+ SH/DXCC W on 20m iota
+
+This can be done with the SHOW/DX command like this:-
+
+ SH/DX dxcc g
+ SH/DX dxcc w on 20m iota
=== 0^SHOW/DXSTATS^Show the DX Statistics for last 31 days
Show the total DX spots for the last 31 days
my $info;
my $expr;
my $hint;
+my $dxcc;
+my $fromdxcc;
my ($doqsl, $doiota, $doqra);
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?
+ ($from, $to) = $f =~ m|^(\d+)[-/](\d+)$|; # 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 'dxcc') {
+ $dxcc = 1;
+ next;
+ }
if (lc $f eq 'on' && $list[0]) { # is it freq range?
# print "yup freq\n";
- my @r = split '/', lc $list[0];
- # print "r0: $r[0] r1: $r[1]\n";
- my @fr = Bands::get_freq($r[0], $r[1]);
- if (@fr) { # yup, get rid of extranous param
- # print "freq: ", join(',', @fr), "\n";
+ if ($list[0] =~ m|^(\d+)(?:\.\d+)?[-/](\d+)(?:\.\d+)?$|) {
+ push @freq, $1, $2;
shift @list;
- push @freq, @fr; # add these to the list
next;
+ } else {
+ my @r = split '/', lc $list[0];
+ # print "r0: $r[0] r1: $r[1]\n";
+ my @fr = Bands::get_freq($r[0], $r[1]);
+ if (@fr) { # yup, get rid of extranous param
+ # print "freq: ", join(',', @fr), "\n";
+ push @freq, @fr; # add these to the list
+ shift @list;
+ next;
+ }
}
}
if (lc $f eq 'day' && $list[0]) {
# print "got day\n";
- ($fromday, $today) = split '-', shift(@list);
+ ($fromday, $today) = split m|[-/]|, shift(@list);
next;
}
if (lc $f eq 'info' && $list[0]) {
if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) {
# print "got spotter\n";
$spotter = uc shift @list;
+ if ($list[0] && lc $list[0] eq 'dxcc') {
+ $fromdxcc = 1;
+ shift @list;
+ }
next;
}
if (lc $f eq 'qsl') {
# first deal with the prefix
if ($pre) {
- $pre .= '*' unless $pre =~ /[\*\?\[]/o;
- $pre = shellregex($pre);
- $expr = "\$f1 =~ m{$pre}";
- $pre =~ s/[\^\$]//g;
- $hint = "m{\U$pre}";
+ my @ans;
+
+ if ($dxcc) {
+ @ans = Prefix::extract($pre); # is it a callsign/prefix?
+
+ if (@ans) {
+
+ # first deal with the prefix
+ my $pre = shift @ans;
+ my $a;
+ my $str = "Prefix: $pre";
+ my $l = length $str;
+ my @expr;
+ my @hint;
+
+ # build up a search string for this dxcc country/countries
+ foreach $a (@ans) {
+ my $n = $a->dxcc();
+ push @expr, "\$f5 == $n";
+ push @hint, "m{$n}";
+ my $name = $a->name();
+ $str .= " Dxcc: $n ($name)";
+ push @out, $str;
+ $str = ' ' x $l;
+ }
+ $expr = @expr > 1 ? '(' . join(' || ', @expr) . ')' : $expr[0];
+ $hint = @hint > 1 ? '(' . join(' || ', @hint) . ')' : $hint[0];
+ }
+ }
+ unless (@ans) {
+ $pre .= '*' unless $pre =~ /[\*\?\[]/o;
+ $pre = shellregex($pre);
+ $expr = "\$f1 =~ m{$pre}";
+ $pre =~ s/[\^\$]//g;
+ $hint = "m{\U$pre}";
+ }
}
# now deal with any frequencies specified
# any spotter
if ($spotter) {
- $expr .= " && " if $expr;
- $spotter .= '*' unless $spotter =~ /[\*\?\[]/o;
- $spotter = shellregex($spotter);
- $expr .= "\$f4 =~ m{\U$spotter}";
- $hint .= " && " if $hint;
- $spotter =~ s/[\^\$]//g;
- $hint .= "m{\U$spotter}";
+
+ if ($fromdxcc) {
+ @ans = Prefix::extract($spotter); # is it a callsign/prefix?
+
+ if (@ans) {
+
+ # first deal with the prefix
+ my $pre = shift @ans;
+ my $a;
+ $expr .= ' && ' if $expr;
+ $hint .= ' && ' if $hint;
+ my $str = "Spotter: $pre";
+ my $l = length $str;
+ my @expr;
+ my @hint;
+
+ # build up a search string for this dxcc country/countries
+ foreach $a (@ans) {
+ my $n = $a->dxcc();
+ push @expr, "\$f6 == $n";
+ push @hint, "m{$n}";
+ my $name = $a->name();
+ $str .= " Dxcc: $n ($name)";
+ push @out, $str;
+ $str = ' ' x $l;
+ }
+ $expr .= @expr > 1 ? '(' . join(' || ', @expr) . ')' : $expr[0];
+ $hint .= @hint > 1 ? '(' . join(' || ', @hint) . ')' : $hint[0];
+ }
+ }
+ unless (@ans) {
+ $expr .= " && " if $expr;
+ $spotter .= '*' unless $spotter =~ /[\*\?\[]/o;
+ $spotter = shellregex($spotter);
+ $expr .= "\$f4 =~ m{\U$spotter}";
+ $hint .= " && " if $hint;
+ $spotter =~ s/[\^\$]//g;
+ $hint .= "m{\U$spotter}";
+ }
}
# qsl requests
+++ /dev/null
-#
-# 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);