various RBN fixes, fix links spacing
authorDirk Koopman <djk@tobit.co.uk>
Thu, 25 Jun 2020 14:00:34 +0000 (15:00 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 25 Jun 2020 14:00:34 +0000 (15:00 +0100)
Add incoming RBN filtering from the RBN servers.
Use spot filtering if there is no RBN specific filtering.
Fix formatting issues in the 'links' command for isolated and skimmer nodes.

cmd/links.pl
perl/DXCommandmode.pm
perl/RBN.pm

index ab3f27a2438d0592b51a6b65427f8f6f002eedd3..ed4082ff72a4e61af5df563a58c3181cb5a64752 100644 (file)
@@ -28,7 +28,7 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {
        my $obscount = $dxchan->nopings;
        my $pingint = $dxchan->pingint;
        my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint;
-       my $ping = $dxchan->is_node && $dxchan != $main::me ? sprintf("%7.2f",$dxchan->pingave) : "";
+       my $ping = sprintf("%7.2f", $dxchan->pingave || 0);
        my $iso = $dxchan->isolate ? 'Y' : ' ';
        my $uptime = difft($dxchan->startt, 1);
        my ($fin, $fout, $pc92) = (' ', ' ', ' ');
@@ -43,9 +43,10 @@ foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {
                        $fout = $dxchan->routefilter =~ /node_default/ ? 'D' : 'Y';
                }
        }
-       unless ($pingint) {
+       unless ($pingint && $ping) {
                $lastt = 0;
-               $ping = "        ";
+               $ping = '       ';
+               $obscount = ' ';
        }
 
        $sort = "DXSP" if $dxchan->is_spider;
index 0515a91c06f1c85c05c5ddc829adf1a3fab6d40d..729675be0685da73848d16f6c648c291daa7e111 100644 (file)
@@ -179,10 +179,7 @@ sub start
                        || Filter::read_in('ann', 'user_default', 0) ;
        $self->{rbnfilter} = Filter::read_in('rbn', $call, 0) 
                || Filter::read_in('rbn', $nossid, 0)
-               || Filter::read_in('spots', $call, 0) 
-               || Filter::read_in('spots', $nossid, 0)
-               || Filter::read_in('rbn', 'user_default', 0)
-               || Filter::read_in('spots', 'user_default', 0);
+               || Filter::read_in('rbn', 'user_default', 0);
        
        # clean up qra locators
        my $qra = $user->qra;
index b78e9d4be24cffc77f45730580a49936b9321e38..91d1a9fd2a18c224df5b81dcba7fd7e0c1e2090c 100644 (file)
@@ -47,8 +47,7 @@ sub new
        my $pkg = shift;
        my $call = shift;
 
-       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->hostname], );
-       $self->{d} = {};
+#      DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1, undef, undef, $self->hostname], );
        $self->{spot} = {};
        $self->{last} = 0;
        $self->{noraw} = 0;
@@ -69,8 +68,6 @@ sub start
        my $user = $self->{user};
        my $call = $self->{call};
        my $name = $user->{name};
-       my $dref = $self->{d};
-       my $spotref = $self->{spot};
                
        # log it
        my $host = $self->{conn}->peerhost;
@@ -102,11 +99,10 @@ sub start
        # get the filters
        my $nossid = $call;
        $nossid =~ s/-\d+$//;
-       
-       $self->{spotsfilter} = Filter::read_in('spots', $call, 0) 
-               || Filter::read_in('spots', $nossid, 0)
-                       || Filter::read_in('spots', 'user_default', 0);
 
+       $self->{inrbnfilter} = Filter::read_in('rbn', $call, 1) 
+               || Filter::read_in('rbn', 'node_default', 1);
+       
        # clean up qra locators
        my $qra = $user->qra;
        $qra = undef if ($qra && !DXBearing::is_qra($qra));
@@ -260,6 +256,10 @@ sub normal
                my $r = [$origin, nearest(.1, $qrg), $call, $mode, $s, $t, $utz, $respot, $u];
                dbg("RBN: key: '$sp' ADD RECORD call: $call qrg: $qrg origin: $origin") if isdbg('rbn');
                my @s =  Spot::prepare($r->[1], $r->[2], $r->[6], '', $r->[0]);
+               if ($self->{inrbnfilter}) {
+                       my ($want, undef) = $self->{inrbnfilter}->it($s);
+                       next unless $want;      
+               }
                $r->[9] = \@s;
 
                push @$spot, $r;
@@ -400,11 +400,11 @@ sub dx_spot
                ++$qrg{$s->[0]};                # and the qrg
 
  
-               my $filter = 0;
-
-               if ($dxchan->{rbnfilter}) {
-                       ($filter, undef) = $dxchan->{rbnfilter}->it($s);
-                       next unless $filter;
+               my $want = 0;
+               my $rf = $dxchan->{rbnfilter} || $dxchan->{spotsfilter};
+               if ($rf) {
+                       ($want, undef) = $rf->it($s);
+                       next unless $want;
                        $saver = $s;
                        dbg("RBN: FILTERED call: $s->[1] qrg: $s->[0] origin: $s->[4] dB: $r->[4]") if isdbg 'rbn';
                        last;
@@ -439,10 +439,10 @@ sub dx_spot
                
                dbg("RBN: SENDING call: $saver->[1] qrg: $saver->[0] origin: $saver->[4] $saver->[3]") if isdbg 'rbn';
                if ($dxchan->{ve7cc}) {
-                       my $call = $saver->[1];
-                       $saver->[1] .= '-#';
+                       my $call = $saver->[4];
+                       $saver->[4] .= '-#';
                        $buf = VE7CC::dx_spot($dxchan, @$saver);
-                       $saver->[1] = $call;
+                       $saver->[4] = $call;
                } else {
                        $buf = $dxchan->format_dx_spot(@$saver);
                }