{
my $self = shift;
my $nodes_only = shift || 0;
+ my $width = shift || 79;
my $level = shift;
my $seen = shift;
my @out;
} else {
$c = "$ucall?";
}
- if ((length $line) + (length $c) + 1 < 79) {
+ if ((length $line) + (length $c) + 1 < $width) {
$line .= $c . ' ';
} else {
$line =~ s/\s+$//;
if ($nref) {
my $c = $nref->user_call;
dbg("recursing from $call -> $c") if isdbg('routec');
- my @rout = $nref->config($nodes_only, $level+1, $seen, @_);
+ my @rout = $nref->config($nodes_only, $width, $level+1, $seen, @_);
if (@rout && @_) {
push @out, ' ' x ($level*2) . $self->user_call unless grep /^\s+$call/, @out;
}
# recursion detector
return () if $seen->{$call};
+
+ # return immediately if we are directly connected
if (my $dxchan = DXChannel::get($call)) {
$seen->{$call}++;
push @out, $level ? [$level, $dxchan] : $dxchan;
return () unless $nref;
foreach my $ncall (@{$nref->{parent}}) {
unless ($seen->{$ncall}) {
- dbg("recursing from $call -> $ncall") if isdbg('routec');
- my @rout = findroutes($ncall, $level+1, $seen);
+
+ # put non-pc9x nodes to the back of the queue
+ my $l = $level + ($nref->{do_pc9x} && ($nref->{version}||5454) >= 5454 ? 0 : 30);
+ dbg("recursing from $call -> $ncall level $l") if isdbg('routec');
+ my @rout = findroutes($ncall, $l+1, $seen);
push @out, @rout;
}
}