my $respot = 0;
if ($cand && ref $cand) {
if (@$cand <= CData) {
- unless ($self->{minspottime} > 0 && $now - $cand->[CTime] >= $self->{minspottime}) {
+ if ($self->{minspottime} > 0 && $now - $cand->[CTime] < $self->{minspottime}) {
dbg("RBN: key: '$sp' call: $call qrg: $qrg DUPE \@ ". atime(int $cand->[CTime])) if $dbgrbn;
return;
}
} elsif ($cand) {
dbg("RBN: key '$sp' = '$cand' not ref");
return;
- }
-
- # here we either have an existing spot record buildup on the go, or we need to create the first one
- unless ($cand) {
+ } else {
+ # new spot / frequency
$spots->{$sp} = $cand = [$now, 0];
dbg("RBN: key: '$sp' call: $call qrg: $qrg NEW" . ($respot ? ' RESPOT' : '')) if $dbgrbn;
}
++$self->{queue}->{$sp};# unless @$cand>= CData; # queue the KEY (not the record)
- dbg("RBN: key: '$sp' ADD RECORD call: $call qrg: $qrg origin: $origin") if $dbgrbn;
+ dbg("RBN: key: '$sp' ADD RECORD call: $call qrg: $qrg origin: $origin respot: $respot") if $dbgrbn;
push @$cand, $r;
dbg "RBN: QUEUE key '$sp' cleared" if isdbg 'rbn';
delete $dxchan->{queue}->{$sp};
- delete $spots->{$sp};
# calculate new sp (which will be 70% likely the same as the old one)
# we do this to cope with the fact that the first spotter may well be "wrongly calibrated" giving a qrg that disagrees with the majority.
my $nsp = "$r->[RCall]|$nqrg";
if ($sp ne $nsp) {
dbg("RBN:SKIM CHANGE KEY sp '$sp' -> '$nsp' for storage") if $rbnskim;
+ delete $spots->{$sp};
$spots->{$nsp} = [$now, $cand->[CQual]];
+ } else {
+ $spots->{$sp} = [$now, $cand->[CQual]];
}
}
else {