2 # module to manage the band list
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
17 use vars qw(%bands %regions $bandsfn %valid);
19 %bands = (); # the 'raw' band data
20 %regions = (); # list of regions for shortcuts eg vhf ssb
21 $bandsfn = "$main::data/bands.pl";
24 cw => '0,CW,parraypairs',
25 ssb => '0,SSB,parraypairs',
26 data => '0,DATA,parraypairs',
27 sstv => '0,SSTV,parraypairs',
28 fstv => '0,FSTV,parraypairs',
29 rtty => '0,RTTY,parraypairs',
30 pactor => '0,PACTOR,parraypairs',
31 packet => '0,PACKET,parraypairs',
32 repeater => '0,REPEATER,parraypairs',
33 fax => '0,FAX,parraypairs',
34 beacon => '0,BEACON,parraypairs',
35 band => '0,BAND,parraypairs',
46 # obtain a band object by callsign [$obj = Band::get($call)]
53 # obtain all the band objects
56 return values(%bands);
59 # get all the band keys
65 # get all the frequency pairs associated with the band and sub-band offered
66 # the band can be a region, sub-band can be missing
68 # called Bands::get_freq(band-label, subband-label)
71 my ($band, $subband) = @_;
76 $subband = 'band' if !$subband;
78 # first look in the region
81 @band = ($band) if @band == 0;
83 # we now have a list of bands to scan for sub bands
87 my $sb = $wb->{$subband};
88 push @out, @$sb if $sb;
95 # return a list of valid elements
104 # return a prompt for a field
109 my ($self, $ele) = @_;
117 my $name = $AUTOLOAD;
118 return if $name =~ /::DESTROY$/;
121 @_ ? $self->{$name} = shift : $self->{$name} ;