X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=3101c5352f0466d95e615ee5d98bea914c928036;hb=77592822c77e2a3696997d4b958ecc11956c5e44;hp=a49ffeec990317d55cafc473b502627d150a785d;hpb=6624dcdf07d628e8d6a16fc6549edf40be25b7b2;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index a49ffeec..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,53 +14,65 @@ 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; - my $call = $dxchan->call; - $call = "($call)" if $dxchan->here == 0; + 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 = (); + $call = "($call)" unless DXChannel::get($call)->here; push @l, $call; - my $i = 0; - foreach $call (@val) { - if ($i >= 5) { + foreach my $ref (@val) { + if (@l >= 6) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @l = (); push @l, ""; - $i = 0; } - my $s = $call->call; - $s = sprintf "(%s)", $s unless $call->here; + my $s = $ref->call; + $s ||= '???'; + $s = sprintf "(%s)", $s unless $ref->here; push @l, $s; - $i++; } + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } } else { + my $printall; + + $printall = 1 if @list && $list[0] =~ /^ALL/i; + # build up the screen from the Node table foreach $node (@nodes) { - next if scalar @list && !grep $node->call =~ /^$_/, @list; + unless ($printall) { + if (@list) { + next unless grep $node->call =~ /^$_/, @list; + } else { + next unless grep $node->dxcc == $_, @main::my_cc; + } + } my $call = $node->call; - $call = "($call)" unless $node->here; @l = (); + $call ||= '???'; + $call = "($call)" unless $node->here; 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; @@ -70,8 +82,8 @@ if ($list[0] && $list[0] =~ /^NOD/) { $s = "$call?"; } push @l, $s; - $i++; } + push @l, "" while @l < 6; push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; } }