4 # Copyright (c) 2001 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
26 if ($f =~ /^\d+$/ && $f < 366) { # no of days
30 if (my $utime = Date::Parse::str2time($f)) { # is it a parseable date?
32 $now = Julian::Day->new($utime);
33 $date = cldate($utime);
37 if (is_callsign($f)) {
46 if (my @ciz = Prefix::to_ciz('nc', $f)) {
47 push @dxcc, map {[$_, 2]} @ciz;
50 push @out, $self->msg('e27', $f);
55 # return error messages if any
56 return (1, @out) if @out;
59 unless (@pref) { # no prefix or callsign, use default prefix
60 push @dxcc, [$_, 2] for @main::my_cc;
61 push @pref, $main::mycall;
66 $now = Julian::Day->new(time); #no starting date
70 @out = $self->spawn_cmd(sub {
75 # generate the spot list
76 for ($i = 0; $i < $days; $i++) {
77 my $fh = $Spot::statp->open($now); # get the next file
80 $fh = $Spot::statp->open($now);
85 next if $l[0] eq 'TOTALS';
86 next unless $all || grep $l[$_->[1]] eq $_->[0], @dxcc;
87 my $ref = $list{$l[0]} || [0,0,0,0,0,0,0,0,0,0];
89 foreach my $item (@l[14..16, 18..23]) {
94 $list{$l[0]} = $ref if $ref->[0];
102 my $l = join ',', @pref;
103 push @out, $self->msg('statvhft', $l, $date, $days);
104 #push @out, $self->msg('statvhft', join(',', @dxcc), cldate(time));
105 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);
107 for (sort {$list{$b}->[0] <=> $list{$a}->[0] || $a cmp $b} keys %list) {
110 my @list = (sprintf "%10s", $_);
111 foreach my $j (0..9) {
115 $r = sprintf("%4d", $r);
122 push @out, join('|', @list, "");
123 last if $limit && $nocalls >= $limit;
126 $nocalls = sprintf "%10s", "$nocalls calls";
127 @tot = map {$_ ? sprintf("%4d", $_) : ' ' } @tot;
128 push @out, join('|', $nocalls, @tot, "");