X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fbands.pl;h=d2b818aa0ce9ba5f433db5c090a25d1bc04cd719;hb=18f2934d60c7a702ac9eeca325914e4c346c0621;hp=158238f3d13c3dbd01b6f5433a8873ab5d1ee94c;hpb=6a0068ec3df1dca0c6ae2714af3c0a4a62998dcf;p=spider.git diff --git a/cmd/show/bands.pl b/cmd/show/bands.pl index 158238f3..d2b818aa 100644 --- a/cmd/show/bands.pl +++ b/cmd/show/bands.pl @@ -1,6 +1,10 @@ # # display the band data # +# Copyright (c) 1998 - Dirk Koopman G1TLH +# +# $Id$ +# #$DB::single = 1; @@ -9,23 +13,29 @@ my @f = split /\s+/, $line; my @bands; my $band; my @out; +my $i; if (!$line) { - @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys(); - push @out, "Bands Available:-"; - foreach $band (@bands) { - my $ref = Bands::get($band)->band; - my $from = $ref->[0]; - my $to = $ref->[1]; - push @out, sprintf "%10s: %d -> %d", $band, $from, $to; - } - push @out, "Regions Available:-"; - @bands = Bands::get_region_keys(); - foreach $band (@bands) { - my $ref = Bands::get_region($band); - my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref}); - push @out, $s; - } + @bands = sort { Bands::get($a)->band->[0] <=> Bands::get($b)->band->[0] } Bands::get_keys(); + push @out, "Bands Available:-"; + foreach $band (@bands) { + my $ref = Bands::get($band)->band; + my $s = sprintf "%10s: ", $band; + for ($i = 0; $i < $#{$ref}; $i += 2) { + my $from = $ref->[$i]; + my $to = $ref->[$i+1]; + $s .= ", " if $i; + $s .= "$from -> $to"; + } + push @out, $s; + } + push @out, "Regions Available:-"; + @bands = Bands::get_region_keys(); + foreach $band (@bands) { + my $ref = Bands::get_region($band); + my $s = sprintf("%10s: ", $band ) . join(' ', @{$ref}); + push @out, $s; + } } return (1, @out);