[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 #2983
这个提交包含在:
		
							父节点
							
								
									94f3ebf53d
								
							
						
					
					
						当前提交
						aac251d251
					
				
					共有  1 个文件被更改,包括 13 次插入 和 5 次删除
				
			
		|  | @ -2984,7 +2984,8 @@ 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'); | ||||||
|  | @ -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; | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用