X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=3101c5352f0466d95e615ee5d98bea914c928036;hb=HEAD;hp=51c39dd07a8fa22733a429c69355cc26e498c561;hpb=f651e64ef06bd79eb2342e85d5dd7c86fee407d1;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index 51c39dd0..3101c535 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -3,7 +3,7 @@ # # Copyright (c) 1998 Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; @@ -14,34 +14,34 @@ my $node; my @l; my @val; -push @out, "Node Callsigns"; +push @out, $self->msg('showconf'); if ($list[0] && $list[0] =~ /^NOD/) { - my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes(); + my %ch; my $dxchan; - foreach $dxchan (@ch) { - @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; + foreach my $n (@nodes) { + $dxchan = $n->dxchan; + push @{$ch{$dxchan->call}}, $n if $dxchan; + } + + foreach my $call (sort keys %ch) { + @val = sort {$a->call cmp $b->call} @{$ch{$call}}; @l = (); - my $call = $dxchan->call; - $call ||= '???'; - $call = "($call)" unless $dxchan->here; + $call = "($call)" unless DXChannel::get($call)->here; push @l, $call; - my $i = 0; foreach my $ref (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $s = $ref->call; $s ||= '???'; $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { @@ -55,7 +55,7 @@ if ($list[0] && $list[0] =~ /^NOD/) { if (@list) { next unless grep $node->call =~ /^$_/, @list; } else { - next unless $node->dxcc == $self->dxcc; + next unless grep $node->dxcc == $_, @main::my_cc; } } my $call = $node->call; @@ -65,16 +65,14 @@ if ($list[0] && $list[0] =~ /^NOD/) { push @l, $call; @val = sort $node->users; - my $i = 0; if (@val == 0 && $node->usercount) { push @l, sprintf "(%d users)", $node->usercount; } foreach $call (@val) { - if ($i >= 5) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } my $uref = Route::User::get($call); my $s = $call; @@ -84,9 +82,8 @@ if ($list[0] && $list[0] =~ /^NOD/) { $s = "$call?"; } push @l, $s; - $i++; } - push @l, "" while ($i++ < 5); + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } }