X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fdxstats.pl;h=9924a903bc5734727825914e6e8fa7d01e4109e7;hb=5bc87856bb191e42d91628a5a4d9579a242b9541;hp=0b60e7a4bae96b8f9be616f97dd484985af45290;hpb=2a14d4a69c11e55d30616d5f226b2f51105dc137;p=spider.git diff --git a/cmd/show/dxstats.pl b/cmd/show/dxstats.pl index 0b60e7a4..9924a903 100644 --- a/cmd/show/dxstats.pl +++ b/cmd/show/dxstats.pl @@ -11,11 +11,34 @@ my @f = split /\s+/, $line; my @calls; my $days = 31; my @dxcc; - -my $now = Julian::Day->new(time())->sub(31); my $i; my @in; +my $now; +my $date = cldate($main::systime); +my $utime = $main::systime; +my @out; + +while (@f) { + my $f = shift @f; + + if ($f =~ /^\d+$/ && $f < 366) { # no of days + $days = $f; + next; + } + if (my $ut = Date::Parse::str2time($f)) { # is it a parseable date? + $utime = $ut+3600; + next; + } + push @out, $self->msg('e33', $f); +} + +return (1, @out) if @out; + +$now = Julian::Day->new($utime); +$now = $now->sub($days); +$date = cldate($utime); + # generate the spot list for ($i = 0; $i < $days; $i++) { my $fh = $Spot::statp->open($now); # get the next file @@ -35,10 +58,9 @@ for ($i = 0; $i < $days; $i++) { $now = $now->add(1); } -my @out; my $tot; -push @out, $self->msg('statdx'); +push @out, $self->msg('statdx', $date, $days); foreach my $ref (@in) { push @out, sprintf "%12s: %7d", $ref->[0]->as_string, $ref->[1]; $tot += $ref->[1];