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} (Route::Node::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 =~ /^$_/, @list;
48 my $call = $node->call;
49 $call = "($call)" if $node->here == 0;
52 @val = sort $node->users;
55 if (@val == 0 && $node->usercount) {
56 push @l, sprintf "(%d users)", $node->usercount;
58 foreach $call (@val) {
60 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
65 my $uref = Route::User::get($call);
67 $s = sprintf "(%s)", $s unless $uref->here;
71 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;