2 # Show total VHF DX Spot Stats per day
4 # Copyright (c) 2001 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
13 my $date = cldate($main::systime);
14 my $utime = $main::systime;
20 if ($f =~ /^\d+$/ && $f < 366) { # no of days
24 if (my $ut = Date::Parse::str2time($f)) { # is it a parseable date?
28 push @out, $self->msg('e33', $f);
31 return (1, @out) if @out;
33 $now = Julian::Day->new($utime);
34 $now = $now->sub($days);
35 $date = cldate($utime);
37 @out = $self->spawn_cmd(sub {
43 # generate the spot list
44 for ($i = 0; $i < $days; $i++) {
45 my $fh = $Spot::statp->open($now); # get the next file
48 $fh = $Spot::statp->open($now);
53 next unless $l[0] eq 'TOTALS';
64 push @out, $self->msg('statvhf', $date, $days);
65 push @out, sprintf "%11s|%6s|%5s|%5s|%5s|%5s|%5s|%5s|%5s|%5s|%5s|", qw(Date Total 6m 4m 2m 70cm 23cm 13cm 9cm 6cm 3cm);
66 foreach my $ref (@in) {
68 foreach my $j (14..16,18..23) {
69 $tot[$j] += $ref->[$j];
70 $tot[0] += $ref->[$j];
71 $linetot += $ref->[$j];
73 push @out, join('|', sprintf("%11s|%6d", $ref->[0]->as_string, $linetot), map {$_ ? sprintf("%5d", $_) : ' '} @$ref[14..16,18..23]) . '|';
75 push @out, join('|', sprintf("%11s|%6d", 'Total', $tot[0]), map {$_ ? sprintf("%5d", $_) : ' '} @tot[14..16,18..23]) . '|';