2 # Show total VHF DX Spot Stats per day
4 # Copyright (c) 2001 Dirk Koopman G1TLH
11 my $date = cldate($main::systime);
12 my $utime = $main::systime;
15 my ($self, $line) = @_;
16 my @f = split /\s+/, $line;
22 if ($f =~ /^\d+$/ && $f < 366) { # no of days
26 if (my $ut = Date::Parse::str2time($f)) { # is it a parseable date?
30 push @out, $self->msg('e33', $f);
33 return (1, @out) if @out;
35 $now = Julian::Day->new($utime);
36 $now = $now->sub($days);
37 $date = cldate($utime);
39 if ($self->{_nospawn}) {
40 return (1, generate($self));
43 return (1, $self->spawn_cmd("show/vhfstats $line", sub { return (generate($self)); }))
55 # generate the spot list
56 for ($i = 0; $i < $days; $i++) {
57 my $fh = $Spot::statp->open($now); # get the next file
60 $fh = $Spot::statp->open($now);
65 next unless $l[0] eq 'TOTALS';
76 push @out, $self->msg('statvhf', $date, $days);
77 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);
78 foreach my $ref (@in) {
80 foreach my $j (14..16,18..23) {
81 $tot[$j] += $ref->[$j];
82 $tot[0] += $ref->[$j];
83 $linetot += $ref->[$j];
85 push @out, join('|', sprintf("%11s|%6d", $ref->[0]->as_string, $linetot), map {$_ ? sprintf("%5d", $_) : ' '} @$ref[14..16,18..23]) . '|';
87 push @out, join('|', sprintf("%11s|%6d", 'Total', $tot[0]), map {$_ ? sprintf("%5d", $_) : ' '} @tot[14..16,18..23]) . '|';