kopia lustrzana https://github.com/magicbug/Cloudlog
Fixed issue #113 where MixW imports without band due to it not being in the ADIF file this is now figured out within the import script
rodzic
82684ee0fa
commit
96a1f089bc
|
@ -66,7 +66,8 @@ class adif extends CI_Controller {
|
|||
}
|
||||
}
|
||||
|
||||
public function import() {
|
||||
public function import() {
|
||||
|
||||
$data['page_title'] = "ADIF Import";
|
||||
|
||||
$config['upload_path'] = './uploads/';
|
||||
|
|
|
@ -218,6 +218,69 @@ class Frequency {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public function GetBand($Frequency) {
|
||||
$Band = NULL;
|
||||
|
||||
if ($Frequency > 1000000 && $Frequency < 2000000) {
|
||||
$Band = "160m";
|
||||
} else if ($Frequency > 3000000 && $Frequency < 4000000) {
|
||||
$Band = "80m";
|
||||
} else if ($Frequency > 6000000 && $Frequency < 8000000) {
|
||||
$Band = "40m";
|
||||
} else if ($Frequency > 9000000 && $Frequency < 11000000) {
|
||||
$Band = "30m";
|
||||
} else if ($Frequency > 13000000 && $Frequency < 15000000) {
|
||||
$Band = "20m";
|
||||
} else if ($Frequency > 17000000 && $Frequency < 19000000) {
|
||||
$Band = "17m";
|
||||
} else if ($Frequency > 20000000 && $Frequency < 22000000) {
|
||||
$Band = "15m";
|
||||
} else if ($Frequency > 23000000 && $Frequency < 25000000) {
|
||||
$Band = "12m";
|
||||
} else if ($Frequency > 27000000 && $Frequency < 30000000) {
|
||||
$Band = "10m";
|
||||
} else if ($Frequency > 49000000 && $Frequency < 52000000) {
|
||||
$Band = "6m";
|
||||
} else if ($Frequency > 69000000 && $Frequency < 71000000) {
|
||||
$Band = "4m";
|
||||
} else if ($Frequency > 140000000 && $Frequency < 150000000) {
|
||||
$Band = "2m";
|
||||
} else if ($Frequency > 218000000 && $Frequency < 226000000) {
|
||||
$Band = "1.25m";
|
||||
} else if ($Frequency > 430000000 && $Frequency < 440000000) {
|
||||
$Band = "70cm";
|
||||
} else if ($Frequency > 900000000 && $Frequency < 930000000) {
|
||||
$Band = "33cm";
|
||||
} else if ($Frequency > 1200000000 && $Frequency < 1300000000) {
|
||||
$Band = "23cm";
|
||||
} else if ($Frequency > 2200000000 && $Frequency < 2600000000) {
|
||||
$Band = "13cm";
|
||||
} else if ($Frequency > 3000000000 && $Frequency < 4000000000) {
|
||||
$Band = "9cm";
|
||||
} else if ($Frequency > 5000000000 && $Frequency < 6000000000) {
|
||||
$Band = "6cm";
|
||||
} else if ($Frequency > 9000000000 && $Frequency < 11000000000) {
|
||||
$Band = "3cm";
|
||||
} else if ($Frequency > 23000000000 && $Frequency < 25000000000) {
|
||||
$Band = "1.2cm";
|
||||
} else if ($Frequency > 46000000000 && $Frequency < 55000000000) {
|
||||
$Band = "6mm";
|
||||
} else if ($Frequency > 75000000000 && $Frequency < 82000000000) {
|
||||
$Band = "4mm";
|
||||
} else if ($Frequency > 120000000000 && $Frequency < 125000000000) {
|
||||
$Band = "2.5mm";
|
||||
} else if ($Frequency > 133000000000 && $Frequency < 150000000000) {
|
||||
$Band = "2mm";
|
||||
} else if ($Frequency > 240000000000 && $Frequency < 250000000000) {
|
||||
$Band = "1mm";
|
||||
} else if ($Frequency >= 250000000000) {
|
||||
$Band = "<1mm";
|
||||
}
|
||||
|
||||
return $Band;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file Frequency.php */
|
|
@ -600,6 +600,8 @@ class Logbook_model extends CI_Model {
|
|||
}
|
||||
|
||||
function import($record) {
|
||||
$CI =& get_instance();
|
||||
$CI->load->library('frequency');
|
||||
// Join date+time
|
||||
//$datetime = date('Y-m-d') ." ". $this->input->post('start_time');
|
||||
//$myDate = date('Y-m-d', $record['qso_date']);
|
||||
|
@ -705,7 +707,9 @@ class Logbook_model extends CI_Model {
|
|||
if(isset($record['band'])) {
|
||||
$band = $record['band'];
|
||||
} else {
|
||||
$band = null;
|
||||
$myfreq = str_replace(array('.', ','), '' , $record['freq'].'0');
|
||||
|
||||
$band = $CI->frequency->GetBand($myfreq);
|
||||
}
|
||||
|
||||
// Store IOTA Ref if available
|
||||
|
@ -755,6 +759,7 @@ class Logbook_model extends CI_Model {
|
|||
} else {
|
||||
$srx = null;
|
||||
}
|
||||
|
||||
|
||||
$this->db->where('COL_CALL', $record['call']);
|
||||
$this->db->where('COL_TIME_ON', $time_on);
|
||||
|
@ -767,7 +772,7 @@ class Logbook_model extends CI_Model {
|
|||
'COL_TIME_ON' => $time_on,
|
||||
'COL_TIME_OFF' => $time_off,
|
||||
'COL_CALL' => strtoupper($record['call']),
|
||||
'COL_BAND' => $record['band'],
|
||||
'COL_BAND' => $band,
|
||||
'COL_FREQ' => $freq,
|
||||
'COL_MODE' => $record['mode'],
|
||||
'COL_RST_RCVD' => $rst_rx,
|
||||
|
|
Ładowanie…
Reference in New Issue