-$fp = 0; # the DXLog fcb
-$date = 0; # the unix time of the WWV (notional)
-$sfi = 0; # the current SFI value
-$k = 0; # the current K value
-$a = 0; # the current A value
-$forecast = ""; # the current geomagnetic forecast
-$node = ""; # originating node
-$from = ""; # who this came from
-@allowed = (); # if present only these callsigns are regarded as valid WWV updators
-@denied = (); # if present ignore any wwv from these callsigns
+$fp = 0; # the DXLog fcb
+$date = 0; # the unix time of the WWV (notional)
+$sfi = 0; # the current SFI value
+$k = 0; # the current K value
+$a = 0; # the current A value
+$forecast = ""; # the current geomagnetic forecast
+$node = ""; # originating node
+$from = ""; # who this came from
+@allowed = (); # if present only these callsigns are regarded as valid WWV updators
+@denied = (); # if present ignore any wwv from these callsigns
my $dirprefix = "$main::data/wwv";
my $param = "$dirprefix/param";
sub init
{
$fp = DXLog::new('wwv', 'dat', 'm');
my $dirprefix = "$main::data/wwv";
my $param = "$dirprefix/param";
sub init
{
$fp = DXLog::new('wwv', 'dat', 'm');
- my $fh = new FileHandle;
- open $fh, "> $param" or confess "can't open $param $!";
- print $fh "# Geomagnetic data parameter file last mod:", scalar gmtime, "\n";
- print $fh "\$date = $date;\n";
- print $fh "\$sfi = $sfi;\n";
- print $fh "\$a = $a;\n";
- print $fh "\$k = $k;\n";
- print $fh "\$from = '$from';\n";
- print $fh "\$node = '$node';\n";
- print $fh "\@denied = qw(", join(' ', @denied), ");\n" if @denied > 0;
- print $fh "\@allowed = qw(", join(' ', @allowed), ");\n" if @allowed > 0;
- close $fh;
-
- # log it
- $fp->writeunix($date, "$from^$date^$sfi^$a^$k^$forecast^$node");
+ my $fh = new FileHandle;
+ open $fh, "> $param" or confess "can't open $param $!";
+ print $fh "# Geomagnetic data parameter file last mod:", scalar gmtime, "\n";
+ print $fh "\$date = $date;\n";
+ print $fh "\$sfi = $sfi;\n";
+ print $fh "\$a = $a;\n";
+ print $fh "\$k = $k;\n";
+ print $fh "\$from = '$from';\n";
+ print $fh "\$node = '$node';\n";
+ print $fh "\@denied = qw(", join(' ', @denied), ");\n" if @denied > 0;
+ print $fh "\@allowed = qw(", join(' ', @allowed), ");\n" if @allowed > 0;
+ close $fh;
+
+ # log it
+ $fp->writeunix($date, "$from^$date^$sfi^$a^$k^$forecast^$node");
- my ($mydate, $mytime, $mysfi, $mya, $myk, $myforecast, $myfrom, $mynode) = @_;
- if ((@allowed && grep {$_ eq $from} @allowed) ||
- (@denied && !grep {$_ eq $from} @denied) ||
- (@allowed == 0 && @denied == 0)) {
-
- my $trydate = cltounix($mydate, sprintf("%02d18Z", $mytime));
- if ($trydate >= $date) {
- $sfi = 0 + $mysfi;
- $k = 0 + $myk;
- $a = 0 + $mya;
- $forecast = $myforecast;
- $date = $trydate;
- $from = $myfrom;
- $node = $mynode;
-
- store();
+ my ($mydate, $mytime, $mysfi, $mya, $myk, $myforecast, $myfrom, $mynode) = @_;
+ if ((@allowed && grep {$_ eq $from} @allowed) ||
+ (@denied && !grep {$_ eq $from} @denied) ||
+ (@allowed == 0 && @denied == 0)) {
+
+ # my $trydate = cltounix($mydate, sprintf("%02d18Z", $mytime));
+ if ($mydate >= $date) {
+ $sfi = 0 + $mysfi;
+ $k = 0 + $myk;
+ $a = 0 + $mya;
+ $forecast = $myforecast;
+ $date = $mydate;
+ $from = $myfrom;
+ $node = $mynode;
+
+ store();
+ }
- my $flag = shift;
- if ($flag eq '+') {
- push @allowed, map {uc $_} @_;
- } else {
- my $c;
- foreach $c (@_) {
- @allowed = map {$_ ne uc $c} @allowed;
- }
- }
- store();
+ my $flag = shift;
+ if ($flag eq '+') {
+ push @allowed, map {uc $_} @_;
+ } else {
+ my $c;
+ foreach $c (@_) {
+ @allowed = map {$_ ne uc $c} @allowed;
+ }
+ }
+ store();
- my $flag = shift;
- if ($flag eq '+') {
- push @denied, map {uc $_} @_;
- } else {
- my $c;
- foreach $c (@_) {
- @denied = map {$_ ne uc $c} @denied;
- }
- }
- store();
+ my $flag = shift;
+ if ($flag eq '+') {
+ push @denied, map {uc $_} @_;
+ } else {
+ my $c;
+ foreach $c (@_) {
+ @denied = map {$_ ne uc $c} @denied;
+ }
+ }
+ store();
return sprintf("$d %02d %5d %3d %3d %-37s <%s>", $t, $ref[2], $ref[3], $ref[4], $ref[5], $ref[0]);
}
return sprintf("$d %02d %5d %3d %3d %-37s <%s>", $t, $ref[2], $ref[3], $ref[4], $ref[5], $ref[0]);
}