fix console.pl max scroll depth
[spider.git] / cmd / wwv.pl
index dd7a6de5f343a472c780b3a88b91c6c572c26671..98930c895a9063dfd9608174856d528dfe109a03 100644 (file)
@@ -21,7 +21,7 @@
 #
 # Copyright (c) 2001 Dirk Koopman G1TLH
 #
-# $Id$
+#
 #
 my ($self, $line) = @_;
 my $call = $self->call;
@@ -36,18 +36,20 @@ my @out;
 my $hour = (gmtime $main::systime)[2];
 my $d = int ($main::systime / 3600) * 3600 + 18 * 60; 
 
+$line = unpad($line);
+
 my @l = split /\s*,\s*/, $line;
 my $forecast = pop @l;
-$forecast = unpad($forecast);
 
 # make a hash out of the args
 my %args = map {split /\s*=\s*/, lc $_} @l; 
 
 # check the ranges of each one
-push @out, $self->msg('wwv1', 'k') unless $args{k} && $args{k} >= 0 && $args{k} <= 9;
-push @out, $self->msg('wwv1', 'a') unless $args{a} && $args{a} >= 0 && $args{a} <= 400;
-push @out, $self->msg('wwv1', 'sf') unless $args{sf} && $args{sf} >= 65 && $args{sf} <= 300;
+push @out, $self->msg('wwv1', 'k') unless defined $args{k} && $args{k} >= 0 && $args{k} <= 9;
+push @out, $self->msg('wwv1', 'a') unless defined $args{a} && $args{a} >= 0 && $args{a} <= 400;
+push @out, $self->msg('wwv1', 'sf') unless defined $args{sf} && $args{sf} >= 65 && $args{sf} <= 300;
 push @out, $self->msg('wwv1', 'forecast') unless $forecast;
+push @out, $self->msg('wwv2') if Geomag::dup($d, $args{sf}, $args{k}, $args{a}, $forecast);
 
 return (1, @out) if @out;