4 # Copyright (c) 2001 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
28 if ($f =~ /^\d+$/ && $f < 366) { # no of days
32 if (my $utime = Date::Parse::str2time($f)) { # is it a parseable date?
34 $now = Julian::Day->new($utime);
35 $date = cldate($utime);
39 if (is_callsign($f)) {
48 if (my @ciz = Prefix::to_ciz('nc', $f)) {
49 push @dxcc, map {[$_, 2]} @ciz;
52 push @out, $self->msg('e27', $f);
57 # return error messages if any
58 return (1, @out) if @out;
61 unless (@pref) { # no prefix or callsign, use default prefix
62 if ($self->dxcc >= 61 && $self->dxcc < 67) {
63 push @dxcc, [$_, 2] for (61..67);
66 push @dxcc, [$self->dxcc, 2];
67 push @pref, $self->call;
73 $now = Julian::Day->new(time); #no starting date
77 # generate the spot list
78 for ($i = 0; $i < $days; $i++) {
79 my $fh = $Spot::statp->open($now); # get the next file
82 $fh = $Spot::statp->open($now);
87 next if $l[0] eq 'TOTALS';
88 next unless $all || grep $l[$_->[1]] eq $_->[0], @dxcc;
89 my $ref = $list{$l[0]} || [0,0,0,0,0,0,0,0,0,0];
91 foreach my $item (@l[14..16, 18..23]) {
96 $list{$l[0]} = $ref if $ref->[0];
104 my $l = join ',', @pref;
105 push @out, $self->msg('statvhft', $l, $date, $days);
106 #push @out, $self->msg('statvhft', join(',', @dxcc), cldate(time));
107 push @out, sprintf "%10s|%4s|%4s|%4s|%4s|%4s|%4s|%4s|%4s|%4s|%4s|", qw(Callsign Tot 6m 4m 2m 70cm 23cm 13cm 9cm 6cm 3cm);
109 for (sort {$list{$b}->[0] <=> $list{$a}->[0] || $a cmp $b} keys %list) {
112 my @list = (sprintf "%10s", $_);
113 foreach my $j (0..9) {
117 $r = sprintf("%4d", $r);
123 push @out, join('|', @list, "");
124 last if $limit && $nocalls >= $limit;
127 $nocalls = sprintf "%10s", "$nocalls calls";
128 @tot = map {$_ ? sprintf("%4d", $_) : ' ' } @tot;
129 push @out, join('|', $nocalls, @tot, "");