X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fwcy.pl;h=bdd01fc43670c7a0b354d6bd09a4350844ba8bee;hb=18f2934d60c7a702ac9eeca325914e4c346c0621;hp=dc52b6aa78eaddf86994a4de9d68a2034ec09330;hpb=4c4e8bb5564df1acbdce0b67f27bd78d924b4cef;p=spider.git diff --git a/cmd/wcy.pl b/cmd/wcy.pl index dc52b6aa..bdd01fc4 100644 --- a/cmd/wcy.pl +++ b/cmd/wcy.pl @@ -35,17 +35,18 @@ my $hour = (gmtime $main::systime)[2]; my $d = int ($main::systime / 3600) * 3600 + 18 * 60; # make a hash out of the args +$line = unpad($line); my %args = map {split /\s*=\s*/} split /\s*,\s*/, lc $line; # check the ranges of each one -push @out, $self->msg('wcy1', 'k') unless $args{k} && $args{k} >= 0 && $args{k} <= 9; -push @out, $self->msg('wcy1', 'espk') unless $args{expk} && $args{expk} >= 0 && $args{expk} <= 9; -push @out, $self->msg('wcy1', 'a') unless $args{a} && $args{a} >= 0 && $args{a} <= 400; -push @out, $self->msg('wcy1', 'r') unless $args{r} && $args{r} >= 0 && $args{r} <= 300; -push @out, $self->msg('wcy1', 'sf') unless $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; -push @out, $self->msg('wcy1', 'sa') unless $args{sa} && grep $args{sa} eq $_, qw(qui eru act maj pro war nil); -push @out, $self->msg('wcy1', 'gmf') unless $args{gmf} && grep $args{gmf} eq $_, qw(qui act min maj sev mag war nil); -push @out, $self->msg('wcy1', 'au') unless $args{au} && grep $args{au} eq $_, qw(no aurora strong); +push @out, $self->msg('wcy1', 'k') unless defined $args{k} && $args{k} >= 0 && $args{k} <= 9; +push @out, $self->msg('wcy1', 'espk') unless defined $args{expk} && $args{expk} >= 0 && $args{expk} <= 9; +push @out, $self->msg('wcy1', 'a') unless defined $args{a} && $args{a} >= 0 && $args{a} <= 400; +push @out, $self->msg('wcy1', 'r') unless defined $args{r} && $args{r} >= 0 && $args{r} <= 500; +push @out, $self->msg('wcy1', 'sf') unless defined $args{sf} && $args{sf} >= 65 && $args{sf} <= 300; +push @out, $self->msg('wcy1', 'sa') unless defined $args{sa} && grep $args{sa} eq $_, qw(qui eru act maj pro war nil); +push @out, $self->msg('wcy1', 'gmf') unless defined $args{gmf} && grep $args{gmf} eq $_, qw(qui act min maj sev mag war nil); +push @out, $self->msg('wcy1', 'au') unless defined $args{au} && grep $args{au} eq $_, qw(no aurora strong); push @out, $self->msg('wcy2') if WCY::dup($d); #$DB::single=1; @@ -60,7 +61,7 @@ my $today = cldate($main::systime); # 14-Dec-2001 15 220 3 1 0 212 act qui no my @field = ('PC73',$today,$hour,$args{sf},$args{a},$args{k},$args{expk},$args{r},$args{sa},$args{gmf},$args{au}, $self->call ,$main::mycall, 'H99'); -my $s = sprintf "%s^%s^%02d^%3d^%2d^%2d^%2d^%3d^%s^%s^%s^%s^%s^%s^", @field; +my $s = sprintf "%s^%s^%02d^%3d^%3d^%2d^%2d^%3d^%s^%s^%s^%s^%s^%s^", @field; WCY::update($d, @field[2..12]); DXProt::send_wcy_spot($self, $s, $d, @field[2..12]); $self->wcy($s, 0, @field[1..12]);