kopia lustrzana https://github.com/magicbug/Cloudlog
[ADIF Import] Catch when RX_PWR is not a number and error out
If RX_POWER is not a number or K or KW then set the value to null and show error. Fixes #2983pull/2998/head
rodzic
94f3ebf53d
commit
aac251d251
|
@ -2984,8 +2984,9 @@ class Logbook_model extends CI_Model
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Used to check if the qso is already in the database */
|
/* Used to check if the qso is already in the database */
|
||||||
function import_check($datetime, $callsign, $band, $mode, $station_callsign, $station_id = null) {
|
function import_check($datetime, $callsign, $band, $mode, $station_callsign, $station_id = null)
|
||||||
$mode=$this->get_main_mode_from_mode($mode);
|
{
|
||||||
|
$mode = $this->get_main_mode_from_mode($mode);
|
||||||
|
|
||||||
$this->db->select('COL_PRIMARY_KEY, COL_TIME_ON, COL_CALL, COL_BAND');
|
$this->db->select('COL_PRIMARY_KEY, COL_TIME_ON, COL_CALL, COL_BAND');
|
||||||
$this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("' . $datetime . '", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )');
|
$this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("' . $datetime . '", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )');
|
||||||
|
@ -2995,8 +2996,8 @@ class Logbook_model extends CI_Model
|
||||||
$this->db->where('COL_BAND', $band);
|
$this->db->where('COL_BAND', $band);
|
||||||
$this->db->where('COL_MODE', $mode);
|
$this->db->where('COL_MODE', $mode);
|
||||||
|
|
||||||
if(isset($station_id) && $station_id > 0) {
|
if (isset($station_id) && $station_id > 0) {
|
||||||
$this->db->where('station_id', $station_id);
|
$this->db->where('station_id', $station_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = $this->db->get($this->config->item('table_name'));
|
$query = $this->db->get($this->config->item('table_name'));
|
||||||
|
@ -3412,8 +3413,15 @@ class Logbook_model extends CI_Model
|
||||||
// Check if RX_PWR is "K" which N1MM+ uses to indicate 1000W
|
// Check if RX_PWR is "K" which N1MM+ uses to indicate 1000W
|
||||||
if ($record['rx_pwr'] == "K") {
|
if ($record['rx_pwr'] == "K") {
|
||||||
$rx_pwr = 1000;
|
$rx_pwr = 1000;
|
||||||
|
} elseif ($record['rx_pwr'] == "KW") {
|
||||||
|
$rx_pwr = 1000;
|
||||||
} else {
|
} else {
|
||||||
$rx_pwr = filter_var($record['rx_pwr'], FILTER_VALIDATE_FLOAT);
|
if (isset($record['rx_pwr']) && is_numeric($record['rx_pwr'])) {
|
||||||
|
$rx_pwr = $record['rx_pwr'];
|
||||||
|
} else {
|
||||||
|
$rx_pwr = null;
|
||||||
|
$my_error .= "Error QSO: Date: " . $time_on . " Callsign: " . $record['call'] . " RX_PWR (".$record['rx_pwr'].") is not a number<br>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$rx_pwr = NULL;
|
$rx_pwr = NULL;
|
||||||
|
|
Ładowanie…
Reference in New Issue