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, $self->msg('showconf');
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;
25 my $call = $dxchan->call;
27 $call = "($call)" unless $dxchan->here;
30 foreach my $ref (@val) {
32 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
38 $s = sprintf "(%s)", $s unless $ref->here;
41 push @l, "" while @l < 5;
42 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
47 $printall = 1 if @list && $list[0] =~ /^ALL/i;
49 # build up the screen from the Node table
50 foreach $node (@nodes) {
53 next unless grep $node->call =~ /^$_/, @list;
55 next unless grep $node->dxcc == $_, @main::my_cc;
58 my $call = $node->call;
61 $call = "($call)" unless $node->here;
63 @val = sort $node->users;
65 if (@val == 0 && $node->usercount) {
66 push @l, sprintf "(%d users)", $node->usercount;
68 foreach $call (@val) {
70 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
74 my $uref = Route::User::get($call);
77 $s = sprintf "(%s)", $call unless $uref->here;
83 push @l, "" while @l < 6;
84 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;