/[drupal]/contributions/modules/ham/arrl_band_plan.inc
ViewVC logotype

Contents of /contributions/modules/ham/arrl_band_plan.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Nov 6 18:28:25 2008 UTC (12 months, 3 weeks ago) by ppicazo
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -2 lines
File MIME type: text/x-php
Removed line break from the end of include file which caused an error.
1 <?php
2 // $Id: arrl_band_plan.inc,v 1.1 2008/10/31 02:02:44 ppicazo Exp $
3 // Note: File was originally used in another personal project, will be tailoried to the Drupal Ham Radio Module project as development continues.
4 // Effective Date of Band Plan Data: February 23, 2007
5
6 define("HAM_EXTRA", "5");
7 define("HAM_ADVANCED", "4");
8 define("HAM_GENERAL", "3");
9 define("HAM_TECH", "2");
10 define("HAM_NOVICE", "1");
11 define("HAM_NONE", "0");
12
13 define("HAM_CW", "1");
14 define("HAM_RTTY", "2");
15 define("HAM_DATA", "3");
16 define("HAM_MCW", "4");
17 define("HAM_TEST", "5");
18 define("HAM_PHONE", "6");
19 define("HAM_IMAGE", "7");
20 define("HAM_SSB", "8");
21 define("HAM_USB", "9");
22 define("HAM_DMF", "10");
23
24 class band
25 {
26 public $band_wavelength;
27
28 public $band_notes;
29
30 public $sub_bands;
31
32 function __construct()
33 {
34 //nothing
35 }
36
37 function add_sub_band($in_start, $in_end, $in_privs, $in_modes, $in_limit)
38 {
39 $this->sub_bands[] = new sub_band($in_start, $in_end, $in_privs, $in_modes, $in_limit);
40
41 }
42
43 function get_sub_bands($license_type)
44 {
45 $retval = null;
46
47 foreach($this->sub_bands as $sub)
48 {
49 if(in_array($license_type, $sub->privs))
50 {
51 $retval[] = $sub;
52 }
53 }
54
55 return $retval;
56 }
57
58 function get_sub_band_by_freq($freq)
59 {
60 $retval = null;
61
62 foreach($this->sub_bands as $sub)
63 {
64 if($freq >= $sub->start && $freq <= $sub->end)
65 {
66 $retval[] = $sub;
67 }
68 }
69
70 return $retval;
71 }
72
73 function permission_to_use_band($license_type)
74 {
75 foreach($this->sub_bands as $sub)
76 {
77 if($sub->permission_to_use_sub_band($license_type))
78 {
79 return true;
80 }
81 }
82 return false;
83 }
84
85 function get_usable_sub_bands($license_type)
86 {
87 $retval = null;
88
89 foreach($this->sub_bands as $sub)
90 {
91 if($sub->permission_to_use_sub_band($license_type))
92 {
93 $retval[] = $sub;
94 }
95 }
96
97 return $retval;
98 }
99
100 function get_usable_sub_bands2($freq, $license_type)
101 {
102 $retval = null;
103
104 foreach($this->sub_bands as $sub)
105 {
106 if($sub->permission_to_use_sub_band($license_type) && $freq <= $sub->end && $freq >= $sub->start)
107 {
108 //echo "woot";
109 $retval[] = $sub;
110 }
111 }
112
113 return $retval;
114 }
115
116 function get_band_max()
117 {
118 $max = null;
119 foreach($this->sub_bands as $sub)
120 {
121 if($sub->end > $max)
122 {
123 $max = $sub->end;
124 }
125 }
126 return $max;
127 }
128
129 function get_band_min()
130 {
131 $min = null;
132 foreach($this->sub_bands as $sub)
133 {
134 if($sub->start < $min || $min == null)
135 {
136 $min = $sub->start;
137 }
138 }
139 return $min;
140 }
141
142 function get_freq_sub_bands($freq)
143 {
144 $retval = null;
145
146 foreach($this->sub_bands as $sub)
147 {
148 if($freq <= $sub->end && $freq >= $sub->start)
149 {
150 //echo "woot";
151 $retval[] = $sub;
152 }
153 }
154
155 return $retval;
156 }
157 }
158
159 class sub_band
160 {
161 public $start;
162 public $end;
163 public $privs;
164 public $modes;
165 public $limit;
166
167 function __construct($in_start, $in_end, $in_privs, $in_modes, $in_limit)
168 {
169 $this->start = $in_start;
170 $this->end = $in_end;
171 $this->privs = $in_privs;
172 $this->modes = $in_modes;
173 $this->limit = $in_limit;
174 }
175
176 function permission_to_use_sub_band($license_type)
177 {
178 if(in_array($license_type,$this->privs))
179 {
180 return true;
181 }
182 else
183 {
184 return false;
185 }
186 }
187 }
188
189 class ham
190 {
191 private $license_type;
192
193 public $band_plan;
194
195 function __construct()
196 {
197 $this->license_type = 0;
198
199 $this->make_band_plan();
200
201 }
202
203 function add_band($name)
204 {
205 $this->band_plan[$name] = new band();
206 }
207
208 function add_sub_band($in_start, $in_end, $in_privs, $in_modes, $band, $in_limit = 1500)
209 {
210 $this->band_plan[$band]->add_sub_band($in_start, $in_end, $in_privs, $in_modes, $in_limit);
211 }
212
213 function get_my_bands()
214 {
215 return $this->get_bands($this->get_license_type());
216 }
217
218 function get_bands($license_type)
219 {
220 $retval = null;
221
222 foreach($this->band_plan as $key => $single_band)
223 {
224 if($single_band->permission_to_use_band($license_type))
225 {
226 $retval[$key] = $single_band->get_usable_sub_bands($license_type);
227 }
228 }
229
230 return $retval;
231 }
232
233 function get_general_freq_info($freq)
234 {
235 $retval = null;
236
237 foreach($this->band_plan as $key => $single_band)
238 {
239 //echo "checking band...<br>";
240 if($freq <= $single_band->get_band_max() && $freq >= $single_band->get_band_min())
241 {
242 //echo "found band!<br>";
243 $subbands = $single_band->get_freq_sub_bands();
244
245 foreach($subbands as $sub)
246 {
247 $sb[] = array("");
248 }
249
250 $retval[$key] = "";
251 }
252 }
253
254 return $retval;
255 }
256
257 function my_freq_info($freq)
258 {
259 return $this->freq_info($freq, $this->get_license_type());
260 }
261
262 function freq_info($freq, $license_type)
263 {
264 $retval = null;
265
266 foreach($this->band_plan as $key => $single_band)
267 {
268 if($freq <= $single_band->get_band_max() && $freq >= $single_band->get_band_min())
269 {
270 $retval[$key] = $single_band->get_usable_sub_bands2($freq, $license_type);
271 }
272 }
273
274 return $retval;
275 }
276
277 function freq_band($freq)
278 {
279 $retval = null;
280
281 foreach($this->band_plan as $key => $single_band)
282 {
283 if($freq <= $single_band->get_band_max() && $freq >= $single_band->get_band_min())
284 {
285 $retval = $single_band->band_wavelength;
286 }
287 }
288
289 return $retval;
290 }
291
292 function freq_modes($freq)
293 {
294 $retval = null;
295
296 foreach($this->band_plan as $key => $single_band)
297 {
298 if($freq <= $single_band->get_band_max() && $freq >= $single_band->get_band_min())
299 {
300 $retval = $single_band->get_usable_sub_bands2($freq, 5);
301 $retval = $retval[0]->modes;
302 }
303 }
304
305 return $retval;
306 }
307
308
309
310 function make_band_plan()
311 {
312 //make the band plan!
313
314 //160 Meters
315 $this->add_band("160 Meters");
316
317 $this->band_plan['160 Meters']->band_wavelength = "160m";
318
319 $this->band_plan['160 Meters']->band_notes = "Avoid interference to radiolocation operations from 1900 to 2000 kHz";
320
321 $this->add_sub_band(1.800,2.000,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "160 Meters");
322
323
324 //80 Meters
325 $this->add_band("80 Meters");
326
327 $this->band_plan['80 Meters']->band_wavelength = "80m";
328
329 $this->add_sub_band(3.525,3.600,array(HAM_NOVICE, HAM_TECH), array(HAM_CW), "80 Meters", 200); //200 watt limit
330
331 $this->add_sub_band(3.525,3.600,array(HAM_GENERAL, HAM_ADVANCED), array(HAM_CW, HAM_RTTY, HAM_DATA), "80 Meters");
332 $this->add_sub_band(3.800,4.000,array(HAM_GENERAL), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "80 Meters");
333
334 //$this->add_sub_band(3.525,3.600,array(HAM_ADVANCED, HAM_GENERAL), array(HAM_CW, HAM_RTTY, HAM_DATA), "80 Meters");
335 $this->add_sub_band(3.700,4.000,array(HAM_ADVANCED), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "80 Meters");
336
337 $this->add_sub_band(3.500,3.600,array(HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "80 Meters");
338 $this->add_sub_band(3.600,4.000,array(HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "80 Meters");
339
340
341 //60 Meters (power limit of 50 Watts)
342 // must be centered on the center freq and no more than 2.8kHz bandwidth!
343 //
344 $this->add_band("60 Meters");
345
346 $this->band_plan['60 Meters']->band_wavelength = "60m";
347
348 $this->band_plan['60 Meters']->band_notes = "General, Advanced, and Amateur Extra licensees may use the following five channels on a secondary basis with a maximum effective radiated power of 50 W PEP relative to a half wave dipole. Only upper sideband suppressed carrier voice transmissions may be used. The frequencies are 5330.5, 5346.5, 5366.5, 5371.5 and 5403.5 kHz. The occupied bandwidth is limited to 2.8 kHz centered on 5332, 5348, 5368, 5373, and 5405 kHz respectively.";
349
350 $this->add_sub_band(5.332 - 0.0015,5.332 + 0.0015,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_USB), "60 Meters",50);
351 $this->add_sub_band(5.348 - 0.0015,5.348 + 0.0015,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_USB), "60 Meters",50);
352 $this->add_sub_band(5.368 - 0.0015,5.368 + 0.0015,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_USB), "60 Meters",50);
353 $this->add_sub_band(5.373 - 0.0015,5.373 + 0.0015,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_USB), "60 Meters",50);
354 $this->add_sub_band(5.405 - 0.0015,5.405 + 0.0015,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_USB), "60 Meters",50);
355
356
357 //40 Meters
358 $this->add_band("40 Meters");
359
360 $this->band_plan['40 Meters']->band_wavelength = "40m";
361
362 $this->band_plan['40 Meters']->band_notes = "Phone and Image modes are permitted between 7075 and 7100 kHz for FCC licensed stations in ITU Regions 1 and 3 and by FCC licensed stations in ITU Region 2 West of 130 degrees West longitude or South of 20 degrees North latitude. See Sections 97.305(c) and 97.307(f)(11). Novice and Technician licensees outside ITU Region 2 may use CW only between 7025 and 7075 kHz. See Section 97.301(e). These exemptions do not apply to stations in the continental US.";
363
364 $this->add_sub_band(7.025,7.125,array(HAM_NOVICE, HAM_TECH), array(HAM_CW), "40 Meters",200);
365
366 $this->add_sub_band(7.025,7.125,array(HAM_GENERAL, HAM_ADVANCED), array(HAM_CW, HAM_RTTY, HAM_DATA), "40 Meters");
367 $this->add_sub_band(7.175,7.300,array(HAM_GENERAL), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "40 Meters");
368
369 //$this->add_sub_band(7.025,7.125,array(HAM_ADVANCED, HAM_GENERAL), array(HAM_CW, HAM_RTTY, HAM_DATA), "40 Meters");
370 $this->add_sub_band(7.125,7.300,array(HAM_ADVANCED), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "40 Meters");
371
372 $this->add_sub_band(7.000,7.125,array(HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "40 Meters");
373 $this->add_sub_band(7.125,7.300,array(HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "40 Meters");
374
375
376 //30 Meters (power limit of 200 watts PEP)
377 $this->add_band("30 Meters");
378
379 $this->band_plan['30 Meters']->band_wavelength = "30m";
380
381 $this->band_plan['30 Meters']->band_notes = "Avoid interference to fixed services outside the US.";
382
383 $this->add_sub_band(10.100,10.150,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "30 Meters",200);
384
385
386 //20 Meters
387 $this->add_band("20 Meters");
388
389 $this->band_plan['20 Meters']->band_wavelength = "20m";
390
391 $this->add_sub_band(14.025,14.150,array(HAM_GENERAL, HAM_ADVANCED), array(HAM_CW, HAM_RTTY, HAM_DATA), "20 Meters");
392 $this->add_sub_band(14.225,14.350,array(HAM_GENERAL), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "20 Meters");
393
394 //$this->add_sub_band(14.025,14.150,array(HAM_ADVANCED, HAM_GENERAL), array(HAM_CW, HAM_RTTY, HAM_DATA), "20 Meters");
395 $this->add_sub_band(14.175,14.350,array(HAM_ADVANCED), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "20 Meters");
396
397 $this->add_sub_band(14.000,14.150,array(HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "20 Meters");
398 $this->add_sub_band(14.150,14.350,array(HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "20 Meters");
399
400
401 //17 Meters
402 $this->add_band("17 Meters");
403
404 $this->band_plan['17 Meters']->band_wavelength = "17m";
405 $this->add_sub_band(18.068,18.110,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "17 Meters");
406 $this->add_sub_band(18.110,18.168,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "17 Meters");
407
408
409 //15 Meters
410 $this->add_band("15 Meters");
411
412 $this->band_plan['15 Meters']->band_wavelength = "15m";
413
414 $this->add_sub_band(21.025,21.200,array(HAM_NOVICE, HAM_TECH), array(HAM_CW), "15 Meters",200); //200 watt
415
416 $this->add_sub_band(21.025,21.200,array(HAM_GENERAL, HAM_ADVANCED), array(HAM_CW, HAM_RTTY, HAM_DATA), "15 Meters");
417 $this->add_sub_band(21.275,21.450,array(HAM_GENERAL), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "15 Meters");
418
419 //$this->add_sub_band(7.025,7.125,array(HAM_ADVANCED, HAM_GENERAL), array(HAM_CW, HAM_RTTY, HAM_DATA), "15 Meters");
420 $this->add_sub_band(21.225,21.450,array(HAM_ADVANCED), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "15 Meters");
421
422 $this->add_sub_band(21.000,21.200,array(HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "15 Meters");
423 $this->add_sub_band(21.200,21.450,array(HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "15 Meters");
424
425
426 //12 Meters
427 $this->add_band("12 Meters");
428
429 $this->band_plan['12 Meters']->band_wavelength = "12m";
430
431 $this->add_sub_band(24.890,24.930,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "12 Meters");
432 $this->add_sub_band(24.930,24.990,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "12 Meters");
433
434 //10 Meters
435 $this->add_band("10 Meters");
436
437 $this->band_plan['10 Meters']->band_wavelength = "10m";
438
439 $this->add_sub_band(28.000,28.300,array(HAM_NOVICE, HAM_TECH), array(HAM_RTTY, HAM_DATA), "10 Meters",200); //200 watt limit
440 $this->add_sub_band(28.300,28.500,array(HAM_NOVICE, HAM_TECH), array(HAM_CW, HAM_SSB), "10 Meters",200); //200 watt limit
441
442 $this->add_sub_band(28.000,28.300,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA), "10 Meters");
443 $this->add_sub_band(28.300,29.700,array(HAM_GENERAL, HAM_ADVANCED,HAM_EXTRA), array(HAM_CW, HAM_PHONE, HAM_IMAGE), "10 Meters");
444
445 //6 Meters
446 $this->add_band("6 Meters");
447
448 $this->band_plan['6 Meters']->band_wavelength = "6m";
449
450 $this->add_sub_band(50,50.1,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW), "6 Meters");
451 $this->add_sub_band(50.1,54.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "6 Meters");
452
453 //2 Meters
454 $this->add_band("2 Meters");
455
456 $this->band_plan['2 Meters']->band_wavelength = "2m";
457
458 $this->add_sub_band(144.0,144.1,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW), "2 Meters");
459 $this->add_sub_band(144.1,148.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "2 Meters");
460
461 //1.25 Meters
462 $this->add_band("1.25 Meters");
463
464 $this->band_plan['1.25 Meters']->band_wavelength = "1.25m";
465
466 //novice!
467 $this->add_sub_band(222.0,225.0,array(HAM_NOVICE), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "1.25 Meters",25); //25 watts limit
468
469 $this->add_sub_band(219.0,220.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_DMF), "1.25 Meters");
470 $this->add_sub_band(222.0,225.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "1.25 Meters");
471
472 //.7 Meters (power restrictions possibly)
473 $this->add_band("70 Centimeters");
474
475 $this->band_plan['70 Centimeters']->band_wavelength = "70cm";
476
477 $this->band_plan['70 Centimeters']->band_notes = "Geographical and power restrictions may apply to all bands above 420 MHz. See The ARRL Operating Manual for information about your area";
478
479 $this->add_sub_band(420.0,450.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "70 Centimeters");
480
481
482 //.33 Meters
483 $this->add_band("33 Centimeters");
484
485 $this->band_plan['33 Centimeters']->band_wavelength = "33cm";
486
487 $this->band_plan['33 Centimeters']->band_notes = "Geographical and power restrictions may apply to all bands above 420 MHz. See The ARRL Operating Manual for information about your area";
488
489 $this->add_sub_band(902.0,928.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "33 Centimeters");
490
491
492 //.23 Meters
493 $this->add_band("23 Centimeters");
494
495 $this->band_plan['23 Centimeters']->band_wavelength = "23cm";
496
497 $this->band_plan['23 Centimeters']->band_notes = "Geographical and power restrictions may apply to all bands above 420 MHz. See The ARRL Operating Manual for information about your area";
498
499 $this->add_sub_band(1270.0,1295.0,array(HAM_NOVICE), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "23 Centimeters",5); // 5 watts limit
500
501 $this->add_sub_band(1240.0,1300.0,array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "23 Centimeters");
502
503
504 //.23 Meters
505 $this->add_band("Open Spaces");
506
507 $this->band_plan['Open Spaces']->band_wavelength = "OPEN";
508
509 $this->band_plan['Open Spaces']->band_notes = "All licensees except Novices are authorized all modes on these frequencies and above 275 GHz.";
510
511 $this->add_sub_band(2300,2310, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
512 $this->add_sub_band(2390,2450, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
513 $this->add_sub_band(3300,3500, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
514 $this->add_sub_band(5650,5925, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
515
516 $this->add_sub_band(10000,10500, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
517 $this->add_sub_band(24000,24250, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
518 $this->add_sub_band(47000,47200, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
519 $this->add_sub_band(76000,81000, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
520 $this->add_sub_band(122250,123000, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
521 $this->add_sub_band(134000,141000, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
522 $this->add_sub_band(241000,250000, array(HAM_TECH, HAM_GENERAL, HAM_ADVANCED, HAM_EXTRA), array(HAM_CW, HAM_RTTY, HAM_DATA, HAM_PHONE, HAM_IMAGE), "Open Spaces");
523
524 }
525
526 //freq (mhz) to wavelength (meters)
527 function freq_to_wlength($freq)
528 {
529 return 300/$freq;
530 }
531
532 //wavelength (meters) to freq (mhz)
533 function wlength_to_freq($wlength)
534 {
535 return 300/$wlength;
536 }
537
538 function mhz_to_khz($freq)
539 {
540 return $freq * 1000;
541 }
542
543 function khz_to_mhz($freq)
544 {
545 return $freq / 1000;
546 }
547
548 function get_license_type()
549 {
550 return $this->license_type;
551 }
552
553 function display_freq($freq_in_mhz)
554 {
555 if($freq_in_mhz < 10)
556 {
557 // 0.1 MHz should be 100 kHz?
558 return $freq_in_mhz * 1000 . " kHz";
559 }
560 elseif($freq_in_mhz >= 10000)
561 {
562 return number_format($freq_in_mhz / 1000, 3) . " GHz";
563 }
564 else
565 {
566 return number_format($freq_in_mhz,3) . " MHz";
567 }
568 }
569
570 function get_license_type_name($type)
571 {
572 switch ($type)
573 {
574 case HAM_EXTRA:
575 return "Amateur Extra";
576 break;
577 case HAM_ADVANCED:
578 return "Advanced";
579 break;
580 case HAM_GENERAL:
581 return "General";
582 break;
583 case HAM_TECH:
584 return "Technician";
585 break;
586 case HAM_NOVICE:
587 return "Novice";
588 break;
589 default:
590 //NO LICENSE TYPE SET!
591 return "No FCC License";
592 break;
593 }
594 }
595
596 function get_mode_name($type)
597 {
598 switch ($type)
599 {
600 case HAM_CW:
601 return "CW";
602 break;
603 case HAM_RTTY:
604 return "RTTY";
605 break;
606 case HAM_DATA:
607 return "Data";
608 break;
609 case HAM_MCW:
610 return "MCW";
611 break;
612 case HAM_TEST:
613 return "Test";
614 break;
615 case HAM_PHONE:
616 return "Phone";
617 break;
618 case HAM_IMAGE:
619 return "Image";
620 break;
621 case HAM_SSB:
622 return "SSB";
623 break;
624 case HAM_USB:
625 return "USB";
626 break;
627 case HAM_DMF:
628 return "Digital Message Forwarding";
629 break;
630 default:
631 return "[Invalid Mode]";
632 break;
633 }
634 }
635
636 function set_license_type($type)
637 {
638 $this->license_type = $type;
639 }
640 }
641 ?>

  ViewVC Help
Powered by ViewVC 1.1.2