X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=9c10796b8ef4f924f9dc46cbb4eeb9c5053d5cb2;hb=9a1ffd3bd057a47c24e46f380d35aebf29453f93;hp=c9178ddb13b3f8668d25676544d69a6365218512;hpb=f21f292746ef4a2edc703e48542d1ed2d85d14cd;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index c9178ddb..9c10796b 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -44,6 +44,14 @@ $filterdef = bless ([ ], 'Filter::Cmd'); +# create a Spot Object +sub new +{ + my $class = shift; + my $self = [ @_ ]; + return bless $self, $class; +} + sub decodefreq { my $dxchan = shift; @@ -53,14 +61,18 @@ sub decodefreq my $f; foreach $f (@f) { - my ($a, $b) = $f =~ m{^(\d+)/(\d+)$}; - if ($a && $b) { - push @out, $a, $b; + my ($a, $b); + if (m{^\d+/\d+$}) { + push @out, $f; } elsif (($a, $b) = $f =~ m{^(\w+)(?:/(\w+))?$}) { $b = lc $b if $b; my @fr = Bands::get_freq(lc $a, $b); if (@fr) { - push @out, @fr; # add these to the list + while (@fr) { + $a = shift @fr; + $b = shift @fr; + push @out, "$a/$b"; # add them as ranges + } } else { return ('dfreq', $dxchan->msg('dfreq1', $f)); } @@ -109,7 +121,7 @@ sub add my $spotter_cq = (@dxcc > 0 ) ? $dxcc[1]->cq() : 0; push @out, $spotter_dxcc; push @out, $spot[5]; - + my $buf = join("\^", @out); # compare dates to see whether need to open another save file (remember, redefining $fp