From 3406ffa63b1b241a46c42457555ab14b6ec8e08f Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 21 Nov 2024 15:26:35 +0100 Subject: [PATCH] fix some more places where antenna path matters --- application/controllers/Logbook.php | 8 ++++---- application/controllers/Logbookadvanced.php | 4 ++-- application/libraries/Reg1testformat.php | 2 +- application/models/Distances_model.php | 6 +++--- application/models/Logbook_model.php | 4 ++-- application/views/view_log/qso.php | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 6a786fe6b..5d0a44b88 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -1259,7 +1259,7 @@ class Logbook extends CI_Controller { } /* return station bearing */ - function bearing($locator, $unit = 'M', $station_id = null) { + function bearing($locator, $unit = 'M', $station_id = null, $ant_path = null) { if(!$this->load->is_loaded('Qra')) { $this->load->library('Qra'); } @@ -1283,7 +1283,7 @@ class Logbook extends CI_Controller { $mylocator = $this->config->item('locator'); } - $bearing = $this->qra->bearing($mylocator, $locator, $unit); + $bearing = $this->qra->bearing($mylocator, $locator, $unit, $ant_path); return $bearing; } @@ -1291,7 +1291,7 @@ class Logbook extends CI_Controller { } /* return distance */ - function distance($locator, $station_id = null) { + function distance($locator, $station_id = null, $ant_path = null) { $distance = 0; if(!$this->load->is_loaded('Qra')) { $this->load->library('Qra'); @@ -1316,7 +1316,7 @@ class Logbook extends CI_Controller { $mylocator = $this->config->item('locator'); } - $distance = $this->qra->distance($mylocator, $locator, 'K'); + $distance = $this->qra->distance($mylocator, $locator, 'K', $ant_path); } return $distance; diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 75d4570ba..2fcb46c1a 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -448,8 +448,8 @@ class Logbookadvanced extends CI_Controller { } $this->load->model('logbook_model'); - $data['distance'] = $this->qra->distance($locator1, $locator2, $measurement_base) . $var_dist; - $data['bearing'] = $this->qra->get_bearing($locator1, $locator2) . "º"; + $data['distance'] = $this->qra->distance($locator1, $locator2, $measurement_base, $qso['COL_ANT_PATH']) . $var_dist; + $data['bearing'] = $this->qra->get_bearing($locator1, $locator2, $qso['COL_ANT_PATH']) . "º"; $latlng1 = $this->qra->qra2latlong($locator1); $latlng2 = $this->qra->qra2latlong($locator2); $latlng1[0] = number_format((float)$latlng1[0], 3, '.', '');; diff --git a/application/libraries/Reg1testformat.php b/application/libraries/Reg1testformat.php index 9e355fb93..3e41c4cdb 100644 --- a/application/libraries/Reg1testformat.php +++ b/application/libraries/Reg1testformat.php @@ -105,7 +105,7 @@ class Reg1testformat { if (!empty($row->COL_GRIDSQUARE)) { if(!array_key_exists($row->COL_GRIDSQUARE, $locators)){ $newlocator = true; - $distance = intval($CI->qra->distance($mylocator, $row->COL_GRIDSQUARE, "K")); + $distance = intval($CI->qra->distance($mylocator, $row->COL_GRIDSQUARE, "K", $row->COL_ANT_PATH)); $locators[$row->COL_GRIDSQUARE] = $distance; }else{ $newlocator = false; diff --git a/application/models/Distances_model.php b/application/models/Distances_model.php index 0f74a5858..38de2915a 100644 --- a/application/models/Distances_model.php +++ b/application/models/Distances_model.php @@ -26,7 +26,7 @@ class Distances_model extends CI_Model if ($station_gridsquare != null) { $gridsquare = explode(',', $station_gridsquare); // We need to convert to an array, since a user can enter several gridsquares - $this->db->select('COL_PRIMARY_KEY,COL_DISTANCE,col_call callsign, col_gridsquare grid'); + $this->db->select('COL_PRIMARY_KEY,COL_DISTANCE,COL_ANT_PATH,col_call callsign, col_gridsquare grid'); $this->db->join('satellite', 'satellite.name = '.$this->config->item('table_name').'.COL_SAT_NAME', 'left outer'); $this->db->where('LENGTH(col_gridsquare) >', 0); @@ -192,8 +192,8 @@ class Distances_model extends CI_Model foreach ($qsoArray as $qso) { $qrb['Qsos']++; // Counts up number of qsos - $bearingdistance = $this->qra->distance($stationgrid, $qso['grid'], $measurement_base); - $bearingdistance_km = $this->qra->distance($stationgrid, $qso['grid'], 'K'); + $bearingdistance = $this->qra->distance($stationgrid, $qso['grid'], $measurement_base, $qso['COL_ANT_PATH']); + $bearingdistance_km = $this->qra->distance($stationgrid, $qso['grid'], 'K', $qso['COL_ANT_PATH']); if ($bearingdistance_km != $qso['COL_DISTANCE']) { $data = array('COL_DISTANCE' => $bearingdistance_km); $this->db->where('COL_PRIMARY_KEY', $qso['COL_PRIMARY_KEY']); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 83638ee93..b6f4239ce 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3624,10 +3624,10 @@ class Logbook_model extends CI_Model { } if ($qsl_gridsquare != "") { $data['COL_GRIDSQUARE'] = $qsl_gridsquare; - $data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K'); + $data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_gridsquare, 'K', $data['COL_ANT_PATH']); } elseif ($qsl_vucc_grids != "") { $data['COL_VUCC_GRIDS'] = $qsl_vucc_grids; - $data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_vucc_grids, 'K'); + $data['COL_DISTANCE'] = $this->qra->distance($station_gridsquare, $qsl_vucc_grids, 'K', $data['COL_ANT_PATH']); } $this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = ', $datetime); diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index ce2b8bb38..376f39e49 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -180,7 +180,7 @@ COL_VUCC_GRIDS; ?> qra->distance($row->station_gridsquare, $row->COL_VUCC_GRIDS, $measurement_base); + $distance = $this->qra->distance($row->station_gridsquare, $row->COL_VUCC_GRIDS, $measurement_base, $row->COL_ANT_PATH ?? null); switch ($measurement_base) { case 'M':