2 # module to manage the band list
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
17 use vars qw(%bands %regions %aliases $bandsfn %valid);
19 %bands = (); # the 'raw' band data
20 %regions = (); # list of regions for shortcuts eg vhf ssb
21 %aliases = (); # list of aliases
22 $bandsfn = "$main::data/bands.pl";
25 cw => '0,CW,parraypairs',
26 ssb => '0,SSB,parraypairs',
27 data => '0,DATA,parraypairs',
28 sstv => '0,SSTV,parraypairs',
29 fstv => '0,FSTV,parraypairs',
30 rtty => '0,RTTY,parraypairs',
31 pactor => '0,PACTOR,parraypairs',
32 packet => '0,PACKET,parraypairs',
33 repeater => '0,REPEATER,parraypairs',
34 fax => '0,FAX,parraypairs',
35 beacon => '0,BEACON,parraypairs',
36 band => '0,BAND,parraypairs',
47 # obtain a band object by callsign [$obj = Band::get($call)]
51 my $ncall = $aliases{$call};
52 $call = $ncall if $ncall;
56 # obtain all the band objects
59 return values(%bands);
62 # get all the band keys
68 # get all the region keys
71 return keys(%regions);
74 # get all the alias keys
77 return keys(%aliases);
84 return $regions{$reg};
87 # get all the frequency pairs associated with the band and sub-band offered
88 # the band can be a region, sub-band can be missing
90 # called Bands::get_freq(band-label, subband-label)
93 my ($band, $subband) = @_;
98 $subband = 'band' if !$subband;
100 # first look in the region
101 $b = $regions{$band};
103 @band = ($band) if @band == 0;
105 # we now have a list of bands to scan for sub bands
109 my $sb = $wb->{$subband};
110 push @out, @$sb if $sb;
117 # return a list of valid elements
126 # return a prompt for a field
131 my ($self, $ele) = @_;
139 my $name = $AUTOLOAD;
140 return if $name =~ /::DESTROY$/;
143 @_ ? $self->{$name} = shift : $self->{$name} ;