refactored convent band function
这个提交包含在:
父节点
55ccdb23d0
当前提交
8db85dc69a
共有 1 个文件被更改,包括 75 次插入 和 86 次删除
|
|
@ -1,18 +1,7 @@
|
|||
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Frequency {
|
||||
|
||||
/* Class to convert band and mode into a frequnecy in a format based on the specifications of the database table */
|
||||
|
||||
public function convent_band($band, $mode='SSB')
|
||||
{
|
||||
|
||||
if($mode == "PSK31" || $mode == "PSK63" || $mode == "RTTY" || $mode == "JT65"){
|
||||
$mode= "DATA";
|
||||
}
|
||||
|
||||
|
||||
$frequency = array(
|
||||
public $defaultFrequencies = array(
|
||||
'160m'=>array(
|
||||
'SSB'=>"1900000",
|
||||
'DATA'=>"1838000",
|
||||
|
|
@ -86,15 +75,18 @@ class Frequency {
|
|||
'DATA'=>"1022500000",
|
||||
'CW'=>"1022500000")
|
||||
);
|
||||
|
||||
return $frequency[$band][$mode];
|
||||
|
||||
/* Class to convert band and mode into a frequnecy in a format based on the specifications of the database table */
|
||||
public function convent_band($band, $mode='SSB')
|
||||
{
|
||||
if($mode == "PSK31" || $mode == "PSK63" || $mode == "RTTY" || $mode == "JT65"){
|
||||
$mode= "DATA";
|
||||
}
|
||||
|
||||
return $this->defaultFrequencies[$band][$mode];
|
||||
|
||||
}
|
||||
public function GetBand($Frequency) {
|
||||
$Band = NULL;
|
||||
|
||||
if ($Frequency > 1000000 && $Frequency < 2000000) {
|
||||
$Band = "160m";
|
||||
} else if ($Frequency > 3000000 && $Frequency < 4000000) {
|
||||
|
|
@ -150,10 +142,7 @@ public function GetBand($Frequency) {
|
|||
} else if ($Frequency >= 250000000000) {
|
||||
$Band = "<1mm";
|
||||
}
|
||||
|
||||
return $Band;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Frequency.php */
|
||||
|
|
|
|||
正在加载…
在新工单中引用