2 # show the cluster routing tables to the user
4 # Copyright (c) 1998 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes
12 my @nodes = sort {$a->call cmp $b->call} (DXNode::get_all());
17 push @out, "Node Callsigns";
18 if ($list[0] && $list[0] =~ /^NOD/) {
19 my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes();
22 foreach $dxchan (@ch) {
23 @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes;
24 my $call = $dxchan->call;
25 $call = "($call)" if $dxchan->here == 0;
30 foreach $call (@val) {
32 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
37 my $s = $call->{call};
38 $s = sprintf "(%s)", $s if $call->{here} == 0;
42 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
45 # build up the screen from the Node table
46 foreach $node (@nodes) {
47 next if scalar @list && !grep $node->call eq $_, @list;
48 my $call = $node->call;
49 $call = "($call)" if $node->here == 0;
52 my $nlist = $node->list;
53 @val = sort {$a->call cmp $b->call} values %{$nlist};
56 if (@val == 0 && $node->users) {
57 push @l, sprintf "(%d users)", $node->users;
59 foreach $call (@val) {
61 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
66 my $s = $call->{call};
67 $s = sprintf "(%s)", $s if $call->{here} == 0;
71 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;